Compare commits

..

27 Commits

Author SHA1 Message Date
986376c44a Revert "Refactor preferChocolatey system to handle other package managers eas…"
This reverts commit 89919494e5.
2025-04-14 13:57:10 -05:00
89919494e5 Refactor preferChocolatey system to handle other package managers easier (#3296)
* Easier to add more package managers changes

* style fixes
2025-04-14 13:33:16 -05:00
5f6bdb2e48 Update tweaks.json 2025-04-14 13:27:02 -05:00
f614eea435 Add "Disable news and interest" tweak (#3289) 2025-04-14 13:22:29 -05:00
82447a1e7b Remove Balena Etcher due to privacy concerns (#3268) 2025-04-14 13:19:19 -05:00
51424abfad Update preset.json 2025-04-14 13:08:55 -05:00
3caa3be9a3 Update tweaks.json 2025-04-14 13:08:01 -05:00
7769a328bb feat: disable explorer automatic folder discovery (#3262)
* feat: add tweak "Disable Explorer automatic folder discovery"

* refactor: add comments

* feat: add undo script

* refactor: add output comment

* fix: use correct registry key
2025-04-14 13:03:00 -05:00
425f11d787 Fix Double Click problem by using UIElement Names instead of Types (#3246)
* Fix Double Click problem by using UIElement Names instead of Types

* Use lower case 'or' to follow project's common conventions
2025-04-14 12:55:52 -05:00
6df94df594 Delete Invoke-WinUtilInteractiveNerdFontInstall.ps1 2025-04-14 12:49:59 -05:00
29e2c4d197 Action on application right click (#3243)
* implement right click logic

- right click clears selection and only selects right clicked app

* simplify logic
2025-04-14 12:40:20 -05:00
b63a17b7dd Create Invoke-WinUtilInteractiveNerdFontInstall.ps1 (#3183)
Using this script, we could integrate inside of the XAML, a list of all current nerdfonts, and user can choose which to install.

https://raw.githubusercontent.com/jpawlowski/nerd-fonts-installer-PS/main/Invoke-NerdFontInstaller.ps1

I am not sure how to add it into xaml :  - (
2025-04-14 12:37:00 -05:00
abe059917c Optimize UI Performance (#3277)
* Optimize UI Load performance

* remove timers

* Formatting

* Remove unused Collapsed Checkbox Style from inputXML.xaml
2025-04-02 15:54:44 -05:00
698f1644c3 [Toggle] Hide Settings Homepage (#3245)
* addHideSettingsToggle

* set OriginalValue & DefaultState
2025-03-19 14:32:16 -05:00
zy
fd03f33c50 Correct description for Prism Launcher (#3256) 2025-03-19 14:07:21 -05:00
8f9e7d1b7c Correct the Header Font Size (#3257)
* Correct the Header Font Size naming and simplify the creation of the Selected Apps Button

* Adjust HeaderFontSize from 18 to 16 for improved readability
2025-03-19 14:05:55 -05:00
b3dd1a1a50 Add God Mode panel to Legacy Windows Panels (#3264) 2025-03-19 14:00:30 -05:00
4acad32a38 Add Badge to Link to the Documentation at the Top of the Readme (#3265) 2025-03-19 13:59:10 -05:00
0f4fca31b9 [DOCS] Remove old Announcement about not adding any new applications to the app list (#3269)
* Remove old Announcement about not adding any new applications to the app list

* Update '.gitignore' file

The generated 'site' folder, which contains the docs build result by 'mkdocs', in the same folder as 'mkdocs.yml' (i.e. under '.github' folder), so I've temporarily excluded with '.gitignore' file until we've fully migrated the docs site into another repo.
2025-03-19 13:56:00 -05:00
36c984b66c Deploying to main from @ ChrisTitusTech/winutil@d215d0fc2c 🚀 2025-03-19 15:33:49 +00:00
d215d0fc2c Deploying to main from @ ChrisTitusTech/winutil@52de4690ab 🚀 2025-03-07 15:32:54 +00:00
52de4690ab Update start.ps1 (#3223)
- use join method to parse $argList
- use $PSCommandPath instead of $MyInvocation.MyCommand.Path
- use ScriptBlock method to create request for latest winutil.ps1 with join $argList 
- condition for $processCmd because in case when wt.exe is not available, there was double/redundant declaration of shell which lead to code mishmash (incorrect interpretation of quotes from Start-Process ArgumentList parameters 
- changes in quotes and escape characters because command where not interpreted correctly in all possible cases of $powershellCmd and $processCmd
2025-03-05 12:15:13 -06:00
ef97a8da24 [WinGet] Fix install loop (#3235)
Only this parameter was missing
2025-03-05 12:13:39 -06:00
18a7f17a0b [APP addition] Zen Browser (#3231)
* add Zen to Browsers for Applications

* remove choco option since it currently needs the --pre flag
2025-03-04 14:31:28 -06:00
5a8cf5deb6 Removing Github and Nuget method. Revamp of Version check to use DesktopAppInstaller (#3233) 2025-03-04 14:30:54 -06:00
e4b2a38372 fix a few tweak errors 2025-03-03 14:31:18 -06:00
94c5d89430 fix winget for good (#3096) 2025-03-03 14:16:53 -06:00
25 changed files with 415 additions and 921 deletions

5
.gitignore vendored
View File

@ -47,4 +47,7 @@ True
test.ps1 test.ps1
winutil.ps1 winutil.ps1
binary/ # temporary excludes for docs
.github/site/
binary/

View File

@ -3,6 +3,7 @@
[![Version](https://img.shields.io/github/v/release/ChrisTitusTech/winutil?color=%230567ff&label=Latest%20Release&style=for-the-badge)](https://github.com/ChrisTitusTech/winutil/releases/latest) [![Version](https://img.shields.io/github/v/release/ChrisTitusTech/winutil?color=%230567ff&label=Latest%20Release&style=for-the-badge)](https://github.com/ChrisTitusTech/winutil/releases/latest)
![GitHub Downloads (specific asset, all releases)](https://img.shields.io/github/downloads/ChrisTitusTech/winutil/winutil.ps1?label=Total%20Downloads&style=for-the-badge) ![GitHub Downloads (specific asset, all releases)](https://img.shields.io/github/downloads/ChrisTitusTech/winutil/winutil.ps1?label=Total%20Downloads&style=for-the-badge)
[![](https://dcbadge.limes.pink/api/server/https://discord.gg/RUbZUZyByQ?theme=default-inverted&style=for-the-badge)](https://discord.gg/RUbZUZyByQ) [![](https://dcbadge.limes.pink/api/server/https://discord.gg/RUbZUZyByQ?theme=default-inverted&style=for-the-badge)](https://discord.gg/RUbZUZyByQ)
[![Static Badge](https://img.shields.io/badge/Documentation-_?style=for-the-badge&logo=bookstack&color=grey)](https://christitustech.github.io/winutil/)
This utility is a compilation of Windows tasks I perform on each Windows system I use. It is meant to streamline *installs*, debloat with *tweaks*, troubleshoot with *config*, and fix Windows *updates*. I am extremely picky about any contributions to keep this project clean and efficient. This utility is a compilation of Windows tasks I perform on each Windows system I use. It is meant to streamline *installs*, debloat with *tweaks*, troubleshoot with *config*, and fix Windows *updates*. I am extremely picky about any contributions to keep this project clean and efficient.
@ -52,7 +53,7 @@ If you have Issues, refer to [Known Issues](https://christitustech.github.io/win
These are the sponsors that help keep this project alive with monthly contributions. 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/jozozovko"><img src="https:&#x2F;&#x2F;github.com&#x2F;jozozovko.png" width="60px" alt="User avatar: " /></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/altugtekiner"><img src="https:&#x2F;&#x2F;github.com&#x2F;altugtekiner.png" width="60px" alt="User avatar: " /></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 Jones" /></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/claudemods"><img src="https:&#x2F;&#x2F;github.com&#x2F;claudemods.png" width="60px" alt="User avatar: Claudemods" /></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/Ascent7910"><img src="https:&#x2F;&#x2F;github.com&#x2F;Ascent7910.png" width="60px" alt="User avatar: Max" /></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><!-- 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/altugtekiner"><img src="https:&#x2F;&#x2F;github.com&#x2F;altugtekiner.png" width="60px" alt="User avatar: " /></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 Jones" /></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/claudemods"><img src="https:&#x2F;&#x2F;github.com&#x2F;claudemods.png" width="60px" alt="User avatar: claudemods" /></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/Ascent7910"><img src="https:&#x2F;&#x2F;github.com&#x2F;Ascent7910.png" width="60px" alt="User avatar: Max" /></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><!-- sponsors -->
## 🏅 Thanks to all Contributors ## 🏅 Thanks to all Contributors
Thanks a lot for spending your time helping Winutil grow. Thanks a lot! Keep rocking 🍻. Thanks a lot for spending your time helping Winutil grow. Thanks a lot! Keep rocking 🍻.

View File

@ -1,5 +1,6 @@
# Import the function (adjust the path according to your setup) # Import the function (adjust the path according to your setup)
. "./functions/private/Get-WinUtilWingetLatest.ps1" . "./functions/private/Install-WinUtilWinget.ps1"
. "./functions/private/Test-WinUtilPackageManager.ps1"
# Set up Information stream to be visible # Set up Information stream to be visible
$InformationPreference = "Continue" $InformationPreference = "Continue"
@ -7,20 +8,7 @@ $InformationPreference = "Continue"
Write-Host "Starting Winget installation test..." -ForegroundColor Cyan Write-Host "Starting Winget installation test..." -ForegroundColor Cyan
try { try {
# Test the function with verbose output Install-WinUtilWinget
Write-Host "Attempting to run Get-WinUtilWingetLatest..." -ForegroundColor Cyan
Get-WinUtilWingetLatest -Verbose
# Verify Winget is working
if (Get-Command winget -ErrorAction SilentlyContinue) {
Write-Host "Success! Winget is installed and accessible." -ForegroundColor Green
# Display Winget version
Write-Host "`nWinget version:" -ForegroundColor Cyan
winget --version
} else {
Write-Host "Warning: Winget is installed but not accessible in the current session. You may need to restart your terminal." -ForegroundColor Yellow
}
} catch { } catch {
Write-Host "Error occurred during testing: $($_.Exception.Message)" -ForegroundColor Red Write-Host "Error occurred during testing: $($_.Exception.Message)" -ForegroundColor Red
Write-Host "Stack Trace:" -ForegroundColor Red Write-Host "Stack Trace:" -ForegroundColor Red

View File

@ -527,14 +527,6 @@
"link": "https://espanso.org/", "link": "https://espanso.org/",
"winget": "Espanso.Espanso" "winget": "Espanso.Espanso"
}, },
"etcher": {
"category": "Utilities",
"choco": "etcher",
"content": "Etcher USB Creator",
"description": "Etcher is a powerful tool for creating bootable USB drives with ease.",
"link": "https://www.balena.io/etcher/",
"winget": "Balena.Etcher"
},
"falkon": { "falkon": {
"category": "Browsers", "category": "Browsers",
"choco": "falkon", "choco": "falkon",
@ -1699,7 +1691,7 @@
"category": "Games", "category": "Games",
"choco": "prismlauncher", "choco": "prismlauncher",
"content": "Prism Launcher", "content": "Prism Launcher",
"description": "Prism Launcher is a game launcher and manager designed to provide a clean and intuitive interface for organizing and launching your games.", "description": "Prism Launcher is an Open Source Minecraft launcher with the ability to manage multiple instances, accounts and mods.",
"link": "https://prismlauncher.org/", "link": "https://prismlauncher.org/",
"winget": "PrismLauncher.PrismLauncher" "winget": "PrismLauncher.PrismLauncher"
}, },
@ -2934,5 +2926,13 @@
"description": "Fork - a fast and friendly git client.", "description": "Fork - a fast and friendly git client.",
"link": "https://git-fork.com/", "link": "https://git-fork.com/",
"winget": "Fork.Fork" "winget": "Fork.Fork"
},
"ZenBrowser": {
"category": "Browsers",
"choco": "na",
"content": "Zen Browser",
"description": "The modern, privacy-focused, performance-driven browser built on Firefox",
"link": "https://zen-browser.app/",
"winget": "Zen-Team.Zen-Browser"
} }
} }

View File

@ -306,6 +306,13 @@
"ButtonWidth": "300", "ButtonWidth": "300",
"link": "https://christitustech.github.io/winutil/dev/features/Legacy-Windows-Panels/user" "link": "https://christitustech.github.io/winutil/dev/features/Legacy-Windows-Panels/user"
}, },
"WPFPanelGodMode": {
"Content": "God Mode",
"category": "Legacy Windows Panels",
"panel": "2",
"Type": "Button",
"ButtonWidth": "300"
},
"WPFWinUtilInstallPSProfile": { "WPFWinUtilInstallPSProfile": {
"Content": "Install CTT PowerShell Profile", "Content": "Install CTT PowerShell Profile",
"category": "Powershell Profile", "category": "Powershell Profile",

View File

@ -2,6 +2,7 @@
"Standard": [ "Standard": [
"WPFTweaksAH", "WPFTweaksAH",
"WPFTweaksConsumerFeatures", "WPFTweaksConsumerFeatures",
"WPFTweaksDisableExplorerAutoDiscovery",
"WPFTweaksDVR", "WPFTweaksDVR",
"WPFTweaksHiber", "WPFTweaksHiber",
"WPFTweaksHome", "WPFTweaksHome",
@ -18,6 +19,7 @@
], ],
"Minimal": [ "Minimal": [
"WPFTweaksConsumerFeatures", "WPFTweaksConsumerFeatures",
"WPFTweaksDisableExplorerAutoDiscovery",
"WPFTweaksHome", "WPFTweaksHome",
"WPFTweaksServices", "WPFTweaksServices",
"WPFTweaksTele" "WPFTweaksTele"

View File

@ -7,7 +7,7 @@
"CustomDialogHeight": "200", "CustomDialogHeight": "200",
"FontSize": "12", "FontSize": "12",
"FontFamily": "Arial", "FontFamily": "Arial",
"HeadingFontSize": "16", "HeaderFontSize": "16",
"HeaderFontFamily": "Consolas, Monaco", "HeaderFontFamily": "Consolas, Monaco",
"CheckBoxBulletDecoratorSize": "14", "CheckBoxBulletDecoratorSize": "14",
"CheckBoxMargin": "15,0,0,2", "CheckBoxMargin": "15,0,0,2",
@ -35,7 +35,8 @@
"CheckboxMouseOverColor": "#999999", "CheckboxMouseOverColor": "#999999",
"ButtonBorderThickness": "1", "ButtonBorderThickness": "1",
"ButtonMargin": "1", "ButtonMargin": "1",
"ButtonCornerRadius": "2" "ButtonCornerRadius": "2",
"AppTileImageSize": "40"
}, },
"Light": { "Light": {
"AppInstallUnselectedColor": "#F0F0F0", "AppInstallUnselectedColor": "#F0F0F0",

View File

@ -423,26 +423,6 @@
"StartupType": "Automatic", "StartupType": "Automatic",
"OriginalType": "Automatic" "OriginalType": "Automatic"
}, },
{
"Name": "DoSvc",
"StartupType": "AutomaticDelayedStart",
"OriginalType": "Automatic"
},
{
"Name": "DsSvc",
"StartupType": "Manual",
"OriginalType": "Manual"
},
{
"Name": "DsmSvc",
"StartupType": "Manual",
"OriginalType": "Manual"
},
{
"Name": "DusmSvc",
"StartupType": "Automatic",
"OriginalType": "Automatic"
},
{ {
"Name": "EFS", "Name": "EFS",
"StartupType": "Manual", "StartupType": "Manual",
@ -898,11 +878,6 @@
"StartupType": "Manual", "StartupType": "Manual",
"OriginalType": "Manual" "OriginalType": "Manual"
}, },
{
"Name": "SgrmBroker",
"StartupType": "Automatic",
"OriginalType": "Automatic"
},
{ {
"Name": "SharedAccess", "Name": "SharedAccess",
"StartupType": "Manual", "StartupType": "Manual",
@ -933,11 +908,6 @@
"StartupType": "Manual", "StartupType": "Manual",
"OriginalType": "Manual" "OriginalType": "Manual"
}, },
{
"Name": "StateRepository",
"StartupType": "Manual",
"OriginalType": "Automatic"
},
{ {
"Name": "StiSvc", "Name": "StiSvc",
"StartupType": "Manual", "StartupType": "Manual",
@ -973,11 +943,6 @@
"StartupType": "Automatic", "StartupType": "Automatic",
"OriginalType": "Automatic" "OriginalType": "Automatic"
}, },
{
"Name": "TextInputManagementService",
"StartupType": "Manual",
"OriginalType": "Automatic"
},
{ {
"Name": "Themes", "Name": "Themes",
"StartupType": "Automatic", "StartupType": "Automatic",
@ -3449,12 +3414,30 @@
], ],
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/WPFToggleStartMenuRecommendations" "link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/WPFToggleStartMenuRecommendations"
}, },
"WPFToggleHideSettingsHome": {
"Content": "Remove Settings Home Page",
"Description": "Removes the Home page in the Windows Settings app.",
"category": "Customize Preferences",
"panel": "2",
"Order": "a105_",
"Type": "Toggle",
"registry": [
{
"Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
"Name": "SettingsPageVisibility",
"Type": "String",
"Value": "hide:home",
"OriginalValue": "show:home",
"DefaultState": "false"
}
]
},
"WPFToggleSnapWindow": { "WPFToggleSnapWindow": {
"Content": "Snap Window", "Content": "Snap Window",
"Description": "If enabled you can align windows by dragging them. | Relogin Required", "Description": "If enabled you can align windows by dragging them. | Relogin Required",
"category": "Customize Preferences", "category": "Customize Preferences",
"panel": "2", "panel": "2",
"Order": "a105_", "Order": "a106_",
"Type": "Toggle", "Type": "Toggle",
"registry": [ "registry": [
{ {
@ -3473,7 +3456,7 @@
"Description": "If enabled then Snap preview is disabled when maximize button is hovered.", "Description": "If enabled then Snap preview is disabled when maximize button is hovered.",
"category": "Customize Preferences", "category": "Customize Preferences",
"panel": "2", "panel": "2",
"Order": "a106_", "Order": "a107_",
"Type": "Toggle", "Type": "Toggle",
"registry": [ "registry": [
{ {
@ -3502,7 +3485,7 @@
"Description": "If enabled then you will get suggestions to snap other applications in the left over spaces.", "Description": "If enabled then you will get suggestions to snap other applications in the left over spaces.",
"category": "Customize Preferences", "category": "Customize Preferences",
"panel": "2", "panel": "2",
"Order": "a107_", "Order": "a108_",
"Type": "Toggle", "Type": "Toggle",
"registry": [ "registry": [
{ {
@ -3531,7 +3514,7 @@
"Description": "If Enabled then Cursor movement is affected by the speed of your physical mouse movements.", "Description": "If Enabled then Cursor movement is affected by the speed of your physical mouse movements.",
"category": "Customize Preferences", "category": "Customize Preferences",
"panel": "2", "panel": "2",
"Order": "a108_", "Order": "a109_",
"Type": "Toggle", "Type": "Toggle",
"registry": [ "registry": [
{ {
@ -3566,7 +3549,7 @@
"Description": "If Enabled then Sticky Keys is activated - Sticky keys is an accessibility feature of some graphical user interfaces which assists users who have physical disabilities or help users reduce repetitive strain injury.", "Description": "If Enabled then Sticky Keys is activated - Sticky keys is an accessibility feature of some graphical user interfaces which assists users who have physical disabilities or help users reduce repetitive strain injury.",
"category": "Customize Preferences", "category": "Customize Preferences",
"panel": "2", "panel": "2",
"Order": "a109_", "Order": "a110_",
"Type": "Toggle", "Type": "Toggle",
"registry": [ "registry": [
{ {
@ -3775,5 +3758,60 @@
"Type": "Button", "Type": "Button",
"ButtonWidth": "300", "ButtonWidth": "300",
"link": "https://christitustech.github.io/winutil/dev/tweaks/Performance-Plans/RemoveUltPerf" "link": "https://christitustech.github.io/winutil/dev/tweaks/Performance-Plans/RemoveUltPerf"
} },
"WPFTweaksDisableExplorerAutoDiscovery": {
"Content": "Disable Explorer Automatic Folder Discovery",
"Description": "Windows Explorer automatically tries to guess the type of the folder based on its contents, slowing down the browsing experience.",
"category": "Essential Tweaks",
"panel": "1",
"Order": "a005_",
"InvokeScript": [
"
# Previously detected folders
$bags = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\Bags\"
# Folder types lookup table
$bagMRU = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\BagMRU\"
# Flush explorer view database
Remove-Item -Path $bags -Recurse -Force
Write-Host \"Removed $bags\"
Remove-Item -Path $bagMRU -Recurse -Force
Write-Host \"Removed $bagMRU\"
# Every folder
$allFolders = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\Bags\\AllFolders\\Shell\"
if (!(Test-Path $allFolders)) {
New-Item -Path $allFolders -Force
Write-Host \"Created $allFolders\"
}
# Generic view
New-ItemProperty -Path $allFolders -Name \"FolderType\" -Value \"NotSpecified\" -PropertyType String -Force
Write-Host \"Set FolderType to NotSpecified\"
Write-Host Please sign out and back in, or restart your computer to apply the changes!
"
],
"UndoScript": [
"
# Previously detected folders
$bags = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\Bags\"
# Folder types lookup table
$bagMRU = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\BagMRU\"
# Flush explorer view database
Remove-Item -Path $bags -Recurse -Force
Write-Host \"Removed $bags\"
Remove-Item -Path $bagMRU -Recurse -Force
Write-Host \"Removed $bagMRU\"
Write-Host Please sign out and back in, or restart your computer to apply the changes!
"
],
},
} }

View File

@ -1,104 +0,0 @@
function Get-WinUtilWingetLatest {
[CmdletBinding()]
param()
<#
.SYNOPSIS
Uses GitHub API to check for the latest release of Winget.
.DESCRIPTION
This function first attempts to update WinGet using winget itself, then falls back to manual installation if needed.
#>
$ProgressPreference = "SilentlyContinue"
$InformationPreference = 'Continue'
try {
$wingetCmd = Get-Command winget -ErrorAction Stop
Write-Information "Attempting to update WinGet using WinGet..."
$result = Start-Process -FilePath "`"$($wingetCmd.Source)`"" -ArgumentList "install -e --accept-source-agreements --accept-package-agreements Microsoft.AppInstaller" -Wait -NoNewWindow -PassThru
if ($result.ExitCode -ne 0) {
throw "WinGet update failed with exit code: $($result.ExitCode)"
}
return $true
}
catch {
Write-Information "WinGet not found or update failed. Attempting to install from Microsoft Store..."
try {
# Try to close any running WinGet processes
Get-Process -Name "DesktopAppInstaller", "winget" -ErrorAction SilentlyContinue | ForEach-Object {
Write-Information "Stopping running WinGet process..."
$_.Kill()
Start-Sleep -Seconds 2
}
# Try to load Windows Runtime assemblies more reliably
$null = [System.Runtime.WindowsRuntime.WindowsRuntimeSystemExtensions]
Add-Type -AssemblyName System.Runtime.WindowsRuntime
# Load required assemblies from Windows SDK
$null = @(
[Windows.Management.Deployment.PackageManager, Windows.Management.Deployment, ContentType = WindowsRuntime]
[Windows.Foundation.Uri, Windows.Foundation, ContentType = WindowsRuntime]
[Windows.Management.Deployment.DeploymentOptions, Windows.Management.Deployment, ContentType = WindowsRuntime]
)
# Initialize PackageManager
$packageManager = New-Object Windows.Management.Deployment.PackageManager
# Rest of the Microsoft Store installation logic
$appxPackage = "https://aka.ms/getwinget"
$uri = New-Object Windows.Foundation.Uri($appxPackage)
$deploymentOperation = $packageManager.AddPackageAsync($uri, $null, "Add")
# Add timeout check for deployment operation
$timeout = 300
$timer = [System.Diagnostics.Stopwatch]::StartNew()
while ($deploymentOperation.Status -eq 0) {
if ($timer.Elapsed.TotalSeconds -gt $timeout) {
throw "Installation timed out after $timeout seconds"
}
Start-Sleep -Milliseconds 100
}
if ($deploymentOperation.Status -eq 1) {
Write-Information "Successfully installed WinGet from Microsoft Store"
return $true
} else {
throw "Installation failed with status: $($deploymentOperation.Status)"
}
}
catch [System.Management.Automation.RuntimeException] {
Write-Information "Windows Runtime components not available. Attempting manual download..."
try {
# Try to close any running WinGet processes
Get-Process -Name "DesktopAppInstaller", "winget" -ErrorAction SilentlyContinue | ForEach-Object {
Write-Information "Stopping running WinGet process..."
$_.Kill()
Start-Sleep -Seconds 2
}
# Fallback to direct download from GitHub
$apiUrl = "https://api.github.com/repos/microsoft/winget-cli/releases/latest"
$release = Invoke-RestMethod -Uri $apiUrl
$msixBundleUrl = ($release.assets | Where-Object { $_.name -like "*.msixbundle" }).browser_download_url
$tempFile = Join-Path $env:TEMP "Microsoft.DesktopAppInstaller.msixbundle"
Invoke-WebRequest -Uri $msixBundleUrl -OutFile $tempFile
Add-AppxPackage -Path $tempFile -ErrorAction Stop
Remove-Item $tempFile -Force
Write-Information "Successfully installed WinGet from GitHub release"
return $true
}
catch {
Write-Error "Failed to install WinGet: $_"
return $false
}
}
catch {
Write-Error "Failed to install WinGet: $_"
return $false
}
}
}

View File

@ -5,28 +5,23 @@ function Initialize-InstallAppEntry {
Used to as part of the Install Tab UI generation Used to as part of the Install Tab UI generation
.PARAMETER TargetElement .PARAMETER TargetElement
The Element into which the Apps should be placed The Element into which the Apps should be placed
.PARAMETER AppKey .PARAMETER appKey
The Key of the app inside the $sync.configs.applicationsHashtable The Key of the app inside the $sync.configs.applicationsHashtable
#> #>
param( param(
[Windows.Controls.WrapPanel]$TargetElement, [Windows.Controls.WrapPanel]$TargetElement,
$AppKey $appKey
) )
$App = $sync.configs.applicationsHashtable.$AppKey
# Create the outer Border for the application type # Create the outer Border for the application type
$border = New-Object Windows.Controls.Border $border = New-Object Windows.Controls.Border
$border.BorderBrush = [Windows.Media.Brushes]::Gray $border.Style = $sync.Form.Resources.AppTileBorderStyle
$border.SetResourceReference([Windows.Controls.Control]::BorderThicknessProperty, "AppTileBorderThickness") $border.Tag = $appKey
$border.CornerRadius = 5 $border.ToolTip = $Apps.$appKey.description
$border.SetResourceReference([Windows.Controls.Control]::PaddingProperty, "AppTileMargins")
$border.SetResourceReference([Windows.Controls.Control]::WidthProperty, "AppTileWidth")
$border.VerticalAlignment = "Top"
$border.SetResourceReference([Windows.Controls.Control]::MarginProperty, "AppTileMargins")
$border.Cursor = [System.Windows.Input.Cursors]::Hand
$border.SetResourceReference([Windows.Controls.Control]::BackgroundProperty, "AppInstallUnselectedColor")
$border.Tag = $Appkey
$border.ToolTip = $App.description
$border.Add_MouseUp({ $border.Add_MouseUp({
if ($_.ChangedButton -eq [System.Windows.Input.MouseButton]::Right) {
Invoke-WPFPresets -imported $true -checkboxfilterpattern "WPFInstall*";
}
$childCheckbox = ($this.Child.Children | Where-Object {$_.Template.TargetType -eq [System.Windows.Controls.Checkbox]})[0] $childCheckbox = ($this.Child.Children | Where-Object {$_.Template.TargetType -eq [System.Windows.Controls.Checkbox]})[0]
$childCheckBox.isChecked = -not $childCheckbox.IsChecked $childCheckBox.isChecked = -not $childCheckbox.IsChecked
}) })
@ -47,12 +42,8 @@ function Initialize-InstallAppEntry {
# Create the CheckBox, vertically centered # Create the CheckBox, vertically centered
$checkBox = New-Object Windows.Controls.CheckBox $checkBox = New-Object Windows.Controls.CheckBox
$checkBox.Name = $AppKey $checkBox.Name = $appKey
$checkBox.Background = "Transparent" $checkbox.Style = $sync.Form.Resources.AppTileCheckboxStyle
$checkBox.HorizontalAlignment = "Left"
$checkBox.VerticalAlignment = "Center"
$checkBox.SetResourceReference([Windows.Controls.Control]::MarginProperty, "AppTileMargins")
$checkBox.SetResourceReference([Windows.Controls.Control]::StyleProperty, "CollapsedCheckBoxStyle")
$checkbox.Add_Checked({ $checkbox.Add_Checked({
Invoke-WPFSelectedAppsUpdate -type "Add" -checkbox $this Invoke-WPFSelectedAppsUpdate -type "Add" -checkbox $this
$borderElement = $this.Parent.Parent $borderElement = $this.Parent.Parent
@ -64,7 +55,7 @@ function Initialize-InstallAppEntry {
$borderElement = $this.Parent.Parent $borderElement = $this.Parent.Parent
$borderElement.SetResourceReference([Windows.Controls.Control]::BackgroundProperty, "AppInstallUnselectedColor") $borderElement.SetResourceReference([Windows.Controls.Control]::BackgroundProperty, "AppInstallUnselectedColor")
}) })
$sync.$($checkBox.Name) = $checkBox
# Create a StackPanel for the image and name # Create a StackPanel for the image and name
$imageAndNamePanel = New-Object Windows.Controls.StackPanel $imageAndNamePanel = New-Object Windows.Controls.StackPanel
$imageAndNamePanel.Orientation = "Horizontal" $imageAndNamePanel.Orientation = "Horizontal"
@ -73,29 +64,15 @@ function Initialize-InstallAppEntry {
# Create the Image and set a placeholder # Create the Image and set a placeholder
$image = New-Object Windows.Controls.Image $image = New-Object Windows.Controls.Image
# $image.Name = "wpfapplogo" + $App.Name # $image.Name = "wpfapplogo" + $App.Name
$image.Width = 40 $image.Style = $sync.Form.Resources.AppTileImageStyle
$image.Height = 40
$image.Margin = New-Object Windows.Thickness(0, 0, 10, 0)
$image.Source = $noimage # Ensure $noimage is defined in your script $image.Source = $noimage # Ensure $noimage is defined in your script
# Clip the image corners
$image.Clip = New-Object Windows.Media.RectangleGeometry
$image.Clip.Rect = New-Object Windows.Rect(0, 0, $image.Width, $image.Height)
$image.Clip.RadiusX = 5
$image.Clip.RadiusY = 5
$image.SetResourceReference([Windows.Controls.Control]::VisibilityProperty, "AppTileCompactVisibility")
$imageAndNamePanel.Children.Add($image) | Out-Null $imageAndNamePanel.Children.Add($image) | Out-Null
# Create the TextBlock for the application name # Create the TextBlock for the application name
$appName = New-Object Windows.Controls.TextBlock $appName = New-Object Windows.Controls.TextBlock
$appName.Text = $App.Content $appName.Style = $sync.Form.Resources.AppTileNameStyle
$appName.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "AppTileFontSize") $appName.Text = $Apps.$appKey.content
$appName.FontWeight = [Windows.FontWeights]::Bold
$appName.SetResourceReference([Windows.Controls.Control]::ForegroundProperty, "MainForegroundColor")
$appName.VerticalAlignment = "Center"
$appName.SetResourceReference([Windows.Controls.Control]::MarginProperty, "AppTileMargins")
$appName.Background = "Transparent"
$imageAndNamePanel.Children.Add($appName) | Out-Null $imageAndNamePanel.Children.Add($appName) | Out-Null
# Add the image and name panel to the Checkbox # Add the image and name panel to the Checkbox
@ -107,91 +84,53 @@ function Initialize-InstallAppEntry {
# Create the StackPanel for the buttons and dock it to the right # Create the StackPanel for the buttons and dock it to the right
$buttonPanel = New-Object Windows.Controls.StackPanel $buttonPanel = New-Object Windows.Controls.StackPanel
$buttonPanel.Orientation = "Horizontal" $buttonPanel.Style = $sync.Form.Resources.AppTileButtonPanelStyle
$buttonPanel.HorizontalAlignment = "Right"
$buttonPanel.VerticalAlignment = "Center"
$buttonPanel.SetResourceReference([Windows.Controls.Control]::MarginProperty, "AppTileMargins")
$buttonPanel.SetResourceReference([Windows.Controls.Control]::VisibilityProperty, "AppTileCompactVisibility")
[Windows.Controls.DockPanel]::SetDock($buttonPanel, [Windows.Controls.Dock]::Right) [Windows.Controls.DockPanel]::SetDock($buttonPanel, [Windows.Controls.Dock]::Right)
# Create the "Install" button # Define the button properties
$installButton = New-Object Windows.Controls.Button $buttons = @(
$installButton.Width = 45 [PSCustomObject]@{ Name = "Install"; Description = "Install or Upgrade the application"; Tooltip = "Install or Upgrade the application"; Icon = [char]0xE118 },
$installButton.Height = 35 [PSCustomObject]@{ Name = "Uninstall"; Description = "Uninstall the application"; Tooltip = "Uninstall the application"; Icon = [char]0xE74D },
$installButton.Margin = New-Object Windows.Thickness(0, 0, 10, 0) [PSCustomObject]@{ Name = "Info"; Description = "Open the application's website in your default browser"; Tooltip = "Open the application's website in your default browser"; Icon = [char]0xE946 }
)
$installIcon = New-Object Windows.Controls.TextBlock # Iterate over each button and create it
$installIcon.Text = [char]0xE118 # Install Icon foreach ($button in $buttons) {
$installIcon.FontFamily = "Segoe MDL2 Assets" $newButton = New-Object Windows.Controls.Button
$installIcon.FontSize = 20 $newButton.Style = $sync.Form.Resources.AppTileButtonStyle
$installIcon.SetResourceReference([Windows.Controls.Control]::ForegroundProperty, "MainForegroundColor") $newButton.Content = $button.Icon
$installIcon.Background = "Transparent" $newButton.ToolTip = $button.Tooltip
$installIcon.HorizontalAlignment = "Center" $buttonPanel.Children.Add($newButton) | Out-Null
$installIcon.VerticalAlignment = "Center"
$installButton.Content = $installIcon switch ($button.Name) {
$installButton.ToolTip = "Install or Upgrade the application" "Install" {
$buttonPanel.Children.Add($installButton) | Out-Null $newButton.Add_Click({
$appKey = $this.Parent.Parent.Parent.Tag
# Add Click event for the "Install" button $appObject = $sync.configs.applicationsHashtable.$appKey
$installButton.Add_Click({ Invoke-WPFInstall -PackagesToInstall $appObject
$appKey = $this.Parent.Parent.Parent.Tag })
$appObject = $sync.configs.applicationsHashtable.$appKey }
Invoke-WPFInstall -PackagesToInstall $appObject "Uninstall" {
}) $newButton.Add_Click({
$appKey = $this.Parent.Parent.Parent.Tag
# Create the "Uninstall" button $appObject = $sync.configs.applicationsHashtable.$appKey
$uninstallButton = New-Object Windows.Controls.Button Invoke-WPFUnInstall -PackagesToUninstall $appObject
$uninstallButton.Width = 45 })
$uninstallButton.Height = 35 }
"Info" {
$uninstallIcon = New-Object Windows.Controls.TextBlock $newButton.Add_Click({
$uninstallIcon.Text = [char]0xE74D # Uninstall Icon $appKey = $this.Parent.Parent.Parent.Tag
$uninstallIcon.FontFamily = "Segoe MDL2 Assets" $appObject = $sync.configs.applicationsHashtable.$appKey
$uninstallIcon.FontSize = 20 Start-Process $appObject.link
$uninstallIcon.SetResourceReference([Windows.Controls.Control]::ForegroundProperty, "MainForegroundColor") })
$uninstallIcon.Background = "Transparent" }
$uninstallIcon.HorizontalAlignment = "Center" }
$uninstallIcon.VerticalAlignment = "Center" }
$uninstallButton.Content = $uninstallIcon
$buttonPanel.Children.Add($uninstallButton) | Out-Null
$uninstallButton.ToolTip = "Uninstall the application"
$uninstallButton.Add_Click({
$appKey = $this.Parent.Parent.Parent.Tag
$appObject = $sync.configs.applicationsHashtable.$appKey
Invoke-WPFUnInstall -PackagesToUninstall $appObject
})
# Create the "Info" button
$infoButton = New-Object Windows.Controls.Button
$infoButton.Width = 45
$infoButton.Height = 35
$infoButton.Margin = New-Object Windows.Thickness(10, 0, 0, 0)
$infoIcon = New-Object Windows.Controls.TextBlock
$infoIcon.Text = [char]0xE946 # Info Icon
$infoIcon.FontFamily = "Segoe MDL2 Assets"
$infoIcon.FontSize = 20
$infoIcon.SetResourceReference([Windows.Controls.Control]::ForegroundProperty, "MainForegroundColor")
$infoIcon.Background = "Transparent"
$infoIcon.HorizontalAlignment = "Center"
$infoIcon.VerticalAlignment = "Center"
$infoButton.Content = $infoIcon
$infoButton.ToolTip = "Open the application's website in your default browser"
$buttonPanel.Children.Add($infoButton) | Out-Null
$infoButton.Add_Click({
$appKey = $this.Parent.Parent.Parent.Tag
$appObject = $sync.configs.applicationsHashtable.$appKey
Start-Process $appObject.link
})
# Add the button panel to the DockPanel # Add the button panel to the DockPanel
$dockPanel.Children.Add($buttonPanel) | Out-Null $dockPanel.Children.Add($buttonPanel) | Out-Null
# Add the border to the corresponding Category # Add the border to the corresponding Category
$TargetElement.Children.Add($border) | Out-Null $TargetElement.Children.Add($border) | Out-Null
return $checkbox
} }

View File

@ -42,7 +42,7 @@ function Initialize-InstallCategoryAppList {
$loadingLabel.Content = "Loading, please wait..." $loadingLabel.Content = "Loading, please wait..."
$loadingLabel.HorizontalAlignment = "Center" $loadingLabel.HorizontalAlignment = "Center"
$loadingLabel.VerticalAlignment = "Center" $loadingLabel.VerticalAlignment = "Center"
$loadingLabel.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "FontSizeHeading") $loadingLabel.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "HeaderFontSize")
$loadingLabel.FontWeight = [Windows.FontWeights]::Bold $loadingLabel.FontWeight = [Windows.FontWeights]::Bold
$loadingLabel.Foreground = [Windows.Media.Brushes]::Gray $loadingLabel.Foreground = [Windows.Media.Brushes]::Gray
$sync.LoadingLabel = $loadingLabel $sync.LoadingLabel = $loadingLabel
@ -53,8 +53,17 @@ function Initialize-InstallCategoryAppList {
$TargetElement.Dispatcher.Invoke([System.Windows.Threading.DispatcherPriority]::Background, [action]{ $TargetElement.Dispatcher.Invoke([System.Windows.Threading.DispatcherPriority]::Background, [action]{
$TargetElement.Items.Clear() # Remove the loading message $TargetElement.Items.Clear() # Remove the loading message
$categories = $Apps.Values | Select-Object -ExpandProperty category -Unique | Sort-Object
foreach ($category in $categories) { # Pre-group apps by category
$appsByCategory = @{}
foreach ($appKey in $Apps.Keys) {
$category = $Apps.$appKey.Category
if (-not $appsByCategory.ContainsKey($category)) {
$appsByCategory[$category] = @()
}
$appsByCategory[$category] += $appKey
}
foreach ($category in $($appsByCategory.Keys | Sort-Object)) {
Add-Category -Category $category -TargetElement $TargetElement Add-Category -Category $category -TargetElement $TargetElement
$wrapPanel = New-Object Windows.Controls.WrapPanel $wrapPanel = New-Object Windows.Controls.WrapPanel
$wrapPanel.Orientation = "Horizontal" $wrapPanel.Orientation = "Horizontal"
@ -64,9 +73,9 @@ function Initialize-InstallCategoryAppList {
$wrapPanel.Visibility = [Windows.Visibility]::Collapsed $wrapPanel.Visibility = [Windows.Visibility]::Collapsed
$wrapPanel.Tag = "CategoryWrapPanel_$category" $wrapPanel.Tag = "CategoryWrapPanel_$category"
$null = $TargetElement.Items.Add($wrapPanel) $null = $TargetElement.Items.Add($wrapPanel)
$Apps.Keys | Where-Object { $Apps.$_.Category -eq $category } | Sort-Object | ForEach-Object { $appsByCategory[$category] | ForEach-Object {
Initialize-InstallAppEntry -TargetElement $wrapPanel -AppKey $_ $sync.$_ = $(Initialize-InstallAppEntry -TargetElement $wrapPanel -AppKey $_)
}
} }
}) }
})
} }

View File

@ -29,7 +29,8 @@ function Initialize-InstallHeader {
$buttonConfigs = @( $buttonConfigs = @(
@{Name="WPFInstall"; Content="Install/Upgrade Selected"}, @{Name="WPFInstall"; Content="Install/Upgrade Selected"},
@{Name="WPFInstallUpgrade"; Content="Upgrade All"}, @{Name="WPFInstallUpgrade"; Content="Upgrade All"},
@{Name="WPFUninstall"; Content="Uninstall Selected"} @{Name="WPFUninstall"; Content="Uninstall Selected"},
@{Name="WPFselectedAppsButton"; Content="Selected Apps: 0"}
) )
foreach ($config in $buttonConfigs) { foreach ($config in $buttonConfigs) {
@ -38,18 +39,9 @@ function Initialize-InstallHeader {
$sync[$config.Name] = $button $sync[$config.Name] = $button
} }
$selectedAppsButton = New-Object Windows.Controls.Button
$selectedAppsButton.Name = "WPFselectedAppsButton"
$selectedAppsButton.Content = "Selected Apps: 0"
$selectedAppsButton.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "FontSizeHeading")
$selectedAppsButton.SetResourceReference([Windows.Controls.Control]::MarginProperty, "TabContentMargin")
$selectedAppsButton.SetResourceReference([Windows.Controls.Control]::ForegroundProperty, "MainForegroundColor")
$selectedAppsButton.HorizontalAlignment = "Center"
$selectedAppsButton.VerticalAlignment = "Center"
$selectedAppsPopup = New-Object Windows.Controls.Primitives.Popup $selectedAppsPopup = New-Object Windows.Controls.Primitives.Popup
$selectedAppsPopup.IsOpen = $false $selectedAppsPopup.IsOpen = $false
$selectedAppsPopup.PlacementTarget = $selectedAppsButton $selectedAppsPopup.PlacementTarget = $sync.WPFselectedAppsButton
$selectedAppsPopup.Placement = [System.Windows.Controls.Primitives.PlacementMode]::Bottom $selectedAppsPopup.Placement = [System.Windows.Controls.Primitives.PlacementMode]::Bottom
$selectedAppsPopup.AllowsTransparency = $true $selectedAppsPopup.AllowsTransparency = $true
@ -66,24 +58,21 @@ function Initialize-InstallHeader {
$selectedAppsBorder.Child = $sync.selectedAppsstackPanel $selectedAppsBorder.Child = $sync.selectedAppsstackPanel
# Toggle selectedAppsPopup open/close with button # Toggle selectedAppsPopup open/close with button
$selectedAppsButton.Add_Click({ $sync.WPFselectedAppsButton.Add_Click({
$sync.selectedAppsPopup.IsOpen = -not $sync.selectedAppsPopup.IsOpen $sync.selectedAppsPopup.IsOpen = -not $sync.selectedAppsPopup.IsOpen
}) })
# Close selectedAppsPopup when mouse leaves both button and selectedAppsPopup # Close selectedAppsPopup when mouse leaves both button and selectedAppsPopup
$selectedAppsButton.Add_MouseLeave({ $sync.WPFselectedAppsButton.Add_MouseLeave({
if (-not $sync.selectedAppsPopup.IsMouseOver) { if (-not $sync.selectedAppsPopup.IsMouseOver) {
$sync.selectedAppsPopup.IsOpen = $false $sync.selectedAppsPopup.IsOpen = $false
} }
}) })
$selectedAppsPopup.Add_MouseLeave({ $selectedAppsPopup.Add_MouseLeave({
if (-not $selectedAppsButton.IsMouseOver) { if (-not $sync.WPFselectedAppsButton.IsMouseOver) {
$sync.selectedAppsPopup.IsOpen = $false $sync.selectedAppsPopup.IsOpen = $false
} }
}) })
$null = $wrapPanelTop.Children.Add($selectedAppsButton)
$sync.$($selectedAppsButton.Name) = $selectedAppsButton
[Windows.Controls.DockPanel]::SetDock($wrapPanelTop, [Windows.Controls.Dock]::Top) [Windows.Controls.DockPanel]::SetDock($wrapPanelTop, [Windows.Controls.Dock]::Top)
$null = $TargetElement.Children.Add($wrapPanelTop) $null = $TargetElement.Children.Add($wrapPanelTop)
} }

View File

@ -33,18 +33,44 @@ function Install-WinUtilWinget {
return return
} }
# Install Winget via GitHub method. Write-Host "Attempting to install/update Winget`r"
# Used part of my own script with some modification: ruxunderscore/windows-initialization try {
Write-Host "Downloading Winget and License File`r" $wingetCmd = Get-Command winget -ErrorAction Stop
Get-WinUtilWingetLatest Write-Information "Attempting to update WinGet using WinGet..."
Write-Host "Enabling NuGet and Module..." $result = Start-Process -FilePath "`"$($wingetCmd.Source)`"" -ArgumentList "install -e --accept-source-agreements --accept-package-agreements Microsoft.AppInstaller" -Wait -NoNewWindow -PassThru
Install-PackageProvider -Name NuGet -Force if ($result.ExitCode -ne 0) {
Install-Module -Name Microsoft.WinGet.Client -Force throw "WinGet update failed with exit code: $($result.ExitCode)"
# Winget only needs a refresh of the environment variables to be used. }
Write-Output "Refreshing Environment Variables...`n" Write-Output "Refreshing Environment Variables...`n"
$ENV:PATH = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User") $ENV:PATH = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
} catch { return
Write-Error "Failed to install Winget: $($_.Exception.Message)" } catch {
} Write-Information "WinGet not found or update failed. Attempting to install from Microsoft Store..."
}
try {
Write-Host "Attempting to repair WinGet using Repair-WinGetPackageManager..." -ForegroundColor Yellow
# Check if Windows version supports Repair-WinGetPackageManager (24H2 and above)
if ([System.Environment]::OSVersion.Version.Build -ge 26100) {
Repair-WinGetPackageManager -Force -Latest -Verbose
# Verify if repair was successful
$wingetCmd = Get-Command winget -ErrorAction Stop
Write-Host "WinGet repair successful!" -ForegroundColor Green
} else {
Write-Host "Repair-WinGetPackageManager is only available on Windows 24H2 and above. Your version doesn't support this method." -ForegroundColor Yellow
throw "Windows version not supported for repair method"
}
Write-Output "Refreshing Environment Variables...`n"
$ENV:PATH = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
return
} catch {
Write-Error "All installation methods failed. Unable to install WinGet."
throw
}
} catch {
Write-Error "An error occurred during WinGet installation: $_"
throw
}
} }

View File

@ -23,14 +23,22 @@ function Test-WinUtilPackageManager {
# Check if Winget is available while getting it's Version if it's available # Check if Winget is available while getting it's Version if it's available
$wingetExists = $true $wingetExists = $true
try { try {
$wingetVersionFull = winget --version $wingetInfo = winget --info
# Extract the package version from the output
$wingetVersionFull = ($wingetInfo | Select-String -Pattern 'Microsoft\.DesktopAppInstaller v\d+\.\d+\.\d+\.\d+').Matches.Value
if ($wingetVersionFull) {
$wingetVersionFull = $wingetVersionFull.Split(' ')[-1].TrimStart('v')
} else {
# Fallback in case the pattern isn't found
$wingetVersionFull = ($wingetInfo | Select-String -Pattern 'Package Manager v\d+\.\d+\.\d+').Matches.Value.Split(' ')[-1]
}
} catch [System.Management.Automation.CommandNotFoundException], [System.Management.Automation.ApplicationFailedException] { } catch [System.Management.Automation.CommandNotFoundException], [System.Management.Automation.ApplicationFailedException] {
Write-Warning "Winget was not found due to un-availablity reasons" Write-Warning "Winget was not found due to un-availablity reasons"
$wingetExists = $false $wingetExists = $false
} catch { } catch {
Write-Warning "Winget was not found due to un-known reasons, The Stack Trace is:`n$($psitem.Exception.StackTrace)" Write-Warning "Winget was not found due to un-known reasons, The Stack Trace is:`n$($psitem.Exception.StackTrace)"
$wingetExists = $false $wingetExists = $false
} }
# If Winget is available, Parse it's Version and give proper information to Terminal Output. # If Winget is available, Parse it's Version and give proper information to Terminal Output.
# If it isn't available, the return of this funtion will be "not-installed", indicating that # If it isn't available, the return of this funtion will be "not-installed", indicating that
@ -48,13 +56,14 @@ function Test-WinUtilPackageManager {
# Check if Winget's Version is too old. # Check if Winget's Version is too old.
$wingetCurrentVersion = [System.Version]::Parse($wingetVersion.Trim('v')) $wingetCurrentVersion = [System.Version]::Parse($wingetVersion.Trim('v'))
# Grabs the latest release of Winget from the Github API for version check process. # Grabs the latest release of Winget from the Github API for version check process.
$response = Invoke-RestMethod -Uri "https://api.github.com/repos/microsoft/Winget-cli/releases/latest" -Method Get -ErrorAction Stop $response = winget search -e Microsoft.AppInstaller --accept-source-agreements
$wingetLatestVersion = [System.Version]::Parse(($response.tag_name).Trim('v')) #Stores version number of latest release. $wingetLatestVersion = ($response | Select-String -Pattern '\d+\.\d+\.\d+\.\d+').Matches.Value
$wingetOutdated = $wingetCurrentVersion -lt $wingetLatestVersion Write-Host "Latest Search Version: $wingetLatestVersion" -ForegroundColor White
Write-Host "Current Installed Version: $wingetCurrentVersion" -ForegroundColor White
$wingetOutdated = $wingetCurrentVersion -lt [System.Version]::Parse($wingetLatestVersion)
Write-Host "===========================================" -ForegroundColor Green Write-Host "===========================================" -ForegroundColor Green
Write-Host "--- Winget is installed ---" -ForegroundColor Green Write-Host "--- Winget is installed ---" -ForegroundColor Green
Write-Host "===========================================" -ForegroundColor Green Write-Host "===========================================" -ForegroundColor Green
Write-Host "Version: $wingetVersionFull" -ForegroundColor White
if (!$wingetPreview) { if (!$wingetPreview) {
Write-Host " - Winget is a release version." -ForegroundColor Green Write-Host " - Winget is a release version." -ForegroundColor Green

View File

@ -44,6 +44,7 @@ function Invoke-WPFButton {
"WPFPanelprinter" {Invoke-WPFControlPanel -Panel $button} "WPFPanelprinter" {Invoke-WPFControlPanel -Panel $button}
"WPFPanelsystem" {Invoke-WPFControlPanel -Panel $button} "WPFPanelsystem" {Invoke-WPFControlPanel -Panel $button}
"WPFPaneluser" {Invoke-WPFControlPanel -Panel $button} "WPFPaneluser" {Invoke-WPFControlPanel -Panel $button}
"WPFPanelGodMode" {Invoke-WPFControlPanel -Panel $button}
"WPFUpdatesdefault" {Invoke-WPFFixesUpdate} "WPFUpdatesdefault" {Invoke-WPFFixesUpdate}
"WPFFixesUpdate" {Invoke-WPFFixesUpdate} "WPFFixesUpdate" {Invoke-WPFFixesUpdate}
"WPFFixesWinget" {Invoke-WPFFixesWinget} "WPFFixesWinget" {Invoke-WPFFixesWinget}
@ -61,10 +62,5 @@ function Invoke-WPFButton {
"WPFWinUtilInstallPSProfile" {Invoke-WinUtilInstallPSProfile} "WPFWinUtilInstallPSProfile" {Invoke-WinUtilInstallPSProfile}
"WPFWinUtilUninstallPSProfile" {Invoke-WinUtilUninstallPSProfile} "WPFWinUtilUninstallPSProfile" {Invoke-WinUtilUninstallPSProfile}
"WPFWinUtilSSHServer" {Invoke-WPFSSHServer} "WPFWinUtilSSHServer" {Invoke-WPFSSHServer}
"WPFScanUpdates" {Invoke-WPFUpdatesScan}
"WPFShowUpdateHistory" { Invoke-WPFUpdateHistoryToggle }
"WPFUpdateSelectedInstall" {Invoke-WPFUpdateMGMT -Selected}
"WPFUpdateAllInstall" {Invoke-WPFUpdateMGMT -All}
"WPFUpdateScanHistory" {Invoke-WPFUpdateScanHistory}
} }
} }

View File

@ -19,5 +19,6 @@ function Invoke-WPFControlPanel {
"WPFPanelprinter" {Start-Process "shell:::{A8A91A66-3A7D-4424-8D24-04E180695C7A}"} "WPFPanelprinter" {Start-Process "shell:::{A8A91A66-3A7D-4424-8D24-04E180695C7A}"}
"WPFPanelsystem" {cmd /c sysdm.cpl} "WPFPanelsystem" {cmd /c sysdm.cpl}
"WPFPaneluser" {cmd /c "control userpasswords2"} "WPFPaneluser" {cmd /c "control userpasswords2"}
"WPFPanelGodMode" {Start-Process "shell:::{ED7BA470-8E54-465E-825C-99712043E01C}"}
} }
} }

View File

@ -144,7 +144,7 @@ function Invoke-WPFUIElements {
$label = New-Object Windows.Controls.Label $label = New-Object Windows.Controls.Label
$label.Content = $category -replace ".*__", "" $label.Content = $category -replace ".*__", ""
$label.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "FontSizeHeading") $label.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "HeaderFontSize")
$label.SetResourceReference([Windows.Controls.Control]::FontFamilyProperty, "HeaderFontFamily") $label.SetResourceReference([Windows.Controls.Control]::FontFamilyProperty, "HeaderFontFamily")
$itemsControl.Items.Add($label) | Out-Null $itemsControl.Items.Add($label) | Out-Null
$sync[$category] = $label $sync[$category] = $label

View File

@ -1,11 +0,0 @@
function Invoke-WPFUpdateHistoryToggle {
if ($sync["WPFShowUpdateHistory"].Content -eq "Show History") {
$sync["WPFShowUpdateHistory"].Content = "Show available Updates"
$sync["HistoryGrid"].Visibility = "Visible"
$sync["UpdatesGrid"].Visibility = "Collapsed"
} else {
$sync["WPFShowUpdateHistory"].Content = "Show History"
$sync["HistoryGrid"].Visibility = "Collapsed"
$sync["UpdatesGrid"].Visibility = "Visible"
}
}

View File

@ -1,50 +0,0 @@
function Invoke-WPFUpdateMGMT {
param (
[switch]$Selected,
[switch]$All
)
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 -overlay "logo" })
if ($All) {
Write-Host "Installing all available updates ..."
Invoke-WPFRunspace -ArgumentList $sync["WPFUpdateVerbose"].IsChecked -DebugPreference $DebugPreference -ScriptBlock {
param ($WPFUpdateVerbose)
if ($WPFUpdateVerbose) {
Install-WindowsUpdate -Verbose -Confirm:$false -IgnoreReboot:$true -IgnoreRebootRequired:$true
} else {
Install-WindowsUpdate -Confirm:$false -IgnoreReboot:$true -IgnoreRebootRequired:$true
}
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "None" -overlay "checkmark" })
Write-Host "All Update Processes Completed"
#catch $sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Error" -overlay "warning" })
}
} elseif (($Selected) -and ($sync["WPFUpdatesList"].SelectedItems.Count -gt 0)) {
write-host "Installing selected updates..."
$selectedUpdates = $sync["WPFUpdatesList"].SelectedItems | ForEach-Object {
[PSCustomObject]@{
ComputerName = $_.ComputerName
Title = $_.LongTitle
KB = $_.KB
Size = $_.Size
}
}
Invoke-WPFRunspace -ParameterList @(("selectedUpdates", $selectedUpdates), ("WPFUpdateVerbose", $sync["WPFUpdateVerbose"].IsChecked)) -DebugPreference $DebugPreference -ScriptBlock {
param ($selectedUpdates, $WPFUpdateVerbose)
foreach ($update in $selectedUpdates) {
Write-Host "Installing update $($update.Title) on $($update.ComputerName)"
if ($WPFUpdateVerbose) {
Get-WindowsUpdate -ComputerName $update.ComputerName -Title $update.Title -Install -Confirm:$false -Verbose -IgnoreReboot:$true -IgnoreRebootRequired:$true
} else {
Get-WindowsUpdate -ComputerName $update.ComputerName -Title $update.Title -Install -Confirm:$false -IgnoreReboot:$true -IgnoreRebootRequired:$true
}
}
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "None" -overlay "checkmark" })
Write-Host "Selected Update Processes Completed"
#catch $sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Error" -overlay "warning" })
}
} else {
Write-Host "No updates selected"
return
}
}

View File

@ -1,49 +0,0 @@
function Invoke-WPFUpdateScanHistory {
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 -overlay "logo" })
$sync["WPFUpdateHistory"].Items.Clear()
Invoke-WPFRunspace -DebugPreference $DebugPreference -ScriptBlock {
write-host "Scanning for Windows update history..."
$UpdateHistory = Get-WUHistory -Last 50 -ErrorAction SilentlyContinue
if ($UpdateHistory) {
foreach ($update in $UpdateHistory) {
$item = New-Object PSObject -Property @{
ComputerName = $update.ComputerName
Result = $update.Result
Title = $update.Title -replace '\s*\(KB\d+\)', '' -replace '\s*KB\d+\b', '' # Remove KB number from title, first in parentheses, then standalone
KB = $update.KB
Date = $update.Date
}
$Computers = $item | Select-Object -ExpandProperty ComputerName -Unique
$sync.form.Dispatcher.Invoke([action] {
$sync["WPFUpdateHistory"].Items.Add($item)
if ($item.Result -eq "Succeeded") {
# does not work : $sync["WPFUpdateHistory"].Items[$sync["WPFUpdateHistory"].Items.Count - 1].Foreground = "Green"
#write-host "$($item.Title) was successful"
}
elseif ($item.Result -eq "Failed") {
# does not work : $sync["WPFUpdateHistory"].Items[$sync["WPFUpdateHistory"].Items.Count - 1].Foreground = "Red"
#write-host "$($item.Title) failed"
}
})
}
write-host "Found $($UpdateHistory.Count) updates."
$sync.form.Dispatcher.Invoke([action] {
if ($Computers.Count -gt 1) {
$sync["WPFUpdateHistory"].Columns[0].Visibility = "Visible"
}
else {
Write-Debug "Hiding ComputerName column, only $item.ComputerName"
$sync["WPFUpdateHistory"].Columns[0].Visibility = "Collapsed"
}
})
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "None" -overlay "checkmark" })
#catch $sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Error" -overlay "warning" })
}
else {
$sync.form.Dispatcher.Invoke([action] {
$sync["WPFUpdateHistory"].Items.Clear()
})
Write-Host "No update history available."
}
}
}

View File

@ -1,61 +0,0 @@
function Invoke-WPFUpdatesScan {
Invoke-WPFRunspace -DebugPreference $DebugPreference -ScriptBlock {
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 -overlay "logo" })
# Check if the PSWindowsUpdate module is installed
if (-not (Get-Module -ListAvailable -Name PSWindowsUpdate)) {
try {
Write-Host "PSWindowsUpdate module not found. Attempting to install..."
Install-Module -Name PSWindowsUpdate -Force -Scope CurrentUser
Write-Host "PSWindowsUpdate module installed successfully."
}
catch {
Write-Error "Failed to install PSWindowsUpdate module: $_"
return
}
}
# Import the module
try {
Import-Module PSWindowsUpdate -ErrorAction Stop
Write-Host "PSWindowsUpdate module imported successfully."
}
catch {
Write-Error "Failed to import PSWindowsUpdate module: $_"
return
}
try {
$sync.form.Dispatcher.Invoke([action] { $sync["WPFUpdatesList"].Items.Clear() })
Write-Host "Scanning for Windows updates..."
$updates = Get-WindowsUpdate -ErrorAction Stop
Write-Host "Found $($updates.Count) updates."
$sync.form.Dispatcher.Invoke([action] {
foreach ($update in $updates) {
$item = New-Object PSObject -Property @{
LongTitle = $update.Title
ComputerName = $update.ComputerName
KB = $update.KB
Size = $update.Size
Title = $update.Title -replace '\s*\(KB\d+\)', '' -replace '\s*KB\d+\b', '' # Remove KB number from title, first in parentheses, then standalone
Status = "Not Installed"
}
$Computers = $item | Select-Object -ExpandProperty ComputerName -Unique
$sync["WPFUpdatesList"].Items.Add($item)
}
if ($Computers.Count -gt 1) {
$sync["WPFUpdatesList"].Columns[0].Visibility = "Visible"
} else {
Write-Debug "Hiding ComputerName column, only $item.ComputerName"
$sync["WPFUpdatesList"].Columns[0].Visibility = "Collapsed"
}
})
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "None" -overlay "checkmark" })
} catch {
Write-Error "Error scanning for updates: $_"
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Error" -overlay "warning" })
}
}
}

View File

@ -3,7 +3,6 @@
{% block header %} {% block header %}
{{ super() }} {{ super() }}
<div style="color: red; text-align: center; padding: 10px; font-size: 20px;"> <div style="color: red; text-align: center; padding: 10px; font-size: 20px;">
<strong>Announcement:</strong> We are currently not adding any applications to WinUtil and any apps that will be added through a PR will be declined by the maintainer.
<strong>Announcement:</strong> We are currently reworking the docs to use Hugo rather then mkdocs. <strong>Announcement:</strong> We are currently reworking the docs to use Hugo rather then mkdocs.
</div> </div>
{% endblock %} {% endblock %}

View File

@ -46,7 +46,6 @@ class GenericException : Exception {
GenericException($Message) : base($Message) {} GenericException($Message) : base($Message) {}
} }
$inputXML = $inputXML -replace 'mc:Ignorable="d"', '' -replace "x:N", 'N' -replace '^<Win.*', '<Window' $inputXML = $inputXML -replace 'mc:Ignorable="d"', '' -replace "x:N", 'N' -replace '^<Win.*', '<Window'
[void][System.Reflection.Assembly]::LoadWithPartialName('presentationframework') [void][System.Reflection.Assembly]::LoadWithPartialName('presentationframework')
@ -119,6 +118,7 @@ $sync.configs.applications.PSObject.Properties | ForEach-Object {
# Now call the function with the final merged config # Now call the function with the final merged config
Invoke-WPFUIElements -configVariable $sync.configs.appnavigation -targetGridName "appscategory" -columncount 1 Invoke-WPFUIElements -configVariable $sync.configs.appnavigation -targetGridName "appscategory" -columncount 1
# Add logic to handle click to the ToggleView Button on the Install Tab # Add logic to handle click to the ToggleView Button on the Install Tab
$sync.WPFToggleView.Add_Click({ $sync.WPFToggleView.Add_Click({
$sync.CompactView = -not $sync.CompactView $sync.CompactView = -not $sync.CompactView
@ -130,7 +130,9 @@ $sync.WPFToggleView.Add_Click({
Invoke-WPFUIApps -Apps $sync.configs.applicationsHashtable -targetGridName "appspanel" Invoke-WPFUIApps -Apps $sync.configs.applicationsHashtable -targetGridName "appspanel"
Invoke-WPFUIElements -configVariable $sync.configs.tweaks -targetGridName "tweakspanel" -columncount 2 Invoke-WPFUIElements -configVariable $sync.configs.tweaks -targetGridName "tweakspanel" -columncount 2
Invoke-WPFUIElements -configVariable $sync.configs.feature -targetGridName "featurespanel" -columncount 2 Invoke-WPFUIElements -configVariable $sync.configs.feature -targetGridName "featurespanel" -columncount 2
# Future implementation: Add Windows Version to updates panel # Future implementation: Add Windows Version to updates panel
#Invoke-WPFUIElements -configVariable $sync.configs.updates -targetGridName "updatespanel" -columncount 1 #Invoke-WPFUIElements -configVariable $sync.configs.updates -targetGridName "updatespanel" -columncount 1
@ -303,8 +305,8 @@ $sync["Form"].Add_MouseLeftButtonDown({
}) })
$sync["Form"].Add_MouseDoubleClick({ $sync["Form"].Add_MouseDoubleClick({
if ($_.OriginalSource -is [System.Windows.Controls.Grid] -or if ($_.OriginalSource.Name -eq "NavDockPanel" -or
$_.OriginalSource -is [System.Windows.Controls.StackPanel]) { $_.OriginalSource.Name -eq "GridBesideNavDockPanel") {
if ($sync["Form"].WindowState -eq [Windows.WindowState]::Normal) { if ($sync["Form"].WindowState -eq [Windows.WindowState]::Normal) {
$sync["Form"].WindowState = [Windows.WindowState]::Maximized $sync["Form"].WindowState = [Windows.WindowState]::Maximized
} }
@ -579,7 +581,5 @@ $sync["SponsorMenuItem"].Add_Click({
Show-CustomDialog -Title "Sponsors" -Message $authorInfo -EnableScroll $true Show-CustomDialog -Title "Sponsors" -Message $authorInfo -EnableScroll $true
}) })
$sync["Form"].ShowDialog() | out-null $sync["Form"].ShowDialog() | out-null
Stop-Transcript Stop-Transcript

View File

@ -54,21 +54,27 @@ if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]:
$PSBoundParameters.GetEnumerator() | ForEach-Object { $PSBoundParameters.GetEnumerator() | ForEach-Object {
$argList += if ($_.Value -is [switch] -and $_.Value) { $argList += if ($_.Value -is [switch] -and $_.Value) {
"-$($_.Key)" "-$($_.Key)"
} elseif ($_.Value -is [array]) {
"-$($_.Key) $($_.Value -join ',')"
} elseif ($_.Value) { } elseif ($_.Value) {
"-$($_.Key) `"$($_.Value)`"" "-$($_.Key) '$($_.Value)'"
} }
} }
$script = if ($MyInvocation.MyCommand.Path) { $script = if ($PSCommandPath) {
"& { & '$($MyInvocation.MyCommand.Path)' $argList }" "& { & `'$($PSCommandPath)`' $($argList -join ' ') }"
} else { } else {
"iex '& { $(irm https://github.com/ChrisTitusTech/winutil/releases/latest/download/winutil.ps1) } $argList'" "&([ScriptBlock]::Create((irm https://github.com/ChrisTitusTech/winutil/releases/latest/download/winutil.ps1))) $($argList -join ' ')"
} }
$powershellcmd = if (Get-Command pwsh -ErrorAction SilentlyContinue) { "pwsh" } else { "powershell" } $powershellCmd = if (Get-Command pwsh -ErrorAction SilentlyContinue) { "pwsh" } else { "powershell" }
$processCmd = if (Get-Command wt.exe -ErrorAction SilentlyContinue) { "wt.exe" } else { $powershellcmd } $processCmd = if (Get-Command wt.exe -ErrorAction SilentlyContinue) { "wt.exe" } else { "$powershellCmd" }
Start-Process $processCmd -ArgumentList "$powershellcmd -ExecutionPolicy Bypass -NoProfile -Command $script" -Verb RunAs if ($processCmd -eq "wt.exe") {
Start-Process $processCmd -ArgumentList "$powershellCmd -ExecutionPolicy Bypass -NoProfile -Command `"$script`"" -Verb RunAs
} else {
Start-Process $processCmd -ArgumentList "-ExecutionPolicy Bypass -NoProfile -Command `"$script`"" -Verb RunAs
}
break break
} }

View File

@ -67,6 +67,82 @@
</Trigger> </Trigger>
</Style.Triggers> </Style.Triggers>
</Style> </Style>
<Style x:Key="AppTileBorderStyle" TargetType="Border">
<Setter Property="BorderBrush" Value="Gray"/>
<Setter Property="BorderThickness" Value="{DynamicResource AppTileBorderThickness}"/>
<Setter Property="CornerRadius" Value="5"/>
<Setter Property="Padding" Value="{DynamicResource AppTileMargins}"/>
<Setter Property="Width" Value="{DynamicResource AppTileWidth}"/>
<Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="Margin" Value="{DynamicResource AppTileMargins}"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Background" Value="{DynamicResource AppInstallUnselectedColor}"/>
</Style>
<Style x:Key="AppTileCheckboxStyle" TargetType="CheckBox">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="{DynamicResource AppTileMargins}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="CheckBox">
<ContentPresenter Content="{TemplateBinding Content}"
VerticalAlignment="Center"
HorizontalAlignment="Left"
Margin="{TemplateBinding Padding}"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="AppTileImageStyle" TargetType="Image">
<Setter Property="Width" Value="{DynamicResource AppTileImageSize}"/>
<Setter Property="Height" Value="{DynamicResource AppTileImageSize}"/>
<Setter Property="Margin">
<Setter.Value>
<Thickness Left="0" Top="0" Right="10" Bottom="0"/>
</Setter.Value>
</Setter>
<Setter Property="Clip">
<Setter.Value>
<RectangleGeometry Rect="0,0,40,40" RadiusX="5" RadiusY="5"/>
</Setter.Value>
</Setter>
<Setter Property="Visibility" Value="{DynamicResource AppTileCompactVisibility}"/>
</Style>
<Style x:Key="AppTileNameStyle" TargetType="TextBlock">
<Setter Property="FontSize" Value="{DynamicResource AppTileFontSize}"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Foreground" Value="{DynamicResource MainForegroundColor}"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="{DynamicResource AppTileMargins}"/>
<Setter Property="Background" Value="Transparent"/>
</Style>
<Style x:Key="AppTileButtonPanelStyle" TargetType="StackPanel">
<Setter Property="Orientation" Value="Horizontal"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="{DynamicResource AppTileMargins}"/>
<Setter Property="Visibility" Value="{DynamicResource AppTileCompactVisibility}"/>
</Style>
<Style x:Key="AppTileButtonStyle" TargetType="Button">
<Setter Property="Width" Value="45"/>
<Setter Property="Height" Value="35"/>
<Setter Property="Margin" Value="0,0,10,0"/>
<Setter Property="Foreground" Value="{DynamicResource ButtonForegroundColor}"/>
<Setter Property="Background" Value="{DynamicResource ButtonBackgroundColor}"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<TextBlock Text="{Binding}" FontFamily="Segoe MDL2 Assets" FontSize="20"
Foreground="{DynamicResource MainForegroundColor}"
Background="Transparent" HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="Button" x:Key="HoverButtonStyle"> <Style TargetType="Button" x:Key="HoverButtonStyle">
<Setter Property="Foreground" Value="{DynamicResource MainForegroundColor}" /> <Setter Property="Foreground" Value="{DynamicResource MainForegroundColor}" />
@ -202,7 +278,7 @@
<Setter Property="Foreground" Value="{DynamicResource LabelboxForegroundColor}"/> <Setter Property="Foreground" Value="{DynamicResource LabelboxForegroundColor}"/>
<Setter Property="Background" Value="{DynamicResource MainBackgroundColor}"/> <Setter Property="Background" Value="{DynamicResource MainBackgroundColor}"/>
<Setter Property="FontFamily" Value="{DynamicResource HeaderFontFamily}"/> <Setter Property="FontFamily" Value="{DynamicResource HeaderFontFamily}"/>
<Setter Property="FontSize" Value="{DynamicResource FontSizeHeading}"/> <Setter Property="FontSize" Value="{DynamicResource HeaderFontSize}"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/> <Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="VerticalAlignment" Value="Center"/> <Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/> <Setter Property="HorizontalContentAlignment" Value="Left"/>
@ -502,19 +578,6 @@
</Setter.Value> </Setter.Value>
</Setter> </Setter>
</Style> </Style>
<!-- Collapsed Checkbox Style -->
<Style x:Key="CollapsedCheckBoxStyle" TargetType="CheckBox">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="CheckBox">
<ContentPresenter Content="{TemplateBinding Content}"
VerticalAlignment="Center"
HorizontalAlignment="Left"
Margin="{TemplateBinding Padding}"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="RadioButton"> <Style TargetType="RadioButton">
<Setter Property="Foreground" Value="{DynamicResource MainForegroundColor}"/> <Setter Property="Foreground" Value="{DynamicResource MainForegroundColor}"/>
<Setter Property="Background" Value="{DynamicResource MainBackgroundColor}"/> <Setter Property="Background" Value="{DynamicResource MainBackgroundColor}"/>
@ -842,182 +905,6 @@
</MultiDataTrigger> </MultiDataTrigger>
</Style.Triggers> </Style.Triggers>
</Style> </Style>
<Style TargetType="DataGrid">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="{DynamicResource MainForegroundColor}" />
<Setter Property="BorderBrush" Value="{DynamicResource BorderColor}" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="FontSize" Value="{DynamicResource FontSize}" />
<Setter Property="FontFamily" Value="{DynamicResource FontFamily}" />
<Setter Property="RowBackground" Value="Transparent" />
<Setter Property="AlternatingRowBackground" Value="{DynamicResource AlternatingRowBackgroundColor}" />
<Setter Property="GridLinesVisibility" Value="None" />
<Setter Property="HeadersVisibility" Value="Column" />
<Setter Property="HorizontalScrollBarVisibility" Value="Auto" />
<Setter Property="VerticalScrollBarVisibility" Value="Auto" />
<Setter Property="SelectionMode" Value="Extended" />
<Setter Property="SelectionUnit" Value="FullRow" />
<Setter Property="CanUserAddRows" Value="False" />
<Setter Property="CanUserDeleteRows" Value="False" />
<Setter Property="CanUserReorderColumns" Value="False" />
<Setter Property="CanUserResizeRows" Value="True" />
<Setter Property="CanUserSortColumns" Value="True" />
<Setter Property="AutoGenerateColumns" Value="False" />
<Setter Property="Margin" Value="0,10,0,10" />
<Setter Property="CellStyle">
<Setter.Value>
<Style TargetType="DataGridCell">
<Setter Property="Padding" Value="10,6" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridCell">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="4"
Margin="2,1"
Padding="{TemplateBinding Padding}">
<ContentPresenter VerticalAlignment="Center" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource ButtonBackgroundMouseoverColor}" />
<Setter Property="Foreground" Value="{DynamicResource MainForegroundColor}" />
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="{DynamicResource ButtonBackgroundSelectedColor}" />
<Setter Property="Foreground" Value="{DynamicResource MainForegroundColor}" />
<Setter Property="BorderThickness" Value="0" />
</Trigger>
</Style.Triggers>
</Style>
</Setter.Value>
</Setter>
<Setter Property="RowStyle">
<Setter.Value>
<Style TargetType="DataGridRow">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="{DynamicResource MainForegroundColor}" />
<Setter Property="MinHeight" Value="35" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Margin" Value="0,1" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridRow">
<Border x:Name="RowBorder"
BorderThickness="0"
BorderBrush="{DynamicResource BorderColor}"
Background="{TemplateBinding Background}"
CornerRadius="6"
Margin="4,2"
SnapsToDevicePixels="True">
<SelectiveScrollingGrid>
<SelectiveScrollingGrid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</SelectiveScrollingGrid.ColumnDefinitions>
<SelectiveScrollingGrid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</SelectiveScrollingGrid.RowDefinitions>
<DataGridCellsPresenter Grid.Column="1"
ItemsPanel="{TemplateBinding ItemsPanel}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
<DataGridDetailsPresenter Grid.Column="1" Grid.Row="1"
Visibility="{TemplateBinding DetailsVisibility}"
SelectiveScrollingGrid.SelectiveScrollingOrientation="{Binding AreRowDetailsFrozen,
RelativeSource={RelativeSource AncestorType={x:Type DataGrid}},
Converter={x:Static DataGrid.RowDetailsScrollingConverter},
ConverterParameter={x:Static SelectiveScrollingOrientation.Vertical}}"/>
<DataGridRowHeader Grid.RowSpan="2"
SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical"
Visibility="{Binding HeadersVisibility,
RelativeSource={RelativeSource AncestorType={x:Type DataGrid}},
Converter={x:Static DataGrid.HeadersVisibilityConverter},
ConverterParameter={x:Static DataGridHeadersVisibility.Row}}"/>
</SelectiveScrollingGrid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource ButtonBackgroundMouseoverColor}" />
<Setter Property="Effect">
<Setter.Value>
<DropShadowEffect ShadowDepth="0" BlurRadius="5" Opacity="0.2" Color="#000000" />
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="{DynamicResource ButtonBackgroundSelectedColor}" />
<Setter Property="Foreground" Value="{DynamicResource MainForegroundColor}" />
<Setter Property="Effect">
<Setter.Value>
<DropShadowEffect ShadowDepth="1" BlurRadius="7" Opacity="0.3" Color="#000000" />
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
</Setter.Value>
</Setter>
<Setter Property="ColumnHeaderStyle">
<Setter.Value>
<Style TargetType="DataGridColumnHeader">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="{DynamicResource ButtonForegroundColor}" />
<Setter Property="FontSize" Value="{DynamicResource FontSize}" />
<Setter Property="FontFamily" Value="{DynamicResource FontFamily}" />
<Setter Property="FontWeight" Value="SemiBold" />
<Setter Property="Padding" Value="10,8" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Margin" Value="2,0" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridColumnHeader">
<Grid>
<Border Background="{TemplateBinding Background}"
BorderBrush="{DynamicResource BorderColor}"
BorderThickness="0,0,0,1"
Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
SnapsToDevicePixels="True" />
</Border>
<Path x:Name="SortArrow" Visibility="Collapsed"
HorizontalAlignment="Right" VerticalAlignment="Center"
Margin="0,0,5,0" Fill="{DynamicResource ButtonForegroundColor}"
Width="8" Height="6" Stretch="Fill" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="SortDirection" Value="Ascending">
<Setter TargetName="SortArrow" Property="Visibility" Value="Visible"/>
<Setter TargetName="SortArrow" Property="Data" Value="M 0,5 L 8,5 L 4,0 Z"/>
</Trigger>
<Trigger Property="SortDirection" Value="Descending">
<Setter TargetName="SortArrow" Property="Visibility" Value="Visible"/>
<Setter TargetName="SortArrow" Property="Data" Value="M 0,0 L 8,0 L 4,5 Z"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="{DynamicResource LinkHoverForegroundColor}" />
</Trigger>
</Style.Triggers>
</Style>
</Setter.Value>
</Setter>
</Style>
</Window.Resources> </Window.Resources>
<Grid Background="{DynamicResource MainBackgroundColor}" ShowGridLines="False" Name="WPFMainGrid" Width="Auto" Height="Auto" HorizontalAlignment="Stretch"> <Grid Background="{DynamicResource MainBackgroundColor}" ShowGridLines="False" Name="WPFMainGrid" Width="Auto" Height="Auto" HorizontalAlignment="Stretch">
<Grid.RowDefinitions> <Grid.RowDefinitions>
@ -1027,7 +914,7 @@
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<DockPanel HorizontalAlignment="Stretch" Background="{DynamicResource MainBackgroundColor}" SnapsToDevicePixels="True" Grid.Row="0" Width="Auto"> <DockPanel Name="NavDockPanel" HorizontalAlignment="Stretch" Background="{DynamicResource MainBackgroundColor}" SnapsToDevicePixels="True" Grid.Row="0" Width="Auto">
<StackPanel Name="NavLogoPanel" Orientation="Horizontal" HorizontalAlignment="Left" Background="{DynamicResource MainBackgroundColor}" SnapsToDevicePixels="True" Margin="10,0,20,0"> <StackPanel Name="NavLogoPanel" Orientation="Horizontal" HorizontalAlignment="Left" Background="{DynamicResource MainBackgroundColor}" SnapsToDevicePixels="True" Margin="10,0,20,0">
</StackPanel> </StackPanel>
<ToggleButton Margin="0,0,5,0" HorizontalAlignment="Left" Height="{DynamicResource TabButtonHeight}" Width="{DynamicResource TabButtonWidth}" <ToggleButton Margin="0,0,5,0" HorizontalAlignment="Left" Height="{DynamicResource TabButtonHeight}" Width="{DynamicResource TabButtonWidth}"
@ -1070,7 +957,7 @@
</TextBlock> </TextBlock>
</ToggleButton.Content> </ToggleButton.Content>
</ToggleButton> </ToggleButton>
<Grid Background="{DynamicResource MainBackgroundColor}" ShowGridLines="False" Width="Auto" Height="Auto" HorizontalAlignment="Stretch"> <Grid Name="GridBesideNavDockPanel" Background="{DynamicResource MainBackgroundColor}" ShowGridLines="False" Width="Auto" Height="Auto" HorizontalAlignment="Stretch">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/> <!-- Main content area --> <ColumnDefinition Width="*"/> <!-- Main content area -->
<ColumnDefinition Width="Auto"/><!-- Space for options button --> <ColumnDefinition Width="Auto"/><!-- Space for options button -->
@ -1308,232 +1195,100 @@
</ScrollViewer> </ScrollViewer>
</TabItem> </TabItem>
<TabItem Header="Updates" Visibility="Collapsed" Name="WPFTab4"> <TabItem Header="Updates" Visibility="Collapsed" Name="WPFTab4">
<!-- <ScrollViewer VerticalScrollBarVisibility="Auto" Margin="{DynamicResource TabContentMargin}"> --> <ScrollViewer VerticalScrollBarVisibility="Auto" Margin="{DynamicResource TabContentMargin}">
<Grid Background="Transparent"> <Grid Background="Transparent">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="*"/> <RowDefinition Height="Auto"/> <!-- Row for the 3 columns -->
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> <!-- Row for Windows Version -->
</Grid.RowDefinitions> </Grid.RowDefinitions>
<!-- Three columns container -->
<Grid Grid.Row="0"> <Grid Grid.Row="0">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="200"/> <ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<!-- Left Column - Update Options --> <!-- Default Settings -->
<Border Grid.Column="0" Style="{StaticResource BorderStyle}" VerticalAlignment="Stretch"> <Border Grid.Column="0" Style="{StaticResource BorderStyle}">
<StackPanel Margin="5"> <StackPanel>
<TextBlock Text="Update Presets" Margin="0,0,0,5"/>
<Button Name="WPFFixesUpdate" <Button Name="WPFFixesUpdate"
Content="Default" FontSize="{DynamicResource ConfigTabButtonFontSize}"
Width="Auto" Content="Default Settings"
Margin="0,2" Margin="10,5"
ToolTip="Default Windows Update Configuration&#x0a;- No modifications to Windows defaults&#x0a;- Removes any custom update settings&#x0a;&#x0a;Note: This resets your Windows Update settings to default out of the box settings. It removes ANY policy or customization that has been done to Windows Update."/> Padding="10"/>
<TextBlock Margin="10"
<Button Name="WPFUpdatessecurity" TextWrapping="Wrap"
Content="Security" Foreground="{DynamicResource MainForegroundColor}">
Width="Auto" <Run FontWeight="Bold">Default Windows Update Configuration</Run>
Margin="0,2" <LineBreak/>
ToolTip="Balanced Security Configuration&#x0a;- Feature updates delayed by 2 years&#x0a;- Security updates installed after 4 days&#x0a;&#x0a;Feature Updates: New features and potential bugs&#x0a;Security Updates: Critical security patches&#x0a;&#x0a;Note: This only applies to Pro systems that can use group policy."/> - No modifications to Windows defaults
<LineBreak/>
<Button Name="WPFUpdatesdisable" - Removes any custom update settings
Content="Disable" <LineBreak/><LineBreak/>
Width="Auto" <Run FontStyle="Italic" FontSize="11">Note: This resets your Windows Update settings to default out of the box settings. It removes ANY policy or customization that has been done to Windows Update.</Run>
Foreground="Red" </TextBlock>
Margin="0,2"
ToolTip="!! Not Recommended !!&#x0a;- Disables ALL Windows Updates&#x0a;- Increases security risks&#x0a;- Only use for isolated systems&#x0a;&#x0a;Warning: Your system will be vulnerable without security updates."/>
</StackPanel> </StackPanel>
</Border> </Border>
<!-- Right Column - Updates List --> <!-- Security Settings -->
<Border Grid.Column="1" Style="{StaticResource BorderStyle}" VerticalAlignment="Stretch"> <Border Grid.Column="1" Style="{StaticResource BorderStyle}">
<Grid Margin="5,0,0,0"> <StackPanel>
<Grid.RowDefinitions> <Button Name="WPFUpdatessecurity"
<RowDefinition Height="Auto"/> FontSize="{DynamicResource ConfigTabButtonFontSize}"
<RowDefinition Height="*"/> Content="Security Settings"
</Grid.RowDefinitions> Margin="10,5"
Padding="10"/>
<TextBlock Margin="10"
TextWrapping="Wrap"
Foreground="{DynamicResource MainForegroundColor}">
<Run FontWeight="Bold">Balanced Security Configuration</Run>
<LineBreak/>
- Feature updates delayed by 2 years
<LineBreak/>
- Security updates installed after 4 days
<LineBreak/><LineBreak/>
<Run FontWeight="SemiBold">Feature Updates:</Run> New features and potential bugs
<LineBreak/>
<Run FontWeight="SemiBold">Security Updates:</Run> Critical security patches
<LineBreak/><LineBreak/>
<Run FontStyle="Italic" FontSize="11">Note: This only applies to Pro systems that can use group policy.</Run>
</TextBlock>
</StackPanel>
</Border>
<!-- Toggle button at the top --> <!-- Disable Updates -->
<StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Right" Margin="5"> <Border Grid.Column="2" Style="{StaticResource BorderStyle}">
<ToggleButton Name="WPFShowUpdateHistory" <StackPanel>
Content="Show History" <Button Name="WPFUpdatesdisable"
Style="{StaticResource ToggleButtonStyle}" FontSize="{DynamicResource ConfigTabButtonFontSize}"
Margin="5" Content="Disable All Updates"
Padding="10,5" Foreground="Red"
ToolTip="Toggle between pending updates and update history"/> Margin="10,5"
</StackPanel> Padding="10"/>
<TextBlock Margin="10"
<!-- Updates Grid - Visible by default --> TextWrapping="Wrap"
<Grid Grid.Row="1" Name="UpdatesGrid" Visibility="Visible"> Foreground="{DynamicResource MainForegroundColor}">
<Grid.RowDefinitions> <Run FontWeight="Bold" Foreground="Red">!! Not Recommended !!</Run>
<RowDefinition Height="Auto"/> <LineBreak/>
<RowDefinition Height="*"/> - Disables ALL Windows Updates
<RowDefinition Height="Auto"/> <LineBreak/>
</Grid.RowDefinitions> - Increases security risks
<LineBreak/>
<Button Name="WPFScanUpdates" - Only use for isolated systems
Content="Scan for Updates" <LineBreak/><LineBreak/>
Grid.Row="0" <Run FontStyle="Italic" FontSize="11">Warning: Your system will be vulnerable without security updates.</Run>
Margin="5" </TextBlock>
HorizontalAlignment="Left" </StackPanel>
Padding="10,5"/>
<DataGrid Name="WPFUpdatesList"
Grid.Row="1"
Margin="5"
AutoGenerateColumns="False"
Background="Transparent"
IsReadOnly="True"
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<DataGrid.Columns>
<DataGridTextColumn Header="LongTitle"
Binding="{Binding LongTitle}"
Width="Auto"
Visibility="Collapsed"/>
<DataGridTextColumn Header="ComputerName"
Binding="{Binding ComputerName}"
Width="Auto"
Visibility="Collapsed"/>
<DataGridTextColumn Header="Title"
Binding="{Binding Title}"
Width="*"
MinWidth="100"/>
<DataGridTextColumn Header="KB"
Binding="{Binding KB}"
Width="Auto"
MinWidth="100">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="Size"
Binding="{Binding Size}"
Width="Auto"
MinWidth="80">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="Status"
Binding="{Binding Status}"
Width="Auto"
MinWidth="100">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
<StackPanel Grid.Row="2"
Orientation="Horizontal"
HorizontalAlignment="Right"
Margin="5">
<StackPanel VerticalAlignment="Center">
<CheckBox x:Name="WPFUpdateVerbose"
Content="Verbose Output"
Margin="5"
Padding="10,5"
ToolTip="Verbose output for update installation"
IsChecked="True"/>
</StackPanel>
<Button Name="WPFUpdateSelectedInstall"
Content="Install Selected"
Margin="5"
Padding="10,5"/>
<Button Name="WPFUpdateAllInstall"
Content="Install All"
Margin="5"
Padding="10,5"/>
</StackPanel>
</Grid>
<!-- History Grid - Collapsed by default -->
<Grid Grid.Row="1" Name="HistoryGrid" Visibility="Collapsed">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Button Name="WPFUpdateScanHistory"
Content="Scan History"
Grid.Row="0"
Margin="5"
HorizontalAlignment="Left"
Padding="10,5"/>
<DataGrid Name="WPFUpdateHistory"
Grid.Row="1"
Margin="5"
AutoGenerateColumns="False"
Background="Transparent"
IsReadOnly="True"
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<DataGrid.Columns>
<DataGridTextColumn Header="ComputerName"
Binding="{Binding ComputerName}"
Width="Auto"
Visibility="Collapsed"/>
<DataGridTextColumn Header="Result"
Binding="{Binding Result}"
Width="Auto"
MinWidth="100">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="Title"
Binding="{Binding Title}"
Width="*"/>
<DataGridTextColumn Header="KB"
Binding="{Binding KB}"
Width="Auto"
MinWidth="100">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="Date"
Binding="{Binding Date}"
Width="Auto"
MinWidth="160">
</DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
</Grid>
</Grid>
</Border> </Border>
</Grid> </Grid>
<Border Grid.Row="1" Style="{StaticResource BorderStyle}"> <!-- Future Implementation: Add Windows Version to updates panel -->
<StackPanel Background="{DynamicResource MainBackgroundColor}" Orientation="Horizontal" HorizontalAlignment="Left"> <Grid Name="updatespanel" Grid.Row="1" Background="Transparent">
<TextBlock Padding="10"> </Grid>
Note: Updates may require a system restart to complete installation. Make sure to save any work before proceeding.
</TextBlock>
</StackPanel>
</Border>
</Grid> </Grid>
<!-- </ScrollViewer> --> </ScrollViewer>
</TabItem> </TabItem>
<TabItem Header="MicroWin" Visibility="Collapsed" Name="WPFTab5"> <TabItem Header="MicroWin" Visibility="Collapsed" Name="WPFTab5">
<ScrollViewer VerticalScrollBarVisibility="Auto" Margin="{DynamicResource TabContentMargin}"> <ScrollViewer VerticalScrollBarVisibility="Auto" Margin="{DynamicResource TabContentMargin}">