Wax/Trace: switch baseline to FormTracePak v6.213 vendor install

Replace the V6.0 captured-binary replay (pf-x86-MitutoyoApp.zip +
c-MitutoyoApp.zip + hklm-wow-mitutoyo.reg.gz) with a real vendor install
from FORMTRACEPAK-V6.213.iso mounted via Mount-DiskImage.

09-Setup-WaxAndTrace.ps1:
- Step 2 rewritten: Mount-DiskImage on
  C:\WaxTrace-Install\formtracepak\FORMTRACEPAK-V6.213.iso, run the VB6
  Setup.exe wrapper from the assigned drive letter (DRIVE_CDROM check
  satisfied by virtual mount, no real CD needed), then Dismount.
- Header rewritten: drop captured/ description, note legacy fallback
  remains in the repo (captured-binary/ unchanged) for manual recovery
  if the v6.213 vendor install fails on a bay.

sync-waxtrace.sh:
- Push formtracepak/FORMTRACEPAK-V6.213.iso (2.0 GB) into the bundle
  instead of captured/ payload. Override path via $FTPAK_ISO env var if
  needed (e.g. testing a v6.213 patch ISO).
- Sanity check no longer demands pf-x86-MitutoyoApp.zip; only requires
  prereqs/ + the manifest + dispatcher PS1.

playbook/utilities/convert-cal-iso.sh:
- New helper. Rebuilds a Linux-dd of a multi-session UDF cal disc into
  a clean ISO9660+UDF hybrid that Windows Mount-DiskImage reads. mkisofs
  reads the file via loop-udf, repacks single-session with the asset tag
  as volume label. Run when `file CAL-*.iso` reports "data" (multi-session
  UDF dd produced a Linux-readable but Windows-unreadable container).
  Single-session 218-458A discs from dd are already ISO9660 and don't
  need this.

Verified on win11 VM via qga: V6.213 ISO mounts, Setup.exe locatable.
14 cal ISOs all converted to ISO9660 (md5s refreshed in INDEX.csv),
re-synced to /srv/samba/enrollment/installers-post/waxtrace/calibrations/.
PXE share bundle now 2.0 GB total (V6.213 ISO + 14 cal ISOs + prereqs).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
cproudlock
2026-05-21 15:44:42 -04:00
parent 2a0b4885fe
commit e1ea6b7c62
3 changed files with 152 additions and 70 deletions

View File

@@ -1,14 +1,10 @@
# 09-Setup-WaxAndTrace.ps1 - Wax and Trace pc-type setup (Mitutoyo FormTracePak v6.0)
# 09-Setup-WaxAndTrace.ps1 - Wax and Trace pc-type setup (Mitutoyo FormTracePak v6.213)
#
# Imaging-time install. Mitutoyo's CD-ROM-bound VB6 wrapper (Setup.exe +
# appSetup.exe) is unreliable on Win11 and requires interactive clicks
# through model + cal + HASP dialogs. We bypass it entirely: prereqs install
# via manifest, FormTracePak itself is xcopy + reg-import from a master capture.
#
# Master capture was taken 2026-05-18 on a Win11 VM with both CV-3000/4000
# series + SV-C3000/4000 series installed via Mount-DiskImage approach (see
# project-waxtrace-image.md). Covers all WJ wax/trace bays since both series
# end up sharing the same Program Files dir + reg.
# Imaging-time install. Installs prereqs from manifest, then runs the
# Mitutoyo FormTracePak v6.213 vendor installer from a mounted ISO. The
# VB6 Setup.exe wrapper checks GetDriveType() == DRIVE_CDROM; Mount-DiskImage
# satisfies that (a real CD drive isn't required). Per-asset calibration ISO
# applies last.
#
# Layout at C:\WaxTrace-Install\ (xcopied by startnet.cmd):
# waxtrace-manifest.json
@@ -18,15 +14,17 @@
# prereqs\vc_redist.x86.exe (VC++ 2017 x86)
# prereqs\vc_redist.x64.exe (VC++ 2017 x64)
# prereqs\HASPUserSetup.exe (Sentinel Runtime / HASP dongle driver)
# captured\pf-x86-MitutoyoApp.zip (~108 MB compressed -> 675 MB)
# captured\c-MitutoyoApp.zip (data dir skeleton, mostly empty)
# captured\reg\hklm-wow-mitutoyo.reg.gz (gzipped, ~218 KB -> 5.4 MB)
# captured\arp-entries.json (informational - what to expect)
# calibrations\CAL-WJRP<asset>_serial-<sn>_probe-<probe>.iso (per-machine)
# formtracepak\FORMTRACEPAK-V6.213.iso (vendor installer ISO, ~2 GB)
# calibrations\CAL-<asset>_serial-<sn>_probe-<probe>.iso (per-machine)
#
# Per-machine calibration is applied separately (mount cal ISO + run its
# Setup.exe), keyed by C:\Enrollment\machine-number.txt.
#
# Legacy captured/ replay path (V6.0 zip + reg) retired 2026-05-21. The
# captured-binary/ payload is still in the repo as a fallback - if the
# v6.213 vendor install fails on a bay, fall back to the captured path
# manually. See git history for the prior shape.
#
# Log: C:\Logs\WaxTrace\09-Setup-WaxAndTrace.log
# C:\Logs\WaxTrace\install.log (written by Install-FromManifest)
@@ -93,58 +91,53 @@ if (-not (Test-Path $manifestPath)) {
}
# ============================================================================
# Step 2: Replay FormTracePak install from master capture
# Step 2: FormTracePak v6.213 vendor install (Mount-DiskImage + Setup.exe)
# ============================================================================
# Detection: skip if Formtracepak already present (re-run safe).
$ftpakExe = 'C:\Program Files (x86)\MitutoyoApp\Formtracepak\Formtracepak.exe'
if (Test-Path -LiteralPath $ftpakExe) {
Write-WTLog "Formtracepak.exe already present - skipping replay"
Write-WTLog "Formtracepak.exe already present - skipping vendor install"
} else {
$pfZip = Join-Path $stagingRoot 'captured\pf-x86-MitutoyoApp.zip'
$maZip = Join-Path $stagingRoot 'captured\c-MitutoyoApp.zip'
$regGz = Join-Path $stagingRoot 'captured\reg\hklm-wow-mitutoyo.reg.gz'
if (-not (Test-Path $pfZip)) {
Write-WTLog "Master capture pf-x86-MitutoyoApp.zip not found at $pfZip" 'ERROR'
$ftpakIso = Join-Path $stagingRoot 'formtracepak\FORMTRACEPAK-V6.213.iso'
if (-not (Test-Path -LiteralPath $ftpakIso)) {
Write-WTLog "FormTracePak ISO not found at $ftpakIso" 'ERROR'
} else {
$pfDest = 'C:\Program Files (x86)\MitutoyoApp'
Write-WTLog "Extracting $pfZip -> $pfDest"
Write-WTLog "Mounting FormTracePak ISO: $ftpakIso"
try {
if (-not (Test-Path $pfDest)) { New-Item -Path $pfDest -ItemType Directory -Force | Out-Null }
Expand-Archive -Path $pfZip -DestinationPath $pfDest -Force
$count = (Get-ChildItem $pfDest -Recurse -File -ErrorAction SilentlyContinue).Count
Write-WTLog " extracted $count files"
$img = Mount-DiskImage -ImagePath $ftpakIso -PassThru -ErrorAction Stop
Start-Sleep -Seconds 8
$vol = Get-DiskImage -ImagePath $ftpakIso | Get-Volume
$ftpakDrive = $vol.DriveLetter
if (-not $ftpakDrive) {
Write-WTLog " Mount succeeded but no drive letter assigned" 'ERROR'
} else {
Write-WTLog " mounted at ${ftpakDrive}: (volume label=$($vol.FileSystemLabel))"
$setupExe = "${ftpakDrive}:\Setup.exe"
if (-not [System.IO.File]::Exists($setupExe)) {
Write-WTLog " Setup.exe not found at $setupExe" 'ERROR'
} else {
Write-WTLog " running $setupExe (VB6 wrapper - requires DRIVE_CDROM)"
# Setup.exe is the VB6 wrapper. /silent + /qn flags often
# ignored - the wrapper drives appSetup.exe + msiexec from
# its own UI. If the wrapper insists on interactive, a tech
# at the bay clicks through. Acceptable today; quieter
# path is a future improvement (drive msiexec direct on
# the wrapper's bundled MSIs).
try {
$p = Start-Process -FilePath $setupExe `
-WorkingDirectory "${ftpakDrive}:\" `
-ArgumentList '/silent' `
-Wait -PassThru
Write-WTLog " Setup.exe exit $($p.ExitCode)"
} catch {
Write-WTLog " Setup.exe failed: $_" 'ERROR'
}
}
}
Dismount-DiskImage -ImagePath $ftpakIso -ErrorAction SilentlyContinue | Out-Null
Write-WTLog " FormTracePak ISO dismounted"
} catch {
Write-WTLog " Expand-Archive failed: $_" 'ERROR'
}
}
if (Test-Path $maZip) {
$maDest = 'C:\MitutoyoApp'
Write-WTLog "Extracting $maZip -> $maDest"
try {
if (-not (Test-Path $maDest)) { New-Item -Path $maDest -ItemType Directory -Force | Out-Null }
Expand-Archive -Path $maZip -DestinationPath $maDest -Force
} catch {
Write-WTLog " Expand-Archive failed: $_" 'WARN'
}
}
if (Test-Path $regGz) {
$regOut = Join-Path $env:TEMP 'hklm-wow-mitutoyo.reg'
Write-WTLog "Decompressing $regGz -> $regOut"
try {
$inGz = [IO.File]::OpenRead($regGz)
$gz = New-Object IO.Compression.GZipStream($inGz, [IO.Compression.CompressionMode]::Decompress)
$out = [IO.File]::Create($regOut)
$gz.CopyTo($out)
$out.Close(); $gz.Close(); $inGz.Close()
Write-WTLog "Importing reg file via reg.exe /s"
& reg.exe import $regOut 2>&1 | ForEach-Object { Write-WTLog " reg: $_" }
Write-WTLog " reg import exit $LASTEXITCODE"
Remove-Item $regOut -Force -ErrorAction SilentlyContinue
} catch {
Write-WTLog " reg import failed: $_" 'ERROR'
Write-WTLog " Mount-DiskImage failed: $_" 'ERROR'
}
}
}