geenforce display dispatcher: purge legacy HKLM Run autostart

The old LobbyDisplay/Dashboard Inno installers planted an HKLM
...\CurrentVersion\Run value (plus a Startup .lnk). The dispatcher already
swept the stale .lnk/.url launchers but never the Run value, so a display
with our new ShopDB Kiosk.lnk still relaunched the old kiosk URL at logon
(the Run key beats the Startup shortcut). Remove the two legacy Run values
and kill any running old-URL Edge so the display self-heals to the resolved
target on the next enforce cycle.
This commit is contained in:
cproudlock
2026-07-30 14:28:44 -04:00
parent 516e33a6c3
commit e6533d5205

View File

@@ -198,6 +198,26 @@ Get-ChildItem -LiteralPath $startup -Filter '*.url' -ErrorAction SilentlyContinu
}} catch {{}}
}}
# Legacy HKLM Run autostarts the OLD Dashboard/Lobby Inno installers planted.
# The .lnk/.url sweep above misses these -- a Run value relaunches the old kiosk
# URL at every logon and BEATS our Startup shortcut (this is why a display with
# our new .lnk still opened the old page). Purge them, then kill any running
# old-URL Edge so the display self-heals to the resolved target this cycle.
$legacyRun = 'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run'
foreach ($legacyName in @('GE Aerospace Dashboard','GE Aerospace Lobby Display')) {{
try {{
if ($null -ne (Get-ItemProperty -LiteralPath $legacyRun -Name $legacyName -ErrorAction SilentlyContinue)) {{
Remove-ItemProperty -LiteralPath $legacyRun -Name $legacyName -Force -ErrorAction SilentlyContinue
Write-Host "removed legacy Run value $legacyName"
}}
}} catch {{}}
}}
try {{
Get-CimInstance Win32_Process -Filter "Name = 'msedge.exe'" -ErrorAction SilentlyContinue |
Where-Object {{ $_.CommandLine -match 'tv-dashboard|shopfloor-dashboard' }} |
ForEach-Object {{ Stop-Process -Id $_.ProcessId -Force -ErrorAction SilentlyContinue; Write-Host "killed old-URL kiosk Edge pid $($_.ProcessId)" }}
}} catch {{}}
$edgeArgs = "--kiosk `"$kioskUrl`" --edge-kiosk-type=fullscreen"
$lnkPath = Join-Path $startup 'ShopDB Kiosk.lnk'
$lnk = $shell.CreateShortcut($lnkPath)