geenforce display dispatcher: revert to direct Edge shortcut, drop VBS launcher

The white-on-login was the old Dashboard/Lobby installer's leftover autostart
relaunching the dead old URL (404 -> white), not a network race - so the
wait-for-URL launcher solved the wrong problem. Go back to the plain direct
Edge kiosk shortcut and clean up any stale launcher file. The real fix (the
legacy HKLM Run-key + old .lnk purge) stays; it just has to be published.
This commit is contained in:
cproudlock
2026-07-30 15:37:26 -04:00
parent 95df51fddf
commit 01a545f507

View File

@@ -218,54 +218,21 @@ try {{
ForEach-Object {{ Stop-Process -Id $_.ProcessId -Force -ErrorAction SilentlyContinue; Write-Host "killed old-URL kiosk Edge pid $($_.ProcessId)" }}
}} catch {{}}
# WHY a launcher, not a direct Edge shortcut: at auto-login the shortcut fires
# before the network is up, so Edge --kiosk navigates to nothing and sits on a
# blank WHITE page with no retry. This VBS waits (hidden, no console flash -
# wscript has no window) until the kiosk URL actually responds, THEN launches
# Edge fullscreen, so the first paint is the real page. Gives up after ~3 min
# and launches anyway so a display is never left dark.
$launcherDir = Join-Path $env:ProgramData 'ShopDB'
if (-not (Test-Path $launcherDir)) {{ New-Item -ItemType Directory -Path $launcherDir -Force | Out-Null }}
$launcherPath = Join-Path $launcherDir 'Start-ShopdbKiosk.vbs'
$vbsTemplate = @'
Option Explicit
Dim kioskUrl, edgePath, i, reachable, http, shell
kioskUrl = "__URL__"
edgePath = "__EDGE__"
reachable = False
For i = 1 To 60
On Error Resume Next
Set http = CreateObject("MSXML2.ServerXMLHTTP.6.0")
http.SetTimeouts 5000, 5000, 5000, 5000
http.Open "GET", kioskUrl, False
http.Send
If Err.Number = 0 Then
If http.Status >= 200 And http.Status < 400 Then reachable = True
End If
On Error GoTo 0
If reachable Then Exit For
WScript.Sleep 3000
Next
Set shell = CreateObject("WScript.Shell")
Dim q
q = Chr(34)
shell.Run q & edgePath & q & " --kiosk " & q & kioskUrl & q & " --edge-kiosk-type=fullscreen", 1, False
'@
$vbs = $vbsTemplate.Replace('__URL__', $kioskUrl).Replace('__EDGE__', $edge)
Set-Content -LiteralPath $launcherPath -Value $vbs -Encoding ASCII
# remove a stale VBS launcher from an earlier build (kiosk now uses a direct
# Edge shortcut again). Harmless if absent.
$staleVbs = Join-Path (Join-Path $env:ProgramData 'ShopDB') 'Start-ShopdbKiosk.vbs'
if (Test-Path -LiteralPath $staleVbs) {{ Remove-Item -LiteralPath $staleVbs -Force -ErrorAction SilentlyContinue }}
# Startup shortcut launches the VBS via wscript (windowless), which waits then
# opens Edge. TargetPath is wscript, not Edge, so the connectivity wait runs.
$wscript = Join-Path $env:WINDIR 'System32\\wscript.exe'
$edgeArgs = "--kiosk `"$kioskUrl`" --edge-kiosk-type=fullscreen"
$lnkPath = Join-Path $startup 'ShopDB Kiosk.lnk'
$lnk = $shell.CreateShortcut($lnkPath)
$lnk.TargetPath = $wscript
$lnk.Arguments = '"' + $launcherPath + '"'
$lnk.WorkingDirectory = $launcherDir
$lnk.WindowStyle = 7
$lnk.TargetPath = $edge
$lnk.Arguments = $edgeArgs
$lnk.WorkingDirectory = Split-Path -Parent $edge
$lnk.WindowStyle = 3
$lnk.Description = "ShopDB kiosk display: $kioskUrl"
$lnk.Save()
Write-Host "display-type '$displayType' -> kiosk Startup launcher (waits for $kioskUrl)"
Write-Host "display-type '$displayType' -> kiosk Startup shortcut for $kioskUrl"
"""