From 743bc91996a0bb341cadfba51fa50b1008b3c88c Mon Sep 17 00:00:00 2001 From: cproudlock Date: Mon, 13 Apr 2026 11:38:59 -0400 Subject: [PATCH] Shopfloor Display: move kiosk app install to preinstall system Install-KioskApp.cmd wrapper reads display-type.txt and runs the matching Inno Setup installer (Lobby or Dashboard). Replaces the standalone 09-Setup-Display.ps1 for uniform app install pipeline. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../preinstall/display/Install-KioskApp.cmd | 43 +++++++++++++++ playbook/preinstall/preinstall.json | 9 ++++ .../Display/09-Setup-Display.ps1 | 54 ++++--------------- 3 files changed, 61 insertions(+), 45 deletions(-) create mode 100644 playbook/preinstall/display/Install-KioskApp.cmd diff --git a/playbook/preinstall/display/Install-KioskApp.cmd b/playbook/preinstall/display/Install-KioskApp.cmd new file mode 100644 index 0000000..6e9703a --- /dev/null +++ b/playbook/preinstall/display/Install-KioskApp.cmd @@ -0,0 +1,43 @@ +@echo off +REM Install-KioskApp.cmd - Install Lobby Display or Dashboard kiosk app +REM +REM Reads C:\Enrollment\display-type.txt to determine which app to install. +REM Only runs on Display PCs (PCTypes filter in preinstall.json). +REM Both installers live alongside this script in the staged display\ subtree. + +set "TYPEFILE=C:\Enrollment\display-type.txt" + +if not exist "%TYPEFILE%" ( + echo No display-type.txt found - skipping kiosk app install. + exit /b 0 +) + +set /p DISPLAYTYPE=<"%TYPEFILE%" + +if /i "%DISPLAYTYPE%"=="Lobby" ( + set "INSTALLER=%~dp0GEAerospaceLobbyDisplaySetup.exe" + set "APPNAME=Lobby Display" +) else if /i "%DISPLAYTYPE%"=="Dashboard" ( + set "INSTALLER=%~dp0GEAerospaceDashboardSetup.exe" + set "APPNAME=Dashboard" +) else ( + echo Unknown display type: %DISPLAYTYPE% + exit /b 1 +) + +if not exist "%INSTALLER%" ( + echo %APPNAME% installer not found: %INSTALLER% + exit /b 1 +) + +echo Installing %APPNAME%... +"%INSTALLER%" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /LOG="C:\Logs\PreInstall\%APPNAME%-install.log" +set EXITCODE=%errorlevel% + +if %EXITCODE% equ 0 ( + echo %APPNAME% installed successfully. +) else ( + echo %APPNAME% exited with code %EXITCODE%. +) + +exit /b %EXITCODE% diff --git a/playbook/preinstall/preinstall.json b/playbook/preinstall/preinstall.json index 83f548c..106bd29 100644 --- a/playbook/preinstall/preinstall.json +++ b/playbook/preinstall/preinstall.json @@ -144,6 +144,15 @@ "DetectionPath": "HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\UDC", "PCTypes": ["Standard"] }, + { + "_comment": "Display kiosk app (Lobby Display or Dashboard). Install-KioskApp.cmd wrapper reads C:\\Enrollment\\display-type.txt to determine which installer to run. Both GEAerospaceLobbyDisplaySetup.exe and GEAerospaceDashboardSetup.exe must be staged in the display\\ subtree alongside the wrapper. Inno Setup /VERYSILENT is idempotent so no detection needed.", + "Name": "Display Kiosk App", + "Installer": "display\\Install-KioskApp.cmd", + "Type": "EXE", + "InstallArgs": "", + "LogFile": "C:\\Logs\\PreInstall\\Dashboard-install.log", + "PCTypes": ["Display"] + }, { "_comment": "Shopfloor Standard serial-port drivers: StarTech PCIe serial adapter (MosChip-based) + Prolific PL2303 USB-to-serial. Install-Drivers.cmd runs pnputil /add-driver with /subdirs /install so every bundled INF under drivers/ lands in the Windows driver store and auto-binds to matching hardware present now or plugged in later. Scoped to Standard PCs (both Machine + Timeclock) because the PCTypes filter is type-level only; installing a serial driver on a Timeclock without the hardware is harmless - it just sits in the driver store.", "Name": "Shopfloor Serial Drivers", diff --git a/playbook/shopfloor-setup/Display/09-Setup-Display.ps1 b/playbook/shopfloor-setup/Display/09-Setup-Display.ps1 index 9578aec..ece2008 100644 --- a/playbook/shopfloor-setup/Display/09-Setup-Display.ps1 +++ b/playbook/shopfloor-setup/Display/09-Setup-Display.ps1 @@ -1,45 +1,9 @@ -# 09-Setup-Display.ps1 -- Display-specific setup (runs after Shopfloor baseline) -# Reads display-type.txt to install either LobbyDisplay or Dashboard kiosk app. - -$enrollDir = "C:\Enrollment" -$typeFile = Join-Path $enrollDir "display-type.txt" -$setupDir = Split-Path -Parent $MyInvocation.MyCommand.Path - -if (-not (Test-Path $typeFile)) { - Write-Warning "No display-type.txt found - skipping display setup." - return -} - -$displayType = (Get-Content $typeFile -First 1).Trim() -Write-Host "=== Display Setup: $displayType ===" - -switch ($displayType) { - "Lobby" { - $installer = Join-Path $setupDir "GEAerospaceLobbyDisplaySetup.exe" - $appName = "Lobby Display" - } - "Dashboard" { - $installer = Join-Path $setupDir "GEAerospaceDashboardSetup.exe" - $appName = "Dashboard" - } - default { - Write-Warning "Unknown display type: $displayType" - return - } -} - -if (-not (Test-Path $installer)) { - Write-Warning "$appName installer not found at $installer - skipping." - return -} - -Write-Host "Installing $appName..." -$proc = Start-Process -FilePath $installer -ArgumentList '/VERYSILENT', '/SUPPRESSMSGBOXES', '/NORESTART', "/LOG=C:\Enrollment\$appName-install.log" -Wait -PassThru - -if ($proc.ExitCode -eq 0) { - Write-Host "$appName installed successfully." -} else { - Write-Warning "$appName exited with code $($proc.ExitCode). Check C:\Enrollment\$appName-install.log" -} - -Write-Host "=== Display Setup Complete ===" +# 09-Setup-Display.ps1 -- Display-specific setup (runs after Shopfloor baseline) +# +# Kiosk app installation moved to preinstall.json (Install-KioskApp.cmd wrapper). +# The wrapper reads display-type.txt and installs the matching kiosk app during +# the baseline preinstall phase (00-PreInstall-MachineApps.ps1). +# +# This script is intentionally empty. Remove it once confirmed working. + +Write-Host "=== Display Setup: kiosk app installed via preinstall system ==="