Kiosk bootstrap: look for the installer where staging actually puts it

The bootstrap looked for C:\Enrollment\kiosk\Install-ShopdbKiosk.ps1, but
startnet copies the type-specific tree to
C:\Enrollment\shopfloor-setup\gea-shopfloor-display\ - so the payload lands
beside the bootstrap, not under C:\Enrollment.

As written it would have logged "Installer not staged" on every 15-minute cycle
and never installed anything, with no error anywhere. Exactly the silent-failure
shape this whole day has been about, and it would have looked like the API being
unreachable.

Resolves via a -KioskRoot parameter defaulting to kiosk\ next to the script, so
the bootstrap and its payload travel together regardless of where the tree is
staged. display-type.txt still comes from EnrollmentRoot, which is correct - that
one really is at C:\Enrollment.
This commit is contained in:
cproudlock
2026-08-06 16:12:41 -04:00
parent 7ed30f9b85
commit d5cf255443

View File

@@ -25,9 +25,9 @@
.PARAMETER EnrollmentRoot .PARAMETER EnrollmentRoot
Where imaging staged things. Expects: Where imaging staged things. Expects:
<root>\display-type.txt Dashboard | Lobby | 3DPrintRoom <root>\display-type.txt Dashboard | Lobby | 3DPrintRoom
<root>\kiosk\Install-ShopdbKiosk.ps1 and, beside this script (see -KioskRoot):
<root>\kiosk\shopdb-key.txt (optional) line1 collector.ingest PAT, kiosk\Install-ShopdbKiosk.ps1
line2 geenforce.fetch PAT kiosk\shopdb-key.txt (optional) labelled: collector=..., fetch=...
.PARAMETER TaskName .PARAMETER TaskName
The scheduled task to remove once installation succeeds. The scheduled task to remove once installation succeeds.
@@ -42,6 +42,15 @@
[CmdletBinding()] [CmdletBinding()]
param( param(
[string]$EnrollmentRoot = 'C:\Enrollment', [string]$EnrollmentRoot = 'C:\Enrollment',
# Where the staged installer and key live. Defaults to kiosk\ NEXT TO THIS
# SCRIPT, not under EnrollmentRoot: startnet copies the whole type-specific
# tree to
# C:\Enrollment\shopfloor-setup\gea-shopfloor-display\
# so the payload arrives beside this file, not at C:\Enrollment\kiosk.
# Getting this wrong is silent - the bootstrap just logs "not staged" every
# cycle and never installs anything.
[string]$KioskRoot = (Join-Path $PSScriptRoot 'kiosk'),
[string]$BaseUrl = 'https://tsgwp00525.wjs.geaerospace.net/shopdb', [string]$BaseUrl = 'https://tsgwp00525.wjs.geaerospace.net/shopdb',
[string]$TaskName = 'ShopDB Kiosk Bootstrap', [string]$TaskName = 'ShopDB Kiosk Bootstrap',
[int]$TimeoutSeconds = 30 [int]$TimeoutSeconds = 30
@@ -93,7 +102,7 @@ if ($displayType -notin @('Dashboard','Lobby','3DPrintRoom')) {
} }
Log "DisplayType: $displayType" Log "DisplayType: $displayType"
$installer = Join-Path $EnrollmentRoot 'kiosk\Install-ShopdbKiosk.ps1' $installer = Join-Path $KioskRoot 'Install-ShopdbKiosk.ps1'
if (-not (Test-Path $installer)) { if (-not (Test-Path $installer)) {
Log "Installer not staged at $installer. Leaving armed." Log "Installer not staged at $installer. Leaving armed."
return return
@@ -118,7 +127,7 @@ try {
} }
# --- keys ---------------------------------------------------------------- # --- keys ----------------------------------------------------------------
$keyFile = Join-Path $EnrollmentRoot 'kiosk\shopdb-key.txt' $keyFile = Join-Path $KioskRoot 'shopdb-key.txt'
$collectorKey = '' $collectorKey = ''
$fetchToken = '' $fetchToken = ''
if (Test-Path $keyFile) { if (Test-Path $keyFile) {