Previously the stage indices reflected logical milestones but not the order they fire in. Run-ShopfloorSetup posted idx=1 (start) and idx=4 (PPKG) - but 09-Setup-Keyence (inside per-type loop) ran BETWEEN them and posted idx=5/6. The dashboard then "regressed" from 6 back to 4 when PPKG fired, making it look stuck at the per-type-complete card. New numbering matches actual execution order: 1 - WinPE: PESetup / WIM apply (startnet.cmd) 2 - Run-ShopfloorSetup: starting (Run-ShopfloorSetup.ps1) 3 - 09-Setup-<Type>: starting (per-type) 4 - 09-Setup-<Type>: complete (per-type) 5 - Run-ShopfloorSetup: PPKG enrollment (Run-ShopfloorSetup.ps1) 6 - Run-ShopfloorSetup: handoff to Monitor (Run-ShopfloorSetup.ps1) 7 - Monitor-IntuneProgress: Intune Device ID captured services/imaging_status.py rewind threshold reverts to stage_index <= 1 now that WinPE startnet posts idx=1. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
59 lines
2.9 KiB
PowerShell
59 lines
2.9 KiB
PowerShell
# 09-Setup-Display.ps1 -- Display pc-type setup (runs after Shopfloor baseline)
|
|
#
|
|
# Display = lobby display / dashboard kiosk PC. Kiosk app itself
|
|
# (LobbyDisplay or Dashboard) installs via preinstall.json (Install-
|
|
# KioskApp.cmd reads display-type.txt). No OpenText, no eDNC, no UDC.
|
|
#
|
|
# This script applies Edge kiosk-mode relaunch policies so the
|
|
# "An update is available - restart Edge" dialog auto-clears without
|
|
# requiring keyboard/mouse interaction (display bays have neither).
|
|
#
|
|
# Refs:
|
|
# https://learn.microsoft.com/en-us/deployedge/microsoft-edge-browser-policies/relaunchnotification
|
|
# https://learn.microsoft.com/en-us/deployedge/microsoft-edge-configure-kiosk-mode
|
|
|
|
$ErrorActionPreference = 'Continue'
|
|
|
|
Write-Host '=== Display Setup ==='
|
|
|
|
$pxeStatusLib = Join-Path $PSScriptRoot '..\Shopfloor\lib\Send-PxeStatus.ps1'
|
|
if (Test-Path $pxeStatusLib) {
|
|
try { . $pxeStatusLib; Send-PxeStatus -Stage '09-Setup-Display: starting' -StageIndex 3 -StageTotal 8 } catch { }
|
|
}
|
|
|
|
# --- Edge relaunch policies (suppress update-prompt dialog on kiosks) ---
|
|
$edgePolicy = 'HKLM:\SOFTWARE\Policies\Microsoft\Edge'
|
|
if (-not (Test-Path -LiteralPath $edgePolicy)) {
|
|
New-Item -Path $edgePolicy -Force | Out-Null
|
|
}
|
|
|
|
# RelaunchNotification = 2 (Required): Edge auto-restarts itself after the
|
|
# notification period. Display has no operator to click "dismiss" so this
|
|
# is the only mode that recovers without intervention.
|
|
New-ItemProperty -Path $edgePolicy -Name 'RelaunchNotification' -Value 2 -PropertyType DWord -Force | Out-Null
|
|
|
|
# RelaunchNotificationPeriod (ms): time before forced auto-restart.
|
|
# 3600000 ms = 1 hour. Short window minimises how long the dialog is on
|
|
# screen but still gives an active session a chance to finish.
|
|
New-ItemProperty -Path $edgePolicy -Name 'RelaunchNotificationPeriod' -Value 3600000 -PropertyType DWord -Force | Out-Null
|
|
|
|
# RelaunchHeadsUpPeriod (ms): final warning duration before auto-restart.
|
|
# 60000 ms = 1 min. Trims the visible warning to a minute before relaunch.
|
|
New-ItemProperty -Path $edgePolicy -Name 'RelaunchHeadsUpPeriod' -Value 60000 -PropertyType DWord -Force | Out-Null
|
|
|
|
# RelaunchWindow: schedules the forced restart in an overnight window
|
|
# (02:00-04:00) so business-hour updates wait until off-hours, leaving the
|
|
# dialog effectively invisible during the day. JSON format per MS docs.
|
|
$relaunchWindow = '{"entries":[{"start":{"hour":2,"minute":0},"duration_mins":120}]}'
|
|
New-ItemProperty -Path $edgePolicy -Name 'RelaunchWindow' -Value $relaunchWindow -PropertyType String -Force | Out-Null
|
|
|
|
Write-Host " Edge RelaunchNotification=2 (Required, auto-restart)"
|
|
Write-Host " Edge RelaunchNotificationPeriod=1h"
|
|
Write-Host " Edge RelaunchHeadsUpPeriod=1m"
|
|
Write-Host " Edge RelaunchWindow=02:00-04:00"
|
|
|
|
if (Get-Command Send-PxeStatus -ErrorAction SilentlyContinue) {
|
|
Send-PxeStatus -Stage '09-Setup-Display: complete' -StageIndex 4 -StageTotal 8
|
|
}
|
|
Write-Host '=== Display Setup Complete ==='
|