CMM/DODA: fix DODA-bay profile resolution + goCMM 2.12 DataFolder + settings converter
- Get-PCProfile: subtype-strip fallback. DODA bays set pc-subtype.txt=doda, so the profile key became "gea-shopfloor-cmm-doda" which matched NO profile/alias -> Get-PCProfile returned null -> callers fell to hardcoded defaults (no PC-DMIS desktop icons; Defect Tracker / WJ Shopfloor / Plant Apps force-started). Now an unmatched compound key falls back to the bare pc-type (-> CMM). VM-tested: gea-shopfloor-cmm/doda + CMM/doda resolve to CMM (7 apps, PC-DMIS present); non-CMM unaffected. - 09-Setup-CMM Step 2.5c: Active Setup seed for goCMM 2.12 DataFolder. goCMM 2.12 stores its shared-data-dir in HKCU\Software\General Electric\goCMM\DataFolder (decompiled: RegistrySettings uses Registry.CurrentUser - per-user). Imaging as SupportUser wouldn't reach the ShopFloor operator's HKCU. Active Setup runs the StubPath once per user at first logon -> every user gets DataFolder=C:\geaofi\. VM-tested: StubPath writes the value with the trailing backslash intact. - Convert-goCMMSettings.ps1: converts legacy goCMM 1.1 ApplicationSettings.xml -> goCMM 2.12 goCMMSettings.xml schema. VM-tested: output byte-identical to a real goCMM-2.12-produced CMM10 goCMMSettings.xml. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -193,6 +193,27 @@ try {
|
||||
Write-CMMLog "Granted Users + Authenticated Users Modify on $frontEnd"
|
||||
} catch { Write-CMMLog "Failed to ensure ${frontEnd}: $_" "WARN" }
|
||||
|
||||
# ============================================================================
|
||||
# Step 2.5c: Active Setup - seed goCMM 2.12 DataFolder per-user for ALL users
|
||||
# ============================================================================
|
||||
# goCMM 2.12 stores its shared-data-dir in HKCU\Software\General Electric\goCMM
|
||||
# \DataFolder (decompiled: RegistrySettings uses Registry.CurrentUser - PER USER,
|
||||
# not HKLM). Setting it at imaging only touches the imaging user (SupportUser);
|
||||
# the ShopFloor operator's HKCU would be empty -> goCMM prompts them to pick the
|
||||
# folder on first launch. Active Setup runs StubPath once in EACH user's context
|
||||
# at first logon, so every user (SupportUser, ShopFloor, future) gets
|
||||
# DataFolder=C:\geaofi\. Bump Version to re-push. (Uses Set-ItemProperty in the
|
||||
# stub, not reg.exe, to avoid the trailing-backslash quoting trap.)
|
||||
$asKey = 'HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{8F3B2A10-7C4D-4E9A-B1F6-0A9C5D2E7B43}'
|
||||
try {
|
||||
New-Item -Path $asKey -Force | Out-Null
|
||||
Set-ItemProperty -Path $asKey -Name '(default)' -Value 'goCMM DataFolder (per-user)'
|
||||
Set-ItemProperty -Path $asKey -Name 'Version' -Value '1'
|
||||
$stub = 'powershell.exe -NoProfile -WindowStyle Hidden -Command "New-Item -Path ''HKCU:\SOFTWARE\General Electric\goCMM'' -Force | Out-Null; Set-ItemProperty -Path ''HKCU:\SOFTWARE\General Electric\goCMM'' -Name DataFolder -Value ''C:\geaofi\''"'
|
||||
Set-ItemProperty -Path $asKey -Name 'StubPath' -Value $stub
|
||||
Write-CMMLog "Seeded Active Setup: goCMM DataFolder=C:\geaofi\ (per-user, all users)"
|
||||
} catch { Write-CMMLog "Failed to seed Active Setup goCMM DataFolder: $_" 'WARN' }
|
||||
|
||||
# ============================================================================
|
||||
# Step 2.6: First-run-as-admin for each installed PC-DMIS version
|
||||
# ============================================================================
|
||||
|
||||
Reference in New Issue
Block a user