diff --git a/playbook/shopfloor-setup/gea-shopfloor-waxtrace/09-Setup-WaxAndTrace.ps1 b/playbook/shopfloor-setup/gea-shopfloor-waxtrace/09-Setup-WaxAndTrace.ps1 index 0721ebc..be7fe63 100644 --- a/playbook/shopfloor-setup/gea-shopfloor-waxtrace/09-Setup-WaxAndTrace.ps1 +++ b/playbook/shopfloor-setup/gea-shopfloor-waxtrace/09-Setup-WaxAndTrace.ps1 @@ -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'