Add Part Marker + HeatTreat shopfloor PC types (eDNC + vendor MSI)

New gea-shopfloor-partmarker type (startnet menu option 10) and fill the
gea-shopfloor-heattreat stub. Both follow the collections eDNC pattern:
01-eDNC.ps1 installs DNC, then a 02-Setup script installs the vendor MSI.

Part Marker (02-Setup-PartMarker.ps1):
- msiexec Mark-6.2.1.msi /qn /norestart LAUNCHNTLARS=false (the LaunchNtlars
  custom action otherwise fires under /qn and launches NTLARS mid-install,
  same as eDNC).
- After install: import WJPRT.reg rewritten to WOW6432Node (reg import does
  not honor /reg:32; DNC is 32-bit and reads the redirected hive), then copy
  the Mark overlay + eMxInfo.txt into C:\Program Files (x86)\Mark.

HeatTreat (02-Setup-HeatTreat.ps1):
- msiexec HeatTreat_6.2.1.msi /qn /norestart LAUNCHNTLARS=false. Existing
  09-Setup-Heattreat.ps1 (OpenText) still runs after. Optional .reg/file
  copy left as a marked TODO pending confirmation.

Both MSIs decompiled: WiX/GE Aviation, no forced reboot, only LaunchCondition
is NOT NEWERVERSIONDETECTED. utilpassword.txt is gitignored (secret, deployed
via the enrollment share from the working tree).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
cproudlock
2026-06-01 10:59:45 -04:00
parent 69a1682a7f
commit 59b1a9fb65
31 changed files with 995 additions and 2 deletions

View File

@@ -0,0 +1,111 @@
# 01-eDNC.ps1 - Install eDNC and deploy custom eMxInfo.txt (Standard-Machine only)
# --- Transcript ---
$logDir = 'C:\Logs\SFLD'
if (-not (Test-Path $logDir)) { try { New-Item -ItemType Directory -Path $logDir -Force | Out-Null } catch {} }
try { Start-Transcript -Path (Join-Path $logDir '01-eDNC.log') -Append -Force | Out-Null } catch {}
# --- Skip on Timeclock sub-type ---
$subtypeFile = 'C:\Enrollment\pc-subtype.txt'
if (Test-Path $subtypeFile) {
$subtype = (Get-Content $subtypeFile -First 1 -ErrorAction SilentlyContinue).Trim()
if ($subtype -eq 'Timeclock') {
Write-Host "=== eDNC Setup: skipped (Standard-Timeclock) ==="
try { Stop-Transcript | Out-Null } catch {}
return
}
}
Write-Host "=== eDNC Setup ==="
function Get-SiteConfig {
$configPath = 'C:\Enrollment\site-config.json'
if (-not (Test-Path -LiteralPath $configPath)) {
Write-Host "site-config.json not found - using defaults" -ForegroundColor DarkGray
return $null
}
try {
return (Get-Content -LiteralPath $configPath -Raw -ErrorAction Stop | ConvertFrom-Json)
} catch {
Write-Warning "Failed to parse site-config.json: $_"
return $null
}
}
$siteConfig = Get-SiteConfig
$siteName = if ($siteConfig) { $siteConfig.siteName } else { 'West Jefferson' }
$siteNameCompact = if ($siteConfig) { $siteConfig.siteNameCompact } else { 'WestJefferson' }
$edncDir = Join-Path $PSScriptRoot 'eDNC'
if (-not (Test-Path $edncDir)) {
Write-Warning "eDNC folder not found at $edncDir - skipping."
try { Stop-Transcript | Out-Null } catch {}
exit 0
}
# --- Find installer ---
# Filter is eDNC*.msi (no dash) so we match both vendor naming styles:
# eDNC-6.4.3.msi (dash) and eDNC_6-4-5.msi (underscore). Imaging dir should
# only contain ONE version at a time; rollback to a prior version is handled
# post-imaging via the SFLD share's standard-machine/apps/ alternates.
$edncMsi = Get-ChildItem -Path $edncDir -Filter "eDNC*.msi" | Select-Object -First 1
$emxInfo = Join-Path $edncDir "eMxInfo.txt"
# --- 1. Install eDNC ---
if ($edncMsi) {
Write-Host "Installing eDNC: $($edncMsi.Name)..."
$p = Start-Process -FilePath "msiexec.exe" -ArgumentList "/i `"$($edncMsi.FullName)`" /qn /norestart LAUNCHNTLARS=false SITESELECTED=`"$siteName`"" -Wait -PassThru
Write-Host " eDNC exit code: $($p.ExitCode)"
} else {
Write-Warning "eDNC installer not found in $edncDir (expected eDNC*.msi)"
}
# --- 2. Mirror x86 install to 64-bit Program Files (app uses hardcoded paths) ---
# mxTransactionDll.dll references \Dnc\Server Files\
$copies = @(
@{ Src = "C:\Program Files (x86)\Dnc"; Dst = "C:\Program Files\Dnc" }
)
foreach ($c in $copies) {
if (Test-Path $c.Src) {
if (-not (Test-Path $c.Dst)) {
New-Item -Path $c.Dst -ItemType Directory -Force | Out-Null
}
Copy-Item -Path "$($c.Src)\*" -Destination $c.Dst -Recurse -Force
Write-Host " Copied $($c.Src) -> $($c.Dst)"
}
}
# --- 3. Set DNC site + machine number ---
$regBase = "HKLM\SOFTWARE\WOW6432Node\GE Aircraft Engines\DNC"
reg add "$regBase\General" /v Site /t REG_SZ /d $siteNameCompact /f | Out-Null
Write-Host " DNC site set to $siteNameCompact."
# Set machine number if tech entered one during PXE menu (defaults to 9999)
$machineNumFile = 'C:\Enrollment\machine-number.txt'
$machineNum = '9999'
if (Test-Path -LiteralPath $machineNumFile) {
$num = (Get-Content -LiteralPath $machineNumFile -First 1 -ErrorAction SilentlyContinue).Trim()
if ($num -and $num -match '^\d+$') { $machineNum = $num }
}
reg add "$regBase\General" /v MachineNo /t REG_SZ /d $machineNum /f | Out-Null
Write-Host " DNC MachineNo set to $machineNum."
# --- 4. Deploy custom eMxInfo.txt to both Program Files paths ---
if (Test-Path $emxInfo) {
$dest86 = "C:\Program Files (x86)\DNC\Server Files"
$dest64 = "C:\Program Files\DNC\Server Files"
foreach ($dest in @($dest86, $dest64)) {
if (-not (Test-Path $dest)) {
New-Item -Path $dest -ItemType Directory -Force | Out-Null
}
Copy-Item -Path $emxInfo -Destination (Join-Path $dest "eMxInfo.txt") -Force
Write-Host " eMxInfo.txt -> $dest"
}
} else {
Write-Warning "eMxInfo.txt not found at $emxInfo"
}
Write-Host "=== eDNC Setup Complete ==="
try { Stop-Transcript | Out-Null } catch {}

View File

@@ -0,0 +1,56 @@
# 02-Setup-HeatTreat.ps1 - HeatTreat app setup (runs AFTER 01-eDNC.ps1).
#
# HeatTreat_6.2.1.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).
#
# 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.
#
# 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.2.1.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"
}
# 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.
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 {}