CMM first-run-as-admin, controller credential user-context fix, IE compat hash
09-Setup-CMM: add Step 2.6 that launches each installed PC-DMIS version once as admin before the PPKG locks the machine down. Also adds PC-DMIS 2026.1 to the ACL directory list. Controller credential: cmdkey /add under SYSTEM stored creds in the wrong vault. Switch to a Register script (MarkerFile detection, runs once) that creates an AtLogOn scheduled task under BUILTIN\Users so cmdkey runs in the ShopFloor user's session. IE compat: update test matrix hash for the new site list that adds wjfms3.apps.wlm.geaerospace.net. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -139,12 +139,12 @@ else {
|
||||
# PC-DMIS writes settings, probe configs, and measurement data to its own
|
||||
# install directory at runtime. Without Modify permission for BUILTIN\Users,
|
||||
# non-admin accounts get a UAC elevation prompt on every launch. Granting
|
||||
# the ACL here is the Hexagon-documented approach for non-admin deployment
|
||||
# and avoids the need for a first-run-as-admin (which hits a license dialog
|
||||
# and can't be automated silently).
|
||||
# the ACL here is the Hexagon-documented approach for non-admin deployment.
|
||||
# Step 2.6 below handles the required first-run-as-admin initialization.
|
||||
$pcdmisDirs = @(
|
||||
'C:\Program Files\Hexagon\PC-DMIS 2016.0 64-bit',
|
||||
'C:\Program Files\Hexagon\PC-DMIS 2019 R2 64-bit',
|
||||
'C:\Program Files\Hexagon\PC-DMIS 2026.1 64-bit',
|
||||
'C:\ProgramData\Hexagon',
|
||||
'C:\Program Files (x86)\General Electric\goCMM',
|
||||
'C:\Program Files\DODA'
|
||||
@@ -171,6 +171,39 @@ foreach ($dir in $pcdmisDirs) {
|
||||
}
|
||||
}
|
||||
|
||||
# ============================================================================
|
||||
# Step 2.6: First-run-as-admin for each installed PC-DMIS version
|
||||
# ============================================================================
|
||||
# PC-DMIS performs one-time initialization on first launch (COM registration,
|
||||
# config file creation, internal setup). This must happen with admin rights
|
||||
# before the PPKG locks the machine down. Launch each installed version,
|
||||
# wait for it to initialize, then kill it.
|
||||
$pcdmisExes = @(
|
||||
'C:\Program Files\Hexagon\PC-DMIS 2016.0 64-bit\PCDLRN.exe',
|
||||
'C:\Program Files\Hexagon\PC-DMIS 2019 R2 64-bit\PCDLRN.exe',
|
||||
'C:\Program Files\Hexagon\PC-DMIS 2026.1 64-bit\PCDLRN.exe'
|
||||
)
|
||||
foreach ($exe in $pcdmisExes) {
|
||||
if (-not (Test-Path -LiteralPath $exe)) { continue }
|
||||
$ver = Split-Path (Split-Path $exe -Parent) -Leaf
|
||||
Write-CMMLog "First-run init: launching $ver"
|
||||
try {
|
||||
$proc = Start-Process -FilePath $exe -PassThru -ErrorAction Stop
|
||||
$initTimeout = 45
|
||||
Write-CMMLog " PID $($proc.Id) started, waiting ${initTimeout}s for initialization..."
|
||||
Start-Sleep -Seconds $initTimeout
|
||||
if (-not $proc.HasExited) {
|
||||
$proc.Kill()
|
||||
$proc.WaitForExit(10000)
|
||||
Write-CMMLog " Killed after ${initTimeout}s (first-run init complete)"
|
||||
} else {
|
||||
Write-CMMLog " Exited on its own (exit $($proc.ExitCode))"
|
||||
}
|
||||
} catch {
|
||||
Write-CMMLog " First-run launch failed: $_" 'WARN'
|
||||
}
|
||||
}
|
||||
|
||||
# ============================================================================
|
||||
# Step 3: Conditional cleanup of the bootstrap staging dir
|
||||
# ============================================================================
|
||||
|
||||
Reference in New Issue
Block a user