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:
@@ -218,54 +218,21 @@ try {{
|
|||||||
ForEach-Object {{ Stop-Process -Id $_.ProcessId -Force -ErrorAction SilentlyContinue; Write-Host "killed old-URL kiosk Edge pid $($_.ProcessId)" }}
|
ForEach-Object {{ Stop-Process -Id $_.ProcessId -Force -ErrorAction SilentlyContinue; Write-Host "killed old-URL kiosk Edge pid $($_.ProcessId)" }}
|
||||||
}} catch {{}}
|
}} catch {{}}
|
||||||
|
|
||||||
# WHY a launcher, not a direct Edge shortcut: at auto-login the shortcut fires
|
# remove a stale VBS launcher from an earlier build (kiosk now uses a direct
|
||||||
# before the network is up, so Edge --kiosk navigates to nothing and sits on a
|
# Edge shortcut again). Harmless if absent.
|
||||||
# blank WHITE page with no retry. This VBS waits (hidden, no console flash -
|
$staleVbs = Join-Path (Join-Path $env:ProgramData 'ShopDB') 'Start-ShopdbKiosk.vbs'
|
||||||
# wscript has no window) until the kiosk URL actually responds, THEN launches
|
if (Test-Path -LiteralPath $staleVbs) {{ Remove-Item -LiteralPath $staleVbs -Force -ErrorAction SilentlyContinue }}
|
||||||
# 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
|
|
||||||
|
|
||||||
# Startup shortcut launches the VBS via wscript (windowless), which waits then
|
$edgeArgs = "--kiosk `"$kioskUrl`" --edge-kiosk-type=fullscreen"
|
||||||
# opens Edge. TargetPath is wscript, not Edge, so the connectivity wait runs.
|
|
||||||
$wscript = Join-Path $env:WINDIR 'System32\\wscript.exe'
|
|
||||||
$lnkPath = Join-Path $startup 'ShopDB Kiosk.lnk'
|
$lnkPath = Join-Path $startup 'ShopDB Kiosk.lnk'
|
||||||
$lnk = $shell.CreateShortcut($lnkPath)
|
$lnk = $shell.CreateShortcut($lnkPath)
|
||||||
$lnk.TargetPath = $wscript
|
$lnk.TargetPath = $edge
|
||||||
$lnk.Arguments = '"' + $launcherPath + '"'
|
$lnk.Arguments = $edgeArgs
|
||||||
$lnk.WorkingDirectory = $launcherDir
|
$lnk.WorkingDirectory = Split-Path -Parent $edge
|
||||||
$lnk.WindowStyle = 7
|
$lnk.WindowStyle = 3
|
||||||
$lnk.Description = "ShopDB kiosk display: $kioskUrl"
|
$lnk.Description = "ShopDB kiosk display: $kioskUrl"
|
||||||
$lnk.Save()
|
$lnk.Save()
|
||||||
Write-Host "display-type '$displayType' -> kiosk Startup launcher (waits for $kioskUrl)"
|
Write-Host "display-type '$displayType' -> kiosk Startup shortcut for $kioskUrl"
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user