Files
pxe-server/playbook/shopfloor-setup/gea-shopfloor-heattreat/02-Setup-HeatTreat.ps1
cproudlock 99e7679e87 HeatTreat: bump DNC app 6.2.1 -> 6.4.9
Replace HeatTreat_6.2.1.msi with HeatTreat_6-4-9.msi (ProductVersion
6.4.9.0, ProductCode {9E603EFE-888A-4E3F-8CF5-7F03B7029919}). The install
script globs HeatTreat*.msi so no logic change; the MSI's NOT
NEWERVERSIONDETECTED LaunchCondition makes 6.2.1 -> 6.4.9 a clean
in-place upgrade. Update version references in 02-Setup-HeatTreat.ps1.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 17:09:05 -04:00

87 lines
4.2 KiB
PowerShell

# 02-Setup-HeatTreat.ps1 - HeatTreat app setup (runs AFTER 01-eDNC.ps1).
#
# HeatTreat_6-4-9.msi is a WiX/GE Aviation installer, same lineage as Mark
# and eDNC. Decompiled findings:
# - LAUNCHNTLARS=true by default and the LaunchNtlars custom action fires
# under /qn (condition NOT Installed AND LAUNCHNTLARS="true"). Pass
# LAUNCHNTLARS=false to suppress it (same as 01-eDNC.ps1 and Mark).
# - No ForceReboot/ScheduleReboot (only WixCheckRebootRequired, which just
# sets a flag) - so /norestart is safe.
# - Only LaunchCondition is NOT NEWERVERSIONDETECTED (blocks downgrade).
#
# After the MSI, HeatTreat imports the per-machine DNC config .reg matching
# the machine number the tech entered at imaging (6601-6604). The .reg files
# ship in this type dir under reg\<machine-number>.reg. Like WJPRT.reg they
# target HKLM\SOFTWARE\GE Aircraft Engines\DNC (the 64-bit view as written),
# but DNC is a 32-bit app and reads WOW6432Node, so we rewrite the key paths
# to WOW6432Node before importing (reg import does not honor /reg:32).
#
# Log: C:\Logs\HeatTreat\02-Setup-HeatTreat.log
$ErrorActionPreference = 'Continue'
$logDir = 'C:\Logs\HeatTreat'
if (-not (Test-Path $logDir)) { try { New-Item -ItemType Directory -Path $logDir -Force | Out-Null } catch {} }
try { Start-Transcript -Path (Join-Path $logDir '02-Setup-HeatTreat.log') -Append -Force | Out-Null } catch {}
Write-Host '=== HeatTreat Setup ==='
$pxeStatusLib = Join-Path $PSScriptRoot '..\Shopfloor\lib\Send-PxeStatus.ps1'
if (Test-Path $pxeStatusLib) {
try { . $pxeStatusLib; Send-PxeStatus -Stage '02-Setup-HeatTreat: starting' -StageIndex 3 -StageTotal 8 } catch { }
}
$payloadDir = Join-Path $PSScriptRoot 'HeatTreat'
# ============================================================================
# Install HeatTreat_6-4-9.msi
# ============================================================================
$htMsi = Get-ChildItem -Path $payloadDir -Filter 'HeatTreat*.msi' -File -ErrorAction SilentlyContinue | Select-Object -First 1
if ($htMsi) {
Write-Host "Installing HeatTreat: $($htMsi.Name)..."
$p = Start-Process -FilePath 'msiexec.exe' `
-ArgumentList "/i `"$($htMsi.FullName)`" /qn /norestart LAUNCHNTLARS=false" `
-Wait -PassThru
Write-Host " HeatTreat exit code: $($p.ExitCode)"
} else {
Write-Warning "HeatTreat MSI not found in $payloadDir (expected HeatTreat*.msi) - skipping install"
}
# ============================================================================
# Import the per-machine DNC config .reg (redirected to WOW6432Node)
# ============================================================================
$machineNum = ''
$mnFile = 'C:\Enrollment\machine-number.txt'
if (Test-Path -LiteralPath $mnFile) {
$machineNum = (Get-Content -LiteralPath $mnFile -First 1 -EA 0).Trim()
}
if ($machineNum) {
$regSrc = Join-Path $PSScriptRoot "reg\$machineNum.reg"
if (Test-Path -LiteralPath $regSrc) {
try {
$regText = Get-Content -LiteralPath $regSrc -Raw
$redirected = $regText -replace `
'HKEY_LOCAL_MACHINE\\SOFTWARE\\GE Aircraft Engines', `
'HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\GE Aircraft Engines'
$tmpReg = Join-Path $env:TEMP "$machineNum-wow6432.reg"
Set-Content -LiteralPath $tmpReg -Value $redirected -Encoding ASCII -Force
Write-Host "Importing $machineNum.reg (redirected to WOW6432Node)..."
$r = Start-Process -FilePath 'reg.exe' -ArgumentList "import `"$tmpReg`"" -Wait -PassThru
Write-Host " reg import exit code: $($r.ExitCode)"
Remove-Item -LiteralPath $tmpReg -Force -ErrorAction SilentlyContinue
} catch {
Write-Warning "Import of $machineNum.reg failed: $_"
}
} else {
Write-Warning "No DNC .reg for machine number $machineNum at $regSrc - DNC machine config NOT applied"
}
} else {
Write-Warning "machine-number.txt empty/missing - cannot pick a DNC .reg to import"
}
if (Get-Command Send-PxeStatus -ErrorAction SilentlyContinue) {
Send-PxeStatus -Stage '02-Setup-HeatTreat: complete' -StageIndex 4 -StageTotal 8
}
Write-Host '=== HeatTreat Setup Complete ==='
try { Stop-Transcript | Out-Null } catch {}