diff --git a/windows/installer/build.ps1 b/windows/installer/build.ps1 index b9d9211..925c3b2 100644 --- a/windows/installer/build.ps1 +++ b/windows/installer/build.ps1 @@ -155,6 +155,15 @@ function Copy-WelcomePayload { } else { Write-Warning " No *.json flavour files found in $flavoursDir -- image will ship with no flavours." } + # --- Guard: verify the payload actually landed in the mounted image ------- + $stagedExe = Join-Path $dest 'SilverOS.Welcome.App.exe' + if (-not (Test-Path $stagedExe)) { + throw "Welcome bake failed: SilverOS.Welcome.App.exe missing from image (expected at '$stagedExe'). Check that dotnet publish produced the exe and Copy-Item succeeded." + } + $stagedFlavours = Get-ChildItem $destFlavours -Filter '*.json' -EA SilentlyContinue + if (-not $stagedFlavours) { + throw "Welcome bake failed: no flavour manifests staged in '$destFlavours'. Add *.json files under windows/flavours/ or the installed wizard will have no flavour choices." + } Write-Host " Welcome payload staged at $dest" } diff --git a/windows/tests/Assert-IsoStructure.ps1 b/windows/tests/Assert-IsoStructure.ps1 index e958978..37d9329 100644 --- a/windows/tests/Assert-IsoStructure.ps1 +++ b/windows/tests/Assert-IsoStructure.ps1 @@ -36,6 +36,14 @@ try { $mods = Get-ChildItem (Join-Path $mount 'Windows\Setup\Scripts\hardening') -Filter *.ps1 -EA SilentlyContinue Assert 'hardening modules baked (>=9 .ps1)' ($mods.Count -ge 9) Assert 'Verify script baked' (Test-Path (Join-Path $mount 'Windows\Setup\Scripts\hardening\Verify-SilverMetalWindows.ps1')) + + # Welcome app payload assertions (skipped when Welcome is intentionally disabled). + if ($env:SILVERMETAL_WELCOME_ENABLED -ne '0') { + $welcomeExe = Join-Path $mount 'Program Files\SilverOS\Welcome\SilverOS.Welcome.App.exe' + Assert 'Welcome exe baked into WIM' (Test-Path $welcomeExe) + $welcomeFlavours = Get-ChildItem (Join-Path $mount 'Program Files\SilverOS\Welcome\flavours') -Filter '*.json' -EA SilentlyContinue + Assert 'Welcome flavours baked (>=1 .json)' ($welcomeFlavours.Count -ge 1) + } } finally { Dismount-WindowsImage -Path $mount -Discard | Out-Null } } } finally { Dismount-DiskImage -ImagePath $IsoPath | Out-Null }