# 01-eDNC.ps1 — Install eDNC and MarkZebra, deploy custom eMxInfo.txt (Standard) Write-Host "=== eDNC / MarkZebra 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 installers --- $edncMsi = Get-ChildItem -Path $edncDir -Filter "eDNC-*.msi" | Select-Object -First 1 $markMsi = Get-ChildItem -Path $edncDir -Filter "MarkZebra.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" -Wait -PassThru Write-Host " eDNC exit code: $($p.ExitCode)" } else { Write-Warning "eDNC installer not found in $edncDir (expected eDNC-*.msi)" } # --- 2. Install MarkZebra --- if ($markMsi) { Write-Host "Installing MarkZebra: $($markMsi.Name)..." $p = Start-Process -FilePath "msiexec.exe" -ArgumentList "/i `"$($markMsi.FullName)`" /qn /norestart LAUNCHNTLARS=false" -Wait -PassThru Write-Host " MarkZebra exit code: $($p.ExitCode)" } else { Write-Warning "MarkZebra installer not found in $edncDir (expected MarkZebra.msi)" } # --- 3. Mirror x86 installs to 64-bit Program Files (app uses hardcoded paths) --- # MarkZebra.exe references \Mark\, mxTransactionDll.dll references \Dnc\Server Files\ $copies = @( @{ Src = "C:\Program Files (x86)\Mark"; Dst = "C:\Program Files\Mark" }, @{ 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)" } } # --- 4. Set DNC site and MarkZebra config --- $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." reg add "$regBase\Mark" /v "Port Id" /t REG_SZ /d COM1 /f | Out-Null reg add "$regBase\Mark" /v "Baud" /t REG_SZ /d 9600 /f | Out-Null reg add "$regBase\Mark" /v "Parity" /t REG_SZ /d None /f | Out-Null reg add "$regBase\Mark" /v "Data Bits" /t REG_SZ /d 8 /f | Out-Null reg add "$regBase\Mark" /v "Stop Bits" /t REG_SZ /d 1 /f | Out-Null reg add "$regBase\Mark" /v "Message Type" /t REG_SZ /d V /f | Out-Null reg add "$regBase\Mark" /v "Debug" /t REG_SZ /d ON /f | Out-Null reg add "$regBase\Mark" /v "MarkerType" /t REG_SZ /d Mark2D /f | Out-Null reg add "$regBase\Mark" /v "DncPatterns" /t REG_SZ /d NO /f | Out-Null Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\GE Aircraft Engines\DNC\Mark" -Name "CageCode" -Value "" -Force Write-Host " MarkZebra registry configured." # --- 5. 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 / MarkZebra Setup Complete ==="