feat: WinPE pre-config collector + simplified first-boot toolbox (SP1) #21

Merged
SilverLABS merged 14 commits from docs/winpe-preconfig-collector into main 2026-06-10 08:40:58 +00:00
Owner

Summary

Pre-configures the install before Windows Setup runs. A branded WinPE collector captures identity + install-shaping choices, generates the answer file so Setup creates the real local-admin account natively (eliminating the sm-bootstrap account + its teardown dance), and hands the rest to a simplified run-once-then-persist first-boot toolbox.

Flow: boot.wimwinpeshl.ini → collector (PowerShell + WinForms) collects account · computer name · locale · flavour · BitLocker PIN → New-SmAnswerFile generates the answer file (real account, AutoLogon-once, no sm-bootstrap) + embeds preconfig.json (base64) written in the specialize pass → Setup installs + creates the account → first logon auto-applies the preconfig (apps + BitLocker, shows recovery key) → Done → persists as a launchable toolbox.

What changed

  • Collector (windows/collector/): Test-SmInput.ps1 (validation), New-SmAnswerFile.ps1 (answer-file generator + embedded preconfig), Collector.ps1 (dark WinForms shell), Start-Collector.cmd + winpeshl.ini (entry + SM_UNATTENDED=1 CI fallback).
  • Toolbox trim (windows/welcome/): removed the Account step, account creation, sm-bootstrap teardown, and the heavy kiosk; ApplyService is now apps → bitlocker. New PreconfigStore (load fail-open / clear-pin / configured-marker); Routes pre-seeds from preconfig and first-run auto-applies (toolbox-home on subsequent launches).
  • Build (build.ps1): adds WinPE WinPE-NetFx/WinPE-PowerShell to boot.wim + stages the collector + winpeshl.ini; SetupComplete.cmd scrubs the Panther unattend (plaintext-password hygiene); Assert-IsoStructure asserts the collector baked into boot.wim.
  • Hardening stays canonical in SetupComplete (runs headless as SYSTEM); the toolbox no longer duplicates it.

Spec: windows/docs/superpowers/specs/2026-06-10-winpe-preconfig-collector-design.md · Plan: windows/docs/superpowers/plans/2026-06-10-winpe-preconfig-collector.md

Built subagent-driven (TDD + spec + code-quality review per task + a final whole-feature integration review that verified the collector→toolbox JSON contract round-trips and the flavour-id/run-once chain is consistent). (Branch name is historical — it started as a docs branch.)

Test Plan

  • dotnet test windows/welcome/SilverOS.Welcome.sln -c Release31/31
  • Collector Pester (windows/tests/Collector.Tests.ps1) → 25/25 (validation + generator incl. base64 round-trip + no-sm-bootstrap)
  • dotnet build windows/welcome/src/SilverOS.Welcome.App -c Release0 / 0
  • VM/hardware e2e (next cycle): WinPE collector form → fill account/flavour/PIN → install → first logon auto-applies → Done; relaunch shows toolbox-home.

Runner prerequisite ⚠️

The CI Windows runner needs the ADK WinPE add-on (WinPE_OCs cabs) for Add-WindowsPackage to add WinPE-NetFx/WinPE-PowerShell to boot.wim. Without it the build warns (doesn't throw) but the collector won't be staged and the Assert-IsoStructure boot.wim assertions will fail. One-time setup on the runner.

Known follow-ups (not this PR)

  • Drop the leftover \sm\winpeshl.ini (System32 copy is authoritative); add the §8 WinPE-NetFx presence assertion.
  • SP2 (rich toolbox-home) and SP3 (disk target + BitLocker pre-provision) per the spec.
  • Slow first-load of the toolbox on first logon (tracked separately).

🤖 Generated with Claude Code

## Summary Pre-configures the install **before** Windows Setup runs. A branded WinPE collector captures identity + install-shaping choices, generates the answer file so Setup creates the **real local-admin account natively** (eliminating the `sm-bootstrap` account + its teardown dance), and hands the rest to a simplified **run-once-then-persist** first-boot toolbox. **Flow:** `boot.wim` → `winpeshl.ini` → collector (PowerShell + WinForms) collects account · computer name · locale · flavour · BitLocker PIN → `New-SmAnswerFile` generates the answer file (real account, AutoLogon-once, **no sm-bootstrap**) + embeds `preconfig.json` (base64) written in the `specialize` pass → Setup installs + creates the account → first logon **auto-applies** the preconfig (apps + BitLocker, shows recovery key) → Done → persists as a launchable toolbox. ### What changed - **Collector** (`windows/collector/`): `Test-SmInput.ps1` (validation), `New-SmAnswerFile.ps1` (answer-file generator + embedded preconfig), `Collector.ps1` (dark WinForms shell), `Start-Collector.cmd` + `winpeshl.ini` (entry + `SM_UNATTENDED=1` CI fallback). - **Toolbox trim** (`windows/welcome/`): removed the Account step, account creation, `sm-bootstrap` teardown, and the heavy kiosk; `ApplyService` is now `apps → bitlocker`. New `PreconfigStore` (load fail-open / clear-pin / configured-marker); `Routes` pre-seeds from preconfig and **first-run auto-applies** (toolbox-home on subsequent launches). - **Build** (`build.ps1`): adds WinPE `WinPE-NetFx`/`WinPE-PowerShell` to `boot.wim` + stages the collector + `winpeshl.ini`; `SetupComplete.cmd` scrubs the Panther unattend (plaintext-password hygiene); `Assert-IsoStructure` asserts the collector baked into `boot.wim`. - **Hardening** stays canonical in `SetupComplete` (runs headless as SYSTEM); the toolbox no longer duplicates it. Spec: `windows/docs/superpowers/specs/2026-06-10-winpe-preconfig-collector-design.md` · Plan: `windows/docs/superpowers/plans/2026-06-10-winpe-preconfig-collector.md` Built subagent-driven (TDD + spec + code-quality review per task + a final whole-feature integration review that verified the collector→toolbox JSON contract round-trips and the flavour-id/run-once chain is consistent). (Branch name is historical — it started as a docs branch.) ## Test Plan - [x] `dotnet test windows/welcome/SilverOS.Welcome.sln -c Release` → **31/31** - [x] Collector Pester (`windows/tests/Collector.Tests.ps1`) → **25/25** (validation + generator incl. base64 round-trip + no-sm-bootstrap) - [x] `dotnet build windows/welcome/src/SilverOS.Welcome.App -c Release` → **0 / 0** - [ ] **VM/hardware e2e** (next cycle): WinPE collector form → fill account/flavour/PIN → install → first logon auto-applies → Done; relaunch shows toolbox-home. ## Runner prerequisite ⚠️ The CI Windows runner needs the **ADK WinPE add-on** (`WinPE_OCs` cabs) for `Add-WindowsPackage` to add `WinPE-NetFx`/`WinPE-PowerShell` to `boot.wim`. Without it the build *warns* (doesn't throw) but the collector won't be staged and the `Assert-IsoStructure` boot.wim assertions will fail. One-time setup on the runner. ## Known follow-ups (not this PR) - Drop the leftover `\sm\winpeshl.ini` (System32 copy is authoritative); add the §8 `WinPE-NetFx` presence assertion. - SP2 (rich toolbox-home) and SP3 (disk target + BitLocker pre-provision) per the spec. - Slow first-load of the toolbox on first logon (tracked separately). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
SilverLABS added 13 commits 2026-06-10 08:36:42 +00:00
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
fix(collector): drop 'essentials' from flavour radios (it's the baseline role, not a flavour)
All checks were successful
Build SilverMetal Enhanced - Windows ISO / build (pull_request) Successful in 5m18s
6c96e92fa5
SilverLABS added 1 commit 2026-06-10 08:38:28 +00:00
ci(windows): install ADK WinPE add-on so boot.wim collector can be staged
All checks were successful
Build SilverMetal Enhanced - Windows ISO / build (pull_request) Successful in 7m26s
e6c292da25
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
SilverLABS merged commit c154e70495 into main 2026-06-10 08:40:58 +00:00
SilverLABS deleted branch docs/winpe-preconfig-collector 2026-06-10 08:40:58 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SilverLABS/SilverMetal#21