Compare commits

...

43 Commits

Author SHA1 Message Date
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
01c8739a8b Update applications.json (#3533) 2025-08-04 14:42:12 -05:00
9ce598fbeb Updated Python Version to Latest (#3509)
Updated the list so that Python 3.13 is installed instead of Python 3.12
2025-08-01 11:35:39 -05:00
965d9e0394 Add scaling functionality for accessibility (#3505) 2025-08-01 11:34:00 -05:00
2b9e277b10 minor fixes 2025-08-01 11:29:10 -05:00
5144551b52 Update to Razer tweak + comments updates (#3482)
* Update to Razer tweak + comments updates

* Add hyphen for Wi-Fi
2025-08-01 10:58:46 -05:00
91ab12dd7f [Tweaks] Cross Device Resume (#3480) 2025-08-01 10:56:22 -05:00
fdee2ea898 Updates to the "Disable Telemetry" tweak (#3465)
* Updates to the "Disable Telemetry" tweak

* Update OriginalValue for DeliveryOptimization policy
2025-08-01 10:55:04 -05:00
5ebd27da7e [Toggle] add New Outlook Toggle (#3439)
* add WPFToggleNewOutlook

* fix link

---------

Co-authored-by: Chris Titus <contact@christitus.com>
2025-08-01 10:48:18 -05:00
f6030eec0b add WPFToggleMultiplaneOverlay Toggle (#3438) 2025-08-01 10:42:18 -05:00
9403b95067 [Legacy Panel] TIMEDATE (#3432)
* add TIMEDATE.cpl Panel

* Fix standardization

---------

Co-authored-by: Chris Titus <contact@christitus.com>
Co-authored-by: Chris Titus Tech <dfm.titus@gmail.com>
2025-08-01 10:40:35 -05:00
cdd43f5e36 Fixing the Credentials system. (#3390)
* Checks if password exists for the user, if it doesn't the user is prompted to create one.

It checks if the password is equal to $null using `ValidateCredentials` and if it isn't the variable will be created. If it is equal to $null, a window with text, a textbox and a button will appear asking the user to create a password. That password is then set for the user and the winget installation continues.

* Made this a little more secure

Securing the password variable when it gets created and deleting it after it's done being used.

* Forces the user to input their password and automatically puts their username into the credentials box

* Removed the second greater than 0 check
2025-08-01 10:13:33 -05:00
cae497b2fe Deploying to main from @ ChrisTitusTech/winutil@c740186232 🚀 2025-07-30 15:36:29 +00:00
c740186232 Deploying to main from @ ChrisTitusTech/winutil@e6263afb59 🚀 2025-07-25 15:35:36 +00:00
e6263afb59 Deploying to main from @ ChrisTitusTech/winutil@122a07d71b 🚀 2025-07-24 15:35:12 +00:00
122a07d71b Update applications.json 2025-07-23 20:14:45 -05:00
a669c455eb Deploying to main from @ ChrisTitusTech/winutil@c983ec2253 🚀 2025-07-18 15:35:13 +00:00
c983ec2253 Deploying to main from @ ChrisTitusTech/winutil@aec16d84ab 🚀 2025-07-10 15:35:57 +00:00
aec16d84ab Deploying to main from @ ChrisTitusTech/winutil@ba951244d9 🚀 2025-07-07 15:34:45 +00:00
ba951244d9 Deploying to main from @ ChrisTitusTech/winutil@9d3c7736b8 🚀 2025-07-04 15:34:05 +00:00
9d3c7736b8 Update README.md (#3466)
corrected typo easiler -> easier
2025-07-02 11:25:23 -05:00
cea4e088cf [Tweaks] Updated Copilot Removal (#3459)
* feat(copilot): update removal and installation for Copilot

* feat(copilot): registry entry to disable user eligibility

* fix indentation
2025-06-26 14:17:53 -05:00
32a4311901 expand disable recall and smart app off 2025-06-26 14:12:32 -05:00
ff95b35f24 refactor(tweaks): separate removal of Home and Gallery from explorer (#3454) 2025-06-26 13:52:01 -05:00
aea9c2cb47 Removed skype (#3453) 2025-06-26 13:41:02 -05:00
7fa0594267 fix MenuShowDelay reg changes (#3449)
- remove false MenuShowDelay
- replace original value with true default value
2025-06-26 13:38:13 -05:00
5e65505007 [Fixes] Improve Error Handling + UI (#3437)
* add proper error handling + Taskbaritem support to WPFSystemRepair

* implement other fixes

- add Taskbarprogress to WPFFixesNetwork
- add Taskbarprogress to WPFFixesUpdate
- add Error handling + Taskbarprogress to WPFFixesWinget
- add finalisation in WPFSystemRepair
2025-06-26 13:35:03 -05:00
686e65adcb [Tweaks] Fix Disabling of Ultimate Performance Profile (#3436)
* improve general codequality of function

* fix issue with disable process

- remove ".Line.Split()[3]"
- change $balancedPlanGUID to be in brackets
2025-06-26 13:29:24 -05:00
1935375f88 add T3Sleep Toggle (#3434) 2025-06-26 13:27:41 -05:00
069a1bda2f [Microwin] Adaptive Busy Icon + Message (#3433)
* Adaptive Busy Icon + Message

- added adaptive color & message of busy indicator
- fixed placement at some places for "Set-WinUtilTaskbaritem" as dialogbox which waits for user input came before

* seperate long Errormessaged for BusyIndication

* add CharacterEllipsis as TextTrimming on BusyText

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

* fix BusyIndication + add more detailed one

* removing wip busymessages before process

* Improve reporting of messages significantly (#15)

- Added parameter sets
- Implemented detections for interactive/noninteractive processes

* Fix hidden message action (#16)

---------

Co-authored-by: CodingWonders <101426328+CodingWonders@users.noreply.github.com>
2025-06-26 13:26:35 -05:00
661dfa6318 add computer management + remove bloat from WPFControlPanel (#3431) 2025-06-26 13:23:33 -05:00
d6b78d1d06 fix winget package for viber application (#3430) 2025-06-26 13:21:59 -05:00
51f15a03c2 add note (#3429) 2025-06-26 13:13:47 -05:00
ce91307daf remove Hibernation tweak from standard preset (#3428) 2025-06-26 13:09:40 -05:00
8fe09d0054 remove msedge tweak (#3427) 2025-06-26 13:09:08 -05:00
e74258acf4 [Microwin] Fix & Cleanup UI (#3426)
* hide MicrowinISOPanel on proceeding steps

* fix textbox styling + remove Password text

* MicroWinPanelToggling
2025-06-26 12:21:49 -05:00
28958938fc Fixing the winget installing 0 failed error (#3391)
It just adds the `$null =` from the else to the start of the add line if the package is equal to `na`.

For winget the package added is put into an extra set of $(), because of how it is in the else. I haven't tested it without.
2025-06-26 12:14:46 -05:00
91de389c8f Add overlay and block app list during install/uninstall (#3385)
* Implement app installation progress overlay and refactor progress bar handling

* Add overlay background color settings and ensure minimum progress bar value

* Add busy overlay functionality and progress bar updates for installation process

* Refactor busy overlay implementation to dynamically adjust size based on app area dimensions
2025-06-26 12:11:38 -05:00
6b22c63d28 Deploying to main from @ ChrisTitusTech/winutil@faa4701c43 🚀 2025-06-26 15:34:46 +00:00
32 changed files with 1159 additions and 484 deletions

2
.gitignore vendored
View File

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

View File

@ -51,7 +51,7 @@ If you have Issues, refer to [Known Issues](https://winutil.christitus.com/known
## 🛠️ Build & Develop
> [!NOTE]
> Winutil is a relatively large script, so it's split into multiple files which're combined into a single `.ps1` file using a custom compiler. This makes maintaining the project a lot easiler.
> Winutil is a relatively large script, so it's split into multiple files which're combined into a single `.ps1` file using a custom compiler. This makes maintaining the project a lot easier.
Get a copy of the source code, this can be done using GitHub UI (`Code -> Download ZIP`), or by cloning (downloading) the repo using git.
@ -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/craigccfl"><img src="https:&#x2F;&#x2F;github.com&#x2F;craigccfl.png" width="60px" alt="User avatar: CraigW" /></a><a href="https://github.com/RoelCrabbe"><img src="https:&#x2F;&#x2F;github.com&#x2F;RoelCrabbe.png" width="60px" alt="User avatar: Roel Crabbé" /></a><a href="https://github.com/Data-Syd"><img src="https:&#x2F;&#x2F;github.com&#x2F;Data-Syd.png" width="60px" alt="User avatar: Data Syd" /></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/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 -->
## 🏅 Thanks to all Contributors
Thanks a lot for spending your time helping Winutil grow. Thanks a lot! Keep rocking 🍻.

View File

@ -375,6 +375,14 @@
"link": "https://discord.com/",
"winget": "Discord.Discord"
},
"dismtools": {
"category": "Microsoft Tools",
"choco": "na",
"content": "DISMTools",
"description": "DISMTools is a front-end for DISM that lets you manage your Windows Imaging (WIM) files and a whole lot more.",
"link": "https://github.com/CodingWonders/DISMTools",
"winget": "CodingWondersSoftware.DISMTools.Stable"
},
"ditto": {
"category": "Utilities",
"choco": "ditto",
@ -547,7 +555,7 @@
"category": "Multimedia Tools",
"choco": "ffmpeg-full",
"content": "FFmpeg (full)",
"description": "FFmpeg is a powerful multimedia processing tool that enables users to convert, edit, and stream audio and video files with a vast range of codecs and formats.",
"description": "FFmpeg is a powerful multimedia processing tool that enables users to convert, edit, and stream audio and video files with a vast range of codecs and formats. | Note: FFmpeg can not be uninstalled using winget.",
"link": "https://ffmpeg.org/",
"winget": "Gyan.FFmpeg"
},
@ -1741,7 +1749,7 @@
"content": "Python3",
"description": "Python is a versatile programming language used for web development, data analysis, artificial intelligence, and more.",
"link": "https://www.python.org/",
"winget": "Python.Python.3.12"
"winget": "Python.Python.3.13"
},
"qbittorrent": {
"category": "Utilities",
@ -1935,14 +1943,6 @@
"link": "https://github.com/henrypp/simplewall",
"winget": "Henry++.simplewall"
},
"skype": {
"category": "Communications",
"choco": "skype",
"content": "Skype",
"description": "Skype is a widely used communication platform offering video calls, voice calls, and instant messaging services.",
"link": "https://www.skype.com/",
"winget": "Microsoft.Skype"
},
"slack": {
"category": "Communications",
"choco": "slack",
@ -2218,8 +2218,8 @@
"ttaskbar": {
"category": "Utilities",
"choco": "translucenttb",
"content": "Translucent Taskbar",
"description": "Translucent Taskbar is a tool that allows you to customize the transparency of the Windows taskbar.",
"content": "TranslucentTB",
"description": "TranslucentTB is a tool that allows you to customize the transparency of the Windows taskbar.",
"link": "https://github.com/TranslucentTB/TranslucentTB",
"winget": "9PF4KZ2VN4W9"
},
@ -2301,7 +2301,7 @@
"content": "Viber",
"description": "Viber is a free messaging and calling app with features like group chats, video calls, and more.",
"link": "https://www.viber.com/",
"winget": "Viber.Viber"
"winget": "Rakuten.Viber"
},
"videomass": {
"category": "Multimedia Tools",

View File

@ -242,15 +242,7 @@
"ButtonWidth": "300",
"link": "https://winutil.christitus.com/dev/features/fixes/runadobecccleanertool"
},
"WPFPanelnetwork": {
"Content": "Network Connections",
"category": "Legacy Windows Panels",
"panel": "2",
"Type": "Button",
"ButtonWidth": "300",
"link": "https://winutil.christitus.com/dev/features/legacy-windows-panels/network"
},
"WPFPanelcontrol": {
"WPFPanelControl": {
"Content": "Control Panel",
"category": "Legacy Windows Panels",
"panel": "2",
@ -258,7 +250,23 @@
"ButtonWidth": "300",
"link": "https://winutil.christitus.com/dev/features/legacy-windows-panels/control"
},
"WPFPanelpower": {
"WPFPanelComputer": {
"Content": "Computer Management",
"category": "Legacy Windows Panels",
"panel": "2",
"Type": "Button",
"ButtonWidth": "300",
"link": "https://winutil.christitus.com/dev/features/legacy-windows-panels/computer"
},
"WPFPanelNetwork": {
"Content": "Network Connections",
"category": "Legacy Windows Panels",
"panel": "2",
"Type": "Button",
"ButtonWidth": "300",
"link": "https://winutil.christitus.com/dev/features/legacy-windows-panels/network"
},
"WPFPanelPower": {
"Content": "Power Panel",
"category": "Legacy Windows Panels",
"panel": "2",
@ -266,23 +274,7 @@
"ButtonWidth": "300",
"link": "https://winutil.christitus.com/dev/features/legacy-windows-panels/power"
},
"WPFPanelregion": {
"Content": "Region",
"category": "Legacy Windows Panels",
"panel": "2",
"Type": "Button",
"ButtonWidth": "300",
"link": "https://winutil.christitus.com/dev/features/legacy-windows-panels/region"
},
"WPFPanelsound": {
"Content": "Sound Settings",
"category": "Legacy Windows Panels",
"panel": "2",
"Type": "Button",
"ButtonWidth": "300",
"link": "https://winutil.christitus.com/dev/features/legacy-windows-panels/sound"
},
"WPFPanelprinter": {
"WPFPanelPrinter": {
"Content": "Printer Panel",
"category": "Legacy Windows Panels",
"panel": "2",
@ -290,7 +282,24 @@
"ButtonWidth": "300",
"link": "https://winutil.christitus.com/dev/features/legacy-windows-panels/printer"
},
"WPFPanelsystem": {
"WPFPanelRegion": {
"Content": "Region",
"category": "Legacy Windows Panels",
"panel": "2",
"Type": "Button",
"ButtonWidth": "300",
"link": "https://winutil.christitus.com/dev/features/legacy-windows-panels/region"
},
"WPFPanelSound": {
"Content": "Sound Settings",
"category": "Legacy Windows Panels",
"panel": "2",
"Type": "Button",
"ButtonWidth": "300",
"link": "https://winutil.christitus.com/dev/features/legacy-windows-panels/user"
},
"WPFPanelSystem": {
"Content": "System Properties",
"category": "Legacy Windows Panels",
"panel": "2",
@ -298,20 +307,13 @@
"ButtonWidth": "300",
"link": "https://winutil.christitus.com/dev/features/legacy-windows-panels/system"
},
"WPFPaneluser": {
"Content": "User Accounts",
"WPFPanelTimedate": {
"Content": "Time and Date",
"category": "Legacy Windows Panels",
"panel": "2",
"Type": "Button",
"ButtonWidth": "300",
"link": "https://winutil.christitus.com/dev/features/legacy-windows-panels/user"
},
"WPFPanelGodMode": {
"Content": "God Mode",
"category": "Legacy Windows Panels",
"panel": "2",
"Type": "Button",
"ButtonWidth": "300"
"link": "https://winutil.christitus.com/dev/features/legacy-windows-panels/timedate"
},
"WPFWinUtilInstallPSProfile": {
"Content": "Install CTT PowerShell Profile",

View File

@ -4,7 +4,6 @@
"WPFTweaksConsumerFeatures",
"WPFTweaksDisableExplorerAutoDiscovery",
"WPFTweaksDVR",
"WPFTweaksHiber",
"WPFTweaksHome",
"WPFTweaksLoc",
"WPFTweaksServices",

View File

@ -32,6 +32,7 @@
"ButtonFontFamily": "Arial",
"ButtonWidth": "200",
"ButtonHeight": "25",
"ConfigTabButtonFontSize": "14",
"ConfigUpdateButtonFontSize": "14",
"SearchBarWidth": "200",
"SearchBarHeight": "26",
@ -46,6 +47,7 @@
"AppInstallUnselectedColor": "#F7F7F7",
"AppInstallHighlightedColor": "#CFCFCF",
"AppInstallSelectedColor": "#C2C2C2",
"AppInstallOverlayBackgroundColor":"#6A6D72",
"ComboBoxForegroundColor": "#232629",
"ComboBoxBackgroundColor": "#F7F7F7",
"LabelboxForegroundColor": "#232629",
@ -58,6 +60,7 @@
"ScrollBarHoverColor": "#5A5D62",
"ScrollBarDraggingColor": "#6A6D72",
"MicrowinBusyColor": "#2e77ff",
"ProgressBarForegroundColor": "#2e77ff",
"ProgressBarBackgroundColor": "Transparent",
"ProgressBarTextColor": "#232629",
@ -85,6 +88,7 @@
"AppInstallUnselectedColor": "#232629",
"AppInstallHighlightedColor": "#3C3C3C",
"AppInstallSelectedColor": "#4C4C4C",
"AppInstallOverlayBackgroundColor":"#2E3135",
"ComboBoxForegroundColor": "#F7F7F7",
"ComboBoxBackgroundColor": "#1E3747",
"LabelboxForegroundColor": "#0567ff",
@ -97,9 +101,10 @@
"ScrollBarHoverColor": "#3B4252",
"ScrollBarDraggingColor": "#5E81AC",
"MicrowinBusyColor": "#2e77ff",
"ProgressBarForegroundColor": "#222222",
"ProgressBarBackgroundColor": "Transparent",
"ProgressBarTextColor": "#cccccc",
"ProgressBarTextColor": "#232629",
"ButtonInstallBackgroundColor": "#222222",
"ButtonTweaksBackgroundColor": "#333333",
"ButtonConfigBackgroundColor": "#444444",

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>"
}
]
},
@ -1824,10 +1817,10 @@
"registry": [
{
"Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\DataCollection",
"Type": "DWord",
"Value": "0",
"OriginalValue": "<RemoveEntry>",
"Name": "AllowTelemetry",
"OriginalValue": "<RemoveEntry>"
"Value": "0",
"Type": "DWord"
},
{
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\DataCollection",
@ -1913,6 +1906,13 @@
"Value": "0",
"Type": "DWord"
},
{
"Path": "HKCU:\\SOFTWARE\\Microsoft\\Siuf\\Rules",
"OriginalValue": "<RemoveEntry>",
"Name": "PeriodInNanoSeconds",
"Value": "<RemoveEntry>",
"Type": "QWord"
},
{
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\DataCollection",
"OriginalValue": "<RemoveEntry>",
@ -1945,7 +1945,14 @@
"Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\DeliveryOptimization\\Config",
"OriginalValue": "1",
"Name": "DODownloadMode",
"Value": "1",
"Value": "0",
"Type": "DWord"
},
{
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\DeliveryOptimization",
"OriginalValue": "<RemoveEntry>",
"Name": "DODownloadMode",
"Value": "0",
"Type": "DWord"
},
{
@ -1990,14 +1997,6 @@
"Value": "1",
"Type": "DWord"
},
{
"_Comment": "Driver searching is a function that should be left in",
"Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\DriverSearching",
"OriginalValue": "1",
"Name": "SearchOrderConfig",
"Value": "1",
"Type": "DWord"
},
{
"Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Multimedia\\SystemProfile",
"OriginalValue": "1",
@ -2012,13 +2011,6 @@
"Value": "4294967295",
"Type": "DWord"
},
{
"Path": "HKCU:\\Control Panel\\Desktop",
"OriginalValue": "1",
"Name": "MenuShowDelay",
"Value": "1",
"Type": "DWord"
},
{
"Path": "HKCU:\\Control Panel\\Desktop",
"OriginalValue": "1",
@ -2114,8 +2106,8 @@
"link": "https://winutil.christitus.com/dev/tweaks/essential-tweaks/tele"
},
"WPFTweaksWifi": {
"Content": "Disable Wifi-Sense",
"Description": "Wifi Sense is a spying service that phones home all nearby scanned wifi networks and your current geo location.",
"Content": "Disable Wi-Fi Sense",
"Description": "Wi-Fi Sense is a spying service that phones home all nearby scanned Wi-Fi networks and your current geographic location.",
"category": "Essential Tweaks",
"panel": "1",
"Order": "a005_",
@ -2154,28 +2146,46 @@
],
"link": "https://winutil.christitus.com/dev/tweaks/z--advanced-tweaks---caution/utc"
},
"WPFTweaksRemoveHomeGallery": {
"Content": "Remove Home and Gallery from explorer",
"Description": "Removes the Home and Gallery from explorer and sets This PC as default",
"WPFTweaksRemoveHome": {
"Content": "Remove Home from Explorer",
"Description": "Removes the Home from Explorer and sets This PC as default",
"category": "z__Advanced Tweaks - CAUTION",
"panel": "1",
"Order": "a029_",
"InvokeScript": [
"
REG DELETE \"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Desktop\\NameSpace\\{e88865ea-0e1c-4e20-9aa6-edcd0212c87c}\" /f
REG DELETE \"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Desktop\\NameSpace\\{f874310e-b6b7-47dc-bc84-b9e6b38f5903}\" /f
REG ADD \"HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" /f /v \"LaunchTo\" /t REG_DWORD /d \"1\"
"
],
"UndoScript": [
"
REG ADD \"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Desktop\\NameSpace\\{e88865ea-0e1c-4e20-9aa6-edcd0212c87c}\" /f /ve /t REG_SZ /d \"{e88865ea-0e1c-4e20-9aa6-edcd0212c87c}\"
REG ADD \"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Desktop\\NameSpace\\{f874310e-b6b7-47dc-bc84-b9e6b38f5903}\" /f /ve /t REG_SZ /d \"CLSID_MSGraphHomeFolder\"
REG DELETE \"HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" /f /v \"LaunchTo\"
"
],
"link": "https://winutil.christitus.com/dev/tweaks/z--advanced-tweaks---caution/removehomegallery"
},
"WPFTweaksRemoveGallery": {
"Content": "Remove Gallery from explorer",
"Description": "Removes the Gallery from Explorer and sets This PC as default",
"category": "z__Advanced Tweaks - CAUTION",
"panel": "1",
"Order": "a030_",
"InvokeScript": [
"
REG DELETE \"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Desktop\\NameSpace\\{e88865ea-0e1c-4e20-9aa6-edcd0212c87c}\" /f
REG ADD \"HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" /f /v \"LaunchTo\" /t REG_DWORD /d \"1\"
"
],
"UndoScript": [
"
REG ADD \"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Desktop\\NameSpace\\{e88865ea-0e1c-4e20-9aa6-edcd0212c87c}\" /f /ve /t REG_SZ /d \"{e88865ea-0e1c-4e20-9aa6-edcd0212c87c}\"
REG DELETE \"HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" /f /v \"LaunchTo\"
"
],
"link": "https://winutil.christitus.com/dev/tweaks/z--advanced-tweaks---caution/removehomegallery"
},
"WPFTweaksDisplay": {
"Content": "Set Display for Performance",
"Description": "Sets the system preferences to performance. You can do this manually with sysdm.cpl as well.",
@ -2192,7 +2202,7 @@
},
{
"Path": "HKCU:\\Control Panel\\Desktop",
"OriginalValue": "1",
"OriginalValue": "400",
"Name": "MenuShowDelay",
"Value": "200",
"Type": "String"
@ -2522,20 +2532,6 @@
],
"link": "https://winutil.christitus.com/dev/tweaks/essential-tweaks/storage"
},
"WPFTweaksRemoveEdge": {
"Content": "Remove Microsoft Edge",
"Description": "Removes MS Edge when it gets reinstalled by updates. Credit: Psyirius",
"category": "z__Advanced Tweaks - CAUTION",
"panel": "1",
"Order": "a029_",
"InvokeScript": [
"Uninstall-WinUtilEdgeBrowser -action \"Uninstall\""
],
"UndoScript": [
"Uninstall-WinUtilEdgeBrowser -action \"Install\""
],
"link": "https://winutil.christitus.com/dev/tweaks/z--advanced-tweaks---caution/removeedge"
},
"WPFTweaksRemoveCopilot": {
"Content": "Disable Microsoft Copilot",
"Description": "Disables MS Copilot AI built into Windows since 23H2.",
@ -2563,18 +2559,56 @@
"Type": "DWord",
"Value": "0",
"OriginalValue": "1"
},
{
"Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows\\Shell\\Copilot",
"Name": "IsCopilotAvailable",
"Type": "DWord",
"Value": "0",
"OriginalValue": "<RemoveEntry>"
},
{
"Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows\\Shell\\Copilot",
"Name": "CopilotDisabledReason",
"Type": "String",
"Value": "IsEnabledForGeographicRegionFailed",
"OriginalValue": "<RemoveEntry>"
},
{
"Path": "HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\WindowsCopilot",
"Name": "AllowCopilotRuntime",
"Type": "DWord",
"Value": "0",
"OriginalValue": "<RemoveEntry>"
},
{
"Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Blocked",
"Name": "{CB3B0003-8088-4EDE-8769-8B354AB2FF8C}",
"Type": "String",
"Value": "",
"OriginalValue": "<RemoveEntry>"
},
{
"Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows\\Shell\\Copilot\\BingChat",
"Name": "IsUserEligible",
"Type": "DWord",
"Value": "0",
"OriginalValue": "<RemoveEntry>"
}
],
"InvokeScript": [
"
Write-Host \"Remove Copilot\"
Get-Package | Where-Object Name -like '*copilot*'
Get-AppxPackage -AllUsers *Copilot* | Remove-AppxPackage -AllUsers
Get-AppxProvisionedPackage -Online | Where-Object PackageName -like '*Copilot*' | Remove-AppxProvisionedPackage -Online
dism /online /remove-package /package-name:Microsoft.Windows.Copilot
"
],
"UndoScript": [
"
Write-Host \"Install Copilot\"
dism /online /add-package /package-name:Microsoft.Windows.Copilot
winget install --name \"Microsoft Copilot\" --source msstore --accept-package-agreements --accept-source-agreements --silent
"
],
"link": "https://winutil.christitus.com/dev/tweaks/z--advanced-tweaks---caution/removecopilot"
@ -2592,6 +2626,20 @@
"Type": "DWord",
"Value": "1",
"OriginalValue": "<RemoveEntry>"
},
{
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\WindowsAI",
"Name": "AllowRecallEnablement",
"Type": "DWord",
"Value": "0",
"OriginalValue": "<RemoveEntry>"
},
{
"Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\CI\\Policy",
"Name": "VerifiedAndReputablePolicyState",
"Type": "DWord",
"Value": "0",
"OriginalValue": "<RemoveEntry>"
}
],
"InvokeScript": [
@ -2689,7 +2737,7 @@
"Description": "Moves OneDrive files to Default Home Folders and Uninstalls it.",
"category": "z__Advanced Tweaks - CAUTION",
"panel": "1",
"Order": "a030_",
"Order": "a031_",
"InvokeScript": [
"
$OneDrivePath = $($env:OneDrive)
@ -2728,7 +2776,7 @@
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue \"$OneDrivePath\"
}
Write-Host \"Remove Onedrive from explorer sidebar\"
Write-Host \"Remove Onedrive from Explorer sidebar\"
Set-ItemProperty -Path \"HKCR:\\CLSID\\{018D5C66-4533-4307-9B53-224DE2ED1FE6}\" -Name \"System.IsPinnedToNameSpaceTree\" -Value 0
Set-ItemProperty -Path \"HKCR:\\Wow6432Node\\CLSID\\{018D5C66-4533-4307-9B53-224DE2ED1FE6}\" -Name \"System.IsPinnedToNameSpaceTree\" -Value 0
@ -2774,7 +2822,7 @@
taskkill.exe /F /IM \"explorer.exe\"
Start-Process \"explorer.exe\"
Write-Host \"Waiting for explorer to complete loading\"
Write-Host \"Waiting for Explorer to complete loading\"
Write-Host \"Please Note - The OneDrive folder at $OneDrivePath may still have items in it. You must manually delete it, but all the files should already be copied to the base user folder.\"
Write-Host \"If there are Files missing afterwards, please Login to Onedrive.com and Download them manually\" -ForegroundColor Yellow
Start-Sleep 5
@ -2793,10 +2841,10 @@
},
"WPFTweaksRazerBlock": {
"Content": "Block Razer Software Installs",
"Description": "Blocks ALL Razer Software installations. The hardware works fine without any software.",
"Description": "Blocks ALL Razer Software installations. The hardware works fine without any software. WARNING: this will also block all Windows third-party driver installations.",
"category": "z__Advanced Tweaks - CAUTION",
"panel": "1",
"Order": "a031_",
"Order": "a032_",
"registry": [
{
"Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\DriverSearching",
@ -3597,6 +3645,69 @@
],
"link": "https://winutil.christitus.com/dev/tweaks/customize-preferences/stickykeys"
},
"WPFToggleNewOutlook": {
"Content": "New Outlook",
"Description": "If disabled it removes the toggle for new Outlook, disables the new Outlook migration and makes sure the Outlook Application actually uses the old Outlook.",
"category": "Customize Preferences",
"panel": "2",
"Order": "a112_",
"Type": "Toggle",
"registry": [
{
"Path": "HKCU:\\SOFTWARE\\Microsoft\\Office\\16.0\\Outlook\\Preferences",
"Name": "UseNewOutlook",
"Value": "1",
"OriginalValue": "0",
"DefaultState": "true",
"Type": "DWord"
},
{
"Path": "HKCU:\\Software\\Microsoft\\Office\\16.0\\Outlook\\Options\\General",
"Name": "HideNewOutlookToggle",
"Value": "0",
"OriginalValue": "1",
"DefaultState": "true",
"Type": "DWord"
},
{
"Path": "HKCU:\\Software\\Policies\\Microsoft\\Office\\16.0\\Outlook\\Options\\General",
"Name": "DoNewOutlookAutoMigration",
"Value": "0",
"OriginalValue": "0",
"DefaultState": "false",
"Type": "DWord"
},
{
"Path": "HKCU:\\Software\\Policies\\Microsoft\\Office\\16.0\\Outlook\\Preferences",
"Name": "NewOutlookMigrationUserSetting",
"Value": "0",
"OriginalValue": "<RemoveEntry>",
"DefaultState": "true",
"Type": "DWord"
}
],
"link": "https://winutil.christitus.com/dev/tweaks/customize-preferences/newoutlook"
},
"WPFToggleMultiplaneOverlay": {
"Content": "Multiplane Overlay",
"Description": "Disable the Multiplane Overlay which can sometimes cause issues with Graphics Cards.",
"category": "Customize Preferences",
"panel": "2",
"Order": "a111_",
"Type": "Toggle",
"registry": [
{
"Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows\\Dwm",
"Name": "OverlayTestMode",
"Value": "5",
"OriginalValue": "<RemoveEntry>",
"DefaultState": "true",
"Type": "DWord"
}
],
"link": "https://winutil.christitus.com/dev/tweaks/customize-preferences/multplaneoverlay"
},
"WPFToggleHiddenFiles": {
"Content": "Show Hidden Files",
"Description": "If Enabled then Hidden Files will be shown.",
@ -3758,6 +3869,24 @@
],
"link": "https://winutil.christitus.com/dev/tweaks/customize-preferences/detailedbsod"
},
"WPFToggleS3Sleep": {
"Content": "S3 Sleep",
"Description": "Toggles between Modern Standby and S3 sleep.",
"category": "Customize Preferences",
"panel": "2",
"Order": "a206_",
"Type": "Toggle",
"registry": [
{
"Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Power",
"Name": "PlatformAoAcOverride",
"Value": "0",
"OriginalValue": "<RemoveEntry>",
"DefaultState": "false",
"Type": "DWord"
}
]
},
"WPFOOSUbutton": {
"Content": "Run OO Shutup 10",
"category": "z__Advanced Tweaks - CAUTION",
@ -3807,7 +3936,7 @@
# Folder types lookup table
$bagMRU = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\BagMRU\"
# Flush explorer view database
# Flush Explorer view database
Remove-Item -Path $bags -Recurse -Force
Write-Host \"Removed $bags\"
@ -3837,7 +3966,7 @@
# Folder types lookup table
$bagMRU = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\BagMRU\"
# Flush explorer view database
# Flush Explorer view database
Remove-Item -Path $bags -Recurse -Force
Write-Host \"Removed $bags\"
@ -3847,5 +3976,23 @@
Write-Host Please sign out and back in, or restart your computer to apply the changes!
"
]
},
"WPFTweaksDisableCrossDeviceResume": {
"Content": "Cross-Device Resume",
"Description": "This tweak controls the Resume function in Windows 11 24H2 and later, which allows you to resume an activity from a mobile device and vice-versa.",
"category": "Customize Preferences",
"panel": "2",
"Order": "a207_",
"Type": "Toggle",
"registry": [
{
"Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\CrossDeviceResume\\Configuration",
"Name": "IsResumeAllowed",
"Value": "1",
"OriginalValue": "0",
"DefaultState": "true",
"Type": "DWord"
}
]
}
}

View File

@ -39,12 +39,15 @@ public class PowerManagement {
$SaveDialog.ShowDialog() | Out-Null
if ($SaveDialog.FileName -eq "") {
Write-Host "No file name for the target image was specified"
$msg = "No file name for the target image was specified"
Write-Host $msg
Invoke-MicrowinBusyInfo -action "warning" -message $msg
Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning"
return
}
Set-WinUtilTaskbaritem -state "Indeterminate" -overlay "logo"
Invoke-MicrowinBusyInfo -action "wip" -message "Busy..." -interactive $false
Write-Host "Target ISO location: $($SaveDialog.FileName)"
@ -55,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
@ -63,16 +69,22 @@ 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
$index = 1
} else {
$msg = "The export process has failed and MicroWin processing cannot continue"
Write-Host "Failed to export the image"
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Error)
Write-Host $msg
Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning"
Invoke-MicrowinBusyInfo -action "warning" -message $msg
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Error)
return
}
}
@ -87,6 +99,7 @@ public class PowerManagement {
Write-Host $msg
[System.Windows.MessageBox]::Show($dlg_msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Exclamation)
Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning"
Invoke-MicrowinBusyInfo -action "warning" -message $msg
return
}
@ -101,8 +114,10 @@ public class PowerManagement {
$mountDirExists = Test-Path $mountDir
$scratchDirExists = Test-Path $scratchDir
if (-not $mountDirExists -or -not $scratchDirExists) {
Write-Error "Required directories '$mountDirExists' '$scratchDirExists' and do not exist."
$msg = "Required directories '$mountDirExists' '$scratchDirExists' and do not exist."
Write-Error $msg
Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning"
Invoke-MicrowinBusyInfo -action "warning" -message $msg
return
}
@ -113,8 +128,10 @@ public class PowerManagement {
if ($?) {
Write-Host "The Windows image has been mounted successfully. Continuing processing..."
} else {
Write-Host "Could not mount image. Exiting..."
$msg = "Could not mount image. Exiting..."
Write-Host $msg
Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning"
Invoke-MicrowinBusyInfo -action "warning" -message $msg
return
}
@ -157,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
@ -212,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"
@ -233,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"
@ -268,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"
@ -295,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
}
}
@ -307,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
@ -362,18 +404,39 @@ 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"
if (-not (Test-Path -Path "$mountDir\sources\install.wim")) {
Write-Error "Something went wrong and '$mountDir\sources\install.wim' doesn't exist. Please report this bug to the devs"
$msg = "Something went wrong. Please report this bug to the devs."
Write-Error "$($msg) '$($mountDir)\sources\install.wim' doesn't exist"
Invoke-MicrowinBusyInfo -action "warning" -message $msg
Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning"
return
}
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"
@ -459,6 +522,7 @@ public class PowerManagement {
$msg = "Done. ISO image is located here: $($SaveDialog.FileName)"
Write-Host $msg
Set-WinUtilTaskbaritem -state "None" -overlay "checkmark"
Invoke-MicrowinBusyInfo -action "done" -message "Finished!"
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Information)
} else {
Write-Host "ISO creation failed. The "$($mountDir)" directory has not been removed."
@ -467,14 +531,16 @@ public class PowerManagement {
# Now, this will NOT throw an exception
$exitCode = New-Object System.ComponentModel.Win32Exception($LASTEXITCODE)
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
}
}
$sync.MicrowinOptionsPanel.Visibility = 'Collapsed'
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

@ -0,0 +1,65 @@
function Invoke-MicrowinBusyInfo {
<#
.DESCRIPTION
Function to display the busy info for the Microwin process
#>
[CmdletBinding(DefaultParameterSetName='done')]
param(
[Parameter(ParameterSetName='wip', Mandatory, Position = 0)]
[Parameter(ParameterSetName='warning', Mandatory, Position = 0)]
[Parameter(ParameterSetName='done', Mandatory, Position = 0)]
[Parameter(ParameterSetName='hide', Mandatory, Position = 0)]
[ValidateSet('wip', 'warning', 'done', 'hide')]
[string]$action,
[Parameter(ParameterSetName='wip', Mandatory, Position = 1)]
[Parameter(ParameterSetName='warning', Mandatory, Position = 1)]
[Parameter(ParameterSetName='done', Mandatory, Position = 1)]
[string]$message,
[Parameter(ParameterSetName='wip', Position = 2)] [bool]$interactive = $false
)
switch ($action) {
"wip" {
$sync.form.Dispatcher.BeginInvoke([action]{
$sync.MicrowinBusyIndicator.Visibility="Visible"
$finalMessage = ""
if ($interactive -eq $false) {
$finalMessage += "Please wait. "
}
$finalMessage += $message
$sync.BusyText.Text = $finalMessage
$sync.BusyIcon.Foreground="#FFA500"
$sync.BusyText.Foreground="#FFA500"
})
}
"warning" {
$sync.form.Dispatcher.BeginInvoke([action]{
$sync.MicrowinBusyIndicator.Visibility="Visible"
$sync.BusyText.Text=$message
$sync.BusyText.Foreground="#FF0000"
$sync.BusyIcon.Foreground="#FF0000"
})
}
"done" {
$sync.form.Dispatcher.BeginInvoke([action]{
$sync.MicrowinBusyIndicator.Visibility="Visible"
$sync.BusyText.Text=$message
$sync.BusyText.Foreground="#00FF00"
$sync.BusyIcon.Foreground="#00FF00"
})
}
"hide" {
$sync.form.Dispatcher.BeginInvoke([action]{
$sync.MicrowinBusyIndicator.Visibility="Hidden"
$sync.BusyText.Foreground=$sync.Form.Resources.MicrowinBusyColor
$sync.BusyIcon.Foreground=$sync.Form.Resources.MicrowinBusyColor
})
}
}
# Force the UI to process pending messages
[System.Windows.Forms.Application]::DoEvents()
Start-Sleep -Milliseconds 50
}

View File

@ -12,10 +12,8 @@ function Invoke-MicrowinGetIso {
return
}
$sync.BusyMessage.Visibility="Visible"
$sync.BusyText.Text="N Busy"
# Provide immediate feedback to user
Invoke-MicrowinBusyInfo -action "wip" -message "Initializing MicroWin process..." -interactive $false
Write-Host " _ __ __ _ "
Write-Host " /\/\ (_) ___ _ __ ___ / / /\ \ \(_) _ __ "
@ -23,47 +21,9 @@ function Invoke-MicrowinGetIso {
Write-Host "/ /\/\ \| || (__ | | | (_) | \ /\ / | || | | | "
Write-Host "\/ \/|_| \___||_| \___/ \/ \/ |_||_| |_| "
$oscdimgPath = Join-Path $env:TEMP 'oscdimg.exe'
$oscdImgFound = [bool] (Get-Command -ErrorAction Ignore -Type Application oscdimg.exe) -or (Test-Path $oscdimgPath -PathType Leaf)
Write-Host "oscdimg.exe on system: $oscdImgFound"
if (!$oscdImgFound) {
$downloadFromGitHub = $sync.WPFMicrowinDownloadFromGitHub.IsChecked
$sync.BusyMessage.Visibility="Hidden"
if (!$downloadFromGitHub) {
# only show the message to people who did check the box to download from github, if you check the box
# you consent to downloading it, no need to show extra dialogs
[System.Windows.MessageBox]::Show("oscdimge.exe is not found on the system, winutil will now attempt do download and install it using choco. This might take a long time.")
# the step below needs choco to download oscdimg
# Install Choco if not already present
Install-WinUtilChoco
$chocoFound = [bool] (Get-Command -ErrorAction Ignore -Type Application choco)
Write-Host "choco on system: $chocoFound"
if (!$chocoFound) {
[System.Windows.MessageBox]::Show("choco.exe is not found on the system, you need choco to download oscdimg.exe")
return
}
Start-Process -Verb runas -FilePath powershell.exe -ArgumentList "choco install windows-adk-oscdimg"
[System.Windows.MessageBox]::Show("oscdimg is installed, now close, reopen PowerShell terminal and re-launch winutil.ps1")
return
} else {
[System.Windows.MessageBox]::Show("oscdimge.exe is not found on the system, winutil will now attempt do download and install it from github. This might take a long time.")
Microwin-GetOscdimg -oscdimgPath $oscdimgPath
$oscdImgFound = Test-Path $oscdimgPath -PathType Leaf
if (!$oscdImgFound) {
$msg = "oscdimg was not downloaded can not proceed"
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Error)
return
} else {
Write-Host "oscdimg.exe was successfully downloaded from github"
}
}
}
if ($sync["ISOmanual"].IsChecked) {
# Open file dialog to let user choose the ISO file
Invoke-MicrowinBusyInfo -action "wip" -message "Please select an ISO file..." -interactive $true
[System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms") | Out-Null
$openFileDialog = New-Object System.Windows.Forms.OpenFileDialog
$openFileDialog.initialDirectory = $initialDirectory
@ -73,20 +33,26 @@ function Invoke-MicrowinGetIso {
if ([string]::IsNullOrEmpty($filePath)) {
Write-Host "No ISO is chosen"
$sync.BusyMessage.Visibility="Hidden"
Invoke-MicrowinBusyInfo -action "hide" -message " "
return
}
} elseif ($sync["ISOdownloader"].IsChecked) {
# Create folder browsers for user-specified locations
Invoke-MicrowinBusyInfo -action "wip" -message "Please select download location..." -interactive $true
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null
$isoDownloaderFBD = New-Object System.Windows.Forms.FolderBrowserDialog
$isoDownloaderFBD.Description = "Please specify the path to download the ISO file to:"
$isoDownloaderFBD.ShowNewFolderButton = $true
if ($isoDownloaderFBD.ShowDialog() -ne [System.Windows.Forms.DialogResult]::OK)
{
Invoke-MicrowinBusyInfo -action "hide" -message " "
return
}
Set-WinUtilTaskbaritem -state "Indeterminate" -overlay "logo"
Invoke-MicrowinBusyInfo -action "wip" -message "Preparing to download ISO..." -interactive $false
# Grab the location of the selected path
$targetFolder = $isoDownloaderFBD.SelectedPath
@ -95,6 +61,7 @@ function Invoke-MicrowinGetIso {
$fidopath = "$env:temp\Fido.ps1"
$originalLocation = $PSScriptRoot
Invoke-MicrowinBusyInfo -action "wip" -message "Downloading Fido script..." -interactive $false
Invoke-WebRequest "https://github.com/pbatard/Fido/raw/master/Fido.ps1" -OutFile $fidopath
Set-Location -Path $env:temp
@ -105,11 +72,14 @@ function Invoke-MicrowinGetIso {
$sync["ISOLanguage"].SelectedItem
}
Invoke-MicrowinBusyInfo -action "wip" -message "Downloading Windows ISO... (This may take a long time)" -interactive $false
& $fidopath -Win 'Windows 11' -Rel $sync["ISORelease"].SelectedItem -Arch "x64" -Lang $lang -Ed "Windows 11 Home/Pro/Edu"
if (-not $?)
{
Write-Host "Could not download the ISO file. Look at the output of the console for more information."
$msg = "The ISO file could not be downloaded"
Invoke-MicrowinBusyInfo -action "warning" -message $msg
Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning"
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Error)
return
}
@ -131,8 +101,11 @@ function Invoke-MicrowinGetIso {
}
catch
{
Write-Host "Unable to move the ISO file to the location you specified. The downloaded ISO is in the `"$env:TEMP`" folder"
$msg = "Unable to move the ISO file to the location you specified. The downloaded ISO is in the `"$env:TEMP`" folder"
Write-Host $msg
Write-Host "Error information: $($_.Exception.Message)" -ForegroundColor Yellow
Invoke-MicrowinBusyInfo -action "warning" -message $msg
return
}
}
}
@ -140,11 +113,57 @@ function Invoke-MicrowinGetIso {
Write-Host "File path $($filePath)"
if (-not (Test-Path -Path "$filePath" -PathType Leaf)) {
$msg = "File you've chosen doesn't exist"
Invoke-MicrowinBusyInfo -action "warning" -message $msg
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Error)
return
}
Set-WinUtilTaskbaritem -state "Indeterminate" -overlay "logo"
Invoke-MicrowinBusyInfo -action "wip" -message "Checking system requirements..." -interactive $false
$oscdimgPath = Join-Path $env:TEMP 'oscdimg.exe'
$oscdImgFound = [bool] (Get-Command -ErrorAction Ignore -Type Application oscdimg.exe) -or (Test-Path $oscdimgPath -PathType Leaf)
Write-Host "oscdimg.exe on system: $oscdImgFound"
if (!$oscdImgFound) {
$downloadFromGitHub = $sync.WPFMicrowinDownloadFromGitHub.IsChecked
if (!$downloadFromGitHub) {
# only show the message to people who did check the box to download from github, if you check the box
# you consent to downloading it, no need to show extra dialogs
[System.Windows.MessageBox]::Show("oscdimge.exe is not found on the system, winutil will now attempt do download and install it using choco. This might take a long time.")
# the step below needs choco to download oscdimg
# Install Choco if not already present
Install-WinUtilChoco
$chocoFound = [bool] (Get-Command -ErrorAction Ignore -Type Application choco)
Write-Host "choco on system: $chocoFound"
if (!$chocoFound) {
[System.Windows.MessageBox]::Show("choco.exe is not found on the system, you need choco to download oscdimg.exe")
return
}
Start-Process -Verb runas -FilePath powershell.exe -ArgumentList "choco install windows-adk-oscdimg"
$msg = "oscdimg is installed, now close, reopen PowerShell terminal and re-launch winutil.ps1"
Invoke-MicrowinBusyInfo -action "done" -message $msg # We set it to done because it immediately returns from this function
[System.Windows.MessageBox]::Show($msg)
return
} else {
[System.Windows.MessageBox]::Show("oscdimge.exe is not found on the system, winutil will now attempt do download and install it from github. This might take a long time.")
Invoke-MicrowinBusyInfo -action "wip" -message "Downloading oscdimg.exe..." -interactive $false
Microwin-GetOscdimg -oscdimgPath $oscdimgPath
$oscdImgFound = Test-Path $oscdimgPath -PathType Leaf
if (!$oscdImgFound) {
$msg = "oscdimg was not downloaded can not proceed"
Invoke-MicrowinBusyInfo -action "warning" -message $msg
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Error)
return
} else {
Write-Host "oscdimg.exe was successfully downloaded from github"
}
}
}
Invoke-MicrowinBusyInfo -action "wip" -message "Checking disk space..." -interactive $false
# Detect the file size of the ISO and compare it with the free space of the system drive
$isoSize = (Get-Item -Path "$filePath").Length
@ -159,14 +178,17 @@ function Invoke-MicrowinGetIso {
}
elseif ($driveSpace -lt $isoSize) {
# It's critical and we can't continue. Output an error
Write-Host "You don't have enough space for this operation. You need at least $([Math]::Round(($isoSize / ([Math]::Pow(1024, 2))) * 2, 2)) MB of free space to copy the ISO files to a temp directory and to be able to perform additional operations."
$msg = "You don't have enough space for this operation. You need at least $([Math]::Round(($isoSize / ([Math]::Pow(1024, 2))) * 2, 2)) MB of free space to copy the ISO files to a temp directory and to be able to perform additional operations."
Write-Host $msg
Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning"
Invoke-MicrowinBusyInfo -action "warning" -message $msg
return
} else {
Write-Host "You have enough space for this operation."
}
try {
Invoke-MicrowinBusyInfo -action "wip" -message "Mounting ISO file..." -interactive $false
Write-Host "Mounting Iso. Please wait."
$mountedISO = Mount-DiskImage -PassThru "$filePath"
Write-Host "Done mounting Iso `"$($mountedISO.ImagePath)`""
@ -174,10 +196,12 @@ function Invoke-MicrowinGetIso {
Write-Host "Iso mounted to '$driveLetter'"
} catch {
# @ChrisTitusTech please copy this wiki and change the link below to your copy of the wiki
Write-Error "Failed to mount the image. Error: $($_.Exception.Message)"
$msg = "Failed to mount the image. Error: $($_.Exception.Message)"
Write-Error $msg
Write-Error "This is NOT winutil's problem, your ISO might be corrupt, or there is a problem on the system"
Write-Host "Please refer to this wiki for more details: https://christitustech.github.io/winutil/KnownIssues/#troubleshoot-errors-during-microwin-usage" -ForegroundColor Red
Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning"
Invoke-MicrowinBusyInfo -action "warning" -message $msg
return
}
# storing off values in hidden fields for further steps
@ -236,23 +260,32 @@ function Invoke-MicrowinGetIso {
try {
#$data = @($driveLetter, $filePath)
Invoke-MicrowinBusyInfo -action "wip" -message "Creating directories..." -interactive $false
New-Item -ItemType Directory -Force -Path "$($mountDir)" | Out-Null
New-Item -ItemType Directory -Force -Path "$($scratchDir)" | Out-Null
Invoke-MicrowinBusyInfo -action "wip" -message "Copying Windows files... (This may take several minutes)" -interactive $false
Write-Host "Copying Windows image. This will take awhile, please don't use UI or cancel this step!"
# xcopy we can verify files and also not copy files that already exist, but hard to measure
# xcopy.exe /E /I /H /R /Y /J $DriveLetter":" $mountDir >$null
$totalTime = Measure-Command { Copy-Files "$($driveLetter):" "$mountDir" -Recurse -Force }
$totalTime = Measure-Command {
Copy-Files "$($driveLetter):" "$mountDir" -Recurse -Force
# Force UI update during long operation
[System.Windows.Forms.Application]::DoEvents()
}
Write-Host "Copy complete! Total Time: $($totalTime.Minutes) minutes, $($totalTime.Seconds) seconds"
Invoke-MicrowinBusyInfo -action "wip" -message "Processing Windows image..." -interactive $false
$wimFile = "$mountDir\sources\install.wim"
Write-Host "Getting image information $wimFile"
if ((-not (Test-Path -Path "$wimFile" -PathType Leaf)) -and (-not (Test-Path -Path "$($wimFile.Replace(".wim", ".esd").Trim())" -PathType Leaf))) {
$msg = "Neither install.wim nor install.esd exist in the image, this could happen if you use unofficial Windows images. Please don't use shady images from the internet, use only official images. Here are instructions how to download ISO images if the Microsoft website is not showing the link to download and ISO. https://www.techrepublic.com/article/how-to-download-a-windows-10-iso-file-without-using-the-media-creation-tool/"
Write-Host $msg
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Error)
$msg = "Neither install.wim nor install.esd exist in the image, this could happen if you use unofficial Windows images. Please don't use shady images from the internet."
Write-Host "$($msg) Only use official images. Here are instructions how to download ISO images if the Microsoft website is not showing the link to download and ISO. https://www.techrepublic.com/article/how-to-download-a-windows-10-iso-file-without-using-the-media-creation-tool/"
Invoke-MicrowinBusyInfo -action "warning" -message $msg
Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning"
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Error)
throw
}
elseif ((-not (Test-Path -Path $wimFile -PathType Leaf)) -and (Test-Path -Path $wimFile.Replace(".wim", ".esd").Trim() -PathType Leaf)) {
@ -265,23 +298,34 @@ function Invoke-MicrowinGetIso {
$imageName = $_.ImageName
$sync.MicrowinWindowsFlavors.Items.Add("$imageIdx : $imageName")
}
[System.Windows.Forms.Application]::DoEvents()
$sync.MicrowinWindowsFlavors.SelectedIndex = 0
Write-Host "Finding suitable Pro edition. This can take some time. Do note that this is an automatic process that might not select the edition you want."
Invoke-MicrowinBusyInfo -action "wip" -message "Finding suitable Pro edition..." -interactive $false
Get-WindowsImage -ImagePath $wimFile | ForEach-Object {
if ((Get-WindowsImage -ImagePath $wimFile -Index $_.ImageIndex).EditionId -eq "Professional") {
# We have found the Pro edition
$sync.MicrowinWindowsFlavors.SelectedIndex = $_.ImageIndex - 1
}
# Allow UI updates during this loop
[System.Windows.Forms.Application]::DoEvents()
}
Get-Volume $driveLetter | Get-DiskImage | Dismount-DiskImage
Write-Host "Selected value '$($sync.MicrowinWindowsFlavors.SelectedValue)'....."
$sync.MicrowinOptionsPanel.Visibility = 'Visible'
Toggle-MicrowinPanel 2
} catch {
Write-Host "Dismounting bad image..."
Get-Volume $driveLetter | Get-DiskImage | Dismount-DiskImage
Remove-Item -Recurse -Force "$($scratchDir)"
Remove-Item -Recurse -Force "$($mountDir)"
Invoke-MicrowinBusyInfo -action "warning" -message "Failed to read and unpack ISO"
Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning"
}
Write-Host "Done reading and unpacking ISO"
@ -289,7 +333,7 @@ function Invoke-MicrowinGetIso {
Write-Host "*********************************"
Write-Host "Check the UI for further steps!!!"
$sync.BusyMessage.Visibility="Hidden"
Invoke-MicrowinBusyInfo -action "done" -message "Done! Proceed with customization."
$sync.ProcessRunning = $false
Set-WinUtilTaskbaritem -state "None" -overlay "checkmark"
}

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

@ -0,0 +1,28 @@
function Toggle-MicrowinPanel {
<#
.SYNOPSIS
Toggles the visibility of the Microwin options and ISO panels in the GUI.
.DESCRIPTION
This function toggles the visibility of the Microwin options and ISO panels in the GUI.
.PARAMETER MicrowinOptionsPanel
The panel containing Microwin options.
.PARAMETER MicrowinISOPanel
The panel containing the Microwin ISO options.
.EXAMPLE
Toggle-MicrowinPanel 1
#>
param (
[Parameter(Mandatory = $true, Position = 0)]
[ValidateSet(1, 2)]
[int]$PanelNumber
)
if ($PanelNumber -eq 1) {
$sync.MicrowinISOPanel.Visibility = 'Visible'
$sync.MicrowinOptionsPanel.Visibility = 'Collapsed'
} elseif ($PanelNumber -eq 2) {
$sync.MicrowinOptionsPanel.Visibility = 'Visible'
$sync.MicrowinISOPanel.Visibility = 'Collapsed'
}
}

View File

@ -33,7 +33,7 @@ function Get-WinUtilSelectedPackages
"Choco" {
if ($package.choco -eq "na") {
Write-Debug "$($package.content) has no Choco value."
$packagesWinget.add($package.winget)
$null = $packagesWinget.add($($package.winget))
Write-Host "Queueing $($package.winget) for Winget"
} else {
$null = $packagesChoco.add($package.choco)
@ -44,7 +44,7 @@ function Get-WinUtilSelectedPackages
"Winget" {
if ($package.winget -eq "na") {
Write-Debug "$($package.content) has no Winget value."
$packagesChoco.add($package.choco)
$null = $packagesChoco.add($package.choco)
Write-Host "Queueing $($package.choco) for Chocolatey"
} else {
$null = $packagesWinget.add($($package.winget))

View File

@ -0,0 +1,12 @@
function Hide-WPFInstallAppBusy {
<#
.SYNOPSIS
Hides the busy overlay in the install app area of the WPF form.
This is used to indicate that an install or uninstall has finished.
#>
$sync.form.Dispatcher.Invoke([action]{
$sync.InstallAppAreaOverlay.Visibility = [Windows.Visibility]::Collapsed
$sync.InstallAppAreaBorder.IsEnabled = $true
$sync.InstallAppAreaScrollViewer.Effect.Radius = 0
})
}

View File

@ -5,6 +5,8 @@
This is used as the parent object for all category and app entries on the install tab
Used to as part of the Install Tab UI generation
Also creates an overlay with a progress bar and text to indicate that an install or uninstall is in progress
.PARAMETER TargetElement
The element to which the AppArea shoud be added
@ -17,6 +19,7 @@
$Border = New-Object Windows.Controls.Border
$Border.VerticalAlignment = "Stretch"
$Border.SetResourceReference([Windows.Controls.Control]::StyleProperty, "BorderStyle")
$sync.InstallAppAreaBorder = $Border
# Add a ScrollViewer, because the ItemsControl does not support scrolling by itself
$scrollViewer = New-Object Windows.Controls.ScrollViewer
@ -24,11 +27,19 @@
$scrollViewer.HorizontalAlignment = 'Stretch'
$scrollViewer.VerticalAlignment = 'Stretch'
$scrollViewer.CanContentScroll = $true
$sync.InstallAppAreaScrollViewer = $scrollViewer
$Border.Child = $scrollViewer
# Initialize the Blur Effect for the ScrollViewer, which will be used to indicate that an install/uninstall is in progress
$blurEffect = New-Object Windows.Media.Effects.BlurEffect
$blurEffect.Radius = 0
$scrollViewer.Effect = $blurEffect
## Create the ItemsControl, which will be the parent of all the app entries
$itemsControl = New-Object Windows.Controls.ItemsControl
$itemsControl.HorizontalAlignment = 'Stretch'
$itemsControl.VerticalAlignment = 'Stretch'
$scrollViewer.Content = $itemsControl
# Enable virtualization for the ItemsControl to improve performance (It's hard to test if this is actually working, so if you know what you're doing, please check this)
$itemsPanelTemplate = New-Object Windows.Controls.ItemsPanelTemplate
@ -38,8 +49,64 @@
$itemsControl.SetValue([Windows.Controls.VirtualizingStackPanel]::IsVirtualizingProperty, $true)
$itemsControl.SetValue([Windows.Controls.VirtualizingStackPanel]::VirtualizationModeProperty, [Windows.Controls.VirtualizationMode]::Recycling)
$scrollViewer.Content = $itemsControl
$Border.Child = $scrollViewer
$null = $targetGrid.Children.Add($Border)
# Add the Border containing the App Area to the target Grid
$targetGrid.Children.Add($Border) | Out-Null
$overlay = New-Object Windows.Controls.Border
$overlay.CornerRadius = New-Object Windows.CornerRadius(10)
$overlay.SetResourceReference([Windows.Controls.Control]::BackgroundProperty, "AppInstallOverlayBackgroundColor")
$overlay.Visibility = [Windows.Visibility]::Collapsed
# Also add the overlay to the target Grid on top of the App Area
$targetGrid.Children.Add($overlay) | Out-Null
$sync.InstallAppAreaOverlay = $overlay
$overlayText = New-Object Windows.Controls.TextBlock
$overlayText.Text = "Installing apps..."
$overlayText.HorizontalAlignment = 'Center'
$overlayText.VerticalAlignment = 'Center'
$overlayText.SetResourceReference([Windows.Controls.TextBlock]::ForegroundProperty, "MainForegroundColor")
$overlayText.Background = "Transparent"
$overlayText.SetResourceReference([Windows.Controls.TextBlock]::FontSizeProperty, "HeaderFontSize")
$overlayText.SetResourceReference([Windows.Controls.TextBlock]::FontFamilyProperty, "MainFontFamily")
$overlayText.SetResourceReference([Windows.Controls.TextBlock]::FontWeightProperty, "MainFontWeight")
$overlayText.SetResourceReference([Windows.Controls.TextBlock]::MarginProperty, "MainMargin")
$sync.InstallAppAreaOverlayText = $overlayText
$progressbar = New-Object Windows.Controls.ProgressBar
$progressbar.Name = "ProgressBar"
$progressbar.Width = 250
$progressbar.Height = 50
$sync.ProgressBar = $progressbar
# Add a TextBlock overlay for the progress bar text
$progressBarTextBlock = New-Object Windows.Controls.TextBlock
$progressBarTextBlock.Name = "progressBarTextBlock"
$progressBarTextBlock.FontWeight = [Windows.FontWeights]::Bold
$progressBarTextBlock.FontSize = 16
$progressBarTextBlock.Width = $progressbar.Width
$progressBarTextBlock.Height = $progressbar.Height
$progressBarTextBlock.SetResourceReference([Windows.Controls.TextBlock]::ForegroundProperty, "ProgressBarTextColor")
$progressBarTextBlock.TextTrimming = "CharacterEllipsis"
$progressBarTextBlock.Background = "Transparent"
$sync.progressBarTextBlock = $progressBarTextBlock
# Create a Grid to overlay the text on the progress bar
$progressGrid = New-Object Windows.Controls.Grid
$progressGrid.Width = $progressbar.Width
$progressGrid.Height = $progressbar.Height
$progressGrid.Margin = "0,10,0,10"
$progressGrid.Children.Add($progressbar) | Out-Null
$progressGrid.Children.Add($progressBarTextBlock) | Out-Null
$overlayStackPanel = New-Object Windows.Controls.StackPanel
$overlayStackPanel.Orientation = "Vertical"
$overlayStackPanel.HorizontalAlignment = 'Center'
$overlayStackPanel.VerticalAlignment = 'Center'
$overlayStackPanel.Children.Add($overlayText) | Out-Null
$overlayStackPanel.Children.Add($progressGrid) | Out-Null
$overlay.Child = $overlayStackPanel
return $itemsControl
}

View File

@ -97,9 +97,9 @@ Function Install-WinUtilProgramWinget {
return $true
}
$userChoice = [System.Windows.MessageBox]::Show("Do you want to attempt $($Program) installation with specific user credentials? Select 'Yes' to proceed or 'No' to skip.", "User credential Prompt", [System.Windows.MessageBoxButton]::YesNo)
if ($userChoice -eq 'Yes') {
$getcreds = Get-Credential
$userAcknowledgment = [System.Windows.MessageBox]::Show("You need to input your password to install $($Program) with specific user credentials.", "User credential Prompt", [System.Windows.MessageBoxButton]::Ok)
if ($userAcknowledgment -eq 'Ok') {
$getcreds = Get-Credential $env:USERNAME
$status = Invoke-Winget -wingetId $Program -credential $getcreds
if ($status -eq 0) {
Write-Host "$($Program) installed successfully with User prompt."

View File

@ -0,0 +1,88 @@
function Invoke-WinUtilFontScaling {
<#
.SYNOPSIS
Applies UI and font scaling for accessibility
.PARAMETER ScaleFactor
Sets the scaling from 0.75 and 2.0.
Default is 1.0 (100% - no scaling)
.EXAMPLE
Invoke-WinUtilFontScaling -ScaleFactor 1.25
# Applies 125% scaling
#>
param (
[double]$ScaleFactor = 1.0
)
# Validate if scale factor is within the range
if ($ScaleFactor -lt 0.75 -or $ScaleFactor -gt 2.0) {
Write-Warning "Scale factor must be between 0.75 and 2.0. Using 1.0 instead."
$ScaleFactor = 1.0
}
# Define an array for resources to be scaled
$fontResources = @(
# Fonts
"FontSize",
"ButtonFontSize",
"HeaderFontSize",
"TabButtonFontSize",
"ConfigTabButtonFontSize",
"IconFontSize",
"SettingsIconFontSize",
"CloseIconFontSize",
"AppEntryFontSize",
"SearchBarTextBoxFontSize",
"SearchBarClearButtonFontSize",
"CustomDialogFontSize",
"CustomDialogFontSizeHeader",
"ConfigUpdateButtonFontSize",
# Buttons and UI
"CheckBoxBulletDecoratorSize",
"ButtonWidth",
"ButtonHeight",
"TabButtonWidth",
"TabButtonHeight",
"IconButtonSize",
"AppEntryWidth",
"SearchBarWidth",
"SearchBarHeight",
"CustomDialogWidth",
"CustomDialogHeight",
"CustomDialogLogoSize",
"MicroWinLogoSize",
"ToolTipWidth"
)
# Apply scaling to each resource
foreach ($resourceName in $fontResources) {
try {
# Get the default font size from the theme configuration
$originalValue = $sync.configs.themes.shared.$resourceName
if ($originalValue) {
# Convert string to double since values are stored as strings
$originalValue = [double]$originalValue
# Calculates and applies the new font size
$newValue = [math]::Round($originalValue * $ScaleFactor, 1)
$sync.Form.Resources[$resourceName] = $newValue
Write-Debug "Scaled $resourceName from original $originalValue to $newValue (factor: $ScaleFactor)"
}
}
catch {
Write-Warning "Failed to scale resource $resourceName : $_"
}
}
# Update the font scaling percentage displayed on the UI
if ($sync.FontScalingValue) {
$percentage = [math]::Round($ScaleFactor * 100)
$sync.FontScalingValue.Text = "$percentage%"
}
Write-Debug "Font scaling applied with factor: $ScaleFactor"
}

View File

@ -7,24 +7,18 @@ function Set-WinUtilProgressbar{
The Text to be overlayed onto the Progress Bar
.PARAMETER PERCENT
The percentage of the Progress Bar that should be filled (0-100)
.PARAMETER Hide
If provided, the Progress Bar and the label will be hidden
#>
param(
[string]$Label,
[ValidateRange(0,100)]
[int]$Percent,
$Hide
[int]$Percent
)
if ($hide) {
$sync.form.Dispatcher.Invoke([action]{$sync.ProgressBarLabel.Visibility = "Collapsed"})
$sync.form.Dispatcher.Invoke([action]{$sync.ProgressBar.Visibility = "Collapsed"})
} else {
$sync.form.Dispatcher.Invoke([action]{$sync.ProgressBarLabel.Visibility = "Visible"})
$sync.form.Dispatcher.Invoke([action]{$sync.ProgressBar.Visibility = "Visible"})
$sync.form.Dispatcher.Invoke([action]{$sync.progressBarTextBlock.Text = $label})
$sync.form.Dispatcher.Invoke([action]{$sync.progressBarTextBlock.ToolTip = $label})
if ($percent -lt 5 ) {
$percent = 5 # Ensure the progress bar is not empty, as it looks weird
}
$sync.form.Dispatcher.Invoke([action]{$sync.ProgressBarLabel.Content.Text = $label})
$sync.form.Dispatcher.Invoke([action]{$sync.ProgressBarLabel.Content.ToolTip = $label})
$sync.form.Dispatcher.Invoke([action]{ $sync.ProgressBar.Value = $percent})
}

View File

@ -0,0 +1,21 @@
function Show-WPFInstallAppBusy {
<#
.SYNOPSIS
Displays a busy overlay in the install app area of the WPF form.
This is used to indicate that an install or uninstall is in progress.
Dynamically updates the size of the overlay based on the app area on each invocation.
.PARAMETER text
The text to display in the busy overlay. Defaults to "Installing apps...".
#>
param (
$text = "Installing apps..."
)
$sync.form.Dispatcher.Invoke([action]{
$sync.InstallAppAreaOverlay.Visibility = [Windows.Visibility]::Visible
$sync.InstallAppAreaOverlay.Width = $($sync.InstallAppAreaScrollViewer.ActualWidth * 0.4)
$sync.InstallAppAreaOverlay.Height = $($sync.InstallAppAreaScrollViewer.ActualWidth * 0.4)
$sync.InstallAppAreaOverlayText.Text = $text
$sync.InstallAppAreaBorder.IsEnabled = $false
$sync.InstallAppAreaScrollViewer.Effect.Radius = 5
})
}

View File

@ -1,138 +0,0 @@
Function Uninstall-WinUtilEdgeBrowser {
<#
.SYNOPSIS
Uninstall the Edge Browser (Chromium) from the system in an elegant way.
.DESCRIPTION
This will switch up the region to one of the EEA countries temporarily and uninstall the Edge Browser (Chromium).
#>
param (
[Parameter(Mandatory = $true)]
[ValidateSet("install", "uninstall")]
[string]$action
)
function Uninstall-EdgeClient {
param (
[Parameter(Mandatory = $true)]
[string]$Key
)
$originalNation = [microsoft.win32.registry]::GetValue('HKEY_USERS\.DEFAULT\Control Panel\International\Geo', 'Nation', [Microsoft.Win32.RegistryValueKind]::String)
# Set Nation to any of the EEA regions temporarily
# Refer: https://learn.microsoft.com/en-us/windows/win32/intl/table-of-geographical-locations
$tmpNation = 68 # Ireland
[microsoft.win32.registry]::SetValue('HKEY_USERS\.DEFAULT\Control Panel\International\Geo', 'Nation', $tmpNation, [Microsoft.Win32.RegistryValueKind]::String) | Out-Null
$baseKey = 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate'
$registryPath = $baseKey + '\ClientState\' + $Key
if (!(Test-Path -Path $registryPath)) {
Write-Host "[$Mode] Registry key not found: $registryPath"
return
}
# Remove the status flag
Remove-ItemProperty -Path $baseKey -Name "IsEdgeStableUninstalled" -ErrorAction SilentlyContinue | Out-Null
Remove-ItemProperty -Path $registryPath -Name "experiment_control_labels" -ErrorAction SilentlyContinue | Out-Null
$uninstallString = (Get-ItemProperty -Path $registryPath).UninstallString
$uninstallArguments = (Get-ItemProperty -Path $registryPath).UninstallArguments
if ([string]::IsNullOrEmpty($uninstallString) -or [string]::IsNullOrEmpty($uninstallArguments)) {
Write-Host "[$Mode] Cannot find uninstall methods for $Mode"
return
}
# Extra arguments to nuke it
$uninstallArguments += " --force-uninstall --delete-profile"
# $uninstallCommand = "`"$uninstallString`"" + $uninstallArguments
if (!(Test-Path -Path $uninstallString)) {
Write-Host "[$Mode] setup.exe not found at: $uninstallString"
return
}
Start-Process -FilePath $uninstallString -ArgumentList $uninstallArguments -Wait -NoNewWindow -Verbose
# Restore Nation back to the original
[microsoft.win32.registry]::SetValue('HKEY_USERS\.DEFAULT\Control Panel\International\Geo', 'Nation', $originalNation, [Microsoft.Win32.RegistryValueKind]::String) | Out-Null
# might not exist in some cases
if ((Get-ItemProperty -Path $baseKey).IsEdgeStableUninstalled -eq 1) {
Write-Host "[$Mode] Edge Stable has been successfully uninstalled"
}
}
function Uninstall-Edge {
Remove-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge" -Name "NoRemove" -ErrorAction SilentlyContinue | Out-Null
[microsoft.win32.registry]::SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdateDev", "AllowUninstall", 1, [Microsoft.Win32.RegistryValueKind]::DWord) | Out-Null
Uninstall-EdgeClient -Key '{56EB18F8-B008-4CBD-B6D2-8C97FE7E9062}'
Remove-Item -Path "Computer\\HKEY_CLASSES_ROOT\\MSEdgePDF" -ErrorAction SilentlyContinue | Out-Null
Remove-Item -Path "Computer\\HKEY_CLASSES_ROOT\\MSEdgeHTM" -ErrorAction SilentlyContinue | Out-Null
Remove-Item -Path "Computer\\HKEY_CLASSES_ROOT\\MSEdgeMHT" -ErrorAction SilentlyContinue | Out-Null
# Remove Edge Polocy reg keys
Remove-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Edge" -Recurse -ErrorAction SilentlyContinue | Out-Null
# Remove Edge reg keys
Remove-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Edge" -Recurse -ErrorAction SilentlyContinue | Out-Null
}
function Uninstall-WebView {
# FIXME: might not work on some systems
Remove-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft EdgeWebView" -Name "NoRemove" -ErrorAction SilentlyContinue | Out-Null
Uninstall-EdgeClient -Key '{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}'
}
function Uninstall-EdgeUpdate {
# FIXME: might not work on some systems
Remove-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge Update" -Name "NoRemove" -ErrorAction SilentlyContinue | Out-Null
$registryPath = 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate'
if (!(Test-Path -Path $registryPath)) {
Write-Host "Registry key not found: $registryPath"
return
}
$uninstallCmdLine = (Get-ItemProperty -Path $registryPath).UninstallCmdLine
if ([string]::IsNullOrEmpty($uninstallCmdLine)) {
Write-Host "Cannot find uninstall methods for $Mode"
return
}
Start-Process cmd.exe "/c $uninstallCmdLine" -WindowStyle Hidden -Wait
# Remove EdgeUpdate reg keys
Remove-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate" -Recurse -ErrorAction SilentlyContinue | Out-Null
}
function Install-Edge {
$tempEdgePath = "$env:TEMP\MicrosoftEdgeSetup.exe"
try {
write-host "Installing Edge ..."
Invoke-WebRequest -Uri "https://go.microsoft.com/fwlink/?linkid=2109047&Channel=Stable&language=en&consent=1" -OutFile $tempEdgePath
Start-Process -FilePath $tempEdgePath -ArgumentList "/silent /install" -Wait
Remove-item $tempEdgePath
write-host "Edge Installed Successfully"
} catch {
write-host "Failed to install Edge"
}
}
if ($action -eq "Install") {
Install-Edge
} elseif ($action -eq "Uninstall") {
Uninstall-Edge
Uninstall-EdgeUpdate
# Uninstall-WebView - WebView is needed for Visual Studio and some MS Store Games like Forza
}
}

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

@ -15,7 +15,7 @@ function Invoke-WPFButton {
# Use this to get the name of the button
#[System.Windows.MessageBox]::Show("$Button","Chris Titus Tech's Windows Utility","OK","Info")
if (-not $sync.ProcessRunning) {
Set-WinUtilProgressBar -label "" -percent 0 -hide $true
Set-WinUtilProgressBar -label "" -percent 0
}
Switch -Wildcard ($Button) {
@ -35,15 +35,16 @@ function Invoke-WPFButton {
"WPFFeatureInstall" {Invoke-WPFFeatureInstall}
"WPFPanelDISM" {Invoke-WPFSystemRepair}
"WPFPanelAutologin" {Invoke-WPFPanelAutologin}
"WPFPanelcontrol" {Invoke-WPFControlPanel -Panel $button}
"WPFPanelnetwork" {Invoke-WPFControlPanel -Panel $button}
"WPFPanelpower" {Invoke-WPFControlPanel -Panel $button}
"WPFPanelregion" {Invoke-WPFControlPanel -Panel $button}
"WPFPanelsound" {Invoke-WPFControlPanel -Panel $button}
"WPFPanelprinter" {Invoke-WPFControlPanel -Panel $button}
"WPFPanelsystem" {Invoke-WPFControlPanel -Panel $button}
"WPFPaneluser" {Invoke-WPFControlPanel -Panel $button}
"WPFPanelGodMode" {Invoke-WPFControlPanel -Panel $button}
"WPFPanelComputer" {Invoke-WPFControlPanel -Panel $button}
"WPFPanelControl" {Invoke-WPFControlPanel -Panel $button}
"WPFPanelNetwork" {Invoke-WPFControlPanel -Panel $button}
"WPFPanelPower" {Invoke-WPFControlPanel -Panel $button}
"WPFPanelPrinter" {Invoke-WPFControlPanel -Panel $button}
"WPFPanelRegion" {Invoke-WPFControlPanel -Panel $button}
"WPFPanelSound" {Invoke-WPFControlPanel -Panel $button}
"WPFPanelSystem" {Invoke-WPFControlPanel -Panel $button}
"WPFPanelTimedate" {Invoke-WPFControlPanel -Panel $button}
"WPFPanelUser" {Invoke-WPFControlPanel -Panel $button}
"WPFUpdatesdefault" {Invoke-WPFFixesUpdate}
"WPFFixesUpdate" {Invoke-WPFFixesUpdate}
"WPFFixesWinget" {Invoke-WPFFixesWinget}
@ -62,5 +63,7 @@ function Invoke-WPFButton {
"WPFWinUtilUninstallPSProfile" {Invoke-WinUtilUninstallPSProfile}
"WPFWinUtilSSHServer" {Invoke-WPFSSHServer}
"WPFselectedAppsButton" {$sync.selectedAppsPopup.IsOpen = -not $sync.selectedAppsPopup.IsOpen}
"WPFMicrowinPanelBack" {Toggle-MicrowinPanel 1}
"MicrowinAutoConfigBtn" {Invoke-AutoConfigDialog}
}
}

View File

@ -11,14 +11,15 @@ function Invoke-WPFControlPanel {
param($Panel)
switch ($Panel) {
"WPFPanelcontrol" {cmd /c control}
"WPFPanelnetwork" {cmd /c ncpa.cpl}
"WPFPanelpower" {cmd /c powercfg.cpl}
"WPFPanelregion" {cmd /c intl.cpl}
"WPFPanelsound" {cmd /c mmsys.cpl}
"WPFPanelprinter" {Start-Process "shell:::{A8A91A66-3A7D-4424-8D24-04E180695C7A}"}
"WPFPanelsystem" {cmd /c sysdm.cpl}
"WPFPaneluser" {cmd /c "control userpasswords2"}
"WPFPanelGodMode" {Start-Process "shell:::{ED7BA470-8E54-465E-825C-99712043E01C}"}
"WPFPanelControl" {control}
"WPFPanelComputer" {compmgmt.msc}
"WPFPanelNetwork" {ncpa.cpl}
"WPFPanelPower" {powercfg.cpl}
"WPFPanelPrinter" {Start-Process "shell:::{A8A91A66-3A7D-4424-8D24-04E180695C7A}"}
"WPFPanelRegion" {intl.cpl}
"WPFPanelSound" {mmsys.cpl}
"WPFPanelSystem" {sysdm.cpl}
"WPFPanelTimedate" {timedate.cpl}
"WPFPanelUser" {control userpasswords2}
}
}

View File

@ -8,13 +8,20 @@ function Invoke-WPFFixesNetwork {
Write-Host "Resetting Network with netsh"
Set-WinUtilTaskbaritem -state "Normal" -value 0.01 -overlay "logo"
# Reset WinSock catalog to a clean state
Start-Process -NoNewWindow -FilePath "netsh" -ArgumentList "winsock", "reset"
Set-WinUtilTaskbaritem -state "Normal" -value 0.35 -overlay "logo"
# Resets WinHTTP proxy setting to DIRECT
Start-Process -NoNewWindow -FilePath "netsh" -ArgumentList "winhttp", "reset", "proxy"
Set-WinUtilTaskbaritem -state "Normal" -value 0.7 -overlay "logo"
# Removes all user configured IP settings
Start-Process -NoNewWindow -FilePath "netsh" -ArgumentList "int", "ip", "reset"
Set-WinUtilTaskbaritem -state "None" -overlay "checkmark"
Write-Host "Process complete. Please reboot your computer."
$ButtonType = [System.Windows.MessageBoxButton]::OK

View File

@ -30,6 +30,8 @@ function Invoke-WPFFixesUpdate {
param($Aggressive = $false)
Write-Progress -Id 0 -Activity "Repairing Windows Update" -PercentComplete 0
Set-WinUtilTaskbaritem -state "Indeterminate" -overlay "logo"
Write-Host "Starting Windows Update Repair..."
# Wait for the first progress bar to show, otherwise the second one won't show
Start-Sleep -Milliseconds 200
@ -190,12 +192,15 @@ function Invoke-WPFFixesUpdate {
try {
(New-Object -ComObject Microsoft.Update.AutoUpdate).DetectNow()
} catch {
Set-WinUtilTaskbaritem -state "Error" -overlay "warning"
Write-Warning "Failed to create Windows Update COM object: $_"
}
Start-Process -NoNewWindow -FilePath "wuauclt" -ArgumentList "/resetauthorization", "/detectnow"
Write-Progress -Id 10 -ParentId 0 -Activity "Forcing discovery" -Status "Completed" -PercentComplete 100
Write-Progress -Id 0 -Activity "Repairing Windows Update" -Status "Completed" -PercentComplete 100
Set-WinUtilTaskbaritem -state "None" -overlay "checkmark"
$ButtonType = [System.Windows.MessageBoxButton]::OK
$MessageboxTitle = "Reset Windows Update "
$Messageboxbody = ("Stock settings loaded.`n Please reboot your computer")

View File

@ -8,7 +8,16 @@ function Invoke-WPFFixesWinget {
BravoNorris for the fantastic idea of a button to reinstall winget
#>
# Install Choco if not already present
Install-WinUtilChoco
Start-Process -FilePath "choco" -ArgumentList "install winget -y --force" -NoNewWindow -Wait
try {
Set-WinUtilTaskbaritem -state "Indeterminate" -overlay "logo"
Install-WinUtilChoco
Start-Process -FilePath "choco" -ArgumentList "install winget -y --force" -NoNewWindow -Wait
} catch {
Write-Error "Failed to install winget: $_"
Set-WinUtilTaskbaritem -state "Error" -overlay "warning"
} finally {
Write-Host "==> Finished Winget Repair"
Set-WinUtilTaskbaritem -state "None" -overlay "checkmark"
}
}

View File

@ -4,10 +4,8 @@ function Invoke-WPFInstall {
[PSObject[]]$PackagesToInstall = $($sync.selectedApps | Foreach-Object { $sync.configs.applicationsHashtable.$_ })
)
<#
.SYNOPSIS
Installs the selected programs using winget, if one or more of the selected programs are already installed on the system, winget will try and perform an upgrade if there's a newer version to install.
#>
if($sync.ProcessRunning) {
@ -34,15 +32,60 @@ function Invoke-WPFInstall {
try {
$sync.ProcessRunning = $true
if($packagesWinget.Count -gt 0) {
if($packagesWinget.Count -gt 0 -and $packagesWinget -ne "0") {
Add-Type -AssemblyName System.DirectoryServices.AccountManagement
Add-Type -assembly System.Windows.Forms
$PrincipalContext = New-Object System.DirectoryServices.AccountManagement.PrincipalContext('Machine')
$user = $env:USERNAME
Get-LocalUser | Where-Object Enabled -eq $true | ForEach-Object {
try {
$myPasswordIsBlank = $PrincipalContext.ValidateCredentials($user, $null)
} catch {
$form = New-Object System.Windows.Forms.Form
$form.Text = "Set password for $user"
$form.Size = New-Object System.Drawing.Size(500, 200)
$label = New-Object System.Windows.Forms.Label
$label.Text = 'Maybe a program needs to be installed in "usermode" and you have no password set, you need to set it here. After putting a password into the text box a page asking for your password might open (not right after). If you keep the text box empty, nothing will happen.
REMEMBER THE PASSWORD FOR THE FUTURE. YOU WILL NEED FOR STUFF AND TO LOGIN IF AUTOLOGIN ISN`T SET'
$label.Size = New-Object System.Drawing.Size(480, 60)
$label.Location = New-Object System.Drawing.Point(10, 10)
$form.Controls.Add($label)
$passwordBox = New-Object System.Windows.Forms.TextBox
$passwordBox.Size = New-Object System.Drawing.Size(380, 20)
$passwordBox.UseSystemPasswordChar = $true
$passwordBox.Location = New-Object System.Drawing.Point(10, 125)
$form.Controls.Add($passwordBox)
$button = New-Object System.Windows.Forms.Button
$button.Text = 'Submit'
$button.Size = New-Object System.Drawing.Size(75, 23)
$button.Location = New-Object System.Drawing.Point(400, 125)
$button.Add_Click({
$password = $passwordBox.Text | ConvertTo-SecureString -AsPlainText -Force
if ($password) {
Set-LocalUser -Name $user -Password $password
$Form.Close()
} else {
[System.Windows.Forms.MessageBox]::Show('No password entered!')
}
})
$form.Controls.Add($button)
$form.ShowDialog() | Out-Null
}
}
Show-WPFInstallAppBusy -text "Installing apps..."
Install-WinUtilWinget
Install-WinUtilProgramWinget -Action Install -Programs $packagesWinget
}
if($packagesChoco.Count -gt 0) {
Install-WinUtilChoco
Install-WinUtilProgramChoco -Action Install -Programs $packagesChoco
}
Hide-WPFInstallAppBusy
Write-Host "==========================================="
Write-Host "-- Installs have finished ---"
Write-Host "==========================================="

View File

@ -104,21 +104,34 @@ function Invoke-WPFSystemRepair {
Write-Progress -Id 1 -Activity $childProgressBarActivity -Status "DISM Completed" -PercentComplete 100 -Completed
}
$childProgressBarActivity = "Scanning for corruption"
Write-Progress -Id 0 -Activity "Repairing Windows" -PercentComplete 0
# Step 1: Run chkdsk to fix disk and filesystem corruption before proceeding with system file repairs
Invoke-Chkdsk
Write-Progress -Id 0 -Activity "Repairing Windows" -PercentComplete 25
try {
Set-WinUtilTaskbaritem -state "Indeterminate" -overlay "logo"
# Step 2: Run SFC to fix system file corruption and ensure DISM can operate correctly
Invoke-SFC
Write-Progress -Id 0 -Activity "Repairing Windows" -PercentComplete 50
$childProgressBarActivity = "Scanning for corruption"
Write-Progress -Id 0 -Activity "Repairing Windows" -PercentComplete 0
# Step 1: Run chkdsk to fix disk and filesystem corruption before proceeding with system file repairs
Invoke-Chkdsk
Write-Progress -Id 0 -Activity "Repairing Windows" -PercentComplete 25
# Step 3: Run DISM to repair the system image, which SFC relies on for accurate repairs
Invoke-DISM
Write-Progress -Id 0 -Activity "Repairing Windows" -PercentComplete 75
# Step 2: Run SFC to fix system file corruption and ensure DISM can operate correctly
Invoke-SFC
Write-Progress -Id 0 -Activity "Repairing Windows" -PercentComplete 50
# Step 3: Run DISM to repair the system image, which SFC relies on for accurate repairs
Invoke-DISM
Write-Progress -Id 0 -Activity "Repairing Windows" -PercentComplete 75
# Step 4: Run SFC again to ensure system files are repaired using the now-fixed system image
Invoke-SFC
Write-Progress -Id 0 -Activity "Repairing Windows" -PercentComplete 100 -Completed
Set-WinUtilTaskbaritem -state "None" -overlay "checkmark"
} catch {
Write-Error "An error occurred while repairing the system: $_"
Set-WinUtilTaskbaritem -state "Error" -overlay "warning"
} finally {
Write-Host "==> Finished System Repair"
Set-WinUtilTaskbaritem -state "None" -overlay "checkmark"
}
# Step 4: Run SFC again to ensure system files are repaired using the now-fixed system image
Invoke-SFC
Write-Progress -Id 0 -Activity "Repairing Windows" -PercentComplete 100 -Completed
}

View File

@ -8,65 +8,74 @@ Function Invoke-WPFUltimatePerformance {
Specifies whether to "Enable" or "Disable" the Ultimate Performance power scheme.
#>
param($State)
param(
[Parameter(Mandatory = $true)]
[ValidateSet("Enable", "Disable")]
[string]$State
)
try {
# GUID of the Ultimate Performance power plan
$ultimateGUID = "e9a42b02-d5df-448d-aa00-03f14749eb61"
if ($State -eq "Enable") {
# Duplicate the Ultimate Performance power plan using its GUID
$duplicateOutput = powercfg /duplicatescheme $ultimateGUID
switch ($State) {
"Enable" {
# Duplicate the Ultimate Performance power plan using its GUID
$duplicateOutput = powercfg /duplicatescheme $ultimateGUID
$guid = $null
$nameFromFile = "ChrisTitus - Ultimate Power Plan"
$description = "Ultimate Power Plan, added via WinUtils"
$guid = $null
$nameFromFile = "ChrisTitus - Ultimate Power Plan"
$description = "Ultimate Power Plan, added via WinUtils"
# Extract the new GUID from the duplicateOutput
foreach ($line in $duplicateOutput) {
if ($line -match "\b[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\b") {
$guid = $matches[0] # $matches[0] will contain the first match, which is the GUID
Write-Output "GUID: $guid has been extracted and stored in the variable."
break
# Extract the new GUID from the duplicateOutput
foreach ($line in $duplicateOutput) {
if ($line -match "\b[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\b") {
$guid = $matches[0] # $matches[0] will contain the first match, which is the GUID
Write-Output "GUID: $guid has been extracted and stored in the variable."
break
}
}
if (-not $guid) {
Write-Output "No GUID found in the duplicateOutput. Check the output format."
exit 1
}
# Change the name of the power plan and set its description
$changeNameOutput = powercfg /changename $guid "$nameFromFile" "$description"
Write-Output "The power plan name and description have been changed. Output:"
Write-Output $changeNameOutput
# Set the duplicated Ultimate Performance plan as active
$setActiveOutput = powercfg /setactive $guid
Write-Output "The power plan has been set as active. Output:"
Write-Output $setActiveOutput
Write-Host "> Ultimate Performance plan installed and set as active."
}
"Disable" {
# Check if the Ultimate Performance plan is installed by GUID
$installedPlan = powercfg -list | Select-String -Pattern "ChrisTitus - Ultimate Power Plan"
if ($installedPlan) {
# Extract the GUID of the installed Ultimate Performance plan
$ultimatePlanGUID = $installedPlan.Line.Split()[3]
# Set a different power plan as active before deleting the Ultimate Performance plan
$balancedPlanGUID = "381b4222-f694-41f0-9685-ff5bb260df2e"
powercfg -setactive $balancedPlanGUID
# Delete the Ultimate Performance plan by GUID
powercfg -delete $ultimatePlanGUID
Write-Host "Ultimate Performance plan has been uninstalled."
Write-Host "> Balanced plan is now active."
} else {
Write-Host "Ultimate Performance plan is not installed."
}
}
if (-not $guid) {
Write-Output "No GUID found in the duplicateOutput. Check the output format."
exit 1
}
# Change the name of the power plan and set its description
$changeNameOutput = powercfg /changename $guid "$nameFromFile" "$description"
Write-Output "The power plan name and description have been changed. Output:"
Write-Output $changeNameOutput
# Set the duplicated Ultimate Performance plan as active
$setActiveOutput = powercfg /setactive $guid
Write-Output "The power plan has been set as active. Output:"
Write-Output $setActiveOutput
Write-Host "> Ultimate Performance plan installed and set as active."
} elseif ($State -eq "Disable") {
# Check if the Ultimate Performance plan is installed by GUID
$installedPlan = (powercfg -list | Select-String -Pattern "ChrisTitus - Ultimate Power Plan").Line.Split()[3]
if ($installedPlan) {
# Extract the GUID of the installed Ultimate Performance plan
$ultimatePlanGUID = $installedPlan.Line.Split()[3]
# Set a different power plan as active before deleting the Ultimate Performance plan
$balancedPlanGUID = 381b4222-f694-41f0-9685-ff5bb260df2e
powercfg -setactive $balancedPlanGUID
# Delete the Ultimate Performance plan by GUID
powercfg -delete $ultimatePlanGUID
Write-Host "Ultimate Performance plan has been uninstalled."
Write-Host "> Balanced plan is now active."
} else {
Write-Host "Ultimate Performance plan is not installed."
default {
Write-Host "Invalid state. Please use 'Enable' or 'Disable'."
}
}
} catch {

View File

@ -41,6 +41,7 @@ function Invoke-WPFUnInstall {
try {
$sync.ProcessRunning = $true
Show-WPFInstallAppBusy -text "Uninstalling apps..."
# Uninstall all selected programs in new window
if($packagesWinget.Count -gt 0) {
@ -49,7 +50,7 @@ function Invoke-WPFUnInstall {
if($packagesChoco.Count -gt 0) {
Install-WinUtilProgramChoco -Action Uninstall -Programs $packagesChoco
}
Hide-WPFInstallAppBusy
Write-Host "==========================================="
Write-Host "-- Uninstalls have finished ---"
Write-Host "==========================================="

View File

@ -261,7 +261,7 @@ $commonKeyEvents = {
$sync["Form"].Add_PreViewKeyDown($commonKeyEvents)
$sync["Form"].Add_MouseLeftButtonDown({
Invoke-WPFPopup -Action "Hide" -Popups @("Settings", "Theme")
Invoke-WPFPopup -Action "Hide" -Popups @("Settings", "Theme", "FontScaling")
$sync["Form"].DragMove()
})
@ -279,7 +279,7 @@ $sync["Form"].Add_MouseDoubleClick({
$sync["Form"].Add_Deactivated({
Write-Debug "WinUtil lost focus"
Invoke-WPFPopup -Action "Hide" -Popups @("Settings", "Theme")
Invoke-WPFPopup -Action "Hide" -Popups @("Settings", "Theme", "FontScaling")
})
$sync["Form"].Add_ContentRendered({
@ -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."
@ -441,7 +448,7 @@ $sync["Form"].Add_Activated({
$sync["ThemeButton"].Add_Click({
Write-Debug "ThemeButton clicked"
Invoke-WPFPopup -PopupActionTable @{ "Settings" = "Hide"; "Theme" = "Toggle" }
Invoke-WPFPopup -PopupActionTable @{ "Settings" = "Hide"; "Theme" = "Toggle"; "FontScaling" = "Hide" }
})
$sync["AutoThemeMenuItem"].Add_Click({
Write-Debug "About clicked"
@ -461,7 +468,7 @@ $sync["LightThemeMenuItem"].Add_Click({
$sync["SettingsButton"].Add_Click({
Write-Debug "SettingsButton clicked"
Invoke-WPFPopup -PopupActionTable @{ "Settings" = "Toggle"; "Theme" = "Hide" }
Invoke-WPFPopup -PopupActionTable @{ "Settings" = "Toggle"; "Theme" = "Hide"; "FontScaling" = "Hide" }
})
$sync["ImportMenuItem"].Add_Click({
Write-Debug "Import clicked"
@ -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>
"@
@ -506,5 +513,30 @@ $sync["SponsorMenuItem"].Add_Click({
Show-CustomDialog -Title "Sponsors" -Message $authorInfo -EnableScroll $true
})
# Font Scaling Event Handlers
$sync["FontScalingButton"].Add_Click({
Write-Debug "FontScalingButton clicked"
Invoke-WPFPopup -PopupActionTable @{ "Settings" = "Hide"; "Theme" = "Hide"; "FontScaling" = "Toggle" }
})
$sync["FontScalingSlider"].Add_ValueChanged({
param($slider)
$percentage = [math]::Round($slider.Value * 100)
$sync.FontScalingValue.Text = "$percentage%"
})
$sync["FontScalingResetButton"].Add_Click({
Write-Debug "FontScalingResetButton clicked"
$sync.FontScalingSlider.Value = 1.0
$sync.FontScalingValue.Text = "100%"
})
$sync["FontScalingApplyButton"].Add_Click({
Write-Debug "FontScalingApplyButton clicked"
$scaleFactor = $sync.FontScalingSlider.Value
Invoke-WinUtilFontScaling -ScaleFactor $scaleFactor
Invoke-WPFPopup -Action "Hide" -Popups @("FontScaling")
})
$sync["Form"].ShowDialog() | out-null
Stop-Transcript

View File

@ -801,6 +801,7 @@
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="CaretBrush" Value="{DynamicResource MainForegroundColor}"/>
<Setter Property="ContextMenu">
<Setter.Value>
<ContextMenu>
@ -855,6 +856,7 @@
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="CaretBrush" Value="{DynamicResource MainForegroundColor}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="PasswordBox">
@ -946,6 +948,7 @@
<ColumnDefinition Width="Auto"/><!-- Space for close button -->
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/><!-- Space for Font Scaling button-->
</Grid.ColumnDefinitions>
<!--
@ -992,34 +995,6 @@
Margin="210,0,0,0" Visibility="Collapsed">
</Button>
<ProgressBar
Grid.Column="1"
Minimum="0"
Maximum="100"
Width="250"
Height="{DynamicResource SearchBarHeight}"
Foreground="{DynamicResource ProgressBarForegroundColor}" Background="{DynamicResource ProgressBarBackgroundColor}" BorderBrush="{DynamicResource ProgressBarForegroundColor}"
Visibility="Collapsed"
VerticalAlignment="Center" HorizontalAlignment="Left"
Margin="2,0,0,0" BorderThickness="1" Padding="6,2,2,2"
Name="ProgressBar">
</ProgressBar>
<Label
Grid.Column="1"
Width="250"
Height="{DynamicResource SearchBarHeight}"
VerticalAlignment="Center" HorizontalAlignment="Left"
FontSize="{DynamicResource SearchBarTextBoxFontSize}"
Background="Transparent"
Visibility="Collapsed"
Margin="2,0,0,0" BorderThickness="0" Padding="6,2,2,2"
Name="ProgressBarLabel">
<TextBlock
TextTrimming="CharacterEllipsis"
Background="Transparent"
Foreground="{DynamicResource ProgressBarTextColor}">
</TextBlock>
</Label>
<Button Name="ThemeButton"
Style="{StaticResource HoverButtonStyle}"
Grid.Column="2" BorderBrush="Transparent"
@ -1058,7 +1033,7 @@
</Border>
</Popup>
<Button Name="SettingsButton"
<Button Name="FontScalingButton"
Style="{StaticResource HoverButtonStyle}"
Grid.Column="3" BorderBrush="Transparent"
Background="{DynamicResource MainBackgroundColor}"
@ -1066,6 +1041,74 @@
FontSize="{DynamicResource SettingsIconFontSize}"
Width="{DynamicResource IconButtonSize}" Height="{DynamicResource IconButtonSize}"
HorizontalAlignment="Right" VerticalAlignment="Top"
Margin="0,5,5,0"
FontFamily="Segoe MDL2 Assets"
Content="&#xE8D3;"
ToolTip="Adjust Font Scaling for Accessibility"
/>
<Popup Grid.Column="3" Name="FontScalingPopup"
IsOpen="False"
PlacementTarget="{Binding ElementName=FontScalingButton}" Placement="Bottom"
HorizontalAlignment="Right" VerticalAlignment="Top">
<Border Background="{DynamicResource MainBackgroundColor}" BorderBrush="{DynamicResource MainForegroundColor}" BorderThickness="1" CornerRadius="0" Margin="0">
<StackPanel Background="{DynamicResource MainBackgroundColor}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinWidth="200">
<TextBlock Text="Font Scaling"
FontSize="{DynamicResource ButtonFontSize}"
Foreground="{DynamicResource MainForegroundColor}"
HorizontalAlignment="Center"
Margin="10,5,10,5"
FontWeight="Bold"/>
<Separator Margin="5,0,5,5"/>
<StackPanel Orientation="Horizontal" Margin="10,5,10,10">
<TextBlock Text="Small"
FontSize="{DynamicResource ButtonFontSize}"
Foreground="{DynamicResource MainForegroundColor}"
VerticalAlignment="Center"
Margin="0,0,10,0"/>
<Slider Name="FontScalingSlider"
Minimum="0.75" Maximum="2.0"
Value="1.0"
TickFrequency="0.25"
TickPlacement="BottomRight"
IsSnapToTickEnabled="True"
Width="120"
VerticalAlignment="Center"/>
<TextBlock Text="Large"
FontSize="{DynamicResource ButtonFontSize}"
Foreground="{DynamicResource MainForegroundColor}"
VerticalAlignment="Center"
Margin="10,0,0,0"/>
</StackPanel>
<TextBlock Name="FontScalingValue"
Text="100%"
FontSize="{DynamicResource ButtonFontSize}"
Foreground="{DynamicResource MainForegroundColor}"
HorizontalAlignment="Center"
Margin="10,0,10,5"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="10,0,10,10">
<Button Name="FontScalingResetButton"
Content="Reset"
Style="{StaticResource HoverButtonStyle}"
Width="60" Height="25"
Margin="5,0,5,0"/>
<Button Name="FontScalingApplyButton"
Content="Apply"
Style="{StaticResource HoverButtonStyle}"
Width="60" Height="25"
Margin="5,0,5,0"/>
</StackPanel>
</StackPanel>
</Border>
</Popup>
<Button Name="SettingsButton"
Style="{StaticResource HoverButtonStyle}"
Grid.Column="4" BorderBrush="Transparent"
Background="{DynamicResource MainBackgroundColor}"
Foreground="{DynamicResource MainForegroundColor}"
FontSize="{DynamicResource SettingsIconFontSize}"
Width="{DynamicResource IconButtonSize}" Height="{DynamicResource IconButtonSize}"
HorizontalAlignment="Right" VerticalAlignment="Top"
Margin="5,5,5,0"
FontFamily="Segoe MDL2 Assets"
Content="&#xE713;"/>
@ -1093,7 +1136,7 @@
</Popup>
<Button
Grid.Column="4"
Grid.Column="5"
Content="&#xD7;" BorderThickness="0"
BorderBrush="Transparent"
Background="{DynamicResource MainBackgroundColor}"
@ -1287,7 +1330,7 @@
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch">
<StackPanel Name="MicrowinMain" Background="{DynamicResource MainBackgroundColor}" SnapsToDevicePixels="True" Grid.Column="0" Grid.Row="0">
<StackPanel Background="Transparent" SnapsToDevicePixels="True" Margin="1">
<StackPanel Name="MicrowinISOPanel" Background="Transparent" SnapsToDevicePixels="True" Margin="1">
<CheckBox x:Name="WPFMicrowinDownloadFromGitHub" Content="Download oscdimg.exe from CTT Github repo" IsChecked="True" Margin="{DynamicResource MicrowinCheckBoxMargin}" />
<TextBlock Margin="5" Padding="1" TextWrapping="Wrap" Foreground="{DynamicResource ComboBoxForegroundColor}">
Choose a Windows ISO file that you've downloaded <LineBreak/>
@ -1342,8 +1385,46 @@
</Button.Content>
</Button>
</StackPanel>
<!-- Visibility="Hidden" -->
<StackPanel Name="MicrowinOptionsPanel" HorizontalAlignment="Left" SnapsToDevicePixels="True" Margin="1" Visibility="Hidden">
<Grid Margin="0,0,0,10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button Name="WPFMicrowinPanelBack"
Grid.Column="0"
Width="30" Height="30"
HorizontalAlignment="Left"
FontFamily="Segoe MDL2 Assets"
FontSize="12"
Content="&#xE76B;"
ToolTip="Back to main view"
Background="{DynamicResource ButtonBackgroundColor}"
Foreground="{DynamicResource ButtonForegroundColor}"
BorderBrush="{DynamicResource ButtonBackgroundColor}"
BorderThickness="1"
Padding="0">
<Button.ContentTemplate>
<DataTemplate>
<TextBlock Text="{Binding}"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</DataTemplate>
</Button.ContentTemplate>
</Button>
<TextBlock Name="MicrowinPanel2Title"
Grid.Column="1"
Text="Configure Windows ISO"
Margin="10,0,0,0"
Foreground="{DynamicResource MainForegroundColor}"
FontSize="16"
VerticalAlignment="Center"/>
</Grid>
<TextBlock Margin="6" Padding="1" TextWrapping="Wrap">Choose Windows SKU</TextBlock>
<ComboBox x:Name = "MicrowinWindowsFlavors" Margin="1" />
<Rectangle Fill="{DynamicResource MainForegroundColor}" Height="2" HorizontalAlignment="Stretch" Margin="0,10,0,10"/>
@ -1371,13 +1452,44 @@
Foreground="{DynamicResource LabelboxForegroundColor}"
MaxLength="20"
/>
<TextBlock Margin="6" Padding="1" TextWrapping="Wrap">Password (characters will not be shown for your security):</TextBlock>
<TextBlock Margin="6" Padding="1" TextWrapping="Wrap">Password:</TextBlock>
<PasswordBox Name="MicrowinUserPassword" Background="Transparent" BorderThickness="1" BorderBrush="{DynamicResource MainForegroundColor}"
Margin="6"
PasswordChar="*"
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">
@ -1395,11 +1507,17 @@
Grid.Row="0" Grid.Column="1">
<StackPanel HorizontalAlignment="Left" Background="{DynamicResource MainBackgroundColor}" SnapsToDevicePixels="True" Visibility="Visible">
<Grid Name = "BusyMessage" Visibility="Collapsed">
<TextBlock Name = "BusyText" Text="NBusy" Padding="22,2,1,1" />
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" FontFamily="Segoe MDL2 Assets"
FontSize="{DynamicResource IconFontSize}" Margin="16,0,0,0">&#xE701;</TextBlock>
</Grid>
<StackPanel x:Name="MicrowinBusyIndicator" Orientation="Horizontal" Margin="15,15,15,0">
<TextBlock x:Name="BusyIcon" FontFamily="Segoe MDL2 Assets" Text="&#xE701;"
Margin="0,0,8,2"
FontSize="16"
VerticalAlignment="Center"
Foreground="{DynamicResource MicrowinBusyColor}"/>
<TextBlock x:Name="BusyText" Text="Microwin"
VerticalAlignment="Center"
TextTrimming="CharacterEllipsis"
Foreground="{DynamicResource MicrowinBusyColor}"/>
</StackPanel>
<TextBlock x:Name = "asciiTextBlock"
xml:space ="preserve"
@ -1440,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/>