fix(collector): carry preconfig via chunked FirstLogonCommands (specialize Path too long) #24

Merged
SilverLABS merged 1 commits from fix/answer-file-specialize-length into main 2026-06-10 09:35:34 +00:00
Owner

Symptom (real install, VM 102)

The collector form worked, generated the answer file, and launched Setup — which got through image apply, then failed at the specialize pass: "Windows could not parse or process unattend answer file … for pass [specialize]. The answer file is invalid."

Root cause

New-SmAnswerFile embedded the whole base64 preconfig.json in a single specialize RunSynchronousCommand/<Path> (~300+ chars). The unattend Path is capped (~259 chars), so Setup rejected the file at the specialize pass. (windowsPE + oobeSystem parsed fine — only specialize re-validates that component.)

Fix

  • Removed the specialize pass entirely.
  • Carry preconfig.json through the proven oobeSystem FirstLogonCommands instead, writing the base64 in ≤150-char chunks (echo-append → decode with whitespace-strip → cleanup), before the toolbox-launch command (FirstLogonCommands run synchronously in Order, so preconfig exists before the toolbox reads it).
  • Max generated CommandLine is now 207 chars (< 259).

Test Plan

  • Collector Pester 26/26 (incl. chunked round-trip → flavour=developer, pin=246810; assert no specialize pass; dir+decode present)
  • Sample generates valid XML; longest <CommandLine> = 207 chars
  • ASCII-only, BOM, parse clean
  • VM: collector → install completes past specialize → first-logon auto-apply with the real account

🤖 Generated with Claude Code

## Symptom (real install, VM 102) The collector form worked, generated the answer file, and launched Setup — which got through image apply, then failed at the **specialize pass**: *"Windows could not parse or process unattend answer file … for pass [specialize]. The answer file is invalid."* ## Root cause `New-SmAnswerFile` embedded the whole base64 `preconfig.json` in a single `specialize` `RunSynchronousCommand/<Path>` (~300+ chars). The unattend `Path` is capped (~259 chars), so Setup rejected the file at the specialize pass. (windowsPE + oobeSystem parsed fine — only specialize re-validates that component.) ## Fix - **Removed the `specialize` pass entirely.** - Carry `preconfig.json` through the proven **`oobeSystem` `FirstLogonCommands`** instead, writing the base64 in **≤150-char chunks** (`echo`-append → decode with whitespace-strip → cleanup), *before* the toolbox-launch command (FirstLogonCommands run synchronously in `Order`, so preconfig exists before the toolbox reads it). - Max generated CommandLine is now **207 chars** (< 259). ## Test Plan - [x] Collector Pester **26/26** (incl. chunked round-trip → `flavour=developer`, `pin=246810`; assert no specialize pass; dir+decode present) - [x] Sample generates valid XML; longest `<CommandLine>` = 207 chars - [x] ASCII-only, BOM, parse clean - [ ] VM: collector → install completes past specialize → first-logon auto-apply with the real account 🤖 Generated with [Claude Code](https://claude.com/claude-code)
SilverLABS added 1 commit 2026-06-10 09:35:23 +00:00
fix(collector): carry preconfig via chunked FirstLogonCommands (specialize Path was too long -> answer file invalid)
Some checks failed
Build SilverMetal Enhanced - Windows ISO / build (pull_request) Failing after 5m44s
7e99d7e304
SilverLABS merged commit 04a6f6eabb into main 2026-06-10 09:35:34 +00:00
SilverLABS deleted branch fix/answer-file-specialize-length 2026-06-10 09:35:34 +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#24