Rework the Win11 Creator tab into a three step wizard (#4925)

* Rework the Win11 Creator tab into a three step wizard

- Turn the stacked sections into pages you can navigate between
- Move the edition picker and driver option to the modify step
- Show a working page while mounting and modifying run
- Show what the run changes and a finished panel with the output path
- Put the status log in its own card next to the steps
- Rename Clean & Reset to Start Over and move it below the actions

* Follow the existing colours on the Win11 Creator tab

- Take button text and icon colour from the button they sit in
- Stop the implicit TextBlock style painting a label background on buttons
- Colour step headers from the tab item state
- Use the label accent for headings and field labels like the other tabs

* Cut repeated markup on the Win11 Creator tab

- Render button icon and label from a ContentTemplate, glyph goes in Tag
- Render the step header from a HeaderTemplate the same way
- Move the page scroll wrapper into the tab control template
- Derive the text styles from one another instead of repeating setters

* fix: tidy the dropdown and stop the spinner stuttering

- combo box items painted their own background while the popup painted
  another, so the list read as loose labels on a mismatched sheet; items are
  transparent now and the popup carries the colour
- stretch the item presenter so a highlight spans the popup instead of just
  the text, and bind the popup width to the closed box
- cache the working page's spinner: it animates a rotation on a TextBlock,
  which re-rasterises the glyph every frame on the interface thread
- run that animation only while the page is visible; it was started on Loaded
  and never stopped, so it kept spinning after the step was done

* Stop the Win11 Creator status log rendering justified

The shared TextBox style sets HorizontalContentAlignment to Stretch, which
WPF reads as TextAlignment.Justify. Every other box in WinUtil is single
line, so the status log is the only place it shows, and there it stretched
each wrapped line to the full width with gaps between the words.

Left-aligns it, and while the log is being read as a log rather than as
prose: monospace from a new Win11LogFontFamily theme key so the timestamps
form a column and a wrapped line is visibly not a new entry, and no effect,
since the shared style's drop shadow has neither border nor background to
sit under on this control and smeared the glyphs instead.

* Show the working page for export, USB write and Start Over

Only mount and modify moved to the working page. Saving an ISO, writing a
USB drive and Start Over all ran with the finished output page still on
screen, so the three longest operations in the tab were the ones that looked
like nothing was happening.

All three now open the working page for their duration and return to the
page they belong on: the output step for the two that produce media, the ISO
picker for Start Over, which has just deleted the working directory. Failures
leave the working page before their message box rather than putting a modal
over a spinner, and a finally guard covers cancellation, which skips catch.

Start Over spins the icon backwards. Its work undoes rather than produces,
and reading that off the animation is quicker than reading the label.

* cut comments

Leaves the four that answer a "why is it written this way" a reader cannot
get from the code: the shared TextBox style's justify and drop shadow, the
spinner tag being set before the page is shown, going back to Select rather
than Modify after a failed modification, and the finally guards existing for
cancellation rather than for failure.

* cut changes that only reword

Reverts three edits that changed wording without changing meaning, and drops
the comment on the failed-modification branch.

* cut comments that narrate the code

* address coderabbit review

Hyphenate three-step, and let the chevrons grow past their minimum instead of
pinning a size the glyph could outgrow.

* dismount a replaced ISO and name the USB disk when done

Picking a second ISO after verifying one left the first attached: the mount job
clears Win11ISOImagePath, which is the only handle cleanup has to it. Dismount
it in the job, off the interface thread, before that reset.

The done panel now names the disk it wrote, the way the ISO branch names its file.

* keep the wizard inside the card at the minimum window width

The step column and the chevron grid's middle column were both pinned at 620,
while the left card is about 485px at the 800px minimum. The pages do not
scroll sideways, so controls past the card edge were unreachable.

Both are now capped rather than fixed, and the removed WPFWin11ISOArchLabel was
never assigned by anything.

* stop a replacement mount when the old ISO will not dismount

The warn-and-continue path cleared Win11ISOImagePath anyway, which strands the
old mount for the rest of the session - the leak the dismount was added to
close. It now reports and throws instead, from inside the try so the finally
still re-enables the browse and mount buttons.

* cut comments that narrate the code

* drop the OneDrive sync claim from the modify step list

The post-install script sets DisableFileSyncNGSC=1, but it is prepended to
FirstLogon.ps1, whose own body then sets the same value back to 0. The policy
never survives, so the bullet was promising something the run does not do.
Replaced with search box suggestions, which it does do.
This commit is contained in:
MyDrift
2026-09-19 16:50:51 -05:00
committed by GitHub
parent 9ac45d6c31
commit f9139c75ff
10 changed files with 762 additions and 350 deletions
+3
View File
@@ -13,6 +13,9 @@
"FontSize": "12",
"FontFamily": "Arial",
"HeaderFontSize": "16",
"Win11StepTitleFontSize": "22",
"Win11StepHeroFontSize": "40",
"Win11LogFontFamily": "Consolas, Monaco",
"HeaderFontFamily": "Consolas, Monaco",
"CheckBoxBulletDecoratorSize": "14",
"CheckBoxMargin": "15,0,0,2",
@@ -210,7 +210,7 @@ Invoke-WinUtilISOCleanAndReset (optional)
**Work Session Recovery**:
- Auto-detects incomplete work from previous sessions
- Allows resuming Step 4 (export) without re-running Steps 1-3
- Allows resuming the export step without re-running selection and modification
- Prevents redundant modifications
**Modification Safety**:
+11 -14
View File
@@ -23,29 +23,26 @@ This workflow is intended for fresh Windows installs, not in-place upgrades of a
---
The tab is a three-step wizard. The step you are on is shown in the header row, and you can click an earlier step to go back to it until the image has been modified. The status log on the right stays visible throughout.
### Step 1 — Select Your Official Windows 11 ISO
1. Open WinUtil and go to the **Win11 Creator** tab.
2. Click **Browse** and select your **official Windows 11 ISO file** from Microsoft (must be 4 GB or larger). Custom or modified ISOs are not supported.
3. The file path and size will appear on screen once selected.
---
### Step 2 — Mount & Verify
1. Click **Mount & Verify ISO**.
2. WinUtil mounts the ISO, checks for a valid `install.wim` or `install.esd`, and reads the available editions (Home, Pro, Enterprise, etc.).
3. Once verified, select your desired **edition** from the dropdown — Pro is selected by default if available.
4. Click **Mount & Verify ISO**. WinUtil mounts the ISO, checks for a valid `install.wim` or `install.esd`, and reads the available editions (Home, Pro, Enterprise, etc.).
:::note
This step takes around 10–30 seconds, depending on your drive speed.
Mounting and verification takes around 10–30 seconds, depending on your drive speed.
:::
---
### Step 3 — Run the Modification
### Step 2 — Modify the Image
Click **Run Windows ISO Modification and Creator** to start the customization process. WinUtil will:
Once the ISO is verified, WinUtil moves to this step and shows the mounted drive and image file. Choose your **edition** from the dropdown — Pro is selected by default if available — and tick **Inject current system drivers** if you want them.
Then click **Run Windows ISO Modification and Creator** to start the customization process. WinUtil will:
**App & Component Removal:**
- **Remove 40+ bloat apps** — Clipchamp, Teams, Copilot, Dev Home, new Outlook, Bing apps, Solitaire, and more
@@ -80,7 +77,7 @@ The resulting ISO is close to the size of the source ISO. WinUtil does not remov
---
### Step 4 — Export Your Result
### Step 3 — Export Your Result
Once the modification is complete, choose how to save your image:
@@ -110,9 +107,9 @@ Double-check you have selected the correct drive before confirming. This operati
---
### Step 5 — Clean Up (Optional)
### Start Over (Optional)
Click **Clean & Reset** to delete the temporary working directory (~10–15 GB) and return the tool to its initial state, ready for a new ISO. You will be asked to confirm before anything is deleted.
Click **Start Over** to delete the temporary working directory (~10–15 GB) and return the tool to its initial state, ready for a new ISO. You will be asked to confirm before anything is deleted.
---
@@ -29,6 +29,8 @@ function Invoke-WinUtilFontScaling {
"FontSize",
"ButtonFontSize",
"HeaderFontSize",
"Win11StepTitleFontSize",
"Win11StepHeroFontSize",
"TabButtonFontSize",
"ConfigTabButtonFontSize",
"IconFontSize",
+110 -38
View File
@@ -64,6 +64,45 @@ function Write-WinUtilISOLog {
}
}
function Set-WinUtilISOStep {
<#
.SYNOPSIS
Selects a page of the Win11 Creator wizard and sets which pages can be navigated back to
.PARAMETER Step
Select, Modify, Working or Output
.PARAMETER Label
Headline shown on the working page while a long operation runs
.PARAMETER Reverse
Spins the working page icon backwards
#>
param(
[Parameter(Mandatory)]
[ValidateSet("Select", "Modify", "Working", "Output")]
[string]$Step,
[string]$Label,
[switch]$Reverse
)
Invoke-WPFUIThread -Parameters @{ Step = $Step; Label = $Label; Reverse = [bool]$Reverse } -ScriptBlock {
param($Step, $Label, $Reverse)
if ($Label) { $sync["WPFWin11ISOWorkingLabel"].Text = $Label }
$sync["WPFWin11ISOWorkingSpinner"].Tag = if ($Reverse) { "Reverse" } else { "Forward" }
$sync["WPFWin11ISOSelectSection"].IsEnabled = $Step -in @("Select", "Modify")
$sync["WPFWin11ISOModifySection"].IsEnabled = $Step -eq "Modify"
$sync["WPFWin11ISOOutputSection"].IsEnabled = $Step -eq "Output"
$sync["WPFWin11ISO$($Step)Section"].IsSelected = $true
}
}
function Get-WinUtilEditionIdFromName {
<#
.SYNOPSIS
@@ -108,10 +147,9 @@ function Invoke-WinUtilISOBrowse {
$sync["WPFWin11ISOPath"].Text = $isoPath
$sync["WPFWin11ISOFileInfo"].Text = "File size: $fileSizeGB GB"
$sync["WPFWin11ISOFileInfo"].Visibility = "Visible"
$sync["WPFWin11ISOMountSection"].Visibility = "Visible"
$sync["WPFWin11ISOVerifyResultPanel"].Visibility = "Collapsed"
$sync["WPFWin11ISOModifySection"].Visibility = "Collapsed"
$sync["WPFWin11ISOOutputSection"].Visibility = "Collapsed"
Set-WinUtilISOStep -Step "Select"
Write-WinUtilISOLog "ISO selected: $isoPath ($fileSizeGB GB)"
}
@@ -134,17 +172,32 @@ function Invoke-WinUtilISOMountAndVerify {
$sync["WPFWin11ISOMountButton"].IsEnabled = $false
$sync["WPFWin11ISOModifyButton"].IsEnabled = $false
$sync["WPFWin11ISOVerifyResultPanel"].Visibility = "Collapsed"
$sync["WPFWin11ISOModifySection"].Visibility = "Collapsed"
}
Set-WinUtilISOStep -Step "Working" -Label "Mounting and verifying the ISO"
$verified = $false
$mountedByThisRun = $false
$sync["Win11ISOImageInfo"] = $null
$sync["Win11ISODriveLetter"] = $null
$sync["Win11ISOWimPath"] = $null
$sync["Win11ISOImagePath"] = $null
try {
$previous = $sync["Win11ISOImagePath"]
if ($previous -and $previous -ne $isoPath -and (Get-DiskImage -ImagePath $previous -ErrorAction SilentlyContinue).Attached) {
try {
Dismount-DiskImage -ImagePath $previous -ErrorAction Stop
Write-WinUtilISOLog "Dismounted the previously verified ISO: $previous"
} catch {
Write-WinUtilISOLog -Level "ERROR" -Message "Could not dismount the previously verified ISO ${previous}: $_"
Show-WinUtilMessage -Message "The previously verified ISO is still mounted and could not be dismounted:`n`n$previous`n`nDismount it yourself, then select an ISO again." -Title "Previous ISO Still Mounted" -Button "OK" -Icon "Error" | Out-Null
$stillMounted = [System.InvalidOperationException]::new("Could not dismount the previously verified ISO $previous.")
$stillMounted.Data["WinUtilErrorReported"] = $true
throw $stillMounted
}
}
$sync["Win11ISOImageInfo"] = $null
$sync["Win11ISODriveLetter"] = $null
$sync["Win11ISOWimPath"] = $null
$sync["Win11ISOImagePath"] = $null
Write-WinUtilISOLog "Mounting ISO: $isoPath"
Step-WinUtilJob -Status "Mounting ISO..." -Percent 10
@@ -207,7 +260,8 @@ function Invoke-WinUtilISOMountAndVerify {
} -ScriptBlock {
param($DriveLetter, $ImageFileName, $imageInfo)
$sync["WPFWin11ISOMountDriveLetter"].Text = "Mounted at: $DriveLetter | Image file: $ImageFileName"
$sync["WPFWin11ISOMountDriveLetter"].Text = $DriveLetter
$sync["WPFWin11ISOImageFile"].Text = $ImageFileName
$sync["WPFWin11ISOEditionComboBox"].Items.Clear()
foreach ($img in $imageInfo) {
[void]$sync["WPFWin11ISOEditionComboBox"].Items.Add("$($img.ImageIndex): $($img.ImageName)")
@@ -222,7 +276,7 @@ function Invoke-WinUtilISOMountAndVerify {
$sync["WPFWin11ISOEditionComboBox"].SelectedIndex = if ($proIndex -ge 0) { $proIndex } else { 0 }
}
$sync["WPFWin11ISOVerifyResultPanel"].Visibility = "Visible"
$sync["WPFWin11ISOModifySection"].Visibility = "Visible"
Set-WinUtilISOStep -Step "Modify"
}
$verified = $true
@@ -246,6 +300,10 @@ function Invoke-WinUtilISOMountAndVerify {
$sync["WPFWin11ISOBrowseButton"].IsEnabled = $true
$sync["WPFWin11ISOMountButton"].IsEnabled = $true
$sync["WPFWin11ISOModifyButton"].IsEnabled = [bool]$Verified
if ($sync["WPFWin11ISOWorkingSection"].IsSelected) {
Set-WinUtilISOStep -Step "Select"
}
}
}
}
@@ -257,7 +315,7 @@ function Invoke-WinUtilISOModify {
$wimPath = $sync["Win11ISOWimPath"]
if (-not $isoPath) {
Show-WinUtilMessage -Message "No verified ISO found. Please complete Steps 1 and 2 first." -Title "Not Ready" -Button "OK" -Icon "Warning" | Out-Null
Show-WinUtilMessage -Message "No verified ISO found. Please select and verify an ISO first." -Title "Not Ready" -Button "OK" -Icon "Warning" | Out-Null
return
}
@@ -297,10 +355,8 @@ function Invoke-WinUtilISOModify {
Invoke-WPFUIThread -ScriptBlock {
$sync["WPFWin11ISOModifyButton"].IsEnabled = $false
$sync["WPFWin11ISOSelectSection"].Visibility = "Collapsed"
$sync["WPFWin11ISOMountSection"].Visibility = "Collapsed"
$sync["WPFWin11ISOModifySection"].Visibility = "Collapsed"
}
Set-WinUtilISOStep -Step "Working" -Label "Modifying install.wim"
$modified = $false
try {
@@ -362,11 +418,9 @@ function Invoke-WinUtilISOModify {
$sync["Win11ISOContentsDir"] = $isoContents
Step-WinUtilJob -Status "Modification complete" -Percent 100
Write-WinUtilISOLog "install.wim modification complete. Choose an output option in Step 4."
Write-WinUtilISOLog "install.wim modification complete. Choose an output option in the last step."
Invoke-WPFUIThread -ScriptBlock {
$sync["WPFWin11ISOOutputSection"].Visibility = "Visible"
}
Set-WinUtilISOStep -Step "Output"
$modified = $true
} catch {
Write-WinUtilISOLog -Level "ERROR" -Message "Modification failed: $_"
@@ -404,10 +458,9 @@ function Invoke-WinUtilISOModify {
param($Modified)
$sync["WPFWin11ISOModifyButton"].IsEnabled = [bool]$Modified
if ($sync["WPFWin11ISOOutputSection"].Visibility -ne "Visible") {
$sync["WPFWin11ISOSelectSection"].Visibility = "Visible"
$sync["WPFWin11ISOMountSection"].Visibility = "Visible"
$sync["WPFWin11ISOModifySection"].Visibility = if ($Modified) { "Visible" } else { "Collapsed" }
if ($sync["WPFWin11ISOWorkingSection"].IsSelected) {
Set-WinUtilISOStep -Step "Select"
}
}
}
@@ -443,24 +496,21 @@ function Invoke-WinUtilISOCheckExistingWork {
$sync["Win11ISOWorkDir"] = $existingWorkDir.FullName
$sync["Win11ISOContentsDir"] = $isoContents
$sync["WPFWin11ISOSelectSection"].Visibility = "Collapsed"
$sync["WPFWin11ISOMountSection"].Visibility = "Collapsed"
$sync["WPFWin11ISOModifySection"].Visibility = "Collapsed"
$sync["WPFWin11ISOOutputSection"].Visibility = "Visible"
Set-WinUtilISOStep -Step "Output"
$modified = $existingWorkDir.LastWriteTime.ToString("yyyy-MM-dd HH:mm")
Write-WinUtilISOLog "Existing working directory found: $($existingWorkDir.FullName)"
Write-WinUtilISOLog "Last modified: $modified - Skipping Steps 1-3 and resuming at Step 4."
Write-WinUtilISOLog "Click 'Clean & Reset' if you want to start over with a new ISO."
Write-WinUtilISOLog "Last modified: $modified - Skipping the earlier steps and resuming at the output step."
Write-WinUtilISOLog "Click 'Start Over' if you want to start over with a new ISO."
Show-WinUtilMessage -Message "A previous WinUtil ISO working directory was found:`n`n$($existingWorkDir.FullName)`n`n(Last modified: $modified)`n`nStep 4 (output options) has been restored so you can save the already-modified image.`n`nClick 'Clean & Reset' in Step 4 if you want to start over." -Title "Existing Work Found" -Button "OK" -Icon "Info" | Out-Null
Show-WinUtilMessage -Message "A previous WinUtil ISO working directory was found:`n`n$($existingWorkDir.FullName)`n`n(Last modified: $modified)`n`nThe output step has been restored so you can save the already-modified image.`n`nClick 'Start Over' there if you want to start over." -Title "Existing Work Found" -Button "OK" -Icon "Info" | Out-Null
}
function Invoke-WinUtilISOCleanAndReset {
$workDir = $sync["Win11ISOWorkDir"]
if ($workDir -and (Test-Path $workDir)) {
$confirm = Show-WinUtilMessage -Message "This will delete the temporary working directory:`n`n$workDir`n`nAnd reset the interface back to the start.`n`nContinue?" -Title "Clean & Reset" -Button "YesNo" -Icon "Warning"
$confirm = Show-WinUtilMessage -Message "This will delete the temporary working directory:`n`n$workDir`n`nAnd reset the interface back to the start.`n`nContinue?" -Title "Start Over" -Button "YesNo" -Icon "Warning"
if ($confirm -ne "Yes") { return }
}
@@ -470,6 +520,7 @@ function Invoke-WinUtilISOCleanAndReset {
param($workDir)
Invoke-WPFUIThread -ScriptBlock { $sync["WPFWin11ISOCleanResetButton"].IsEnabled = $false }
Set-WinUtilISOStep -Step "Working" -Label "Starting over" -Reverse
try {
if ($workDir) {
@@ -544,19 +595,23 @@ function Invoke-WinUtilISOCleanAndReset {
Invoke-WPFUIThread -ScriptBlock {
$sync["WPFWin11ISOPath"].Text = "No ISO selected..."
$sync["WPFWin11ISOFileInfo"].Visibility = "Collapsed"
$sync["WPFWin11ISOFileInfo"].Visibility = "Hidden"
$sync["WPFWin11ISOVerifyResultPanel"].Visibility = "Collapsed"
$sync["WPFWin11ISOOptionUSB"].Visibility = "Collapsed"
$sync["WPFWin11ISOOutputSection"].Visibility = "Collapsed"
$sync["WPFWin11ISOModifySection"].Visibility = "Collapsed"
$sync["WPFWin11ISOMountSection"].Visibility = "Collapsed"
$sync["WPFWin11ISOSelectSection"].Visibility = "Visible"
$sync["WPFWin11ISODonePanel"].Visibility = "Collapsed"
$sync["WPFWin11ISOModifyButton"].IsEnabled = $true
$sync["WPFWin11ISOStatusLog"].Text = "Ready. Please select a Windows 11 ISO to begin."
Set-WinUtilISOStep -Step "Select"
}
Step-WinUtilJob -Hide
} finally {
Invoke-WPFUIThread -ScriptBlock { $sync["WPFWin11ISOCleanResetButton"].IsEnabled = $true }
Invoke-WPFUIThread -ScriptBlock {
$sync["WPFWin11ISOCleanResetButton"].IsEnabled = $true
if ($sync["WPFWin11ISOWorkingSection"].IsSelected) {
Set-WinUtilISOStep -Step "Select"
}
}
}
}
}
@@ -565,7 +620,7 @@ function Invoke-WinUtilISOExport {
$contentsDir = $sync["Win11ISOContentsDir"]
if (-not $contentsDir -or -not (Test-Path $contentsDir)) {
Show-WinUtilMessage -Message "No modified ISO content found. Please complete Steps 1-3 first." -Title "Not Ready" -Button "OK" -Icon "Warning" | Out-Null
Show-WinUtilMessage -Message "No modified ISO content found. Please run the modification step first." -Title "Not Ready" -Button "OK" -Icon "Warning" | Out-Null
return
}
@@ -586,10 +641,12 @@ function Invoke-WinUtilISOExport {
param($contentsDir, $outputISO)
Invoke-WPFUIThread -ScriptBlock { $sync["WPFWin11ISOChooseISOButton"].IsEnabled = $false }
Set-WinUtilISOStep -Step "Working" -Label "Building the ISO file"
try {
$oscdimg = Get-WinUtilOscdimgPath
if (-not $oscdimg) {
Set-WinUtilISOStep -Step "Output"
Show-WinUtilMessage -Message "oscdimg.exe could not be found or installed automatically.`n`nPlease install it manually:`n winget install -e --id Microsoft.OSCDIMG`n`nOr install the Windows ADK from:`nhttps://learn.microsoft.com/windows-hardware/get-started/adk-install" -Title "oscdimg Not Found" -Button "OK" -Icon "Warning" | Out-Null
throw "oscdimg.exe could not be found or installed automatically."
}
@@ -648,14 +705,29 @@ function Invoke-WinUtilISOExport {
Step-WinUtilJob -Status "ISO exported" -Percent 100
Write-WinUtilISOLog "ISO exported successfully: $outputISO"
Invoke-WPFUIThread -Parameters @{ OutputISO = $outputISO } -ScriptBlock {
param($OutputISO)
$sync["WPFWin11ISODoneLabel"].Text = "ISO saved to $OutputISO"
$sync["WPFWin11ISODonePanel"].Visibility = "Visible"
}
Set-WinUtilISOStep -Step "Output"
Show-WinUtilMessage -Message "ISO exported successfully!`n`n$outputISO" -Title "Export Complete" -Button "OK" -Icon "Info" | Out-Null
} catch {
Write-WinUtilISOLog -Level "ERROR" -Message "ISO export failed: $_"
$_.Exception.Data["WinUtilErrorReported"] = $true
Set-WinUtilISOStep -Step "Output"
Show-WinUtilMessage -Message "ISO export failed:`n`n$_" -Title "Error" -Button "OK" -Icon "Error" | Out-Null
throw
} finally {
Invoke-WPFUIThread -ScriptBlock { $sync["WPFWin11ISOChooseISOButton"].IsEnabled = $true }
Invoke-WPFUIThread -ScriptBlock {
$sync["WPFWin11ISOChooseISOButton"].IsEnabled = $true
# Cancellation skips catch, so the working page can still be up here
if ($sync["WPFWin11ISOWorkingSection"].IsSelected) {
Set-WinUtilISOStep -Step "Output"
}
}
}
}
}
+18 -2
View File
@@ -39,7 +39,7 @@ function Invoke-WinUtilISOWriteUSB {
$usbDisks = $sync["Win11ISOUSBDisks"]
if (-not $contentsDir -or -not (Test-Path $contentsDir)) {
Show-WinUtilMessage -Message "No modified ISO content found. Please complete Steps 1-3 first." -Title "Not Ready" -Button "OK" -Icon "Warning" | Out-Null
Show-WinUtilMessage -Message "No modified ISO content found. Please run the modification step first." -Title "Not Ready" -Button "OK" -Icon "Warning" | Out-Null
return
}
@@ -87,6 +87,7 @@ function Invoke-WinUtilISOWriteUSB {
param($DiskNumber, $contentsDir)
Invoke-WPFUIThread -ScriptBlock { $sync["WPFWin11ISOWriteUSBButton"].IsEnabled = $false }
Set-WinUtilISOStep -Step "Working" -Label "Writing the USB drive"
try {
Write-WinUtilISOLog "Starting USB write to Disk $DiskNumber..."
@@ -233,14 +234,29 @@ function Invoke-WinUtilISOWriteUSB {
Step-WinUtilJob -Status "USB write complete" -Percent 100
Write-WinUtilISOLog "USB drive is ready for use."
Invoke-WPFUIThread -Parameters @{ DiskNumber = $DiskNumber } -ScriptBlock {
param($DiskNumber)
$sync["WPFWin11ISODoneLabel"].Text = "Disk $DiskNumber is ready to boot from."
$sync["WPFWin11ISODonePanel"].Visibility = "Visible"
}
Set-WinUtilISOStep -Step "Output"
Show-WinUtilMessage -Message "USB drive created successfully!`n`nYou can now boot from this drive to install Windows 11." -Title "USB Ready" -Button "OK" -Icon "Info" | Out-Null
} catch {
Write-WinUtilISOLog -Level "ERROR" -Message "USB write failed: $_"
$_.Exception.Data["WinUtilErrorReported"] = $true
Set-WinUtilISOStep -Step "Output"
Show-WinUtilMessage -Message "USB write failed:`n`n$_" -Title "USB Write Error" -Button "OK" -Icon "Error" | Out-Null
throw
} finally {
Invoke-WPFUIThread -ScriptBlock { $sync["WPFWin11ISOWriteUSBButton"].IsEnabled = $true }
Invoke-WPFUIThread -ScriptBlock {
$sync["WPFWin11ISOWriteUSBButton"].IsEnabled = $true
# Cancellation skips catch, so the working page can still be up here
if ($sync["WPFWin11ISOWorkingSection"].IsSelected) {
Set-WinUtilISOStep -Step "Output"
}
}
}
}
}
@@ -512,6 +512,14 @@ Version : <a href="https://github.com/ChrisTitusTech/winutil/releases/tag/$($sy
Invoke-WinUtilISOCleanAndReset
})
$sync["WPFWin11ISOBackButton"].Add_Click({
$sync["WPFWin11ISOSelectSection"].IsSelected = $true
})
$sync["WPFWin11ISOForwardButton"].Add_Click({
$sync["WPFWin11ISOModifySection"].IsSelected = $true
})
$buildClock.Stop()
Write-WinUtilLog -Level "DEBUG" -Component "UI" -Message "Interface built in $($buildClock.ElapsedMilliseconds) ms, showing the window."
Write-WinUtilTimingSummary -Scope "UI" -TotalMilliseconds $buildClock.ElapsedMilliseconds
+20 -1
View File
@@ -306,7 +306,26 @@ Describe "Win11 Creator setup media" {
$script:mountAndVerifyFunction | Should -Match ([regex]::Escape('$verified = $true'))
$script:mountAndVerifyFunction | Should -Match ([regex]::Escape('Dismount-DiskImage -ImagePath $isoPath -ErrorAction Stop'))
$script:mountAndVerifyFunction | Should -Match ([regex]::Escape('$sync["Win11ISOImagePath"] = $null'))
$script:mountAndVerifyFunction.IndexOf('Dismount-DiskImage') | Should -BeGreaterThan $script:mountAndVerifyFunction.IndexOf('finally')
$script:mountAndVerifyFunction.IndexOf('Dismount-DiskImage -ImagePath $isoPath') | Should -BeGreaterThan $script:mountAndVerifyFunction.IndexOf('finally')
}
It "dismounts a previously verified ISO before mounting a replacement" {
$script:mountAndVerifyFunction | Should -Match ([regex]::Escape('$previous = $sync["Win11ISOImagePath"]'))
$script:mountAndVerifyFunction | Should -Match ([regex]::Escape('Dismount-DiskImage -ImagePath $previous -ErrorAction Stop'))
$script:mountAndVerifyFunction.IndexOf('Dismount-DiskImage -ImagePath $previous') |
Should -BeLessThan $script:mountAndVerifyFunction.IndexOf('$sync["Win11ISOImagePath"] = $null')
}
It "keeps the stored path and restores the interface when the previous ISO will not dismount" {
$dismountIndex = $script:mountAndVerifyFunction.IndexOf('Dismount-DiskImage -ImagePath $previous')
$resetIndex = $script:mountAndVerifyFunction.IndexOf('$sync["Win11ISOImagePath"] = $null')
$throwIndex = $script:mountAndVerifyFunction.IndexOf('throw $stillMounted')
$throwIndex | Should -BeGreaterThan $dismountIndex
$throwIndex | Should -BeLessThan $resetIndex
$script:mountAndVerifyFunction.IndexOf('try {') | Should -BeLessThan $dismountIndex
}
It "keeps ISO cleanup in finally so stopping modification cannot bypass it" {
+9 -2
View File
@@ -241,12 +241,19 @@ Describe "XAML document" {
"WPFWin11ISOBrowseButton",
"WPFWin11ISOFileInfo",
"WPFWin11ISODownloadLink",
"WPFWin11ISOMountSection",
"WPFWin11ISOSteps",
"WPFWin11ISOBackButton",
"WPFWin11ISOForwardButton",
"WPFWin11ISOWorkingSection",
"WPFWin11ISOWorkingLabel",
"WPFWin11ISOWorkingSpinner",
"WPFWin11ISODonePanel",
"WPFWin11ISODoneLabel",
"WPFWin11ISOMountButton",
"WPFWin11ISOInjectDrivers",
"WPFWin11ISOVerifyResultPanel",
"WPFWin11ISOMountDriveLetter",
"WPFWin11ISOArchLabel",
"WPFWin11ISOImageFile",
"WPFWin11ISOEditionComboBox",
"WPFWin11ISOModifySection",
"WPFWin11ISOModifyButton",
+580 -292
View File
@@ -305,12 +305,14 @@
AllowsTransparency="True"
PopupAnimation="Slide">
<Border Name="DropDownBorder"
MinWidth="{Binding ActualWidth, RelativeSource={RelativeSource TemplatedParent}}"
Background="{TemplateBinding Background}"
BorderBrush="{DynamicResource BorderColor}"
BorderThickness="1"
CornerRadius="4">
<ScrollViewer>
<ItemsPresenter HorizontalAlignment="Left" VerticalAlignment="Center" Margin="4,2"/>
<!-- Stretched, so an item's highlight spans the popup rather than just its text -->
<ItemsPresenter HorizontalAlignment="Stretch" Margin="4,2"/>
</ScrollViewer>
</Border>
</Popup>
@@ -320,8 +322,11 @@
</Setter>
</Style>
<Style TargetType="ComboBoxItem">
<Setter Property="Background" Value="{DynamicResource ComboBoxBackgroundColor}"/>
<!-- Transparent rather than its own colour: the item used to paint one background and
the popup another, which read as a stack of labels on a mismatched sheet -->
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="{DynamicResource ComboBoxForegroundColor}"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="Padding" Value="6,3"/>
<Setter Property="ContentTemplate">
<Setter.Value>
@@ -1600,311 +1605,594 @@
</TabItem>
<TabItem Header="Win11ISO" Visibility="Collapsed" Name="WPFTab5">
<Grid Name="Win11ISOPanel" Margin="{DynamicResource TabContentMargin}" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/> <!-- Steps 1-4 -->
<RowDefinition Height="*"/> <!-- Log / Status -->
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<!-- Steps 1-4 -->
<StackPanel Grid.Row="0">
<Border Grid.Column="0" Style="{StaticResource BorderStyle}" Padding="20,16">
<Grid>
<!-- The lopsided weight is what makes the middle column min(available, 620)
rather than a third of the card -->
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="1000*" MaxWidth="620"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button Name="WPFWin11ISOBackButton"
Grid.Column="0"
Margin="0,0,10,0"
Content="&#xE76B;"
FontFamily="Segoe MDL2 Assets"
FontSize="{DynamicResource Win11StepTitleFontSize}"
MinWidth="44" MinHeight="72"
Background="Transparent"
HorizontalAlignment="Right" VerticalAlignment="Center"
Panel.ZIndex="1"
ToolTip="Back to the previous step">
<Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource HoverButtonStyle}">
<Setter Property="Visibility" Value="Hidden"/>
<Style.Triggers>
<DataTrigger Binding="{Binding IsSelected, ElementName=WPFWin11ISOModifySection}" Value="True">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
<Button Name="WPFWin11ISOForwardButton"
Grid.Column="2"
Margin="10,0,0,0"
Content="&#xE76C;"
FontFamily="Segoe MDL2 Assets"
FontSize="{DynamicResource Win11StepTitleFontSize}"
MinWidth="44" MinHeight="72"
Background="Transparent"
HorizontalAlignment="Left" VerticalAlignment="Center"
Panel.ZIndex="1"
ToolTip="Forward to the next step">
<Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource HoverButtonStyle}">
<Setter Property="Visibility" Value="Hidden"/>
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsSelected, ElementName=WPFWin11ISOSelectSection}" Value="True"/>
<Condition Binding="{Binding IsEnabled, ElementName=WPFWin11ISOModifySection}" Value="True"/>
</MultiDataTrigger.Conditions>
<Setter Property="Visibility" Value="Visible"/>
</MultiDataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
<TabControl Name="WPFWin11ISOSteps"
Grid.Column="0" Grid.ColumnSpan="3"
Background="Transparent"
BorderThickness="0">
<TabControl.Resources>
<!-- Text colours: the implicit TextBlock style would paint anything unstyled
cyan on a label background, so every text block here carries a style. -->
<Style x:Key="Win11StepHeaderText" TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground"
Value="{Binding Foreground, RelativeSource={RelativeSource AncestorType={x:Type TabItem}}}"/>
</Style>
<Style x:Key="Win11ButtonText" TargetType="TextBlock" BasedOn="{StaticResource Win11StepHeaderText}">
<Setter Property="FontSize" Value="{DynamicResource ButtonFontSize}"/>
<Setter Property="Foreground"
Value="{Binding Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}}}"/>
</Style>
<Style x:Key="Win11StepIcon" TargetType="TextBlock" BasedOn="{StaticResource Win11StepHeaderText}">
<Setter Property="FontFamily" Value="Segoe MDL2 Assets"/>
<Setter Property="FontSize" Value="{DynamicResource IconFontSize}"/>
<Setter Property="Margin" Value="0,0,8,0"/>
</Style>
<Style x:Key="Win11ButtonIcon" TargetType="TextBlock" BasedOn="{StaticResource Win11ButtonText}">
<Setter Property="FontFamily" Value="Segoe MDL2 Assets"/>
<Setter Property="FontSize" Value="{DynamicResource IconFontSize}"/>
<Setter Property="Margin" Value="0,0,10,0"/>
</Style>
<Style TargetType="TabItem">
<Setter Property="FontSize" Value="{DynamicResource FontSize}"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Foreground" Value="{DynamicResource ToggleButtonOffColor}"/>
<Setter Property="HeaderTemplate">
<Setter.Value>
<DataTemplate>
<StackPanel Orientation="Horizontal" Cursor="Hand">
<TextBlock Style="{StaticResource Win11StepIcon}"
Text="{Binding Tag, RelativeSource={RelativeSource AncestorType={x:Type TabItem}}}"/>
<TextBlock Style="{StaticResource Win11StepHeaderText}" Text="{Binding}"/>
</StackPanel>
</DataTemplate>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TabItem">
<Border Background="Transparent" Padding="0,0,32,0">
<ContentPresenter ContentSource="Header" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Foreground" Value="{DynamicResource MainForegroundColor}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.45"/>
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="TabControl">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TabControl">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TabPanel Grid.Row="0"
IsItemsHost="True"
Background="Transparent"
Margin="0,0,0,10"/>
<Border Grid.Row="1"
BorderBrush="{DynamicResource BorderColor}"
BorderThickness="0,1,0,0"
Padding="0,10,0,0">
<ScrollViewer VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Disabled">
<Grid MinHeight="{Binding ViewportHeight, RelativeSource={RelativeSource AncestorType={x:Type ScrollViewer}}}">
<ContentPresenter ContentSource="SelectedContent"/>
</Grid>
</ScrollViewer>
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="Win11StepColumn" TargetType="StackPanel">
<Setter Property="MaxWidth" Value="620"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<Style x:Key="Win11StepHero" TargetType="TextBlock">
<Setter Property="FontFamily" Value="Segoe MDL2 Assets"/>
<Setter Property="FontSize" Value="{DynamicResource Win11StepHeroFontSize}"/>
<Setter Property="Foreground" Value="{DynamicResource LabelboxForegroundColor}"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="Margin" Value="0,0,0,14"/>
</Style>
<Style x:Key="Win11StepTitle" TargetType="TextBlock">
<Setter Property="FontSize" Value="{DynamicResource Win11StepTitleFontSize}"/>
<Setter Property="Foreground" Value="{DynamicResource LabelboxForegroundColor}"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="Margin" Value="0,0,0,6"/>
</Style>
<Style x:Key="Win11StepBody" TargetType="TextBlock">
<Setter Property="FontSize" Value="{DynamicResource FontSize}"/>
<Setter Property="Foreground" Value="{DynamicResource MainForegroundColor}"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="Margin" Value="0,0,0,10"/>
</Style>
<Style x:Key="Win11StepSubtitle" TargetType="TextBlock" BasedOn="{StaticResource Win11StepBody}">
<Setter Property="Opacity" Value="0.75"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="MaxWidth" Value="520"/>
<Setter Property="Margin" Value="0,0,0,20"/>
</Style>
<Style x:Key="Win11StepLabel" TargetType="TextBlock" BasedOn="{StaticResource Win11StepBody}">
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Foreground" Value="{DynamicResource LabelboxForegroundColor}"/>
<Setter Property="Margin" Value="0,0,0,6"/>
</Style>
<Style x:Key="Win11StepValue" TargetType="TextBlock" BasedOn="{StaticResource Win11StepBody}">
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="0"/>
</Style>
<Style x:Key="Win11StepCaption" TargetType="TextBlock" BasedOn="{StaticResource Win11StepBody}">
<Setter Property="Opacity" Value="0.75"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="0,0,6,0"/>
</Style>
<Style x:Key="Win11StepButton" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="34"/>
<Setter Property="Padding" Value="16,0"/>
<!-- The implicit style pins Width to ButtonWidth, which clips the longer labels -->
<Setter Property="Width" Value="Auto"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource Win11ButtonIcon}"
Text="{Binding Tag, RelativeSource={RelativeSource AncestorType={x:Type Button}}}"/>
<TextBlock Style="{StaticResource Win11ButtonText}" Text="{Binding}"/>
</StackPanel>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="Win11InfoPanel" TargetType="Border">
<Setter Property="Background" Value="{DynamicResource MainBackgroundColor}"/>
<Setter Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="CornerRadius" Value="5"/>
<Setter Property="Padding" Value="16"/>
</Style>
<Style x:Key="Win11FormPanel" TargetType="Border" BasedOn="{StaticResource Win11InfoPanel}">
<Setter Property="BorderBrush" Value="{DynamicResource LabelboxForegroundColor}"/>
</Style>
<Style x:Key="Win11SummaryIcon" TargetType="TextBlock" BasedOn="{StaticResource Win11StepIcon}">
<Setter Property="Foreground" Value="{DynamicResource LabelboxForegroundColor}"/>
<Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="Margin" Value="0,1,12,0"/>
</Style>
<Style x:Key="Win11SummaryRow" TargetType="StackPanel">
<Setter Property="Orientation" Value="Horizontal"/>
<Setter Property="Margin" Value="0,0,0,10"/>
</Style>
</TabControl.Resources>
<!-- ─── STEP 1 : Select Windows 11 ISO ─────────────── -->
<Grid Name="WPFWin11ISOSelectSection" Margin="5" HorizontalAlignment="Left" MinWidth="{DynamicResource ButtonWidth}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TabItem Name="WPFWin11ISOSelectSection" Tag="&#xE958;" Header="1 Select ISO">
<StackPanel Style="{StaticResource Win11StepColumn}">
<TextBlock Text="&#xE958;" Style="{StaticResource Win11StepHero}"/>
<TextBlock Style="{StaticResource Win11StepTitle}" Text="Select your Windows 11 ISO"/>
<TextBlock Style="{StaticResource Win11StepSubtitle}">
Choose an official Windows 11 ISO downloaded from Microsoft. It will be
mounted and checked before anything is changed.
</TextBlock>
<!-- Left: File Selector -->
<StackPanel Grid.Column="0" Margin="5,5,15,5">
<TextBlock FontSize="{DynamicResource FontSize}" FontWeight="Bold"
Foreground="{DynamicResource MainForegroundColor}" Margin="0,0,0,8">
Step 1 - Select Windows 11 ISO
</TextBlock>
<TextBlock FontSize="{DynamicResource FontSize}" Foreground="{DynamicResource MainForegroundColor}"
TextWrapping="Wrap" Margin="0,0,0,6">
Browse to your locally saved Windows 11 ISO file. Only official ISOs
downloaded from Microsoft are supported.
</TextBlock>
<TextBlock FontSize="{DynamicResource FontSize}" Foreground="{DynamicResource MainForegroundColor}"
TextWrapping="Wrap" Margin="0,0,0,12" FontStyle="Italic">
<Run FontWeight="Bold">NOTE:</Run> This is only meant for Fresh and New Windows installs.
</TextBlock>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBox Grid.Column="0"
Name="WPFWin11ISOPath"
IsReadOnly="True"
VerticalAlignment="Center"
Padding="6,4"
Margin="0,0,6,0"
Text="No ISO selected..."
Foreground="{DynamicResource MainForegroundColor}"
Background="{DynamicResource MainBackgroundColor}"/>
<Button Grid.Column="1"
Name="WPFWin11ISOBrowseButton"
Content="Browse"
Width="Auto" Padding="12,0"
Height="{DynamicResource ButtonHeight}"/>
</Grid>
<TextBlock Name="WPFWin11ISOFileInfo"
FontSize="{DynamicResource FontSize}"
Foreground="{DynamicResource MainForegroundColor}"
Margin="0,8,0,0"
TextWrapping="Wrap"
Visibility="Collapsed"/>
<Border Style="{StaticResource Win11FormPanel}" Margin="0,0,0,16">
<StackPanel>
<TextBlock Style="{StaticResource Win11StepLabel}" Text="ISO file"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBox Grid.Column="0"
Name="WPFWin11ISOPath"
IsReadOnly="True"
VerticalAlignment="Center"
VerticalContentAlignment="Center"
Height="34"
Padding="10,0"
Margin="0,0,12,0"
Text="No ISO selected..."
Foreground="{DynamicResource MainForegroundColor}"
Background="{DynamicResource MainBackgroundColor}"/>
<Button Grid.Column="1" Name="WPFWin11ISOBrowseButton" MinWidth="130"
Style="{StaticResource Win11StepButton}" Tag="&#xE8B7;" Content="Browse"/>
</Grid>
<!-- Hidden rather than collapsed so picking an ISO does not shift the page -->
<TextBlock Name="WPFWin11ISOFileInfo"
Style="{StaticResource Win11StepBody}"
Margin="0,10,0,0"
Visibility="Hidden"
Text="File size:"/>
</StackPanel>
</Border>
<Button Name="WPFWin11ISOMountButton" Margin="0,0,0,20"
Style="{StaticResource Win11StepButton}" Tag="&#xE8FB;" Content="Mount &amp; Verify ISO"/>
<Border Style="{StaticResource Win11InfoPanel}">
<StackPanel>
<TextBlock Style="{StaticResource Win11StepLabel}" Foreground="OrangeRed" Margin="0,0,0,10">
<Run FontFamily="Segoe MDL2 Assets" Text="&#xE7BA;"/>
<Run Text=" You must use an official Microsoft ISO"/>
</TextBlock>
<TextBlock Style="{StaticResource Win11StepBody}">
Third-party, pre-modified, or unofficial images are not supported
and may produce broken results. This is only meant for fresh and
new Windows installs.
</TextBlock>
<TextBlock Style="{StaticResource Win11StepBody}" Margin="0,0,0,12">
On the download page choose Windows 11, your language, and 64-bit (x64).
</TextBlock>
<Button Name="WPFWin11ISODownloadLink"
Style="{StaticResource Win11StepButton}" Tag="&#xE8A7;" Content="Open Microsoft Download Page"/>
</StackPanel>
</Border>
</StackPanel>
</TabItem>
<!-- Right: Download guidance -->
<Border Grid.Column="1"
Background="{DynamicResource MainBackgroundColor}"
BorderBrush="{DynamicResource BorderColor}"
BorderThickness="1" CornerRadius="5"
Margin="5" Padding="15">
<StackPanel>
<TextBlock FontSize="{DynamicResource FontSize}" FontWeight="Bold"
Foreground="OrangeRed" Margin="0,0,0,10">
!!WARNING!! You must use an official Microsoft ISO
</TextBlock>
<TextBlock FontSize="{DynamicResource FontSize}"
Foreground="{DynamicResource MainForegroundColor}"
TextWrapping="Wrap" Margin="0,0,0,8">
Download the Windows 11 ISO directly from Microsoft.com.
Third-party, pre-modified, or unofficial images are not supported
and may produce broken results.
</TextBlock>
<TextBlock FontSize="{DynamicResource FontSize}"
Foreground="{DynamicResource MainForegroundColor}"
TextWrapping="Wrap" Margin="0,0,0,6">
On the Microsoft download page, choose:
</TextBlock>
<TextBlock FontSize="{DynamicResource FontSize}"
Foreground="{DynamicResource MainForegroundColor}"
TextWrapping="Wrap" Margin="12,0,0,12">
- Edition : Windows 11
<LineBreak/>- Language : your preferred language
<LineBreak/>- Architecture : 64-bit (x64)
</TextBlock>
<Button Name="WPFWin11ISODownloadLink"
Content="Open Microsoft Download Page"
HorizontalAlignment="Left"
Width="Auto" Padding="12,0"
Height="{DynamicResource ButtonHeight}"/>
</StackPanel>
</Border>
</Grid>
<!-- ─── STEP 2 : Mount & Verify ISO ──────────────────── -->
<Grid Name="WPFWin11ISOMountSection"
Margin="5"
Visibility="Collapsed"
HorizontalAlignment="Left" MinWidth="{DynamicResource ButtonWidth}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" Margin="0,0,20,0" VerticalAlignment="Top">
<TextBlock FontSize="{DynamicResource FontSize}" FontWeight="Bold"
Foreground="{DynamicResource MainForegroundColor}" Margin="0,0,0,8">
Step 2 - Mount &amp; Verify ISO
<!-- ─── STEP 2 : Modify install.wim ───────────────────── -->
<TabItem Name="WPFWin11ISOModifySection" IsEnabled="False" Tag="&#xE713;" Header="2 Modify Image">
<StackPanel Style="{StaticResource Win11StepColumn}">
<TextBlock Text="&#xE713;" Style="{StaticResource Win11StepHero}"/>
<TextBlock Style="{StaticResource Win11StepTitle}" Text="Modify the image"/>
<TextBlock Style="{StaticResource Win11StepSubtitle}">
Pick what goes into the image, then start. This takes several minutes
depending on your hardware.
</TextBlock>
<TextBlock FontSize="{DynamicResource FontSize}"
Foreground="{DynamicResource MainForegroundColor}"
TextWrapping="Wrap" Margin="0,0,0,12" MaxWidth="320">
Mount the ISO and confirm it contains a valid Windows 11
install.wim before any modifications are made.
</TextBlock>
<Button Name="WPFWin11ISOMountButton"
Content="Mount &amp; Verify ISO"
HorizontalAlignment="Left"
Width="Auto" Padding="12,0"
Height="{DynamicResource ButtonHeight}"/>
<CheckBox Name="WPFWin11ISOInjectDrivers"
Content="Inject current system drivers"
FontSize="{DynamicResource FontSize}"
Foreground="{DynamicResource MainForegroundColor}"
IsChecked="False"
Margin="0,8,0,0"
ToolTip="Stages boot-storage drivers for Setup and adds all exported drivers to the selected install.wim edition in one DISM pass."/>
</StackPanel>
<!-- Verification results panel -->
<Border Grid.Column="1"
Name="WPFWin11ISOVerifyResultPanel"
Background="{DynamicResource MainBackgroundColor}"
BorderBrush="{DynamicResource BorderColor}"
BorderThickness="1" CornerRadius="5"
Padding="12" Margin="0,0,0,0"
Visibility="Collapsed">
<StackPanel>
<TextBlock Name="WPFWin11ISOMountDriveLetter"
FontSize="{DynamicResource FontSize}"
Foreground="{DynamicResource MainForegroundColor}"
Margin="0,0,0,4"/>
<TextBlock Name="WPFWin11ISOArchLabel"
FontSize="{DynamicResource FontSize}"
Foreground="{DynamicResource MainForegroundColor}"
Margin="0,0,0,4"/>
<TextBlock FontSize="{DynamicResource FontSize}" FontWeight="Bold"
Foreground="{DynamicResource MainForegroundColor}"
Margin="0,6,0,4">
Select Edition:
</TextBlock>
<ComboBox Name="WPFWin11ISOEditionComboBox"
FontSize="{DynamicResource FontSize}"
Foreground="{DynamicResource MainForegroundColor}"
Background="{DynamicResource MainBackgroundColor}"
HorizontalAlignment="Left"
Margin="0,0,0,0"/>
</StackPanel>
</Border>
</Grid>
<!-- ─── STEP 3 : Modify install.wim ───────────────────── -->
<StackPanel Name="WPFWin11ISOModifySection"
Margin="5"
Visibility="Collapsed"
HorizontalAlignment="Left" MinWidth="{DynamicResource ButtonWidth}">
<TextBlock FontSize="{DynamicResource FontSize}" FontWeight="Bold"
Foreground="{DynamicResource MainForegroundColor}" Margin="0,0,0,8">
Step 3 - Modify install.wim
</TextBlock>
<TextBlock FontSize="{DynamicResource FontSize}"
Foreground="{DynamicResource MainForegroundColor}"
TextWrapping="Wrap" Margin="0,0,0,12">
The ISO contents will be extracted to a temporary working directory,
install.wim will be modified (components removed, tweaks applied),
and the result will be repackaged. This process may take several minutes
depending on your hardware.
</TextBlock>
<Button Name="WPFWin11ISOModifyButton"
Content="Run Windows ISO Modification and Creator"
HorizontalAlignment="Left"
Width="Auto" Padding="12,0"
Height="{DynamicResource ButtonHeight}"/>
</StackPanel>
<!-- ─── STEP 4 : Output Options ───────────────────────── -->
<StackPanel Name="WPFWin11ISOOutputSection"
Margin="5"
Visibility="Collapsed"
HorizontalAlignment="Left" MinWidth="{DynamicResource ButtonWidth}">
<!-- Header row: title + Clean & Reset button -->
<Grid Margin="0,0,0,12">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" FontSize="{DynamicResource FontSize}" FontWeight="Bold"
Foreground="{DynamicResource MainForegroundColor}"
VerticalAlignment="Center">
Step 4 - Output: What would you like to do with the modified image?
</TextBlock>
<Button Grid.Column="1"
Name="WPFWin11ISOCleanResetButton"
Content="Clean &amp; Reset"
Foreground="OrangeRed"
Width="Auto" Padding="12,0"
Height="{DynamicResource ButtonHeight}"
ToolTip="Delete the temporary working directory and reset the interface back to Step 1"
Margin="12,0,0,0"/>
</Grid>
<!-- ── Choice prompt buttons ── -->
<Grid Margin="0,0,0,12">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="16"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button Grid.Column="0"
Name="WPFWin11ISOChooseISOButton"
Content="Save as an ISO File"
HorizontalAlignment="Stretch"
Width="Auto" Padding="12,0"
Height="{DynamicResource ButtonHeight}"/>
<Button Grid.Column="2"
Name="WPFWin11ISOChooseUSBButton"
Content="Write Directly to a USB Drive (ERASES DRIVE)"
Foreground="OrangeRed"
HorizontalAlignment="Stretch"
Width="Auto" Padding="12,0"
Height="{DynamicResource ButtonHeight}"/>
</Grid>
<!-- ── USB write sub-panel (revealed on USB choice) ── -->
<Border Name="WPFWin11ISOOptionUSB"
Style="{StaticResource BorderStyle}"
Visibility="Collapsed"
Margin="0,8,0,0">
<StackPanel>
<TextBlock FontSize="{DynamicResource FontSize}"
Foreground="{DynamicResource MainForegroundColor}"
TextWrapping="Wrap" Margin="0,0,0,8">
<Run FontWeight="Bold" Foreground="OrangeRed">!! All data on the selected USB drive will be permanently erased !!</Run>
<LineBreak/>
Select a removable USB drive below, then click Erase &amp; Write.
</TextBlock>
<!-- USB drive selector row -->
<Grid Margin="0,0,0,8">
<Border Name="WPFWin11ISOVerifyResultPanel"
Style="{StaticResource Win11InfoPanel}"
Padding="14,10"
Margin="0,0,0,14"
Visibility="Collapsed">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<ComboBox Grid.Column="0"
Name="WPFWin11ISOUSBDriveComboBox"
<TextBlock Grid.Column="1" Text="&#xE8FB;" Style="{StaticResource Win11SummaryIcon}"
VerticalAlignment="Center" Margin="12,0,0,0"/>
<StackPanel Grid.Column="0" Orientation="Horizontal">
<TextBlock Text="&#xE958;" Style="{StaticResource Win11StepIcon}"/>
<TextBlock Style="{StaticResource Win11StepCaption}" Text="Mounted at"/>
<TextBlock Name="WPFWin11ISOMountDriveLetter" Style="{StaticResource Win11StepValue}"/>
<TextBlock Text="&#xE8A5;" Style="{StaticResource Win11StepIcon}" Margin="22,0,8,0"/>
<TextBlock Style="{StaticResource Win11StepCaption}" Text="Image file"/>
<TextBlock Name="WPFWin11ISOImageFile" Style="{StaticResource Win11StepValue}"/>
</StackPanel>
</Grid>
</Border>
<Border Style="{StaticResource Win11FormPanel}" Margin="0,0,0,16">
<StackPanel>
<TextBlock Style="{StaticResource Win11StepLabel}" Text="Windows edition"/>
<ComboBox Name="WPFWin11ISOEditionComboBox"
FontSize="{DynamicResource FontSize}"
Foreground="{DynamicResource MainForegroundColor}"
Background="{DynamicResource MainBackgroundColor}"
VerticalAlignment="Center"
Margin="0,0,6,0"/>
<Button Grid.Column="1"
Name="WPFWin11ISORefreshUSBButton"
Content="Refresh"
Width="Auto" Padding="8,0"
Height="{DynamicResource ButtonHeight}"/>
</Grid>
<Button Name="WPFWin11ISOWriteUSBButton"
Content="Erase &amp; Write to USB"
Foreground="OrangeRed"
HorizontalAlignment="Stretch"
Width="Auto" Padding="12,0"
Height="{DynamicResource ButtonHeight}"
Margin="0,0,0,10"/>
</StackPanel>
</Border>
HorizontalAlignment="Stretch"
Height="34"
Margin="0,0,0,14"/>
<CheckBox Name="WPFWin11ISOInjectDrivers"
Content="Inject current system drivers"
FontSize="{DynamicResource FontSize}"
Foreground="{DynamicResource MainForegroundColor}"
IsChecked="False"
Cursor="Hand"
ToolTip="Stages boot-storage drivers for Setup and adds all exported drivers to the selected install.wim edition in one DISM pass."/>
</StackPanel>
</Border>
<Button Name="WPFWin11ISOModifyButton" Margin="0,0,0,20"
Style="{StaticResource Win11StepButton}" Tag="&#xE768;"
Content="Run Windows ISO Modification and Creator"/>
<Border Style="{StaticResource Win11InfoPanel}">
<StackPanel>
<TextBlock Style="{StaticResource Win11StepLabel}" Margin="0,0,0,12" Text="What this does to the image"/>
<StackPanel Style="{StaticResource Win11SummaryRow}">
<TextBlock Text="&#xE74D;" Style="{StaticResource Win11SummaryIcon}"/>
<TextBlock Style="{StaticResource Win11StepBody}" Margin="0"
Text="Removes the preinstalled apps and the OneDrive setup"/>
</StackPanel>
<StackPanel Style="{StaticResource Win11SummaryRow}">
<TextBlock Text="&#xE950;" Style="{StaticResource Win11SummaryIcon}"/>
<TextBlock Style="{StaticResource Win11StepBody}" Margin="0"
Text="Bypasses the TPM, Secure Boot, CPU, RAM and storage checks"/>
</StackPanel>
<StackPanel Style="{StaticResource Win11SummaryRow}">
<TextBlock Text="&#xE77B;" Style="{StaticResource Win11SummaryIcon}"/>
<TextBlock Style="{StaticResource Win11StepBody}" Margin="0"
Text="Skips the Microsoft account screen so you can use a local account"/>
</StackPanel>
<StackPanel Style="{StaticResource Win11SummaryRow}">
<TextBlock Text="&#xE7EE;" Style="{StaticResource Win11SummaryIcon}"/>
<TextBlock Style="{StaticResource Win11StepBody}" Margin="0"
Text="Turns off telemetry, Copilot, the chat icon and search box suggestions"/>
</StackPanel>
<StackPanel Style="{StaticResource Win11SummaryRow}" Margin="0">
<TextBlock Text="&#xE8EF;" Style="{StaticResource Win11SummaryIcon}"/>
<TextBlock Style="{StaticResource Win11StepBody}" Margin="0"
Text="Pins the edition you picked above so Setup does not choose another one"/>
</StackPanel>
</StackPanel>
</Border>
</StackPanel>
</TabItem>
<!-- ─── STEP 3 : Output Options ───────────────────────── -->
<TabItem Name="WPFWin11ISOOutputSection" IsEnabled="False" Tag="&#xE88E;" Header="3 Output">
<StackPanel Style="{StaticResource Win11StepColumn}">
<TextBlock Text="&#xE88E;" Style="{StaticResource Win11StepHero}"/>
<TextBlock Style="{StaticResource Win11StepTitle}" Text="Your image is ready"/>
<TextBlock Style="{StaticResource Win11StepSubtitle}">
Save the modified image as an ISO file, or write it straight to a USB
drive you can boot from.
</TextBlock>
<Border Name="WPFWin11ISODonePanel"
Style="{StaticResource Win11InfoPanel}"
Padding="14,10"
Margin="0,0,0,14"
Visibility="Collapsed">
<StackPanel Orientation="Horizontal">
<TextBlock Text="&#xE8FB;" Style="{StaticResource Win11SummaryIcon}"
VerticalAlignment="Center" Margin="0,0,10,0"/>
<TextBlock Name="WPFWin11ISODoneLabel" Style="{StaticResource Win11StepValue}"/>
</StackPanel>
</Border>
<Button Name="WPFWin11ISOChooseISOButton" Margin="0,0,0,10"
Style="{StaticResource Win11StepButton}" Tag="&#xE74E;" Content="Save as an ISO File"/>
<Button Name="WPFWin11ISOChooseUSBButton" Foreground="OrangeRed"
Style="{StaticResource Win11StepButton}" Tag="&#xE88E;"
Content="Write Directly to a USB Drive (ERASES DRIVE)"/>
<Border Name="WPFWin11ISOOptionUSB"
Style="{StaticResource Win11FormPanel}"
Visibility="Collapsed"
Margin="0,14,0,0">
<StackPanel>
<TextBlock Style="{StaticResource Win11StepBody}">
<Run FontWeight="Bold" Foreground="OrangeRed">!! All data on the selected USB drive will be permanently erased !!</Run>
</TextBlock>
<TextBlock Style="{StaticResource Win11StepLabel}" Text="USB drive"/>
<Grid Margin="0,0,0,12">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<ComboBox Grid.Column="0"
Name="WPFWin11ISOUSBDriveComboBox"
Foreground="{DynamicResource MainForegroundColor}"
Background="{DynamicResource MainBackgroundColor}"
VerticalAlignment="Center"
Height="34"
Margin="0,0,12,0"/>
<Button Grid.Column="1" Name="WPFWin11ISORefreshUSBButton" MinWidth="130"
Style="{StaticResource Win11StepButton}" Tag="&#xE895;" Content="Refresh"/>
</Grid>
<Button Name="WPFWin11ISOWriteUSBButton" Foreground="OrangeRed"
Style="{StaticResource Win11StepButton}" Tag="&#xE7BA;" Content="Erase &amp; Write to USB"/>
</StackPanel>
</Border>
<Border BorderBrush="{DynamicResource BorderColor}" BorderThickness="0,1,0,0"
Margin="0,20,0,0" Padding="0,14,0,0">
<StackPanel>
<TextBlock Style="{StaticResource Win11StepSubtitle}" Margin="0,0,0,10"
Text="Done with this image? Clear the temporary files and start again from step 1."/>
<Button Name="WPFWin11ISOCleanResetButton"
HorizontalAlignment="Center" MinWidth="240"
Style="{StaticResource Win11StepButton}" Tag="&#xE72C;" Content="Start Over"
ToolTip="Delete the temporary working directory and go back to the first step"/>
</StackPanel>
</Border>
</StackPanel>
</TabItem>
<!-- ─── Working page: selected while a step runs, no header of its own ─── -->
<TabItem Name="WPFWin11ISOWorkingSection" Visibility="Collapsed">
<StackPanel Style="{StaticResource Win11StepColumn}">
<!-- BitmapCache because this is text: without it WPF re-rasterises the
glyph every frame on the interface thread and the spin stutters.
Cached, the rotation is a transform on an image the GPU already has. -->
<TextBlock Name="WPFWin11ISOWorkingSpinner"
Text="&#xE895;"
Tag="Forward"
RenderTransformOrigin="0.5,0.5"
CacheMode="BitmapCache">
<TextBlock.RenderTransform>
<RotateTransform Angle="0"/>
</TextBlock.RenderTransform>
<TextBlock.Style>
<Style TargetType="TextBlock" BasedOn="{StaticResource Win11StepHero}">
<Style.Triggers>
<!-- Tied to visibility, not to Loaded: the working page stays loaded
while collapsed, so a Loaded trigger left it spinning forever -->
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsVisible, RelativeSource={RelativeSource Self}}" Value="True"/>
<Condition Binding="{Binding Tag, RelativeSource={RelativeSource Self}}" Value="Forward"/>
</MultiDataTrigger.Conditions>
<MultiDataTrigger.EnterActions>
<BeginStoryboard Name="Win11ISOSpin">
<Storyboard RepeatBehavior="Forever">
<DoubleAnimation
Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)"
From="0" To="360" Duration="0:0:1.4"/>
</Storyboard>
</BeginStoryboard>
</MultiDataTrigger.EnterActions>
<MultiDataTrigger.ExitActions>
<StopStoryboard BeginStoryboardName="Win11ISOSpin"/>
</MultiDataTrigger.ExitActions>
</MultiDataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsVisible, RelativeSource={RelativeSource Self}}" Value="True"/>
<Condition Binding="{Binding Tag, RelativeSource={RelativeSource Self}}" Value="Reverse"/>
</MultiDataTrigger.Conditions>
<MultiDataTrigger.EnterActions>
<BeginStoryboard Name="Win11ISOSpinReverse">
<Storyboard RepeatBehavior="Forever">
<DoubleAnimation
Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)"
From="360" To="0" Duration="0:0:1.4"/>
</Storyboard>
</BeginStoryboard>
</MultiDataTrigger.EnterActions>
<MultiDataTrigger.ExitActions>
<StopStoryboard BeginStoryboardName="Win11ISOSpinReverse"/>
</MultiDataTrigger.ExitActions>
</MultiDataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Name="WPFWin11ISOWorkingLabel"
Style="{StaticResource Win11StepTitle}"
Text="Working..."/>
<TextBlock Style="{StaticResource Win11StepSubtitle}"
Margin="0"
Text="This can take several minutes. Progress is written to the status log."/>
</StackPanel>
</TabItem>
</TabControl>
</Grid>
</Border>
<!-- ─── Status log ─── -->
<Border Grid.Column="1" Style="{StaticResource BorderStyle}" Padding="20,16">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal" Margin="0,0,0,10">
<TextBlock Text="&#xE9D9;" FontFamily="Segoe MDL2 Assets"
FontSize="{DynamicResource IconFontSize}"
Background="Transparent"
Foreground="{DynamicResource LabelboxForegroundColor}"
VerticalAlignment="Center" Margin="0,0,8,0"/>
<TextBlock FontSize="{DynamicResource FontSize}"
FontWeight="Bold"
Background="Transparent"
Foreground="{DynamicResource LabelboxForegroundColor}"
VerticalAlignment="Center"
Text="Status Log"/>
</StackPanel>
</StackPanel>
<!-- Status Log (fills remaining height) -->
<Grid Grid.Row="1" Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0"
FontSize="{DynamicResource FontSize}" FontWeight="Bold"
Foreground="{DynamicResource MainForegroundColor}"
Margin="0,0,0,4">
Status Log
</TextBlock>
<TextBox Grid.Row="1"
Name="WPFWin11ISOStatusLog"
IsReadOnly="True"
TextWrapping="Wrap"
VerticalScrollBarVisibility="Visible"
VerticalAlignment="Stretch"
Padding="6"
Background="{DynamicResource MainBackgroundColor}"
Foreground="{DynamicResource MainForegroundColor}"
BorderBrush="{DynamicResource BorderColor}"
BorderThickness="1"
Text="Ready. Please select a Windows 11 ISO to begin."/>
</Grid>
<Border Grid.Row="1"
BorderBrush="{DynamicResource BorderColor}"
BorderThickness="0,1,0,0"
Padding="0,10,0,0">
<!-- TextAlignment and Effect look redundant but are not: the shared TextBox
style stretches content alignment, which WPF renders as justified once
text wraps, and its drop shadow lands on the glyphs with no background
here to sit under. -->
<TextBox Name="WPFWin11ISOStatusLog"
IsReadOnly="True"
TextWrapping="Wrap"
TextAlignment="Left"
FontFamily="{DynamicResource Win11LogFontFamily}"
VerticalScrollBarVisibility="Auto"
VerticalAlignment="Stretch"
Padding="0"
Background="Transparent"
Foreground="{DynamicResource MainForegroundColor}"
BorderThickness="0"
Effect="{x:Null}"
Text="Ready. Please select a Windows 11 ISO to begin."/>
</Border>
</Grid>
</Border>
</Grid>
</TabItem>