Files
pxe-server/playbook/shopfloor-setup/Standard/01-eDNC.ps1
cproudlock 9c54307b1b Shopfloor cleanups: drop OpenText CSF + MarkZebra, gitignore eMxInfo
- Delete 02-OpenTextCSF.ps1 (CSF profile delivery moved to Intune YAML's
  CopyFiles section in main/device-config.yaml — no longer needed at the
  PXE/baseline layer)
- Strip MarkZebra install + post-config from 01-eDNC.ps1 (no longer
  needed; only eDNC core install + Dnc x86→x64 mirror + Site reg + eMxInfo
  deployment remain). Section numbering tightened.
- Add SITESELECTED="West Jefferson" to eDNC msiexec args so the MSI's
  site-specific Components (NtLarsWjfRegComp — FTP/FMS/PPDCS hosts +
  credentials) actually install. Without it, only the bare Site value was
  being set and all the connection details were unconfigured.
- gitignore: blanket-block any **/eMxInfo*.txt from being committed —
  the file contains obfuscated eDNC site credentials and must never go
  in git. Canonical source lives at /home/camp/pxe-images/main/eMxInfo.txt
  outside the repo.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 14:05:52 -04:00

62 lines
2.2 KiB
PowerShell

# 01-eDNC.ps1 — Install eDNC and deploy custom eMxInfo.txt (Standard)
Write-Host "=== eDNC Setup ==="
$edncDir = "C:\Enrollment\shopfloor-setup\Standard\eDNC"
if (-not (Test-Path $edncDir)) {
Write-Warning "eDNC folder not found at $edncDir — skipping."
exit 0
}
# --- Find installer ---
$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=`"West Jefferson`"" -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 ---
$regBase = "HKLM\SOFTWARE\WOW6432Node\GE Aircraft Engines\DNC"
reg add "$regBase\General" /v Site /t REG_SZ /d WestJefferson /f | Out-Null
Write-Host " DNC site set to WestJefferson."
# --- 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 ==="