diff --git a/.gitignore b/.gitignore index 4841fa4..a83c3ab 100644 --- a/.gitignore +++ b/.gitignore @@ -114,3 +114,7 @@ playbook/shopfloor-setup/gea-shopfloor-keyence/vr6000/installers/Data1.cab # Part Marker (Telesis) utility password - secret, deployed via the enrollment # share from the working tree, never committed. playbook/shopfloor-setup/gea-shopfloor-partmarker/PartMarker/Mark/utilpassword.txt + +# HeatTreat per-machine DNC .reg exports (6601-6604) - contain DNC FtpPasswd +# credentials. Deployed via the enrollment share from the working tree. +playbook/shopfloor-setup/gea-shopfloor-heattreat/reg/*.reg diff --git a/playbook/shopfloor-setup/gea-shopfloor-heattreat/02-Setup-HeatTreat.ps1 b/playbook/shopfloor-setup/gea-shopfloor-heattreat/02-Setup-HeatTreat.ps1 index f9a42a2..2d43059 100644 --- a/playbook/shopfloor-setup/gea-shopfloor-heattreat/02-Setup-HeatTreat.ps1 +++ b/playbook/shopfloor-setup/gea-shopfloor-heattreat/02-Setup-HeatTreat.ps1 @@ -9,10 +9,12 @@ # sets a flag) - so /norestart is safe. # - Only LaunchCondition is NOT NEWERVERSIONDETECTED (blocks downgrade). # -# NOTE: HeatTreat may also need a DNC .reg overlay (the WJPRT.reg has a -# [...\DNC\HeatTreat] subkey section) and/or a file copy, mirroring the Part -# Marker flow. That is unconfirmed - see the TODO below. Today this installs -# DNC (via 01-eDNC.ps1) + the HeatTreat MSI only. +# 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\.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 @@ -45,9 +47,37 @@ if ($htMsi) { Write-Warning "HeatTreat MSI not found in $payloadDir (expected HeatTreat*.msi) - skipping install" } -# TODO (unconfirmed): if HeatTreat needs a DNC .reg overlay + file copy like -# the Part Marker, add it here - import the .reg redirected to WOW6432Node and -# copy any overlay files into the install dir. Pending confirmation. +# ============================================================================ +# 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 diff --git a/playbook/startnet.cmd b/playbook/startnet.cmd index 1f8d8df..677fa17 100644 --- a/playbook/startnet.cmd +++ b/playbook/startnet.cmd @@ -214,6 +214,7 @@ REM CAL-{asset_tag}_serial-*_probe-*.iso. set MACHINENUM=9999 if /i "%PCTYPE%"=="gea-shopfloor-collections" goto prompt_machinenum if /i "%PCTYPE%"=="gea-shopfloor-nocollections" goto prompt_machinenum +if /i "%PCTYPE%"=="gea-shopfloor-heattreat" goto prompt_machinenum if /i "%PCTYPE%"=="gea-shopfloor-waxtrace" goto prompt_waxtrace_asset if /i "%PCTYPE%"=="gea-shopfloor-cmm" goto skip_machinenum goto skip_machinenum