09-Setup-WaxAndTrace: bypass vendor cal Setup.exe for all 218-378-13 probes

The .NET cal Setup.exe crashes (0xE0434352) on 218-378-13 series ISOs
even when filenames are clean (no trailing-space bug). Previously only
bypassed when the ' _' trailing-space signature was detected. Now
detects by probe series ID in the data filenames too and always does
direct file copy for 218-378-13.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
cproudlock
2026-05-27 13:06:57 -04:00
parent 9ad467ba6c
commit 1860a92afa

View File

@@ -261,21 +261,21 @@ if (-not $asset) {
$srcDataDir = Join-Path $calRoot 'data'
$dstDataDir = 'C:\Program Files (x86)\MitutoyoApp\Formtracepak\data'
$hasBrokenFilenames = $false
$bypassVendorSetup = $false
if (Test-Path -LiteralPath $srcDataDir) {
# Get-ChildItem -Filter uses Win32 filtering and does NOT
# honor PowerShell wildcards / character classes - '[0-9]'
# would match literal bracketed text. Use -Include +
# Where-Object regex instead. The bug signature is
# ' _' (space-underscore) inside the filename, e.g.
# 'Linear_X_218-378-13 _100072210.txt'.
$hasBrokenFilenames = [bool](Get-ChildItem -LiteralPath $srcDataDir -File -ErrorAction SilentlyContinue |
Where-Object { $_.Name -match ' _\d+\.txt$' } |
# The 218-378-13 probe series has a buggy .NET Setup.exe
# that crashes (0xE0434352) even when filenames are clean.
# Older ISOs had trailing-space filenames (' _' pattern);
# newer ISOs fixed the filenames but the .NET wrapper
# still crashes on some path operation. Detect by probe
# series in filename OR the trailing-space signature.
$bypassVendorSetup = [bool](Get-ChildItem -LiteralPath $srcDataDir -File -ErrorAction SilentlyContinue |
Where-Object { $_.Name -match '218-378-13' -or $_.Name -match ' _\d+\.txt$' } |
Select-Object -First 1)
}
if ($hasBrokenFilenames) {
Write-WTLog " disc has trailing-space probe-ID filenames (218-378-13 series) - bypassing buggy vendor Setup.exe, doing direct copy"
if ($bypassVendorSetup) {
Write-WTLog " 218-378-13 series detected - bypassing vendor Setup.exe, doing direct file copy"
if (-not (Test-Path -LiteralPath $dstDataDir)) {
Write-WTLog " destination data dir does not exist: $dstDataDir" 'ERROR'
Write-WTLog " (FormTracePak install may not be complete; cal apply aborted)" 'ERROR'