CMM per-bay PC-DMIS version selection + DODA deploy

Add bay picker (same arrow-key pattern as waxtrace) that maps CMM1-12
to a PC-DMIS version (2016/2019/2026) and DODA flag via cmm-bay-config.csv.

startnet.cmd: replace Standard/DODA submenu with bay picker. Writes
CMMID (e.g. CMM4) to machine-number.txt so the existing
TargetMachineNumbers filter on the SFLD share manifest gates per-bay
entries with no lib changes.

09-Setup-CMM: reads resolved version.txt and filters cmm-manifest.json
by _CmmVersion tag at imaging time so only the matched PC-DMIS version
installs.

cmm-manifest.json: add PC-DMIS 2026.1 entry (patched MSI, product code
{81BACE1B-FB08-4DCF-8100-79911AD3EC1E}) and DODA entry (flat zip extract
to C:\Apps\DODA\). Existing 2016/2019 entries tagged with _CmmVersion.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
cproudlock
2026-05-27 12:01:27 -04:00
parent 55c1ab4814
commit 5e13d38512
7 changed files with 314 additions and 33 deletions

View File

@@ -119,14 +119,47 @@ elseif (-not (Test-Path $libSource)) {
Write-CMMLog "Shared library not found at $libSource" "ERROR"
}
else {
# Pass PCType + PCSubType so cmm-manifest.json's PCTypes filter on
# subtype-specific entries (e.g. DODA gated to cmm-doda) is honored.
# Without this, ALL entries run regardless of subtype - same bug we
# had on Keyence before the per-model gating fix.
$pcType = ''
$pcSubType = ''
if (Test-Path 'C:\Enrollment\pc-type.txt') { $pcType = (Get-Content 'C:\Enrollment\pc-type.txt' -First 1 -EA 0).Trim() }
if (Test-Path 'C:\Enrollment\pc-subtype.txt') { $pcSubType = (Get-Content 'C:\Enrollment\pc-subtype.txt' -First 1 -EA 0).Trim() }
# Read resolved PC-DMIS version from bay-config (written by
# resolve-cmm-bay-config.ps1 via startnet.cmd). If missing, install all
# PC-DMIS versions (legacy behavior for bays imaged before the picker).
$cmmVersion = ''
$cmmVersionFile = 'C:\Enrollment\cmm\version.txt'
if (Test-Path -LiteralPath $cmmVersionFile) {
$cmmVersion = (Get-Content -LiteralPath $cmmVersionFile -First 1 -EA 0).Trim()
}
Write-CMMLog "Resolved CMM version: $(if ($cmmVersion) { $cmmVersion } else { '(none - installing all)' })"
# Filter manifest: drop entries whose _CmmVersion doesn't match the
# resolved version. Entries without _CmmVersion always pass (CLM, goCMM,
# Protect Viewer, DODA). Write a temp filtered manifest for the lib.
if ($cmmVersion) {
try {
$cfg = Get-Content $stagingMani -Raw | ConvertFrom-Json
$filtered = @($cfg.Applications | Where-Object {
if (-not $_._CmmVersion) { return $true }
return ($_._CmmVersion -ieq $cmmVersion)
})
$skipped = @($cfg.Applications | Where-Object {
$_._CmmVersion -and ($_._CmmVersion -ine $cmmVersion)
})
foreach ($s in $skipped) {
Write-CMMLog " Skipping $($s.Name) (_CmmVersion=$($_._CmmVersion) != $cmmVersion)"
}
$cfg.Applications = $filtered
$filteredMani = Join-Path $stagingRoot 'cmm-manifest-filtered.json'
$cfg | ConvertTo-Json -Depth 10 | Set-Content -LiteralPath $filteredMani -Encoding UTF8
Write-CMMLog "Filtered manifest: $($filtered.Count) entries (from $($filtered.Count + $skipped.Count))"
$stagingMani = $filteredMani
} catch {
Write-CMMLog "Version filter failed: $_ - using unfiltered manifest" 'WARN'
}
}
Write-CMMLog "Running Install-FromManifest against $stagingRoot (PCType=$pcType, PCSubType=$pcSubType)"
& $libSource -ManifestPath $stagingMani -InstallerRoot $stagingRoot -LogFile $logFile -PCType $pcType -PCSubType $pcSubType
$rc = $LASTEXITCODE