CMM: add goCMM settings backup/restore + debug scripts

goCMM settings live in two places: 3 pointer values at
HKLM\SOFTWARE\WOW6432Node\General Electric\goCMM, and the real content of all
7 Settings tabs (PC-DMIS, Quindos, Modus, Machine Definition, User Input,
Notifications, Part Groups) in C:\geaofi\ApplicationSettings.xml. Capture-replay
pair, mirroring the Wax/Trace Backup/Install scripts:

- Backup-goCMMSettings.ps1/.bat: on a live legacy bay (admin), zips the registry
  key + the C:\geaofi tree (minus transient LocalProgramCopies/logs) to
  gocmm_backup_<PC>_<ts>.zip.
- Install-goCMMSettings.ps1/.bat: restore at imaging (admin). Imports the key +
  lays down C:\geaofi, then grants BUILTIN\Users WriteKey on the reg key and
  Modify on C:\geaofi - goCMM's RegistrySettings.GetRegistryString opens the key
  with writable:true even to READ, so a locked-down operator throws a
  SecurityException without the grant (the post-lockdown 'registry access not
  allowed' error). Applies a built-in legacy->new FQDN rewrite
  (rd.ds.ge.com -> wjs.geaerospace.net) automatically across the registry values
  and ApplicationSettings.xml (incl PartGroup FullName); -NoDefaultRewrite skips
  it, /replace adds an extra pair, -SelectedPartGroup overrides per bay.
- gocmm-debug.ps1/.bat: run as the operator to reproduce the SecurityException
  and dump the goCMM key ACL (confirms whether lockdown stripped the grant).

All round-trip + FQDN-rewrite verified on the win11 VM. NOTE: covers goCMM only;
PC-DMIS probe calibrations / custom tip angles / machine comp are owned by
PC-DMIS (Hexagon) and not captured here. Not yet wired into 09-Setup-CMM
auto-discovery.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
cproudlock
2026-06-11 08:27:30 -04:00
parent da380fbcd7
commit bfe17fe123
6 changed files with 462 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
@echo off
REM Install-goCMMSettings.bat - restore goCMM settings from a backup zip.
REM
REM Run AS ADMINISTRATOR / at imaging. Imports the registry pointers + the
REM Shared Data Directory and grants the access goCMM needs under lockdown.
REM
REM Usage:
REM Install-goCMMSettings.bat "<zip>"
REM plain restore
REM Install-goCMMSettings.bat "<zip>" "\\server\SHARED\CMM\CMM7\Spool"
REM restore + override the Selected Part Group (per-bay)
REM Install-goCMMSettings.bat "<zip>" /replace <from> <to>
REM restore + find/replace <from> -> <to> across ALL registry values and
REM data files (e.g. legacy FQDN -> new FQDN). Swap the DOMAIN SUFFIX to
REM fix every host at once:
REM Install-goCMMSettings.bat "bk.zip" /replace rd.ds.ge.com wjs.geaerospace.net
setlocal
set "HERE=%~dp0"
if "%~1"=="" (
echo Usage:
echo %~nx0 "^<zip^>"
echo %~nx0 "^<zip^>" "^<SelectedPartGroup^>"
echo %~nx0 "^<zip^>" /replace ^<from^> ^<to^>
pause
exit /b 1
)
set "ZIP=%~1"
set "PS=powershell.exe -NoProfile -ExecutionPolicy Bypass -File ""%HERE%Install-goCMMSettings.ps1"" -BackupPath ""%ZIP%"""
if /i "%~2"=="/replace" (
if "%~4"=="" ( echo /replace needs ^<from^> ^<to^> & pause & exit /b 1 )
%PS% -ReplaceFrom "%~3" -ReplaceTo "%~4"
) else if not "%~2"=="" (
%PS% -SelectedPartGroup "%~2"
) else (
%PS%
)
echo.
pause