geenforce display dispatcher: purge legacy autostart in Wow6432Node + all hives

The old kiosk kept relaunching the dead URL from an HKLM Run value the 32-bit
Inno installer wrote - WOW64-redirected into SOFTWARE\Wow6432Node, which 64-bit
tooling (and the earlier purge) never saw. Broaden the sweep to both registry
views, every loaded user hive, Run/RunOnce/Policies-Explorer-Run, matching by
legacy name AND by any value pointing at the old URLs, plus every per-user and
common Startup folder.
This commit is contained in:
cproudlock
2026-07-30 15:54:18 -04:00
parent 01a545f507
commit af6bcd4726

View File

@@ -198,19 +198,70 @@ Get-ChildItem -LiteralPath $startup -Filter '*.url' -ErrorAction SilentlyContinu
}} catch {{}} }} catch {{}}
}} }}
# Legacy HKLM Run autostarts the OLD Dashboard/Lobby Inno installers planted. # Legacy autostarts the OLD Dashboard/Lobby Inno installers planted keep
# The .lnk/.url sweep above misses these -- a Run value relaunches the old kiosk # relaunching the dead old URL (-> 404 white screen) and BEAT our shortcut. They
# URL at every logon and BEATS our Startup shortcut (this is why a display with # hide in several places: the 32-bit Inno installer's HKLM Run write is
# our new .lnk still opened the old page). Purge them, then kill any running # WOW64-redirected into Wow6432Node (invisible to 64-bit tooling), and copies
# old-URL Edge so the display self-heals to the resolved target this cycle. # can sit in per-user hives, RunOnce, or the policy Run key. Sweep ALL of them
$legacyRun = 'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run' # by legacy NAME and by VALUE (any Run entry whose data points at the old URLs),
foreach ($legacyName in @('GE Aerospace Dashboard','GE Aerospace Lobby Display')) {{ # across the native + Wow6432Node views and every loaded user hive, plus every
try {{ # per-user + common Startup folder.
if ($null -ne (Get-ItemProperty -LiteralPath $legacyRun -Name $legacyName -ErrorAction SilentlyContinue)) {{ $legacyNames = @('GE Aerospace Dashboard','GE Aerospace Lobby Display')
Remove-ItemProperty -LiteralPath $legacyRun -Name $legacyName -Force -ErrorAction SilentlyContinue $oldUrlPattern = 'tv-dashboard|shopfloor-dashboard'
Write-Host "removed legacy Run value $legacyName"
$regRoots = @('HKLM:\\SOFTWARE', 'HKLM:\\SOFTWARE\\Wow6432Node')
if (-not (Get-PSDrive -Name HKU -ErrorAction SilentlyContinue)) {{
New-PSDrive -Name HKU -PSProvider Registry -Root HKEY_USERS -ErrorAction SilentlyContinue | Out-Null
}}
try {{
Get-ChildItem 'Registry::HKEY_USERS' -ErrorAction Stop |
Where-Object {{ $_.PSChildName -notmatch '_Classes$' }} |
ForEach-Object {{
$regRoots += "HKU:\\$($_.PSChildName)\\SOFTWARE"
$regRoots += "HKU:\\$($_.PSChildName)\\SOFTWARE\\Wow6432Node"
}} }}
}} catch {{}} }} catch {{}}
$runSubkeys = @(
'Microsoft\\Windows\\CurrentVersion\\Run',
'Microsoft\\Windows\\CurrentVersion\\RunOnce',
'Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\Run'
)
foreach ($root in $regRoots) {{
foreach ($sub in $runSubkeys) {{
$key = Join-Path $root $sub
if (-not (Test-Path -LiteralPath $key)) {{ continue }}
$props = Get-ItemProperty -LiteralPath $key -ErrorAction SilentlyContinue
if (-not $props) {{ continue }}
foreach ($prop in $props.PSObject.Properties) {{
if ($prop.Name -like 'PS*') {{ continue }}
if (($legacyNames -contains $prop.Name) -or ("$($prop.Value)" -match $oldUrlPattern)) {{
Remove-ItemProperty -LiteralPath $key -Name $prop.Name -Force -ErrorAction SilentlyContinue
Write-Host "removed legacy autostart $key -> $($prop.Name)"
}}
}}
}}
}}
$startupDirs = @($startup, (Join-Path $env:Public 'Desktop'))
Get-ChildItem 'C:\\Users' -Directory -ErrorAction SilentlyContinue | ForEach-Object {{
$startupDirs += (Join-Path $_.FullName 'AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup')
}}
foreach ($dir in ($startupDirs | Select-Object -Unique)) {{
if (-not (Test-Path -LiteralPath $dir)) {{ continue }}
Get-ChildItem -LiteralPath $dir -Filter '*.lnk' -ErrorAction SilentlyContinue | ForEach-Object {{
$drop = ($_.Name -like 'GE Aerospace *')
if (-not $drop) {{
try {{
$existing = $shell.CreateShortcut($_.FullName)
if ("$($existing.Arguments)" -match $oldUrlPattern) {{ $drop = $true }}
}} catch {{}}
}}
if ($drop) {{
Remove-Item -LiteralPath $_.FullName -Force -ErrorAction SilentlyContinue
Write-Host "removed legacy startup shortcut $($_.FullName)"
}}
}}
}} }}
try {{ try {{
Get-CimInstance Win32_Process -Filter "Name = 'msedge.exe'" -ErrorAction SilentlyContinue | Get-CimInstance Win32_Process -Filter "Name = 'msedge.exe'" -ErrorAction SilentlyContinue |