Wax/Trace: per-bay FormTracePak version via bay-config.csv
Bays span 7 FormTracePak versions (5.510 - 6.213) and 3 sub-versions (AVANT / CV-4500 / CV-3200), each with a unique licensing USER ID. Previously all bays got v6.213 with no model/USER hint to the tech. - bay-config.csv: 15 rows mapping asset_tag to ftpak_version + model + user_id. - resolve-bay-config.ps1: WinPE-runnable resolver. Looks up the asset and writes version.txt / model.txt / userid.txt / bay-info.txt under W:\Enrollment\waxtrace\. - startnet.cmd: xcopy WaxTrace bundle minus formtracepak\, invoke the resolver with %MACHINENUM%, then cherry-pick only the matching FORMTRACEPAK-V<ver>.iso (~2 GB local vs ~12 GB if all were staged). - 09-Setup-WaxAndTrace.ps1: read the per-bay files, mount the right ISO, drop <asset>-FTPak-install-info.txt on SupportUser's desktop, and print a banner with MODEL + USER ID so the tech has them top-of-mind when Setup.exe dialogs come up. - sync-waxtrace.sh: loop over all FORMTRACEPAK-V*.iso instead of hard-coding v6.213; also push bay-config.csv + resolve-bay-config.ps1 to the share.
This commit is contained in:
@@ -91,53 +91,121 @@ if (-not (Test-Path $manifestPath)) {
|
||||
}
|
||||
|
||||
# ============================================================================
|
||||
# Step 2: FormTracePak v6.213 vendor install (Mount-DiskImage + Setup.exe)
|
||||
# Step 2: FormTracePak vendor install - per-bay version + sub-version
|
||||
# ============================================================================
|
||||
# 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 vendor install"
|
||||
} else {
|
||||
$ftpakIso = Join-Path $stagingRoot 'formtracepak\FORMTRACEPAK-V6.213.iso'
|
||||
if (-not (Test-Path -LiteralPath $ftpakIso)) {
|
||||
Write-WTLog "FormTracePak ISO not found at $ftpakIso" 'ERROR'
|
||||
# Per-bay config resolved by resolve-bay-config.ps1 at WinPE time + written
|
||||
# to C:\Enrollment\waxtrace\. Drives BOTH which FTPak ISO to mount AND what
|
||||
# to relay to the tech in the pre-install banner + desktop reference file.
|
||||
$waxCfgDir = 'C:\Enrollment\waxtrace'
|
||||
$bayAsset = $null
|
||||
$bayVersion = $null
|
||||
$bayModel = $null
|
||||
$bayUserId = $null
|
||||
foreach ($pair in @(
|
||||
@{ Var='bayAsset'; File='C:\Enrollment\machine-number.txt' },
|
||||
@{ Var='bayVersion'; File=(Join-Path $waxCfgDir 'version.txt') },
|
||||
@{ Var='bayModel'; File=(Join-Path $waxCfgDir 'model.txt') },
|
||||
@{ Var='bayUserId'; File=(Join-Path $waxCfgDir 'userid.txt') }
|
||||
)) {
|
||||
if (Test-Path -LiteralPath $pair.File) {
|
||||
$val = (Get-Content -LiteralPath $pair.File -First 1 -ErrorAction SilentlyContinue)
|
||||
if ($val) { Set-Variable -Name $pair.Var -Value $val.Trim() }
|
||||
}
|
||||
}
|
||||
Write-WTLog "Bay config: asset=$bayAsset version=$bayVersion model=$bayModel userid=$bayUserId"
|
||||
|
||||
if (-not $bayVersion) {
|
||||
Write-WTLog "No FormTracePak version in $waxCfgDir\version.txt - bay-config did not resolve (asset_tag not in bay-config.csv?). Manual install required." 'ERROR'
|
||||
} else {
|
||||
Write-WTLog "Mounting FormTracePak ISO: $ftpakIso"
|
||||
try {
|
||||
$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'
|
||||
$ftpakIso = Join-Path $stagingRoot ("formtracepak\FORMTRACEPAK-V$bayVersion.iso")
|
||||
if (-not (Test-Path -LiteralPath $ftpakIso)) {
|
||||
Write-WTLog "FormTracePak ISO missing: $ftpakIso" 'ERROR'
|
||||
Write-WTLog " Bay needs V$bayVersion but no matching ISO at the expected path. Either bay-config.csv has the wrong version, or sync-waxtrace.sh did not push the right ISO. Manual install required." 'ERROR'
|
||||
} else {
|
||||
# Drop a reference text file on the SupportUser Desktop so the tech
|
||||
# always has the model + USER ID in front of them when the Setup.exe
|
||||
# dialogs come up. File persists post-imaging.
|
||||
try {
|
||||
$desktop = 'C:\Users\SupportUser\Desktop'
|
||||
if (-not (Test-Path -LiteralPath $desktop)) { $desktop = 'C:\Users\Public\Desktop' }
|
||||
$deskFile = Join-Path $desktop ("$bayAsset-FTPak-install-info.txt")
|
||||
$deskContent = @(
|
||||
'========================================',
|
||||
'FormTracePak install info for this bay',
|
||||
'========================================',
|
||||
'',
|
||||
"Bay: $bayAsset",
|
||||
"FormTracePak: V$bayVersion",
|
||||
"Sub-version: $bayModel <- SELECT THIS IN THE Setup.exe DIALOG",
|
||||
"USER ID: $bayUserId <- ENTER THIS AT THE LICENSING PROMPT",
|
||||
'',
|
||||
'Reference file. Open this whenever you need to recall the USER ID',
|
||||
'during the install dialogs.',
|
||||
'',
|
||||
"Generated at imaging time by 09-Setup-WaxAndTrace.ps1 ($(Get-Date -Format 'yyyy-MM-dd HH:mm:ss'))"
|
||||
) -join "`r`n"
|
||||
Set-Content -LiteralPath $deskFile -Value $deskContent -Force
|
||||
Write-WTLog "Wrote reference file to $deskFile"
|
||||
} catch {
|
||||
Write-WTLog "Failed to write desktop reference file: $_" 'WARN'
|
||||
}
|
||||
|
||||
# Big banner in the PS host window. Operator sees this BEFORE Setup.exe
|
||||
# opens so the model + USER ID are top-of-mind when the dialogs come up.
|
||||
$bannerLines = @(
|
||||
'',
|
||||
'================================================================',
|
||||
" BAY: $bayAsset",
|
||||
" FORMTRACEPAK: V$bayVersion",
|
||||
" SELECT MODEL: $bayModel",
|
||||
" USER ID: $bayUserId",
|
||||
'================================================================',
|
||||
' Setup.exe is about to launch. In its dialogs:',
|
||||
" - Pick the MODEL '$bayModel' on the language / model page.",
|
||||
" - Enter USER ID '$bayUserId' at the licensing prompt.",
|
||||
" - A reference text file with these values has been placed on",
|
||||
" SupportUser's desktop ($bayAsset-FTPak-install-info.txt).",
|
||||
'================================================================',
|
||||
''
|
||||
)
|
||||
foreach ($l in $bannerLines) { Write-WTLog $l }
|
||||
|
||||
Write-WTLog "Mounting FormTracePak ISO: $ftpakIso"
|
||||
try {
|
||||
$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 " 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'
|
||||
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)"
|
||||
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 " Mount-DiskImage failed: $_" 'ERROR'
|
||||
}
|
||||
Dismount-DiskImage -ImagePath $ftpakIso -ErrorAction SilentlyContinue | Out-Null
|
||||
Write-WTLog " FormTracePak ISO dismounted"
|
||||
} catch {
|
||||
Write-WTLog " Mount-DiskImage failed: $_" 'ERROR'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user