Refactor Win11 Creator ISO workflow - #4862
Conversation
Keep no-driver ISO generation on the fast copy-only path. Inject exported drivers with one selected-index WIM mount, one Add-Driver pass, and one commit. Limit WinPE staging to boot-storage drivers and improve workflow validation coverage.
Copy the prepared setup script payloads into sources/$//Setup/Scripts so setup media does not depend solely on answer-file extension extraction. Keep the existing autounattend execution path unchanged and cover the fallback files in the Win11 Creator tests.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ccdda4ec91
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Rename the ISO logger to Write-WinUtilISOLog so the shared runspace pool imports it automatically. Run Mount & Verify off the WPF thread with dispatcher-safe UI updates, and add Pester coverage for the runspace and logger contract.
|
@codex review latest changes |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 919768e18b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Keep the selected ISO stable during background verification. Apply ContentDeliveryManager settings to both the first account and the default profile. Block FAT32 USB creation when install.esd exceeds the supported file size.
|
@codex review and let me watch the world cup please |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 709ca0826e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Set BypassNRO before OOBE so local account setup is available during Windows Setup. Detect registered DISM mounts during driver-injection cleanup so partial mount failures are discarded.
|
@codex review. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7f915bb064
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Use the actual FAT32 file limit for install.esd USB checks. Disable ISO modification while mount verification is running. Apply unsupported-hardware notice suppression to the first user profile.
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2570ad93b5
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Set device encryption and reserved-storage registry guards before OOBE. Enable the OEM configuration-set fallback when setup scripts are staged there.
…uds/winutil into bugfix/win11-creator-iso-workflow
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe Win11 ISO workflow now prepares copied setup media, stages post-install scripts and storage drivers, constrains WIM servicing, validates metadata, adds setup bypass commands, runs UI work asynchronously, and blocks oversized ESD files before USB creation. ChangesWin11 ISO creator workflow
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant ISOUI
participant InvokeWPFRunspace
participant InvokeWinUtilISOScript
participant DISM
participant Oscdimg
ISOUI->>InvokeWPFRunspace: start ISO verification
InvokeWPFRunspace->>InvokeWinUtilISOScript: prepare copied setup media
InvokeWinUtilISOScript->>DISM: service selected install.wim index
DISM-->>InvokeWinUtilISOScript: return validation status
ISOUI->>InvokeWPFRunspace: start ISO export
InvokeWPFRunspace->>Oscdimg: build ISO and stream process output
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@functions/private/Invoke-WinUtilISOUSB.ps1`:
- Around line 33-45: Update the install.esd validation near $installEsd so it
runs whenever install.esd exists, independent of whether $installWim is present.
Preserve the existing 4 GB threshold, warning message, and early return so media
containing both files is rejected before USB operations begin.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: c309b750-824f-4f47-bfd6-d9c84c7442f4
📒 Files selected for processing (7)
AGENTS.mdfunctions/private/Invoke-WinUtilISO.ps1functions/private/Invoke-WinUtilISOScript.ps1functions/private/Invoke-WinUtilISOUSB.ps1pester/win11creator.Tests.ps1tools/autounattend.xmlxaml/inputXML.xaml
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Type of Change
Description
This refactors the Win11 Creator ISO flow around the actual failure mode from #4860: the previous workflow performed unnecessary offline DISM servicing on
install.wim, including mounting/saving the image and running cleanup such as/ResetBase, even when the generated ISO did not need driver injection.That made ISO generation depend on the host Windows installation's DISM servicing state. In testing, some hosts could complete the mount/save path without an obvious DISM failure while still leaving the WIM metadata in a bad state. Windows Setup then validates the
<ImageInstall>index fromautounattend.xmlagainst that damaged metadata and fails before setup can continue.The important change is that Win11 Creator no longer touches
install.wimfor the normal no-driver path. For that path, it only copies the ISO contents, writesautounattend.xml, writes the selected-editionei.cfg, and exports the ISO. That avoids the fragile DISM path entirely and makes ISO generation much faster.Driver injection still needs offline servicing, but that path is now narrower: it mounts only the selected WIM index, adds exported drivers in one
/Add-Driver /Recurseoperation, commits once, and validates WIM metadata before and after. It also keeps WinPE staging limited to boot/storage drivers so setup discovery is not overloaded.I tried a few lighter driver-delivery paths first, but they were less predictable:
$OEM$/.cmd/SetupComplete.cmddelivery can depend on Windows Setup timing and OEM activation behavior. On OEM-key machines, that path is not reliable enough for this workflow.pnputildepends on the exported driver folder surviving setup and being discoverable from the installed OS. That failed in testing, including cases where no stagedC:\Windows\DriversINF files were found after install.$WinPEDriver$makes Windows Setup discover them early, but it can overload setup before the normal setup UI loads. In testing that caused setup to fail immediately.That leaves two practical paths: avoid DISM entirely when drivers are not requested, and use the smallest possible DISM servicing path when drivers are requested.
I also added fallback staging for the setup scripts under
sources\$OEM$\$$\Setup\Scripts. The answer-file extension extraction path still exists, but the generated media no longer depends on that being the only way those scripts reachC:\Windows\Setup\Scripts.Benchmarks from local testing:
[12:38:11] ISO selected[12:38:31] install.wim modification complete[12:08:54] ISO selected[12:18:11] install.wim modification complete[09:52:29] ISO selected[09:53:14] install.wim modification complete[09:55:41] ISO selected[10:06:56] install.wim modification completeVerification performed:
Issue related to PR