Compare commits

...

12 Commits

Author SHA1 Message Date
0cf4a1fae8 Install Windows Update Blocker (#3577)
* block updates forever

* remove admin checks for updates
2025-09-05 09:27:26 -05:00
c8dfc529d6 Deploying to main from @ ChrisTitusTech/winutil@88ec1eddf8 🚀 2025-09-03 15:33:17 +00:00
88ec1eddf8 Deploying to main from @ ChrisTitusTech/winutil@a6e9e096ef 🚀 2025-08-30 15:30:59 +00:00
a6e9e096ef [Applications] Possible fix for cmdlet (#3563) 2025-08-28 13:15:42 -05:00
0ee064c191 Deploying to main from @ ChrisTitusTech/winutil@ff0ca400ed 🚀 2025-08-23 15:31:28 +00:00
ff0ca400ed Fix invalid Repair-WingetPackageManager 2025-08-21 13:39:38 -05:00
94d7bb719e Deploying to main from @ ChrisTitusTech/winutil@8622892827 🚀 2025-08-09 15:33:50 +00:00
8622892827 [MicroWin] June-August 2025 Update (#3417)
* Disable "Microsoft account" notification source

* [WinPE] Remove driver addition block for WinPE

WE DO NOT TOUCH THE DRIVERS IN WinPE. There are reports of people getting "Install driver to show hardware" screens all over this repository, and on Discord; and the less drivers we touch in WinPE, the better.

Drivers can still be added to Preinstallation Environments in the following ways:

- Using the driver installation screens
- Firing up "drvload.exe <driver>" in cmd

* [Fix] Added fallback for DISM export command

This is a port of the fix in #3305

* [Cleanup] Removed some comments that no longer make sense

* [Fix] Same DISM export image fallback fix

* Merge branch 'main' into microwin-202506

* [Fix] Improve UI consistency for instructions

Fixes #3394

* Merge branch 'main' into microwin-202506

* [Unattended answer file] Remove it from drive root

The answer file, on the drive root, is not necessary for us to apply it. In fact, it's not even used there

* Merge branch 'main' into microwin-202506

* [MicroWin] June-August 2025 Update (#3) -- Contributions from Callum

* Allow people without compatible hardware or a USB to use MicroWin.

* Update functions/microwin/Microwin-NewUnattend.ps1

Co-authored-by: CodingWonders <101426328+CodingWonders@users.noreply.github.com>

* Update Invoke-Microwin.ps1

* Update Microwin-NewUnattend.ps1

* Update Microwin-NewUnattend.ps1

* Add error pop up if ISO Creation fails.

Issue 2653

* Add Disable WPBT Execution to MicroWin.

* Update functions/microwin/Invoke-Microwin.ps1

Co-authored-by: CodingWonders <101426328+CodingWonders@users.noreply.github.com>

* modified:   functions/microwin/Invoke-Microwin.ps1
	modified:   xaml/inputXML.xaml

---------

Co-authored-by: CodingWonders <101426328+CodingWonders@users.noreply.github.com>

* Add conversion to ESD (#4)

* Add conversion to ESD

Issue - #3450

* Update Invoke-Microwin.ps1

Added quotes to the file paths. Put all the arguments in 1 string (as that also works fine)

---------

Co-authored-by: CodingWonders <101426328+CodingWonders@users.noreply.github.com>

* Update MicroWin contributor list

* Merge branch 'main' into microwin-202506

* Merge branch 'main' into microwin-202506

* [MicroWin] Add automatic configuration settings

Originally implemented in #2618. Adapted to follow the new file structure. And it works.

Though there are issues that will be detailed very soon

* [Fix] Fixed typos, updated descriptions

* Re-add WinPE driver addition

We're not yet sure if that is the actual problem of missing storage controllers. Logs can tell us more about this. Maybe for a future PR?

* [Fix/WPBT] Add spaces to reg key path

Avoid REG failure

* [Fix/XAML] Fix word wrapping issue for checkboxes
2025-08-05 11:24:59 -05:00
af09bcbf0b [Fix] SecureString does not have Close method (#3531) 2025-08-05 10:30:09 -05:00
e2732da2db Blockade fix (#3534)
* Fixes blockade

* Update main.ps1
2025-08-05 10:29:14 -05:00
3bd6003171 Fix scaling of UI Elements when applying Font Scaling (#3526)
* Add scaling for UI elements

* Fix text in Updates tab not scaling

* Fix tab row scaling error

* Add comments for modularity
2025-08-05 10:27:12 -05:00
a921d0c6fa remove brave sync from being disabled (#3529) 2025-08-05 10:26:35 -05:00
15 changed files with 373 additions and 47 deletions

2
.gitignore vendored
View File

@ -54,3 +54,5 @@ winutil.ps1
.github/site/
binary/
.preprocessor_hashes.json

View File

@ -79,7 +79,7 @@ You'll see a new file named `winutil.ps1`, which's created by `Compile.ps1` scri
These are the sponsors that help keep this project alive with monthly contributions.
<!-- sponsors --><a href="https://github.com/TriHydera"><img src="https:&#x2F;&#x2F;github.com&#x2F;TriHydera.png" width="60px" alt="User avatar: TriHydera" /></a><a href="https://github.com/DelDongo"><img src="https:&#x2F;&#x2F;github.com&#x2F;DelDongo.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/markamos"><img src="https:&#x2F;&#x2F;github.com&#x2F;markamos.png" width="60px" alt="User avatar: Mark Amos" /></a><a href="https://github.com/dwelfusius"><img src="https:&#x2F;&#x2F;github.com&#x2F;dwelfusius.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/mews-se"><img src="https:&#x2F;&#x2F;github.com&#x2F;mews-se.png" width="60px" alt="User avatar: Martin Stockzell" /></a><a href="https://github.com/jdiegmueller"><img src="https:&#x2F;&#x2F;github.com&#x2F;jdiegmueller.png" width="60px" alt="User avatar: Jason A. Diegmueller" /></a><a href="https://github.com/robertsandrock"><img src="https:&#x2F;&#x2F;github.com&#x2F;robertsandrock.png" width="60px" alt="User avatar: RMS" /></a><a href="https://github.com/KenichiQaz"><img src="https:&#x2F;&#x2F;github.com&#x2F;KenichiQaz.png" width="60px" alt="User avatar: Stefan" /></a><a href="https://github.com/paulsheets"><img src="https:&#x2F;&#x2F;github.com&#x2F;paulsheets.png" width="60px" alt="User avatar: Paul" /></a><a href="https://github.com/djones369"><img src="https:&#x2F;&#x2F;github.com&#x2F;djones369.png" width="60px" alt="User avatar: Dave J. - WhamGeek" /></a><a href="https://github.com/anthonymendez"><img src="https:&#x2F;&#x2F;github.com&#x2F;anthonymendez.png" width="60px" alt="User avatar: Anthony Mendez" /></a><a href="https://github.com/FatBastard0"><img src="https:&#x2F;&#x2F;github.com&#x2F;FatBastard0.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/DursleyGuy"><img src="https:&#x2F;&#x2F;github.com&#x2F;DursleyGuy.png" width="60px" alt="User avatar: DursleyGuy" /></a><a href="https://github.com/realmuddy"><img src="https:&#x2F;&#x2F;github.com&#x2F;realmuddy.png" width="60px" alt="User avatar: Phillip Waters" /></a><a href="https://github.com/quaszi"><img src="https:&#x2F;&#x2F;github.com&#x2F;quaszi.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/DwayneTheRockLobster1"><img src="https:&#x2F;&#x2F;github.com&#x2F;DwayneTheRockLobster1.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/KieraKujisawa"><img src="https:&#x2F;&#x2F;github.com&#x2F;KieraKujisawa.png" width="60px" alt="User avatar: Kiera Meredith" /></a><a href="https://github.com/felicabrera"><img src="https:&#x2F;&#x2F;github.com&#x2F;felicabrera.png" width="60px" alt="User avatar: Felipe Cabrera" /></a><a href="https://github.com/singhchandan27"><img src="https:&#x2F;&#x2F;github.com&#x2F;singhchandan27.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/danhively"><img src="https:&#x2F;&#x2F;github.com&#x2F;danhively.png" width="60px" alt="User avatar: Dan Hively" /></a><a href="https://github.com/Yamil-Serrano"><img src="https:&#x2F;&#x2F;github.com&#x2F;Yamil-Serrano.png" width="60px" alt="User avatar: Neowizen" /></a><!-- sponsors -->
<!-- sponsors --><a href="https://github.com/TriHydera"><img src="https:&#x2F;&#x2F;github.com&#x2F;TriHydera.png" width="60px" alt="User avatar: TriHydera" /></a><a href="https://github.com/DelDongo"><img src="https:&#x2F;&#x2F;github.com&#x2F;DelDongo.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/markamos"><img src="https:&#x2F;&#x2F;github.com&#x2F;markamos.png" width="60px" alt="User avatar: Mark Amos" /></a><a href="https://github.com/dwelfusius"><img src="https:&#x2F;&#x2F;github.com&#x2F;dwelfusius.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/mews-se"><img src="https:&#x2F;&#x2F;github.com&#x2F;mews-se.png" width="60px" alt="User avatar: Martin Stockzell" /></a><a href="https://github.com/jdiegmueller"><img src="https:&#x2F;&#x2F;github.com&#x2F;jdiegmueller.png" width="60px" alt="User avatar: Jason A. Diegmueller" /></a><a href="https://github.com/robertsandrock"><img src="https:&#x2F;&#x2F;github.com&#x2F;robertsandrock.png" width="60px" alt="User avatar: RMS" /></a><a href="https://github.com/KenichiQaz"><img src="https:&#x2F;&#x2F;github.com&#x2F;KenichiQaz.png" width="60px" alt="User avatar: Stefan" /></a><a href="https://github.com/paulsheets"><img src="https:&#x2F;&#x2F;github.com&#x2F;paulsheets.png" width="60px" alt="User avatar: Paul" /></a><a href="https://github.com/djones369"><img src="https:&#x2F;&#x2F;github.com&#x2F;djones369.png" width="60px" alt="User avatar: Dave J. - WhamGeek" /></a><a href="https://github.com/anthonymendez"><img src="https:&#x2F;&#x2F;github.com&#x2F;anthonymendez.png" width="60px" alt="User avatar: Anthony Mendez" /></a><a href="https://github.com/FatBastard0"><img src="https:&#x2F;&#x2F;github.com&#x2F;FatBastard0.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/DursleyGuy"><img src="https:&#x2F;&#x2F;github.com&#x2F;DursleyGuy.png" width="60px" alt="User avatar: DursleyGuy" /></a><a href="https://github.com/realmuddy"><img src="https:&#x2F;&#x2F;github.com&#x2F;realmuddy.png" width="60px" alt="User avatar: Phillip Waters" /></a><a href="https://github.com/quaszi"><img src="https:&#x2F;&#x2F;github.com&#x2F;quaszi.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/DwayneTheRockLobster1"><img src="https:&#x2F;&#x2F;github.com&#x2F;DwayneTheRockLobster1.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/KieraKujisawa"><img src="https:&#x2F;&#x2F;github.com&#x2F;KieraKujisawa.png" width="60px" alt="User avatar: Kiera Meredith" /></a><a href="https://github.com/danhively"><img src="https:&#x2F;&#x2F;github.com&#x2F;danhively.png" width="60px" alt="User avatar: Dan Hively" /></a><!-- sponsors -->
## 🏅 Thanks to all Contributors
Thanks a lot for spending your time helping Winutil grow. Thanks a lot! Keep rocking 🍻.

View File

@ -32,6 +32,7 @@
"ButtonFontFamily": "Arial",
"ButtonWidth": "200",
"ButtonHeight": "25",
"ConfigTabButtonFontSize": "14",
"ConfigUpdateButtonFontSize": "14",
"SearchBarWidth": "200",
"SearchBarHeight": "26",

View File

@ -1585,13 +1585,6 @@
"Type": "DWord",
"Value": "0",
"OriginalValue": "<RemoveEntry>"
},
{
"Path": "HKLM:\\SOFTWARE\\Policies\\BraveSoftware\\Brave",
"Name": "SyncDisabled",
"Type": "DWord",
"Value": "1",
"OriginalValue": "<RemoveEntry>"
}
]
},

View File

@ -58,6 +58,9 @@ public class PowerManagement {
$injectDrivers = $sync.MicrowinInjectDrivers.IsChecked
$importDrivers = $sync.MicrowinImportDrivers.IsChecked
$WPBT = $sync.MicroWinWPBT.IsChecked
$unsupported = $sync.MicroWinUnsupported.IsChecked
$importVirtIO = $sync.MicrowinCopyVirtIO.IsChecked
$mountDir = $sync.MicrowinMountDir.Text
@ -66,7 +69,12 @@ public class PowerManagement {
# Detect if the Windows image is an ESD file and convert it to WIM
if (-not (Test-Path -Path "$mountDir\sources\install.wim" -PathType Leaf) -and (Test-Path -Path "$mountDir\sources\install.esd" -PathType Leaf)) {
Write-Host "Exporting Windows image to a WIM file, keeping the index we want to work on. This can take several minutes, depending on the performance of your computer..."
Export-WindowsImage -SourceImagePath $mountDir\sources\install.esd -SourceIndex $index -DestinationImagePath $mountDir\sources\install.wim -CompressionType "Max"
try {
Export-WindowsImage -SourceImagePath "$mountDir\sources\install.esd" -SourceIndex $index -DestinationImagePath "$mountDir\sources\install.wim" -CompressionType "Max"
} catch {
# Usually the case if it can't find unattend.dll on the host system. Guys, fix your corrupt messes that are your installations!
dism /english /export-image /sourceimagefile="$mountDir\sources\install.esd" /sourceindex=$index /destinationimagefile="$mountDir\sources\install.wim" /compress:max
}
if ($?) {
Remove-Item -Path "$mountDir\sources\install.esd" -Force
# Since we've already exported the image index we wanted, switch to the first one
@ -166,6 +174,25 @@ public class PowerManagement {
}
}
if ($WPBT) {
Write-Host "Disabling WPBT Execution"
reg load HKLM\zSYSTEM "$($scratchDir)\Windows\System32\config\SYSTEM"
reg add "HKLM\zSYSTEM\ControlSet001\Control\Session Manager" /v DisableWpbtExecution /t REG_DWORD /d 1 /f
reg unload HKLM\zSYSTEM
}
if ($unsupported) {
Write-Host "Bypassing system requirements (locally)"
reg add "HKCU\Control Panel\UnsupportedHardwareNotificationCache" /v "SV1" /t REG_DWORD /d 0 /f
reg add "HKCU\Control Panel\UnsupportedHardwareNotificationCache" /v "SV2" /t REG_DWORD /d 0 /f
reg add "HKLM\SYSTEM\Setup\LabConfig" /v "BypassCPUCheck" /t REG_DWORD /d 1 /f
reg add "HKLM\SYSTEM\Setup\LabConfig" /v "BypassRAMCheck" /t REG_DWORD /d 1 /f
reg add "HKLM\SYSTEM\Setup\LabConfig" /v "BypassSecureBootCheck" /t REG_DWORD /d 1 /f
reg add "HKLM\SYSTEM\Setup\LabConfig" /v "BypassStorageCheck" /t REG_DWORD /d 1 /f
reg add "HKLM\SYSTEM\Setup\LabConfig" /v "BypassTPMCheck" /t REG_DWORD /d 1 /f
reg add "HKLM\SYSTEM\Setup\MoSetup" /v "AllowUpgradesWithUnsupportedTPMOrCPU" /t REG_DWORD /d 1 /f
}
if ($importVirtIO) {
Write-Host "Copying VirtIO drivers..."
Microwin-CopyVirtIO
@ -221,6 +248,20 @@ public class PowerManagement {
Write-Host "Create unattend.xml"
if (($sync.MicrowinAutoConfigBox.Text -ne "") -and (Test-Path "$($sync.MicrowinAutoConfigBox.Text)"))
{
try
{
Write-Host "A configuration file has been specified. Copying to WIM file..."
Copy-Item "$($sync.MicrowinAutoConfigBox.Text)" "$($scratchDir)\winutil-config.json"
}
catch
{
Write-Host "The config file could not be copied. Continuing without it..."
}
}
# Create unattended answer file with user information - Check condition to learn more about this functionality
if ($sync.MicrowinUserName.Text -eq "")
{
Microwin-NewUnattend -userName "User"
@ -242,7 +283,6 @@ public class PowerManagement {
Copy-Item "$env:temp\unattend.xml" "$($scratchDir)\Windows\Panther\unattend.xml" -force
New-Item -ItemType Directory -Force -Path "$($scratchDir)\Windows\System32\Sysprep"
Copy-Item "$env:temp\unattend.xml" "$($scratchDir)\Windows\System32\Sysprep\unattend.xml" -force
Copy-Item "$env:temp\unattend.xml" "$($scratchDir)\unattend.xml" -force
Write-Host "Done Copy unattend.xml"
Write-Host "Create FirstRun"
@ -277,7 +317,6 @@ public class PowerManagement {
reg add "HKLM\zSOFTWARE\Policies\Microsoft\Windows\Windows Chat" /v ChatIcon /t REG_DWORD /d 2 /f >$null 2>&1
reg add "HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "TaskbarMn" /t REG_DWORD /d 0 /f >$null 2>&1
reg query "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Communications" /v "ConfigureChatAutoInstall" >$null 2>&1
# Write-Host Error code $LASTEXITCODE
Write-Host "Done disabling Teams"
Write-Host "Fix Windows Volume Mixer Issue"
@ -304,11 +343,6 @@ public class PowerManagement {
'CrossDeviceUpdate'
) | ForEach-Object {
Write-Host "Removing Windows Expedited App: $_"
# Copied here After Installation (Online)
# reg delete "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Orchestrator\UScheduler\$_" /f | Out-Null
# When in Offline Image
reg delete "HKLM\zSOFTWARE\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe\$_" /f | Out-Null
}
}
@ -316,7 +350,6 @@ public class PowerManagement {
reg add "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v "SearchboxTaskbarMode" /t REG_DWORD /d 0 /f
Write-Host "Setting all services to start manually"
reg add "HKLM\zSOFTWARE\CurrentControlSet\Services" /v Start /t REG_DWORD /d 3 /f
# Write-Host $LASTEXITCODE
Write-Host "Enabling Local Accounts on OOBE"
reg add "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\OOBE" /v "BypassNRO" /t REG_DWORD /d "1" /f
@ -371,7 +404,12 @@ public class PowerManagement {
try {
Write-Host "Exporting image into $mountDir\sources\install2.wim"
Export-WindowsImage -SourceImagePath "$mountDir\sources\install.wim" -SourceIndex $index -DestinationImagePath "$mountDir\sources\install2.wim" -CompressionType "Max"
try {
Export-WindowsImage -SourceImagePath "$mountDir\sources\install.wim" -SourceIndex $index -DestinationImagePath "$mountDir\sources\install2.wim" -CompressionType "Max"
} catch {
# Usually the case if it can't find unattend.dll on the host system. Guys, fix your corrupt messes that are your installations!
dism /english /export-image /sourceimagefile="$mountDir\sources\install.wim" /sourceindex=$index /destinationimagefile="$mountDir\sources\install2.wim" /compress:max
}
Write-Host "Remove old '$mountDir\sources\install.wim' and rename $mountDir\sources\install2.wim"
Remove-Item "$mountDir\sources\install.wim"
Rename-Item "$mountDir\sources\install2.wim" "$mountDir\sources\install.wim"
@ -385,6 +423,20 @@ public class PowerManagement {
}
Write-Host "Windows image completed. Continuing with boot.wim."
$esd = $sync.MicroWinESD.IsChecked
if ($esd) {
Write-Host "Converting install image to ESD."
try {
Export-WindowsImage -SourceImagePath "$mountDir\sources\install.wim" -SourceIndex $index -DestinationImagePath "$mountDir\sources\install.esd" -CompressionType "Recovery"
Remove-Item "$mountDir\sources\install.wim"
Write-Host "Converted install image to ESD."
} catch {
Start-Process -FilePath "$env:SystemRoot\System32\dism.exe" -ArgumentList "/export-image /sourceimagefile:`"$mountDir\sources\install.wim`" /sourceindex:1 /destinationimagefile:`"$mountDir\sources\install.esd`" /compress:recovery" -Wait -NoNewWindow
Remove-Item "$mountDir\sources\install.wim"
Write-Host "Converted install image to ESD."
}
}
# Next step boot image
Write-Host "Mounting boot image $mountDir\sources\boot.wim into $scratchDir"
Mount-WindowsImage -ImagePath "$mountDir\sources\boot.wim" -Index 2 -Path "$scratchDir"
@ -481,6 +533,7 @@ public class PowerManagement {
Write-Host "Reason: $($exitCode.Message)"
Invoke-MicrowinBusyInfo -action "warning" -message $exitCode.Message
Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning"
[System.Windows.MessageBox]::Show("MicroWin failed to make the ISO.", "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Error)
} catch {
# Could not get error description from Windows APIs
}
@ -488,7 +541,6 @@ public class PowerManagement {
Toggle-MicrowinPanel 1
#$sync.MicrowinFinalIsoLocation.Text = "$env:temp\microwin.iso"
$sync.MicrowinFinalIsoLocation.Text = "$($SaveDialog.FileName)"
# Allow the machine to sleep again (optional)
[PowerManagement]::SetThreadExecutionState(0)

View File

@ -85,6 +85,14 @@ function Microwin-NewFirstRun {
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.StartupApp" /v Enabled /t REG_DWORD /d 0 /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Microsoft.SkyDrive.Desktop" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Microsoft.SkyDrive.Desktop" /v Enabled /t REG_DWORD /d 0 /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.AccountHealth" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.AccountHealth" /v Enabled /t REG_DWORD /d 0 /f
if (Test-Path -Path "$env:HOMEDRIVE\winutil-config.json")
{
Write-Host "Configuration file detected. Applying..."
iex "& { $(irm christitus.com/win) } -Config `"$env:HOMEDRIVE\winutil-config.json`" -Run"
}
'@
$firstRun | Out-File -FilePath "$env:temp\FirstStartup.ps1" -Force

View File

@ -52,6 +52,10 @@ function Install-WinUtilWinget {
# Check if Windows version supports Repair-WinGetPackageManager (24H2 and above)
if ([System.Environment]::OSVersion.Version.Build -ge 26100) {
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
Install-Module "Microsoft.WinGet.Client" -Force
Import-Module Microsoft.WinGet.Client
Repair-WinGetPackageManager -Force -Latest -Verbose
# Verify if repair was successful
$wingetCmd = Get-Command winget -ErrorAction Stop

View File

@ -25,10 +25,12 @@ function Invoke-WinUtilFontScaling {
# Define an array for resources to be scaled
$fontResources = @(
# Fonts
"FontSize",
"ButtonFontSize",
"HeaderFontSize",
"TabButtonFontSize",
"ConfigTabButtonFontSize",
"IconFontSize",
"SettingsIconFontSize",
"CloseIconFontSize",
@ -38,7 +40,21 @@ function Invoke-WinUtilFontScaling {
"CustomDialogFontSize",
"CustomDialogFontSizeHeader",
"ConfigUpdateButtonFontSize",
"CheckBoxBulletDecoratorSize"
# Buttons and UI
"CheckBoxBulletDecoratorSize",
"ButtonWidth",
"ButtonHeight",
"TabButtonWidth",
"TabButtonHeight",
"IconButtonSize",
"AppEntryWidth",
"SearchBarWidth",
"SearchBarHeight",
"CustomDialogWidth",
"CustomDialogHeight",
"CustomDialogLogoSize",
"MicroWinLogoSize",
"ToolTipWidth"
)
# Apply scaling to each resource

View File

@ -0,0 +1,24 @@
function Invoke-AutoConfigDialog {
<#
.SYNOPSIS
Sets the automatic configuration file based on a specified JSON file
#>
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null
$OFD = New-Object System.Windows.Forms.OpenFileDialog
$OFD.Filter = "JSON Files (*.json)|*.json"
$OFD.ShowDialog()
if (($OFD.FileName -eq "") -and ($sync.MicrowinAutoConfigBox.Text -eq ""))
{
Write-Host "No automatic config file has been selected. Continuing without one..."
return
}
elseif ($OFD.FileName -ne "")
{
$sync.MicrowinAutoConfigBox.Text = "$($OFD.FileName)"
}
}

View File

@ -64,5 +64,6 @@ function Invoke-WPFButton {
"WPFWinUtilSSHServer" {Invoke-WPFSSHServer}
"WPFselectedAppsButton" {$sync.selectedAppsPopup.IsOpen = -not $sync.selectedAppsPopup.IsOpen}
"WPFMicrowinPanelBack" {Toggle-MicrowinPanel 1}
"MicrowinAutoConfigBtn" {Invoke-AutoConfigDialog}
}
}

View File

@ -67,7 +67,6 @@ function Invoke-WPFInstall {
$password = $passwordBox.Text | ConvertTo-SecureString -AsPlainText -Force
if ($password) {
Set-LocalUser -Name $user -Password $password
$password.Close()
$Form.Close()
} else {
[System.Windows.Forms.MessageBox]::Show('No password entered!')

View File

@ -5,6 +5,9 @@ function Invoke-WPFUpdatesdefault {
Resets Windows Update settings to default
#>
Write-Host "Restoring Windows Update registry settings..." -ForegroundColor Yellow
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Force | Out-Null
}
@ -15,17 +18,99 @@ function Invoke-WPFUpdatesdefault {
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 1
# Reset WaaSMedicSvc registry settings to defaults
Write-Host "Restoring WaaSMedicSvc settings..." -ForegroundColor Yellow
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\WaaSMedicSvc" -Name "Start" -Type DWord -Value 3 -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\WaaSMedicSvc" -Name "FailureActions" -ErrorAction SilentlyContinue
# Restore update services to their default state
Write-Host "Restoring update services..." -ForegroundColor Yellow
$services = @(
"BITS"
"wuauserv"
@{Name = "BITS"; StartupType = "Manual"},
@{Name = "wuauserv"; StartupType = "Manual"},
@{Name = "UsoSvc"; StartupType = "Automatic"},
@{Name = "uhssvc"; StartupType = "Disabled"},
@{Name = "WaaSMedicSvc"; StartupType = "Manual"}
)
foreach ($service in $services) {
# -ErrorAction SilentlyContinue is so it doesn't write an error to stdout if a service doesn't exist
Write-Host "Setting $service StartupType to Automatic"
Get-Service -Name $service -ErrorAction SilentlyContinue | Set-Service -StartupType Automatic
try {
Write-Host "Restoring $($service.Name) to $($service.StartupType)..."
$serviceObj = Get-Service -Name $service.Name -ErrorAction SilentlyContinue
if ($serviceObj) {
Set-Service -Name $service.Name -StartupType $service.StartupType -ErrorAction SilentlyContinue
# Reset failure actions to default using sc command
Start-Process -FilePath "sc.exe" -ArgumentList "failure `"$($service.Name)`" reset= 86400 actions= restart/60000/restart/60000/restart/60000" -Wait -WindowStyle Hidden -ErrorAction SilentlyContinue
# Start the service if it should be running
if ($service.StartupType -eq "Automatic") {
Start-Service -Name $service.Name -ErrorAction SilentlyContinue
}
}
}
catch {
Write-Host "Warning: Could not restore service $($service.Name) - $($_.Exception.Message)" -ForegroundColor Yellow
}
}
# Restore renamed DLLs if they exist
Write-Host "Restoring renamed update service DLLs..." -ForegroundColor Yellow
$dlls = @("WaaSMedicSvc", "wuaueng")
foreach ($dll in $dlls) {
$dllPath = "C:\Windows\System32\$dll.dll"
$backupPath = "C:\Windows\System32\${dll}_BAK.dll"
if ((Test-Path $backupPath) -and !(Test-Path $dllPath)) {
try {
# Take ownership of backup file
Start-Process -FilePath "takeown.exe" -ArgumentList "/f `"$backupPath`"" -Wait -WindowStyle Hidden -ErrorAction SilentlyContinue
# Grant full control to everyone
Start-Process -FilePath "icacls.exe" -ArgumentList "`"$backupPath`" /grant *S-1-1-0:F" -Wait -WindowStyle Hidden -ErrorAction SilentlyContinue
# Rename back to original
Rename-Item -Path $backupPath -NewName "$dll.dll" -ErrorAction SilentlyContinue
Write-Host "Restored ${dll}_BAK.dll to $dll.dll"
# Restore ownership to TrustedInstaller
Start-Process -FilePath "icacls.exe" -ArgumentList "`"$dllPath`" /setowner `"NT SERVICE\TrustedInstaller`"" -Wait -WindowStyle Hidden -ErrorAction SilentlyContinue
Start-Process -FilePath "icacls.exe" -ArgumentList "`"$dllPath`" /remove *S-1-1-0" -Wait -WindowStyle Hidden -ErrorAction SilentlyContinue
}
catch {
Write-Host "Warning: Could not restore $dll.dll - $($_.Exception.Message)" -ForegroundColor Yellow
}
}
}
# Enable update related scheduled tasks
Write-Host "Enabling update related scheduled tasks..." -ForegroundColor Yellow
$taskPaths = @(
'\Microsoft\Windows\InstallService\*'
'\Microsoft\Windows\UpdateOrchestrator\*'
'\Microsoft\Windows\UpdateAssistant\*'
'\Microsoft\Windows\WaaSMedic\*'
'\Microsoft\Windows\WindowsUpdate\*'
'\Microsoft\WindowsUpdate\*'
)
foreach ($taskPath in $taskPaths) {
try {
$tasks = Get-ScheduledTask -TaskPath $taskPath -ErrorAction SilentlyContinue
foreach ($task in $tasks) {
Enable-ScheduledTask -TaskName $task.TaskName -TaskPath $task.TaskPath -ErrorAction SilentlyContinue
Write-Host "Enabled task: $($task.TaskName)"
}
}
catch {
Write-Host "Warning: Could not enable tasks in path $taskPath - $($_.Exception.Message)" -ForegroundColor Yellow
}
}
Write-Host "Enabling driver offering through Windows Update..."
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata" -Name "PreventDeviceMetadataFromNetwork" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DontPromptForWindowsUpdate" -ErrorAction SilentlyContinue
@ -39,6 +124,7 @@ function Invoke-WPFUpdatesdefault {
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "BranchReadinessLevel" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "DeferFeatureUpdatesPeriodInDays" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "DeferQualityUpdatesPeriodInDays" -ErrorAction SilentlyContinue
Write-Host "==================================================="
Write-Host "--- Windows Update Settings Reset to Default ---"
Write-Host "==================================================="
@ -62,4 +148,6 @@ function Invoke-WPFUpdatesdefault {
Write-Host "==================================================="
Write-Host "--- Windows Local Policies Reset to Default ---"
Write-Host "==================================================="
Write-Host "Note: A system restart may be required for all changes to take full effect." -ForegroundColor Yellow
}

View File

@ -6,30 +6,130 @@ function Invoke-WPFUpdatesdisable {
.NOTES
Disabling Windows Update is not recommended. This is only for advanced users who know what they are doing.
This function requires administrator privileges and will attempt to run as SYSTEM for certain operations.
#>
Write-Host "Configuring registry settings..." -ForegroundColor Yellow
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoUpdate" -Type DWord -Value 1
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUOptions" -Type DWord -Value 1
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config")) {
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 0
# Additional registry settings
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\WaaSMedicSvc" -Name "Start" -Type DWord -Value 4 -ErrorAction SilentlyContinue
$failureActions = [byte[]](0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xd4,0x01,0x00,0x00,0x00,0x00,0x00,0xe0,0x93,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00)
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\WaaSMedicSvc" -Name "FailureActions" -Type Binary -Value $failureActions -ErrorAction SilentlyContinue
# Disable and stop update related services
Write-Host "Disabling update services..." -ForegroundColor Yellow
$services = @(
"BITS"
"wuauserv"
"UsoSvc"
"uhssvc"
"WaaSMedicSvc"
)
foreach ($service in $services) {
# -ErrorAction SilentlyContinue is so it doesn't write an error to stdout if a service doesn't exist
Write-Host "Setting $service StartupType to Disabled"
Get-Service -Name $service -ErrorAction SilentlyContinue | Set-Service -StartupType Disabled
try {
Write-Host "Stopping and disabling $service..."
$serviceObj = Get-Service -Name $service -ErrorAction SilentlyContinue
if ($serviceObj) {
Stop-Service -Name $service -Force -ErrorAction SilentlyContinue
Set-Service -Name $service -StartupType Disabled -ErrorAction SilentlyContinue
# Set failure actions to nothing using sc command
Start-Process -FilePath "sc.exe" -ArgumentList "failure `"$service`" reset= 0 actions= `"`"" -Wait -WindowStyle Hidden -ErrorAction SilentlyContinue
}
}
catch {
Write-Host "Warning: Could not process service $service - $($_.Exception.Message)" -ForegroundColor Yellow
}
}
Write-Host "================================="
Write-Host "--- Updates ARE DISABLED ---"
Write-Host "================================="
# Rename critical update service DLLs (requires SYSTEM privileges)
Write-Host "Attempting to rename critical update service DLLs..." -ForegroundColor Yellow
$dlls = @("WaaSMedicSvc", "wuaueng")
foreach ($dll in $dlls) {
$dllPath = "C:\Windows\System32\$dll.dll"
$backupPath = "C:\Windows\System32\${dll}_BAK.dll"
if (Test-Path $dllPath) {
try {
# Take ownership
Start-Process -FilePath "takeown.exe" -ArgumentList "/f `"$dllPath`"" -Wait -WindowStyle Hidden -ErrorAction SilentlyContinue
# Grant full control to everyone
Start-Process -FilePath "icacls.exe" -ArgumentList "`"$dllPath`" /grant *S-1-1-0:F" -Wait -WindowStyle Hidden -ErrorAction SilentlyContinue
# Rename file
if (!(Test-Path $backupPath)) {
Rename-Item -Path $dllPath -NewName "${dll}_BAK.dll" -ErrorAction SilentlyContinue
Write-Host "Renamed $dll.dll to ${dll}_BAK.dll"
# Restore ownership to TrustedInstaller
Start-Process -FilePath "icacls.exe" -ArgumentList "`"$backupPath`" /setowner `"NT SERVICE\TrustedInstaller`"" -Wait -WindowStyle Hidden -ErrorAction SilentlyContinue
Start-Process -FilePath "icacls.exe" -ArgumentList "`"$backupPath`" /remove *S-1-1-0" -Wait -WindowStyle Hidden -ErrorAction SilentlyContinue
}
}
catch {
Write-Host "Warning: Could not rename $dll.dll - $($_.Exception.Message)" -ForegroundColor Yellow
}
}
}
# Delete downloaded update files
Write-Host "Cleaning up downloaded update files..." -ForegroundColor Yellow
try {
$softwareDistPath = "C:\Windows\SoftwareDistribution"
if (Test-Path $softwareDistPath) {
Get-ChildItem -Path $softwareDistPath -Recurse -Force | Remove-Item -Force -Recurse -ErrorAction SilentlyContinue
Write-Host "Cleared SoftwareDistribution folder"
}
}
catch {
Write-Host "Warning: Could not fully clear SoftwareDistribution folder - $($_.Exception.Message)" -ForegroundColor Yellow
}
# Disable update related scheduled tasks
Write-Host "Disabling update related scheduled tasks..." -ForegroundColor Yellow
$taskPaths = @(
'\Microsoft\Windows\InstallService\*'
'\Microsoft\Windows\UpdateOrchestrator\*'
'\Microsoft\Windows\UpdateAssistant\*'
'\Microsoft\Windows\WaaSMedic\*'
'\Microsoft\Windows\WindowsUpdate\*'
'\Microsoft\WindowsUpdate\*'
)
foreach ($taskPath in $taskPaths) {
try {
$tasks = Get-ScheduledTask -TaskPath $taskPath -ErrorAction SilentlyContinue
foreach ($task in $tasks) {
Disable-ScheduledTask -TaskName $task.TaskName -TaskPath $task.TaskPath -ErrorAction SilentlyContinue
Write-Host "Disabled task: $($task.TaskName)"
}
}
catch {
Write-Host "Warning: Could not disable tasks in path $taskPath - $($_.Exception.Message)" -ForegroundColor Yellow
}
}
Write-Host "=================================" -ForegroundColor Green
Write-Host "--- Updates ARE DISABLED ---" -ForegroundColor Green
Write-Host "===================================" -ForegroundColor Green
Write-Host "Note: Some operations may require a system restart to take full effect." -ForegroundColor Yellow
}

View File

@ -315,33 +315,40 @@ $sync["Form"].Add_ContentRendered({
# maybe this is not the best place to load and execute config file?
# maybe community can help?
if ($PARAM_CONFIG) {
if ($PARAM_CONFIG -and -not [string]::IsNullOrWhiteSpace($PARAM_CONFIG)) {
Invoke-WPFImpex -type "import" -Config $PARAM_CONFIG
if ($PARAM_RUN) {
# Wait for any existing process to complete before starting
while ($sync.ProcessRunning) {
Start-Sleep -Seconds 5
}
Start-Sleep -Seconds 5
Write-Host "Applying tweaks..."
Invoke-WPFtweaksbutton
while ($sync.ProcessRunning) {
Start-Sleep -Seconds 5
if (-not $sync.ProcessRunning) {
Invoke-WPFtweaksbutton
while ($sync.ProcessRunning) {
Start-Sleep -Seconds 5
}
}
Start-Sleep -Seconds 5
Write-Host "Installing features..."
Invoke-WPFFeatureInstall
while ($sync.ProcessRunning) {
Start-Sleep -Seconds 5
if (-not $sync.ProcessRunning) {
Invoke-WPFFeatureInstall
while ($sync.ProcessRunning) {
Start-Sleep -Seconds 5
}
}
Start-Sleep -Seconds 5
Write-Host "Installing applications..."
while ($sync.ProcessRunning) {
Start-Sleep -Seconds 1
if (-not $sync.ProcessRunning) {
Invoke-WPFInstall
while ($sync.ProcessRunning) {
Start-Sleep -Seconds 1
}
}
Invoke-WPFInstall
Start-Sleep -Seconds 5
Write-Host "Done."
@ -481,7 +488,7 @@ $sync["AboutMenuItem"].Add_Click({
Author : <a href="https://github.com/ChrisTitusTech">@christitustech</a>
UI : <a href="https://github.com/MyDrift-user">@MyDrift-user</a>, <a href="https://github.com/Marterich">@Marterich</a>
Runspace : <a href="https://github.com/DeveloperDurp">@DeveloperDurp</a>, <a href="https://github.com/Marterich">@Marterich</a>
MicroWin : <a href="https://github.com/KonTy">@KonTy</a>, <a href="https://github.com/CodingWonders">@CodingWonders</a>
MicroWin : <a href="https://github.com/KonTy">@KonTy</a>, <a href="https://github.com/CodingWonders">@CodingWonders</a>, <a href="https://github.com/Real-MullaC">@Real-MullaC</a>
GitHub : <a href="https://github.com/ChrisTitusTech/winutil">ChrisTitusTech/winutil</a>
Version : <a href="https://github.com/ChrisTitusTech/winutil/releases/tag/$($sync.version)">$($sync.version)</a>
"@

View File

@ -1459,6 +1459,37 @@
Foreground="{DynamicResource LabelboxForegroundColor}"
/>
<Rectangle Fill="{DynamicResource MainForegroundColor}" Height="2" HorizontalAlignment="Stretch" Margin="0,10,0,10"/>
<TextBlock Margin="6" Padding="1" TextWrapping="Wrap"><Bold>Tweaks (leave empty for default settings)</Bold></TextBlock>
<CheckBox Name="MicroWinWPBT" Margin="{DynamicResource MicrowinCheckBoxMargin}" IsChecked="False" ToolTip="If enabled then allows your computer vendor to execute a program each time it boots. It enables computer vendors to force install anti-theft software, software drivers, or a software program conveniently. This could also be a security risk."><AccessText TextWrapping="Wrap" Text="Disable Windows Platform Binary Table (WPBT) (ADVANCED TWEAK)" /></CheckBox>
<CheckBox Name="MicroWinUnsupported" Margin="{DynamicResource MicrowinCheckBoxMargin}" IsChecked="False" ToolTip="If enabled then it will allow you to upgrade your PC to Windows 11 if your PC does not support Windows 11 yet. This is good for if you do not have a USB and want to upgrade to Windows 11 on unsupported hardware."><AccessText TextWrapping="Wrap" Text="Allow this PC to upgrade to Windows 11" /></CheckBox>
<CheckBox Name="MicroWinESD" Margin="{DynamicResource MicrowinCheckBoxMargin}" IsChecked="False" ToolTip="The ESD file format compresses the installation image even further, therefore reducing ISO file sizes a little more. Select this if you have a small USB."><AccessText TextWrapping="Wrap" Text="Convert this image to ESD (This will take longer)" /></CheckBox>
<TextBlock Margin="6" Padding="1" TextWrapping="Wrap">WinUtil configuration file (JSON)</TextBlock>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" /> <!-- Takes the remaining space -->
<ColumnDefinition Width="32" /> <!-- Fixed width for Button -->
</Grid.ColumnDefinitions>
<TextBox Name="MicrowinAutoConfigBox" Background="Transparent" BorderBrush="{DynamicResource MainForegroundColor}"
Text=""
Margin="2"
IsReadOnly="False"
Grid.Column="0"
ToolTip="Path of your configuration file"
VerticalAlignment="Center"
Foreground="{DynamicResource LabelboxForegroundColor}">
</TextBox>
<Button Name="MicrowinAutoConfigBtn"
Width="Auto"
Height="Auto"
Grid.Column="1"
Margin="2"
Padding="1" VerticalAlignment="Center">
<Button.Content>
...
</Button.Content>
</Button>
</Grid>
<Rectangle Fill="{DynamicResource MainForegroundColor}" Height="2" HorizontalAlignment="Stretch" Margin="0,10,0,10"/>
<Button Name="WPFMicrowin" Content="Start the process" Margin="2" Padding="15"/>
</StackPanel>
<StackPanel HorizontalAlignment="Left" SnapsToDevicePixels="True" Margin="1" Visibility="Collapsed">
@ -1527,7 +1558,7 @@
May take several minutes to process the ISO depending on your machine and connection <LineBreak/>
- Put it somewhere on the C:\ drive so it is easily accessible <LineBreak/>
- Launch WinUtil and MicroWin <LineBreak/>
- Click on the "Select Windows ISO" button and wait for WinUtil to process the image <LineBreak/>
- Click on the "Get Windows ISO" button and wait for WinUtil to process the image <LineBreak/>
It will be processed and unpacked which may take some time <LineBreak/>
- Once complete, choose which Windows flavor you want to base your image on <LineBreak/>
- Click the "Start Process" button <LineBreak/>