Repository navigation
Wait for Windows setup to finish before doing anything - #46
Merged
Merged
Conversation
A sysprepped image starts the service during specialize and OOBE, with nobody logged in. The reboot coordinator reboots at once with nobody logged in, so a rename or a join could reboot mid-setup and stop Windows setup. runAgent now reads HKLM\SYSTEM\Setup\State\ImageState first and waits, polling every 30 seconds, until it is IMAGE_STATE_COMPLETE or absent. Nothing enrolls, polls or reboots before that. Audit mode counts as unfinished. A read error counts as finished, so a damaged key cannot stop the agent for good. Stop still works while it waits. The install doc and design 0001 section 4.4 describe the wait. The install doc also says the agent needs no inbound firewall rule. Forum topic 18311. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A sysprepped image starts
fog-agentduring specialize and OOBE, with nobody logged in. The reboot coordinator reboots at once when nobody is logged in. So a rename or a domain join could reboot the machine mid-setup and stop Windows setup ("Windows could not complete the installation"). Forum topic 18311 asked whether the agent must be disabled before Sysprep. After this change, it does not.runAgentcallswaitForWindowsSetupbefore it opens state. It readsHKLM\SYSTEM\Setup\State\ImageStateevery 30 seconds and continues atIMAGE_STATE_COMPLETEor when the value is absent. Audit mode and everyRESEALstate wait.docs/install-windows.mdand design 0001 §4.4 describe the wait.Verified: tests for the state table, the hold-until-complete loop, cancel, and read error. All of them fail with
setupFinishedforced totrue. On telliottwin11 (installed from media),HKLM\SYSTEM\Setup\Statedoes not exist, so the agent starts at once there. Not verified: a full Sysprep and OOBE run in the lab.Supersedes #45.
🤖 Generated with Claude Code