-
Notifications
You must be signed in to change notification settings - Fork 0
✨ feat: make AutoUnattend-minimal and defer setup OOBE #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c8e5fad
6841479
4a4b63d
cbf63f7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,27 +1,19 @@ | ||||||||||||||||||||||||||||||||||
| # AutoUnattend.xml Explained | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| This file automates only the minimal parts of Windows 11 setup needed for this repo. It intentionally avoids aggressive install-time customization so Windows Setup stays as reliable as possible. | ||||||||||||||||||||||||||||||||||
| This file is now intentionally ultra-minimal. It avoids changing Windows Setup itself and only kicks off post-install automation after first login. | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| ## How It Works | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| The file runs in three phases during Windows installation: | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| ### 1. windowsPE (Installation Phase) | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| Runs while Windows is being installed to the disk. | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - Bypasses TPM/Secure Boot/RAM checks (helpful for VMs) | ||||||||||||||||||||||||||||||||||
| - Leaves disk and partition selection to the user in Windows Setup | ||||||||||||||||||||||||||||||||||
| - Configures language/locale to en-US | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| ### 2. oobeSystem (First Boot) | ||||||||||||||||||||||||||||||||||
| ### 1. oobeSystem (First Boot) | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
Comment on lines
7
to
10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix stale phase count in setup flow description. Line 7 says “three phases,” but the updated content now documents a single unattended phase ( ✏️ Suggested doc fix-The file runs in three phases during Windows installation:
+The file now runs in a single unattended phase during Windows installation:📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
| Runs when Windows boots for the first time. | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - Hides EULA page | ||||||||||||||||||||||||||||||||||
| - Hides OEM registration | ||||||||||||||||||||||||||||||||||
| - Forces local account creation (no Microsoft account) | ||||||||||||||||||||||||||||||||||
| - Sets privacy to minimal data collection | ||||||||||||||||||||||||||||||||||
| - Leaves the Windows installer completely manual until OOBE is finished | ||||||||||||||||||||||||||||||||||
| - Uses only a few standard OOBE settings (`ProtectYourPC`, `HideEULAPage`, wireless setup visibility) | ||||||||||||||||||||||||||||||||||
| - Waits for network connectivity | ||||||||||||||||||||||||||||||||||
| - Starts `bootstrap.ps1` | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| **You'll still see:** | ||||||||||||||||||||||||||||||||||
| - Region/language selection | ||||||||||||||||||||||||||||||||||
|
|
@@ -31,17 +23,18 @@ Runs when Windows boots for the first time. | |||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| ## What Happens on First Login | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| 1. Windows completes the normal account setup flow | ||||||||||||||||||||||||||||||||||
| 2. The system waits for network connectivity | ||||||||||||||||||||||||||||||||||
| 3. **bootstrap.ps1 runs automatically** via FirstLogonCommands | ||||||||||||||||||||||||||||||||||
| 1. Complete the normal Windows setup flow yourself | ||||||||||||||||||||||||||||||||||
| 2. Sign in for the first time | ||||||||||||||||||||||||||||||||||
| 3. The system waits for network connectivity | ||||||||||||||||||||||||||||||||||
| 4. **bootstrap.ps1 runs automatically** via FirstLogonCommands | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| Install-time tweaking is intentionally minimal. Bootstrap handles app installation via WinGet and system customization via Sophia Script after first login. | ||||||||||||||||||||||||||||||||||
| Everything else now happens in `bootstrap.ps1`: app installs, debloat, Sophia, restore shortcuts, and post-install tweaks. | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| **If bootstrap fails or you want to re-run it:** Just run `C:\Setup\bootstrap.ps1` manually. | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| ## Customization | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| This file is intentionally minimal. If you add more install-time customization later, keep it small and retest Setup carefully. | ||||||||||||||||||||||||||||||||||
| This file should stay minimal. If Windows Setup errors return, prefer moving more logic into `bootstrap.ps1` rather than adding it back here. | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| ## Logs | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,69 +3,23 @@ | |
| <!-- | ||
| declarative-windows AutoUnattend.xml | ||
|
|
||
| This file intentionally keeps Windows Setup minimal and conservative. | ||
| Disk and partition selection remain manual. | ||
| Product keys and passwords are not embedded. | ||
| Ultra-minimal unattended file to avoid interfering with Windows Setup. | ||
| Windows Setup remains fully manual until first login. | ||
| Post-install automation begins only after the user completes OOBE. | ||
| --> | ||
|
|
||
| <settings pass="windowsPE"> | ||
| <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> | ||
| <SetupUILanguage> | ||
| <UILanguage>en-US</UILanguage> | ||
| </SetupUILanguage> | ||
| <InputLocale>en-US</InputLocale> | ||
| <SystemLocale>en-US</SystemLocale> | ||
| <UILanguage>en-US</UILanguage> | ||
| <UserLocale>en-US</UserLocale> | ||
| </component> | ||
|
|
||
| <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> | ||
| <UserData> | ||
| <AcceptEula>true</AcceptEula> | ||
| </UserData> | ||
|
|
||
| <!-- Leave disk and partition selection manual in Windows Setup. --> | ||
|
|
||
| <!-- Hardware requirement bypasses for VM compatibility. --> | ||
| <RunSynchronous> | ||
| <RunSynchronousCommand wcm:action="add"> | ||
| <Order>1</Order> | ||
| <Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassTPMCheck /t REG_DWORD /d 1 /f</Path> | ||
| </RunSynchronousCommand> | ||
| <RunSynchronousCommand wcm:action="add"> | ||
| <Order>2</Order> | ||
| <Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassSecureBootCheck /t REG_DWORD /d 1 /f</Path> | ||
| </RunSynchronousCommand> | ||
| <RunSynchronousCommand wcm:action="add"> | ||
| <Order>3</Order> | ||
| <Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassRAMCheck /t REG_DWORD /d 1 /f</Path> | ||
| </RunSynchronousCommand> | ||
| </RunSynchronous> | ||
| </component> | ||
| </settings> | ||
|
|
||
| <settings pass="oobeSystem"> | ||
| <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> | ||
|
Comment on lines
11
to
12
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Removing the entire Useful? React with 👍 / 👎. |
||
| <!-- Safe standard OOBE settings kept from the Schneegans-generated baseline. --> | ||
| <OOBE> | ||
| <HideEULAPage>true</HideEULAPage> | ||
| <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen> | ||
| <HideOnlineAccountScreens>true</HideOnlineAccountScreens> | ||
| <ProtectYourPC>3</ProtectYourPC> | ||
| <HideEULAPage>true</HideEULAPage> | ||
| <HideWirelessSetupInOOBE>false</HideWirelessSetupInOOBE> | ||
| </OOBE> | ||
|
|
||
| <FirstLogonCommands> | ||
| <SynchronousCommand wcm:action="add"> | ||
| <Order>1</Order> | ||
| <Description>Set PowerShell Execution Policy</Description> | ||
| <CommandLine>powershell.exe -Command "Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force"</CommandLine> | ||
| </SynchronousCommand> | ||
| <SynchronousCommand wcm:action="add"> | ||
| <Order>2</Order> | ||
| <Description>Wait for Network Connectivity</Description> | ||
| <CommandLine>powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "$timeout=300; $interval=5; $start=Get-Date; $connected=$false; while((Get-Date) -lt $start.AddSeconds($timeout)) { if (Test-Connection -ComputerName 1.1.1.1 -Count 1 -Quiet) { $connected=$true; break }; Start-Sleep -Seconds $interval }; if (-not $connected) { Write-Host 'Network wait timed out'; exit 1 }"</CommandLine> | ||
| </SynchronousCommand> | ||
| <SynchronousCommand wcm:action="add"> | ||
| <Order>3</Order> | ||
| <Description>Run Windows Setup Bootstrap Script</Description> | ||
| <CommandLine>powershell.exe -ExecutionPolicy Bypass -File C:\Setup\bootstrap.ps1</CommandLine> | ||
| </SynchronousCommand> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call out Windows 11 (24H2+) explicitly in the intro.
Please make the platform target explicit at the top so the doc enforces the repo policy unambiguously.
✏️ Suggested doc fix
As per coding guidelines: "
**/*.{md,ps1}: Ensure all documentation, scripts, and configurations assume Windows 11 as the target platform and do not include references to Windows 10 compatibility".📝 Committable suggestion
🤖 Prompt for AI Agents