geenforce display dispatcher: purge legacy HKLM Run autostart
This commit is contained in:
@@ -198,7 +198,27 @@ Get-ChildItem -LiteralPath $startup -Filter '*.url' -ErrorAction SilentlyContinu
|
||||
}} catch {{}}
|
||||
}}
|
||||
|
||||
$edgeArgs = "--kiosk `"$kioskUrl`" --edge-kiosk-type=fullscreen --no-first-run --no-default-browser-check"
|
||||
# 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)
|
||||
$lnk.TargetPath = $edge
|
||||
|
||||
Reference in New Issue
Block a user