mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-07-01 02:22:34 -05:00
Compare commits
25 Commits
winget-fix
...
revert-329
Author | SHA1 | Date | |
---|---|---|---|
986376c44a | |||
89919494e5 | |||
5f6bdb2e48 | |||
f614eea435 | |||
82447a1e7b | |||
51424abfad | |||
3caa3be9a3 | |||
7769a328bb | |||
425f11d787 | |||
6df94df594 | |||
29e2c4d197 | |||
b63a17b7dd | |||
abe059917c | |||
698f1644c3 | |||
fd03f33c50 | |||
8f9e7d1b7c | |||
b3dd1a1a50 | |||
4acad32a38 | |||
0f4fca31b9 | |||
36c984b66c | |||
d215d0fc2c | |||
52de4690ab | |||
ef97a8da24 | |||
18a7f17a0b | |||
5a8cf5deb6 |
5
.gitignore
vendored
5
.gitignore
vendored
@ -47,4 +47,7 @@ True
|
||||
test.ps1
|
||||
winutil.ps1
|
||||
|
||||
binary/
|
||||
# temporary excludes for docs
|
||||
.github/site/
|
||||
|
||||
binary/
|
||||
|
@ -3,6 +3,7 @@
|
||||
[](https://github.com/ChrisTitusTech/winutil/releases/latest)
|
||||

|
||||
[](https://discord.gg/RUbZUZyByQ)
|
||||
[](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.
|
||||
|
||||
@ -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.
|
||||
|
||||
<!-- sponsors --><a href="https://github.com/TriHydera"><img src="https://github.com/TriHydera.png" width="60px" alt="User avatar: TriHydera" /></a><a href="https://github.com/jozozovko"><img src="https://github.com/jozozovko.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/DelDongo"><img src="https://github.com/DelDongo.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/markamos"><img src="https://github.com/markamos.png" width="60px" alt="User avatar: Mark Amos" /></a><a href="https://github.com/dwelfusius"><img src="https://github.com/dwelfusius.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/mews-se"><img src="https://github.com/mews-se.png" width="60px" alt="User avatar: Martin Stockzell" /></a><a href="https://github.com/jdiegmueller"><img src="https://github.com/jdiegmueller.png" width="60px" alt="User avatar: Jason A. Diegmueller" /></a><a href="https://github.com/altugtekiner"><img src="https://github.com/altugtekiner.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/robertsandrock"><img src="https://github.com/robertsandrock.png" width="60px" alt="User avatar: RMS" /></a><a href="https://github.com/KenichiQaz"><img src="https://github.com/KenichiQaz.png" width="60px" alt="User avatar: Stefan" /></a><a href="https://github.com/paulsheets"><img src="https://github.com/paulsheets.png" width="60px" alt="User avatar: Paul" /></a><a href="https://github.com/djones369"><img src="https://github.com/djones369.png" width="60px" alt="User avatar: Dave Jones" /></a><a href="https://github.com/anthonymendez"><img src="https://github.com/anthonymendez.png" width="60px" alt="User avatar: Anthony Mendez" /></a><a href="https://github.com/claudemods"><img src="https://github.com/claudemods.png" width="60px" alt="User avatar: Claudemods" /></a><a href="https://github.com/FatBastard0"><img src="https://github.com/FatBastard0.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/Ascent7910"><img src="https://github.com/Ascent7910.png" width="60px" alt="User avatar: Max" /></a><a href="https://github.com/DursleyGuy"><img src="https://github.com/DursleyGuy.png" width="60px" alt="User avatar: DursleyGuy" /></a><a href="https://github.com/realmuddy"><img src="https://github.com/realmuddy.png" width="60px" alt="User avatar: Phillip Waters" /></a><a href="https://github.com/quaszi"><img src="https://github.com/quaszi.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/DwayneTheRockLobster1"><img src="https://github.com/DwayneTheRockLobster1.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/KieraKujisawa"><img src="https://github.com/KieraKujisawa.png" width="60px" alt="User avatar: Kiera Meredith" /></a><!-- sponsors -->
|
||||
<!-- sponsors --><a href="https://github.com/TriHydera"><img src="https://github.com/TriHydera.png" width="60px" alt="User avatar: TriHydera" /></a><a href="https://github.com/DelDongo"><img src="https://github.com/DelDongo.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/markamos"><img src="https://github.com/markamos.png" width="60px" alt="User avatar: Mark Amos" /></a><a href="https://github.com/dwelfusius"><img src="https://github.com/dwelfusius.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/mews-se"><img src="https://github.com/mews-se.png" width="60px" alt="User avatar: Martin Stockzell" /></a><a href="https://github.com/jdiegmueller"><img src="https://github.com/jdiegmueller.png" width="60px" alt="User avatar: Jason A. Diegmueller" /></a><a href="https://github.com/altugtekiner"><img src="https://github.com/altugtekiner.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/robertsandrock"><img src="https://github.com/robertsandrock.png" width="60px" alt="User avatar: RMS" /></a><a href="https://github.com/KenichiQaz"><img src="https://github.com/KenichiQaz.png" width="60px" alt="User avatar: Stefan" /></a><a href="https://github.com/paulsheets"><img src="https://github.com/paulsheets.png" width="60px" alt="User avatar: Paul" /></a><a href="https://github.com/djones369"><img src="https://github.com/djones369.png" width="60px" alt="User avatar: Dave Jones" /></a><a href="https://github.com/anthonymendez"><img src="https://github.com/anthonymendez.png" width="60px" alt="User avatar: Anthony Mendez" /></a><a href="https://github.com/claudemods"><img src="https://github.com/claudemods.png" width="60px" alt="User avatar: claudemods" /></a><a href="https://github.com/FatBastard0"><img src="https://github.com/FatBastard0.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/Ascent7910"><img src="https://github.com/Ascent7910.png" width="60px" alt="User avatar: Max" /></a><a href="https://github.com/DursleyGuy"><img src="https://github.com/DursleyGuy.png" width="60px" alt="User avatar: DursleyGuy" /></a><a href="https://github.com/realmuddy"><img src="https://github.com/realmuddy.png" width="60px" alt="User avatar: Phillip Waters" /></a><a href="https://github.com/quaszi"><img src="https://github.com/quaszi.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/DwayneTheRockLobster1"><img src="https://github.com/DwayneTheRockLobster1.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/KieraKujisawa"><img src="https://github.com/KieraKujisawa.png" width="60px" alt="User avatar: Kiera Meredith" /></a><!-- sponsors -->
|
||||
|
||||
## 🏅 Thanks to all Contributors
|
||||
Thanks a lot for spending your time helping Winutil grow. Thanks a lot! Keep rocking 🍻.
|
||||
|
@ -527,14 +527,6 @@
|
||||
"link": "https://espanso.org/",
|
||||
"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": {
|
||||
"category": "Browsers",
|
||||
"choco": "falkon",
|
||||
@ -1699,7 +1691,7 @@
|
||||
"category": "Games",
|
||||
"choco": "prismlauncher",
|
||||
"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/",
|
||||
"winget": "PrismLauncher.PrismLauncher"
|
||||
},
|
||||
@ -2934,5 +2926,13 @@
|
||||
"description": "Fork - a fast and friendly git client.",
|
||||
"link": "https://git-fork.com/",
|
||||
"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"
|
||||
}
|
||||
}
|
||||
|
@ -306,6 +306,13 @@
|
||||
"ButtonWidth": "300",
|
||||
"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": {
|
||||
"Content": "Install CTT PowerShell Profile",
|
||||
"category": "Powershell Profile",
|
||||
|
@ -2,6 +2,7 @@
|
||||
"Standard": [
|
||||
"WPFTweaksAH",
|
||||
"WPFTweaksConsumerFeatures",
|
||||
"WPFTweaksDisableExplorerAutoDiscovery",
|
||||
"WPFTweaksDVR",
|
||||
"WPFTweaksHiber",
|
||||
"WPFTweaksHome",
|
||||
@ -18,6 +19,7 @@
|
||||
],
|
||||
"Minimal": [
|
||||
"WPFTweaksConsumerFeatures",
|
||||
"WPFTweaksDisableExplorerAutoDiscovery",
|
||||
"WPFTweaksHome",
|
||||
"WPFTweaksServices",
|
||||
"WPFTweaksTele"
|
||||
|
@ -7,7 +7,7 @@
|
||||
"CustomDialogHeight": "200",
|
||||
"FontSize": "12",
|
||||
"FontFamily": "Arial",
|
||||
"HeadingFontSize": "16",
|
||||
"HeaderFontSize": "16",
|
||||
"HeaderFontFamily": "Consolas, Monaco",
|
||||
"CheckBoxBulletDecoratorSize": "14",
|
||||
"CheckBoxMargin": "15,0,0,2",
|
||||
@ -35,7 +35,8 @@
|
||||
"CheckboxMouseOverColor": "#999999",
|
||||
"ButtonBorderThickness": "1",
|
||||
"ButtonMargin": "1",
|
||||
"ButtonCornerRadius": "2"
|
||||
"ButtonCornerRadius": "2",
|
||||
"AppTileImageSize": "40"
|
||||
},
|
||||
"Light": {
|
||||
"AppInstallUnselectedColor": "#F0F0F0",
|
||||
|
@ -3414,12 +3414,30 @@
|
||||
],
|
||||
"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": {
|
||||
"Content": "Snap Window",
|
||||
"Description": "If enabled you can align windows by dragging them. | Relogin Required",
|
||||
"category": "Customize Preferences",
|
||||
"panel": "2",
|
||||
"Order": "a105_",
|
||||
"Order": "a106_",
|
||||
"Type": "Toggle",
|
||||
"registry": [
|
||||
{
|
||||
@ -3438,7 +3456,7 @@
|
||||
"Description": "If enabled then Snap preview is disabled when maximize button is hovered.",
|
||||
"category": "Customize Preferences",
|
||||
"panel": "2",
|
||||
"Order": "a106_",
|
||||
"Order": "a107_",
|
||||
"Type": "Toggle",
|
||||
"registry": [
|
||||
{
|
||||
@ -3467,7 +3485,7 @@
|
||||
"Description": "If enabled then you will get suggestions to snap other applications in the left over spaces.",
|
||||
"category": "Customize Preferences",
|
||||
"panel": "2",
|
||||
"Order": "a107_",
|
||||
"Order": "a108_",
|
||||
"Type": "Toggle",
|
||||
"registry": [
|
||||
{
|
||||
@ -3496,7 +3514,7 @@
|
||||
"Description": "If Enabled then Cursor movement is affected by the speed of your physical mouse movements.",
|
||||
"category": "Customize Preferences",
|
||||
"panel": "2",
|
||||
"Order": "a108_",
|
||||
"Order": "a109_",
|
||||
"Type": "Toggle",
|
||||
"registry": [
|
||||
{
|
||||
@ -3531,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.",
|
||||
"category": "Customize Preferences",
|
||||
"panel": "2",
|
||||
"Order": "a109_",
|
||||
"Order": "a110_",
|
||||
"Type": "Toggle",
|
||||
"registry": [
|
||||
{
|
||||
@ -3740,5 +3758,60 @@
|
||||
"Type": "Button",
|
||||
"ButtonWidth": "300",
|
||||
"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!
|
||||
"
|
||||
],
|
||||
},
|
||||
}
|
||||
|
@ -5,28 +5,23 @@ function Initialize-InstallAppEntry {
|
||||
Used to as part of the Install Tab UI generation
|
||||
.PARAMETER TargetElement
|
||||
The Element into which the Apps should be placed
|
||||
.PARAMETER AppKey
|
||||
.PARAMETER appKey
|
||||
The Key of the app inside the $sync.configs.applicationsHashtable
|
||||
#>
|
||||
param(
|
||||
[Windows.Controls.WrapPanel]$TargetElement,
|
||||
$AppKey
|
||||
$appKey
|
||||
)
|
||||
$App = $sync.configs.applicationsHashtable.$AppKey
|
||||
|
||||
# Create the outer Border for the application type
|
||||
$border = New-Object Windows.Controls.Border
|
||||
$border.BorderBrush = [Windows.Media.Brushes]::Gray
|
||||
$border.SetResourceReference([Windows.Controls.Control]::BorderThicknessProperty, "AppTileBorderThickness")
|
||||
$border.CornerRadius = 5
|
||||
$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.Style = $sync.Form.Resources.AppTileBorderStyle
|
||||
$border.Tag = $appKey
|
||||
$border.ToolTip = $Apps.$appKey.description
|
||||
$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.isChecked = -not $childCheckbox.IsChecked
|
||||
})
|
||||
@ -47,12 +42,8 @@ function Initialize-InstallAppEntry {
|
||||
|
||||
# Create the CheckBox, vertically centered
|
||||
$checkBox = New-Object Windows.Controls.CheckBox
|
||||
$checkBox.Name = $AppKey
|
||||
$checkBox.Background = "Transparent"
|
||||
$checkBox.HorizontalAlignment = "Left"
|
||||
$checkBox.VerticalAlignment = "Center"
|
||||
$checkBox.SetResourceReference([Windows.Controls.Control]::MarginProperty, "AppTileMargins")
|
||||
$checkBox.SetResourceReference([Windows.Controls.Control]::StyleProperty, "CollapsedCheckBoxStyle")
|
||||
$checkBox.Name = $appKey
|
||||
$checkbox.Style = $sync.Form.Resources.AppTileCheckboxStyle
|
||||
$checkbox.Add_Checked({
|
||||
Invoke-WPFSelectedAppsUpdate -type "Add" -checkbox $this
|
||||
$borderElement = $this.Parent.Parent
|
||||
@ -64,7 +55,7 @@ function Initialize-InstallAppEntry {
|
||||
$borderElement = $this.Parent.Parent
|
||||
$borderElement.SetResourceReference([Windows.Controls.Control]::BackgroundProperty, "AppInstallUnselectedColor")
|
||||
})
|
||||
$sync.$($checkBox.Name) = $checkBox
|
||||
|
||||
# Create a StackPanel for the image and name
|
||||
$imageAndNamePanel = New-Object Windows.Controls.StackPanel
|
||||
$imageAndNamePanel.Orientation = "Horizontal"
|
||||
@ -73,29 +64,15 @@ function Initialize-InstallAppEntry {
|
||||
# Create the Image and set a placeholder
|
||||
$image = New-Object Windows.Controls.Image
|
||||
# $image.Name = "wpfapplogo" + $App.Name
|
||||
$image.Width = 40
|
||||
$image.Height = 40
|
||||
$image.Margin = New-Object Windows.Thickness(0, 0, 10, 0)
|
||||
$image.Style = $sync.Form.Resources.AppTileImageStyle
|
||||
$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
|
||||
|
||||
# Create the TextBlock for the application name
|
||||
$appName = New-Object Windows.Controls.TextBlock
|
||||
$appName.Text = $App.Content
|
||||
$appName.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "AppTileFontSize")
|
||||
$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"
|
||||
$appName.Style = $sync.Form.Resources.AppTileNameStyle
|
||||
$appName.Text = $Apps.$appKey.content
|
||||
$imageAndNamePanel.Children.Add($appName) | Out-Null
|
||||
|
||||
# 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
|
||||
$buttonPanel = New-Object Windows.Controls.StackPanel
|
||||
$buttonPanel.Orientation = "Horizontal"
|
||||
$buttonPanel.HorizontalAlignment = "Right"
|
||||
$buttonPanel.VerticalAlignment = "Center"
|
||||
$buttonPanel.SetResourceReference([Windows.Controls.Control]::MarginProperty, "AppTileMargins")
|
||||
$buttonPanel.SetResourceReference([Windows.Controls.Control]::VisibilityProperty, "AppTileCompactVisibility")
|
||||
$buttonPanel.Style = $sync.Form.Resources.AppTileButtonPanelStyle
|
||||
[Windows.Controls.DockPanel]::SetDock($buttonPanel, [Windows.Controls.Dock]::Right)
|
||||
|
||||
# Create the "Install" button
|
||||
$installButton = New-Object Windows.Controls.Button
|
||||
$installButton.Width = 45
|
||||
$installButton.Height = 35
|
||||
$installButton.Margin = New-Object Windows.Thickness(0, 0, 10, 0)
|
||||
# Define the button properties
|
||||
$buttons = @(
|
||||
[PSCustomObject]@{ Name = "Install"; Description = "Install or Upgrade the application"; Tooltip = "Install or Upgrade the application"; Icon = [char]0xE118 },
|
||||
[PSCustomObject]@{ Name = "Uninstall"; Description = "Uninstall the application"; Tooltip = "Uninstall the application"; Icon = [char]0xE74D },
|
||||
[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
|
||||
$installIcon.Text = [char]0xE118 # Install Icon
|
||||
$installIcon.FontFamily = "Segoe MDL2 Assets"
|
||||
$installIcon.FontSize = 20
|
||||
$installIcon.SetResourceReference([Windows.Controls.Control]::ForegroundProperty, "MainForegroundColor")
|
||||
$installIcon.Background = "Transparent"
|
||||
$installIcon.HorizontalAlignment = "Center"
|
||||
$installIcon.VerticalAlignment = "Center"
|
||||
# Iterate over each button and create it
|
||||
foreach ($button in $buttons) {
|
||||
$newButton = New-Object Windows.Controls.Button
|
||||
$newButton.Style = $sync.Form.Resources.AppTileButtonStyle
|
||||
$newButton.Content = $button.Icon
|
||||
$newButton.ToolTip = $button.Tooltip
|
||||
$buttonPanel.Children.Add($newButton) | Out-Null
|
||||
|
||||
$installButton.Content = $installIcon
|
||||
$installButton.ToolTip = "Install or Upgrade the application"
|
||||
$buttonPanel.Children.Add($installButton) | Out-Null
|
||||
|
||||
# Add Click event for the "Install" button
|
||||
$installButton.Add_Click({
|
||||
$appKey = $this.Parent.Parent.Parent.Tag
|
||||
$appObject = $sync.configs.applicationsHashtable.$appKey
|
||||
Invoke-WPFInstall -PackagesToInstall $appObject
|
||||
})
|
||||
|
||||
# Create the "Uninstall" button
|
||||
$uninstallButton = New-Object Windows.Controls.Button
|
||||
$uninstallButton.Width = 45
|
||||
$uninstallButton.Height = 35
|
||||
|
||||
$uninstallIcon = New-Object Windows.Controls.TextBlock
|
||||
$uninstallIcon.Text = [char]0xE74D # Uninstall Icon
|
||||
$uninstallIcon.FontFamily = "Segoe MDL2 Assets"
|
||||
$uninstallIcon.FontSize = 20
|
||||
$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
|
||||
})
|
||||
switch ($button.Name) {
|
||||
"Install" {
|
||||
$newButton.Add_Click({
|
||||
$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
|
||||
$appObject = $sync.configs.applicationsHashtable.$appKey
|
||||
Invoke-WPFUnInstall -PackagesToUninstall $appObject
|
||||
})
|
||||
}
|
||||
"Info" {
|
||||
$newButton.Add_Click({
|
||||
$appKey = $this.Parent.Parent.Parent.Tag
|
||||
$appObject = $sync.configs.applicationsHashtable.$appKey
|
||||
Start-Process $appObject.link
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Add the button panel to the DockPanel
|
||||
$dockPanel.Children.Add($buttonPanel) | Out-Null
|
||||
|
||||
# Add the border to the corresponding Category
|
||||
$TargetElement.Children.Add($border) | Out-Null
|
||||
return $checkbox
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ function Initialize-InstallCategoryAppList {
|
||||
$loadingLabel.Content = "Loading, please wait..."
|
||||
$loadingLabel.HorizontalAlignment = "Center"
|
||||
$loadingLabel.VerticalAlignment = "Center"
|
||||
$loadingLabel.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "FontSizeHeading")
|
||||
$loadingLabel.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "HeaderFontSize")
|
||||
$loadingLabel.FontWeight = [Windows.FontWeights]::Bold
|
||||
$loadingLabel.Foreground = [Windows.Media.Brushes]::Gray
|
||||
$sync.LoadingLabel = $loadingLabel
|
||||
@ -53,8 +53,17 @@ function Initialize-InstallCategoryAppList {
|
||||
$TargetElement.Dispatcher.Invoke([System.Windows.Threading.DispatcherPriority]::Background, [action]{
|
||||
|
||||
$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
|
||||
$wrapPanel = New-Object Windows.Controls.WrapPanel
|
||||
$wrapPanel.Orientation = "Horizontal"
|
||||
@ -64,9 +73,9 @@ function Initialize-InstallCategoryAppList {
|
||||
$wrapPanel.Visibility = [Windows.Visibility]::Collapsed
|
||||
$wrapPanel.Tag = "CategoryWrapPanel_$category"
|
||||
$null = $TargetElement.Items.Add($wrapPanel)
|
||||
$Apps.Keys | Where-Object { $Apps.$_.Category -eq $category } | Sort-Object | ForEach-Object {
|
||||
Initialize-InstallAppEntry -TargetElement $wrapPanel -AppKey $_
|
||||
}
|
||||
$appsByCategory[$category] | ForEach-Object {
|
||||
$sync.$_ = $(Initialize-InstallAppEntry -TargetElement $wrapPanel -AppKey $_)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -29,7 +29,8 @@ function Initialize-InstallHeader {
|
||||
$buttonConfigs = @(
|
||||
@{Name="WPFInstall"; Content="Install/Upgrade Selected"},
|
||||
@{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) {
|
||||
@ -38,18 +39,9 @@ function Initialize-InstallHeader {
|
||||
$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.IsOpen = $false
|
||||
$selectedAppsPopup.PlacementTarget = $selectedAppsButton
|
||||
$selectedAppsPopup.PlacementTarget = $sync.WPFselectedAppsButton
|
||||
$selectedAppsPopup.Placement = [System.Windows.Controls.Primitives.PlacementMode]::Bottom
|
||||
$selectedAppsPopup.AllowsTransparency = $true
|
||||
|
||||
@ -66,24 +58,21 @@ function Initialize-InstallHeader {
|
||||
$selectedAppsBorder.Child = $sync.selectedAppsstackPanel
|
||||
|
||||
# Toggle selectedAppsPopup open/close with button
|
||||
$selectedAppsButton.Add_Click({
|
||||
$sync.WPFselectedAppsButton.Add_Click({
|
||||
$sync.selectedAppsPopup.IsOpen = -not $sync.selectedAppsPopup.IsOpen
|
||||
})
|
||||
# Close selectedAppsPopup when mouse leaves both button and selectedAppsPopup
|
||||
$selectedAppsButton.Add_MouseLeave({
|
||||
$sync.WPFselectedAppsButton.Add_MouseLeave({
|
||||
if (-not $sync.selectedAppsPopup.IsMouseOver) {
|
||||
$sync.selectedAppsPopup.IsOpen = $false
|
||||
}
|
||||
})
|
||||
$selectedAppsPopup.Add_MouseLeave({
|
||||
if (-not $selectedAppsButton.IsMouseOver) {
|
||||
if (-not $sync.WPFselectedAppsButton.IsMouseOver) {
|
||||
$sync.selectedAppsPopup.IsOpen = $false
|
||||
}
|
||||
})
|
||||
|
||||
$null = $wrapPanelTop.Children.Add($selectedAppsButton)
|
||||
$sync.$($selectedAppsButton.Name) = $selectedAppsButton
|
||||
|
||||
[Windows.Controls.DockPanel]::SetDock($wrapPanelTop, [Windows.Controls.Dock]::Top)
|
||||
$null = $TargetElement.Children.Add($wrapPanelTop)
|
||||
}
|
||||
|
@ -48,103 +48,29 @@ function Install-WinUtilWinget {
|
||||
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
|
||||
}
|
||||
Write-Host "Attempting to repair WinGet using Repair-WinGetPackageManager..." -ForegroundColor Yellow
|
||||
|
||||
# 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"
|
||||
Write-Output "Refreshing Environment Variables...`n"
|
||||
$ENV:PATH = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
|
||||
return
|
||||
# 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 {
|
||||
throw "Installation failed with status: $($deploymentOperation.Status)"
|
||||
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"
|
||||
}
|
||||
} catch {
|
||||
Write-Information "Microsoft Store installation failed. Attempting to install from Nuget..."
|
||||
}
|
||||
try {
|
||||
## Nuget Method
|
||||
Write-Host "Enabling NuGet and Module..."
|
||||
# Enable TLS 1.2 for the PowerShell session
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
|
||||
# Try to register the NuGet package source if not present
|
||||
if (-not (Get-PackageSource -Name "NuGet" -ErrorAction SilentlyContinue)) {
|
||||
Register-PackageSource -Name "NuGet" -Location "https://www.nuget.org/api/v2" -ProviderName NuGet -Force
|
||||
}
|
||||
|
||||
# Install NuGet provider with error handling
|
||||
try {
|
||||
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force -Confirm:$false -ErrorAction Stop
|
||||
} catch {
|
||||
Write-Warning "Failed to install NuGet provider through standard method. Trying alternative approach..."
|
||||
Install-PackageProvider -Name NuGet -Source "https://www.powershellgallery.com/api/v2" -Force -Confirm:$false
|
||||
}
|
||||
Install-Module -Name Microsoft.WinGet.Client -Confirm:$false -Force
|
||||
|
||||
# Check if WinGet was installed successfully through NuGet
|
||||
$wingetCmd = Get-Command winget -ErrorAction Stop
|
||||
Write-Information "Successfully installed WinGet through NuGet"
|
||||
Write-Output "Refreshing Environment Variables...`n"
|
||||
$ENV:PATH = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
|
||||
return
|
||||
|
||||
} catch {
|
||||
Write-Warning "NuGet installation failed. Attempting to install from GitHub..."
|
||||
Write-Error "All installation methods failed. Unable to install WinGet."
|
||||
throw
|
||||
}
|
||||
# GitHub fallback installation method
|
||||
$releases_url = "https://api.github.com/repos/microsoft/winget-cli/releases/latest"
|
||||
$asset = (Invoke-RestMethod -Uri $releases_url).assets |
|
||||
Where-Object { $_.name -match "\.msixbundle$" } |
|
||||
Select-Object -First 1
|
||||
|
||||
$download_url = $asset.browser_download_url
|
||||
$output_path = Join-Path $env:TEMP $asset.name
|
||||
|
||||
Invoke-WebRequest -Uri $download_url -OutFile $output_path
|
||||
Add-AppxPackage -Path $output_path -ErrorAction Stop
|
||||
|
||||
# Verify installation
|
||||
$wingetCmd = Get-Command winget -ErrorAction Stop
|
||||
Write-Information "Successfully installed WinGet through GitHub"
|
||||
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."
|
||||
Write-Error "An error occurred during WinGet installation: $_"
|
||||
throw
|
||||
}
|
||||
}
|
||||
|
@ -23,14 +23,22 @@ function Test-WinUtilPackageManager {
|
||||
# Check if Winget is available while getting it's Version if it's available
|
||||
$wingetExists = $true
|
||||
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] {
|
||||
Write-Warning "Winget was not found due to un-availablity reasons"
|
||||
$wingetExists = $false
|
||||
} catch {
|
||||
Write-Warning "Winget was not found due to un-known reasons, The Stack Trace is:`n$($psitem.Exception.StackTrace)"
|
||||
$wingetExists = $false
|
||||
}
|
||||
}
|
||||
|
||||
# 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
|
||||
@ -48,13 +56,14 @@ function Test-WinUtilPackageManager {
|
||||
# Check if Winget's Version is too old.
|
||||
$wingetCurrentVersion = [System.Version]::Parse($wingetVersion.Trim('v'))
|
||||
# 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
|
||||
$wingetLatestVersion = [System.Version]::Parse(($response.tag_name).Trim('v')) #Stores version number of latest release.
|
||||
$wingetOutdated = $wingetCurrentVersion -lt $wingetLatestVersion
|
||||
$response = winget search -e Microsoft.AppInstaller --accept-source-agreements
|
||||
$wingetLatestVersion = ($response | Select-String -Pattern '\d+\.\d+\.\d+\.\d+').Matches.Value
|
||||
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 "--- Winget is installed ---" -ForegroundColor Green
|
||||
Write-Host "===========================================" -ForegroundColor Green
|
||||
Write-Host "Version: $wingetVersionFull" -ForegroundColor White
|
||||
|
||||
if (!$wingetPreview) {
|
||||
Write-Host " - Winget is a release version." -ForegroundColor Green
|
||||
|
@ -44,6 +44,7 @@ function Invoke-WPFButton {
|
||||
"WPFPanelprinter" {Invoke-WPFControlPanel -Panel $button}
|
||||
"WPFPanelsystem" {Invoke-WPFControlPanel -Panel $button}
|
||||
"WPFPaneluser" {Invoke-WPFControlPanel -Panel $button}
|
||||
"WPFPanelGodMode" {Invoke-WPFControlPanel -Panel $button}
|
||||
"WPFUpdatesdefault" {Invoke-WPFFixesUpdate}
|
||||
"WPFFixesUpdate" {Invoke-WPFFixesUpdate}
|
||||
"WPFFixesWinget" {Invoke-WPFFixesWinget}
|
||||
|
@ -19,5 +19,6 @@ function Invoke-WPFControlPanel {
|
||||
"WPFPanelprinter" {Start-Process "shell:::{A8A91A66-3A7D-4424-8D24-04E180695C7A}"}
|
||||
"WPFPanelsystem" {cmd /c sysdm.cpl}
|
||||
"WPFPaneluser" {cmd /c "control userpasswords2"}
|
||||
"WPFPanelGodMode" {Start-Process "shell:::{ED7BA470-8E54-465E-825C-99712043E01C}"}
|
||||
}
|
||||
}
|
||||
|
@ -144,7 +144,7 @@ function Invoke-WPFUIElements {
|
||||
|
||||
$label = New-Object Windows.Controls.Label
|
||||
$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")
|
||||
$itemsControl.Items.Add($label) | Out-Null
|
||||
$sync[$category] = $label
|
||||
|
@ -3,7 +3,6 @@
|
||||
{% block header %}
|
||||
{{ super() }}
|
||||
<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.
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@ -46,7 +46,6 @@ class GenericException : Exception {
|
||||
GenericException($Message) : base($Message) {}
|
||||
}
|
||||
|
||||
|
||||
$inputXML = $inputXML -replace 'mc:Ignorable="d"', '' -replace "x:N", 'N' -replace '^<Win.*', '<Window'
|
||||
|
||||
[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
|
||||
Invoke-WPFUIElements -configVariable $sync.configs.appnavigation -targetGridName "appscategory" -columncount 1
|
||||
|
||||
# Add logic to handle click to the ToggleView Button on the Install Tab
|
||||
$sync.WPFToggleView.Add_Click({
|
||||
$sync.CompactView = -not $sync.CompactView
|
||||
@ -130,7 +130,9 @@ $sync.WPFToggleView.Add_Click({
|
||||
Invoke-WPFUIApps -Apps $sync.configs.applicationsHashtable -targetGridName "appspanel"
|
||||
|
||||
Invoke-WPFUIElements -configVariable $sync.configs.tweaks -targetGridName "tweakspanel" -columncount 2
|
||||
|
||||
Invoke-WPFUIElements -configVariable $sync.configs.feature -targetGridName "featurespanel" -columncount 2
|
||||
|
||||
# Future implementation: Add Windows Version to updates panel
|
||||
#Invoke-WPFUIElements -configVariable $sync.configs.updates -targetGridName "updatespanel" -columncount 1
|
||||
|
||||
@ -303,8 +305,8 @@ $sync["Form"].Add_MouseLeftButtonDown({
|
||||
})
|
||||
|
||||
$sync["Form"].Add_MouseDoubleClick({
|
||||
if ($_.OriginalSource -is [System.Windows.Controls.Grid] -or
|
||||
$_.OriginalSource -is [System.Windows.Controls.StackPanel]) {
|
||||
if ($_.OriginalSource.Name -eq "NavDockPanel" -or
|
||||
$_.OriginalSource.Name -eq "GridBesideNavDockPanel") {
|
||||
if ($sync["Form"].WindowState -eq [Windows.WindowState]::Normal) {
|
||||
$sync["Form"].WindowState = [Windows.WindowState]::Maximized
|
||||
}
|
||||
@ -579,7 +581,5 @@ $sync["SponsorMenuItem"].Add_Click({
|
||||
Show-CustomDialog -Title "Sponsors" -Message $authorInfo -EnableScroll $true
|
||||
})
|
||||
|
||||
|
||||
|
||||
$sync["Form"].ShowDialog() | out-null
|
||||
Stop-Transcript
|
||||
|
@ -54,21 +54,27 @@ if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]:
|
||||
$PSBoundParameters.GetEnumerator() | ForEach-Object {
|
||||
$argList += if ($_.Value -is [switch] -and $_.Value) {
|
||||
"-$($_.Key)"
|
||||
} elseif ($_.Value -is [array]) {
|
||||
"-$($_.Key) $($_.Value -join ',')"
|
||||
} elseif ($_.Value) {
|
||||
"-$($_.Key) `"$($_.Value)`""
|
||||
"-$($_.Key) '$($_.Value)'"
|
||||
}
|
||||
}
|
||||
|
||||
$script = if ($MyInvocation.MyCommand.Path) {
|
||||
"& { & '$($MyInvocation.MyCommand.Path)' $argList }"
|
||||
$script = if ($PSCommandPath) {
|
||||
"& { & `'$($PSCommandPath)`' $($argList -join ' ') }"
|
||||
} 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" }
|
||||
$processCmd = if (Get-Command wt.exe -ErrorAction SilentlyContinue) { "wt.exe" } else { $powershellcmd }
|
||||
$powershellCmd = if (Get-Command pwsh -ErrorAction SilentlyContinue) { "pwsh" } else { "powershell" }
|
||||
$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
|
||||
}
|
||||
|
@ -67,6 +67,82 @@
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</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">
|
||||
<Setter Property="Foreground" Value="{DynamicResource MainForegroundColor}" />
|
||||
@ -202,7 +278,7 @@
|
||||
<Setter Property="Foreground" Value="{DynamicResource LabelboxForegroundColor}"/>
|
||||
<Setter Property="Background" Value="{DynamicResource MainBackgroundColor}"/>
|
||||
<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="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left"/>
|
||||
@ -502,19 +578,6 @@
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</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">
|
||||
<Setter Property="Foreground" Value="{DynamicResource MainForegroundColor}"/>
|
||||
<Setter Property="Background" Value="{DynamicResource MainBackgroundColor}"/>
|
||||
@ -851,7 +914,7 @@
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</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>
|
||||
<ToggleButton Margin="0,0,5,0" HorizontalAlignment="Left" Height="{DynamicResource TabButtonHeight}" Width="{DynamicResource TabButtonWidth}"
|
||||
@ -894,7 +957,7 @@
|
||||
</TextBlock>
|
||||
</ToggleButton.Content>
|
||||
</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>
|
||||
<ColumnDefinition Width="*"/> <!-- Main content area -->
|
||||
<ColumnDefinition Width="Auto"/><!-- Space for options button -->
|
||||
|
Reference in New Issue
Block a user