Skip to content

Commit 2ba3a5d

Browse files
Win11 ISO Creator (#4110)
* Tab creation * scaffold outline for the iso tab * autounattended creation * inital modification success * iso save success * cleanup and iso improvements * fix startmenu on new 26h2 * remove old first startup * Fix run for use * fix unapproved verb * Keep step 4 output expanded * update auto-merge * Cleanup * remove out-null and trailing whitespace * explain modify and creator button * fix scroll to end * remove workflow change
1 parent f854d14 commit 2ba3a5d

File tree

7 files changed

+2011
-0
lines changed

7 files changed

+2011
-0
lines changed

Compile.ps1

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,20 @@ $xaml
103103
'@
104104
"@)
105105

106+
Update-Progress "Adding: autounattend.xml" 95
107+
$autounattendRaw = Get-Content "$workingdir\tools\autounattend.xml" -Raw
108+
# Strip XML comments (<!-- ... -->, including multi-line)
109+
$autounattendRaw = [regex]::Replace($autounattendRaw, '<!--.*?-->', '', [System.Text.RegularExpressions.RegexOptions]::Singleline)
110+
# Drop blank lines and trim trailing whitespace per line
111+
$autounattendXml = ($autounattendRaw -split "`r?`n" |
112+
Where-Object { $_.Trim() -ne '' } |
113+
ForEach-Object { $_.TrimEnd() }) -join "`r`n"
114+
$script_content.Add(@"
115+
`$WinUtilAutounattendXml = @'
116+
$autounattendXml
117+
'@
118+
"@)
119+
106120
$script_content.Add($(Get-Content "scripts\main.ps1"))
107121

108122
Update-Progress "Removing temporary files" 99

config/themes.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,12 @@
6565
"ButtonTweaksBackgroundColor": "#F7F7F7",
6666
"ButtonConfigBackgroundColor": "#F7F7F7",
6767
"ButtonUpdatesBackgroundColor": "#F7F7F7",
68+
"ButtonWin11ISOBackgroundColor": "#F7F7F7",
6869
"ButtonInstallForegroundColor": "#232629",
6970
"ButtonTweaksForegroundColor": "#232629",
7071
"ButtonConfigForegroundColor": "#232629",
7172
"ButtonUpdatesForegroundColor": "#232629",
73+
"ButtonWin11ISOForegroundColor": "#232629",
7274
"ButtonBackgroundColor": "#F5F5F5",
7375
"ButtonBackgroundPressedColor": "#1A1A1A",
7476
"ButtonBackgroundMouseoverColor": "#C2C2C2",
@@ -105,10 +107,12 @@
105107
"ButtonTweaksBackgroundColor": "#333333",
106108
"ButtonConfigBackgroundColor": "#444444",
107109
"ButtonUpdatesBackgroundColor": "#555555",
110+
"ButtonWin11ISOBackgroundColor": "#666666",
108111
"ButtonInstallForegroundColor": "#F7F7F7",
109112
"ButtonTweaksForegroundColor": "#F7F7F7",
110113
"ButtonConfigForegroundColor": "#F7F7F7",
111114
"ButtonUpdatesForegroundColor": "#F7F7F7",
115+
"ButtonWin11ISOForegroundColor": "#F7F7F7",
112116
"ButtonBackgroundColor": "#1E3747",
113117
"ButtonBackgroundPressedColor": "#F7F7F7",
114118
"ButtonBackgroundMouseoverColor": "#3B4252",

functions/private/Invoke-WinUtilISO.ps1

Lines changed: 779 additions & 0 deletions
Large diffs are not rendered by default.

functions/private/Invoke-WinUtilISOScript.ps1

Lines changed: 331 additions & 0 deletions
Large diffs are not rendered by default.

scripts/main.ps1

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ $commonKeyEvents = {
281281
"T" { Invoke-WPFButton "WPFTab2BT"; $keyEventArgs.Handled = $true } # Navigate to Tweaks tab
282282
"C" { Invoke-WPFButton "WPFTab3BT"; $keyEventArgs.Handled = $true } # Navigate to Config tab
283283
"U" { Invoke-WPFButton "WPFTab4BT"; $keyEventArgs.Handled = $true } # Navigate to Updates tab
284+
"W" { Invoke-WPFButton "WPFTab5BT"; $keyEventArgs.Handled = $true } # Navigate to Win11ISO tab
284285
}
285286
}
286287
# Handle Ctrl key combinations for specific actions
@@ -531,5 +532,56 @@ $sync["FontScalingApplyButton"].Add_Click({
531532
Invoke-WPFPopup -Action "Hide" -Popups @("FontScaling")
532533
})
533534

535+
# ── Win11ISO Tab button handlers ──────────────────────────────────────────────
536+
537+
$sync["WPFWin11ISOBrowseButton"].Add_Click({
538+
Write-Debug "WPFWin11ISOBrowseButton clicked"
539+
Invoke-WinUtilISOBrowse
540+
})
541+
542+
$sync["WPFWin11ISODownloadLink"].Add_Click({
543+
Write-Debug "WPFWin11ISODownloadLink clicked"
544+
Start-Process "https://www.microsoft.com/software-download/windows11"
545+
})
546+
547+
$sync["WPFWin11ISOMountButton"].Add_Click({
548+
Write-Debug "WPFWin11ISOMountButton clicked"
549+
Invoke-WinUtilISOMountAndVerify
550+
})
551+
552+
$sync["WPFWin11ISOModifyButton"].Add_Click({
553+
Write-Debug "WPFWin11ISOModifyButton clicked"
554+
Invoke-WinUtilISOModify
555+
})
556+
557+
$sync["WPFWin11ISOChooseISOButton"].Add_Click({
558+
Write-Debug "WPFWin11ISOChooseISOButton clicked"
559+
$sync["WPFWin11ISOOptionUSB"].Visibility = "Collapsed"
560+
Invoke-WinUtilISOExport
561+
})
562+
563+
$sync["WPFWin11ISOChooseUSBButton"].Add_Click({
564+
Write-Debug "WPFWin11ISOChooseUSBButton clicked"
565+
$sync["WPFWin11ISOOptionUSB"].Visibility = "Visible"
566+
Invoke-WinUtilISORefreshUSBDrives
567+
})
568+
569+
$sync["WPFWin11ISORefreshUSBButton"].Add_Click({
570+
Write-Debug "WPFWin11ISORefreshUSBButton clicked"
571+
Invoke-WinUtilISORefreshUSBDrives
572+
})
573+
574+
$sync["WPFWin11ISOWriteUSBButton"].Add_Click({
575+
Write-Debug "WPFWin11ISOWriteUSBButton clicked"
576+
Invoke-WinUtilISOWriteUSB
577+
})
578+
579+
$sync["WPFWin11ISOCleanResetButton"].Add_Click({
580+
Write-Debug "WPFWin11ISOCleanResetButton clicked"
581+
Invoke-WinUtilISOCleanAndReset
582+
})
583+
584+
# ──────────────────────────────────────────────────────────────────────────────
585+
534586
$sync["Form"].ShowDialog() | out-null
535587
Stop-Transcript

0 commit comments

Comments
 (0)