diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index 43426a8a..2520c8d3 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -7,7 +7,7 @@ assignees: ''
---
## Describe the bug
-A clear and concise description of what the bug is.
+
## To Reproduce
Steps to reproduce the behavior:
@@ -17,10 +17,10 @@ Steps to reproduce the behavior:
4. See error
## Expected behavior
-A clear and concise description of what you expected to happen.
+
## Screenshots
-If applicable, add screenshots to help explain your problem.
+
## Additional context
-Add any other context about the problem here.
+
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
index bbcbbe7d..a6f653e0 100644
--- a/.github/ISSUE_TEMPLATE/feature_request.md
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -8,13 +8,13 @@ assignees: ''
---
**Is your feature request related to a problem? Please describe.**
-A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
+
**Describe the solution you'd like**
-A clear and concise description of what you want to happen.
+
**Describe alternatives you've considered**
-A clear and concise description of any alternative solutions or features you've considered.
+
**Additional context**
-Add any other context or screenshots about the feature request here.
+
diff --git a/.github/SECURITY.md b/.github/SECURITY.md
index 6b437033..be3f8839 100644
--- a/.github/SECURITY.md
+++ b/.github/SECURITY.md
@@ -1,5 +1,5 @@
# Security Policy
-If you find a security issue please make post it in the issues tab. If you think it should be private you can email me at contact@christitus.com.
+If you find a security issue please make post it in the issues tab. If you think it should be private you can email me at contact@christitus.com.
For immediate response check out our discord server @ [![](https://dcbadge.limes.pink/api/server/https://discord.gg/RUbZUZyByQ?theme=default-inverted&style=for-the-badge)](https://discord.gg/RUbZUZyByQ)
diff --git a/Compile.ps1 b/Compile.ps1
index f86fbce6..6f7a0313 100644
--- a/Compile.ps1
+++ b/Compile.ps1
@@ -64,38 +64,14 @@ Get-ChildItem "$workingdir\functions" -Recurse -File | ForEach-Object {
}
Update-Progress "Adding: Config *.json" 40
Get-ChildItem "$workingdir\config" | Where-Object {$psitem.extension -eq ".json"} | ForEach-Object {
-
$json = (Get-Content $psitem.FullName).replace("'","''")
-
- # Replace every XML Special Character so it'll render correctly in final build
- # Only do so if json files has content to be displayed (for example the applications, tweaks, features json files)
- # Make an Array List containing every name at first level of Json File
- $jsonAsObject = $json | convertfrom-json
- $firstLevelJsonList = [System.Collections.ArrayList]::new()
- $jsonAsObject.PSObject.Properties.Name | ForEach-Object {$null = $firstLevelJsonList.Add($_)}
- # Note:
- # Avoid using HTML Entity Codes, for example '”' (stands for "Right Double Quotation Mark"),
- # Use **HTML decimal/hex codes instead**, as using HTML Entity Codes will result in XML parse Error when running the compiled script.
- for ($i = 0; $i -lt $firstLevelJsonList.Count; $i += 1) {
- $firstLevelName = $firstLevelJsonList[$i]
- if ($jsonAsObject.$firstLevelName.content -ne $null) {
- $jsonAsObject.$firstLevelName.content = $jsonAsObject.$firstLevelName.content.replace('&','&').replace('“','“').replace('”','”').replace("'",''').replace('<','<').replace('>','>').replace('—','—')
- $jsonAsObject.$firstLevelName.content = $jsonAsObject.$firstLevelName.content.replace('''',"'") # resolves the Double Apostrophe caused by the first replace function in the main loop
- }
- if ($jsonAsObject.$firstLevelName.description -ne $null) {
- $jsonAsObject.$firstLevelName.description = $jsonAsObject.$firstLevelName.description.replace('&','&').replace('“','“').replace('”','”').replace("'",''').replace('<','<').replace('>','>').replace('—','—')
- $jsonAsObject.$firstLevelName.description = $jsonAsObject.$firstLevelName.description.replace('''',"'") # resolves the Double Apostrophe caused by the first replace function in the main loop
- }
- }
+ $jsonAsObject = $json | convertfrom-json
# Add 'WPFInstall' as a prefix to every entry-name in 'applications.json' file
if ($psitem.Name -eq "applications.json") {
- for ($i = 0; $i -lt $firstLevelJsonList.Count; $i += 1) {
- $appEntryName = $firstLevelJsonList[$i]
+ foreach ($appEntryName in $jsonAsObject.PSObject.Properties.Name) {
$appEntryContent = $jsonAsObject.$appEntryName
- # Remove the entire app entry, so we could add it later with a different name
$jsonAsObject.PSObject.Properties.Remove($appEntryName)
- # Add the app entry, but with a different name (WPFInstall + The App Entry Name)
$jsonAsObject | Add-Member -MemberType NoteProperty -Name "WPFInstall$appEntryName" -Value $appEntryContent
}
}
@@ -110,20 +86,7 @@ Get-ChildItem "$workingdir\config" | Where-Object {$psitem.extension -eq ".json"
$xaml = (Get-Content "$workingdir\xaml\inputXML.xaml").replace("'","''")
-# Dot-source the Get-TabXaml function
-. "$workingdir\functions\private\Get-TabXaml.ps1"
-
-Update-Progress "Building: Xaml " 75
-$appXamlContent = Get-TabXaml "applications" 5
-$tweaksXamlContent = Get-TabXaml "tweaks"
-$featuresXamlContent = Get-TabXaml "feature"
-
-
Update-Progress "Adding: Xaml " 90
-# Replace the placeholder in $inputXML with the content of inputApp.xaml
-$xaml = $xaml -replace "{{InstallPanel_applications}}", $appXamlContent
-$xaml = $xaml -replace "{{InstallPanel_tweaks}}", $tweaksXamlContent
-$xaml = $xaml -replace "{{InstallPanel_features}}", $featuresXamlContent
$script_content.Add($(Write-output "`$inputXML = '$xaml'"))
diff --git a/README.md b/README.md
index 1233f475..b0820ded 100644
--- a/README.md
+++ b/README.md
@@ -52,7 +52,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.
-
+
## 🏅 Thanks to all Contributors
Thanks a lot for spending your time helping Winutil grow. Thanks a lot! Keep rocking 🍻.
diff --git a/config/applications.json b/config/applications.json
index c7ad5a7e..29dbff87 100644
--- a/config/applications.json
+++ b/config/applications.json
@@ -87,14 +87,6 @@
"link": "https://anydesk.com/",
"winget": "AnyDeskSoftwareGmbH.AnyDesk"
},
- "ATLauncher": {
- "category": "Games",
- "choco": "na",
- "content": "ATLauncher",
- "description": "ATLauncher is a Launcher for Minecraft which integrates multiple different ModPacks to allow you to download and install ModPacks easily and quickly.",
- "link": "https://github.com/ATLauncher/ATLauncher",
- "winget": "ATLauncher.ATLauncher"
- },
"audacity": {
"category": "Multimedia Tools",
"choco": "audacity",
@@ -511,14 +503,6 @@
"link": "https://www.epicgames.com/store/en-US/",
"winget": "EpicGames.EpicGamesLauncher"
},
- "errorlookup": {
- "category": "Utilities",
- "choco": "na",
- "content": "Windows Error Code Lookup",
- "description": "ErrorLookup is a tool for looking up Windows error codes and their descriptions.",
- "link": "https://github.com/HenryPP/ErrorLookup",
- "winget": "Henry++.ErrorLookup"
- },
"esearch": {
"category": "Utilities",
"choco": "everything",
diff --git a/config/preset.json b/config/preset.json
index 78083d15..570c1f67 100644
--- a/config/preset.json
+++ b/config/preset.json
@@ -14,7 +14,7 @@
"WPFTweaksDeleteTempFiles",
"WPFTweaksEndTaskOnTaskbar",
"WPFTweaksRestorePoint",
- "WPFTweaksTeredo",
+ "WPFTweaksIPv46",
"WPFTweaksPowershell7Tele"
],
"Minimal": [
diff --git a/config/themes.json b/config/themes.json
index 2c11a09d..efada878 100644
--- a/config/themes.json
+++ b/config/themes.json
@@ -1,220 +1,169 @@
{
- "Classic": {
- "CustomDialogFontSize": "12",
- "CustomDialogFontSizeHeader": "14",
- "CustomDialogIconSize": "25",
- "CustomDialogWidth": "400",
- "CustomDialogHeight": "200",
+ "_default": {
+ "CustomDialogFontSize": "12",
+ "CustomDialogFontSizeHeader": "14",
+ "CustomDialogIconSize": "25",
+ "CustomDialogWidth": "400",
+ "CustomDialogHeight": "200",
- "FontSize": "12",
- "FontFamily": "Arial",
- "FontSizeHeading": "14",
- "HeaderFontFamily": "Consolas, Monaco",
+ "FontSize": "14",
+ "FontFamily": "Arial",
+ "FontSizeHeading": "16",
+ "HeaderFontFamily": "Consolas, Monaco",
- "CheckBoxBulletDecoratorFontSize": "14",
- "CheckBoxMargin": "15,0,0,2",
+ "CheckBoxBulletDecoratorSize": "14",
+ "CheckBoxMargin": "15,0,0,2",
- "TabButtonFontSize": "14",
- "TabButtonWidth": "100",
- "TabButtonHeight": "25",
- "TabRowHeightInPixels": "50",
- "IconFontSize": "14",
- "IconButtonSize": "35",
- "WinUtilIconSize": "Auto",
- "SettingsIconFontSize": "18",
+ "TabContentMargin": "5",
+ "TabButtonFontSize": "14",
+ "TabButtonWidth": "100",
+ "TabButtonHeight": "25",
+ "TabRowHeightInPixels": "50",
+ "IconFontSize": "14",
+ "IconButtonSize": "35",
+ "WinUtilIconSize": "Auto",
+ "SettingsIconFontSize": "18",
+ "CloseIconFontSize": "18",
- "MicroWinLogoSize": "10",
+ "MicroWinLogoSize": "10",
- "ProgressBarForegroundColor": "#FFAC1C",
- "ProgressBarBackgroundColor": "Transparent",
- "ProgressBarTextColor": "#000000",
+ "ProgressBarForegroundColor": "#FFAC1C",
+ "ProgressBarBackgroundColor": "Transparent",
+ "ProgressBarTextColor": "#000000",
- "ComboBoxBackgroundColor": "#FFFFFF",
- "LabelboxForegroundColor": "#000000",
- "MainForegroundColor": "#000000",
- "MainBackgroundColor": "#FFFFFF",
- "LabelBackgroundColor": "#FAFAFA",
- "LinkForegroundColor": "#000000",
- "LinkHoverForegroundColor": "#000000",
- "GroupBorderBackgroundColor": "#000000",
- "ComboBoxForegroundColor": "#000000",
+ "ComboBoxBackgroundColor": "#FFFFFF",
+ "LabelboxForegroundColor": "#000000",
+ "MainForegroundColor": "#000000",
+ "MainBackgroundColor": "#FFFFFF",
+ "LabelBackgroundColor": "#FFFFFF",
+ "LinkForegroundColor": "#000000",
+ "LinkHoverForegroundColor": "#000000",
+ "GroupBorderBackgroundColor": "#000000",
+ "ComboBoxForegroundColor": "#000000",
- "ButtonFontSize": "12",
- "ButtonFontFamily": "Arial",
- "ButtonWidth": "200",
- "ButtonHeight": "25",
- "ConfigTabButtonFontSize": "16",
+ "ButtonFontSize": "12",
+ "ButtonFontFamily": "Arial",
+ "ButtonWidth": "200",
+ "ButtonHeight": "25",
+ "ConfigTabButtonFontSize": "16",
- "SearchBarWidth": "200",
- "SearchBarHeight": "25",
- "SearchBarTextBoxFontSize": "16",
- "SearchBarClearButtonFontSize": "14",
+ "SearchBarWidth": "200",
+ "SearchBarHeight": "25",
+ "SearchBarTextBoxFontSize": "12",
+ "SearchBarClearButtonFontSize": "14",
- "ButtonInstallBackgroundColor": "#FFFFFF",
- "ButtonTweaksBackgroundColor": "#FFFFFF",
- "ButtonConfigBackgroundColor": "#FFFFFF",
- "ButtonUpdatesBackgroundColor": "#FFFFFF",
- "ButtonInstallForegroundColor": "#000000",
- "ButtonTweaksForegroundColor": "#000000",
- "ButtonConfigForegroundColor": "#000000",
- "ButtonUpdatesForegroundColor": "#000000",
- "ButtonBackgroundColor": "#F5F5F5",
- "ButtonBackgroundPressedColor": "#1A1A1A",
- "CheckboxMouseOverColor": "#999999",
- "ButtonBackgroundMouseoverColor": "#C2C2C2",
- "ButtonBackgroundSelectedColor": "#F0F0F0",
- "ButtonForegroundColor": "#000000",
- "ToggleButtonOnColor": "#2e77ff",
+ "ButtonInstallBackgroundColor": "#FFFFFF",
+ "ButtonTweaksBackgroundColor": "#FFFFFF",
+ "ButtonConfigBackgroundColor": "#FFFFFF",
+ "ButtonUpdatesBackgroundColor": "#FFFFFF",
+ "ButtonInstallForegroundColor": "#000000",
+ "ButtonTweaksForegroundColor": "#000000",
+ "ButtonConfigForegroundColor": "#000000",
+ "ButtonUpdatesForegroundColor": "#000000",
+ "ButtonBackgroundColor": "#F5F5F5",
+ "ButtonBackgroundPressedColor": "#1A1A1A",
+ "CheckboxMouseOverColor": "#999999",
+ "ButtonBackgroundMouseoverColor": "#C2C2C2",
+ "ButtonBackgroundSelectedColor": "#F0F0F0",
+ "ButtonForegroundColor": "#000000",
+ "ToggleButtonOnColor": "#2e77ff",
- "ButtonBorderThickness": "1",
- "ButtonMargin": "1",
- "ButtonCornerRadius": "2",
- "BorderColor": "#000000",
- "BorderOpacity": "0.2",
- "ShadowPulse": "Forever"
- },
- "Matrix": {
- "CustomDialogFontSize": "12",
- "CustomDialogFontSizeHeader": "14",
- "CustomDialogIconSize": "25",
- "CustomDialogWidth": "400",
- "CustomDialogHeight": "200",
+ "ButtonBorderThickness": "1",
+ "ButtonMargin": "1",
+ "ButtonCornerRadius": "2",
+ "BorderColor": "#000000",
+ "BorderOpacity": "0.2",
+ "ShadowPulse": "Forever"
+ },
+ "Classic": {
+ "ComboBoxBackgroundColor": "#FFFFFF",
+ "LabelboxForegroundColor": "#000000",
+ "MainForegroundColor": "#000000",
+ "MainBackgroundColor": "#FFFFFF",
+ "LabelBackgroundColor": "#FFFFFF",
+ "LinkForegroundColor": "#000000",
+ "LinkHoverForegroundColor": "#000000",
+ "GroupBorderBackgroundColor": "#000000",
+ "ComboBoxForegroundColor": "#000000",
- "FontSize": "12",
- "FontFamily": "Arial",
- "FontSizeHeading": "14",
- "HeaderFontFamily": "Consolas, Monaco",
+ "ButtonInstallBackgroundColor": "#FFFFFF",
+ "ButtonTweaksBackgroundColor": "#FFFFFF",
+ "ButtonConfigBackgroundColor": "#FFFFFF",
+ "ButtonUpdatesBackgroundColor": "#FFFFFF",
+ "ButtonInstallForegroundColor": "#000000",
+ "ButtonTweaksForegroundColor": "#000000",
+ "ButtonConfigForegroundColor": "#000000",
+ "ButtonUpdatesForegroundColor": "#000000",
+ "ButtonBackgroundColor": "#F5F5F5",
+ "ButtonBackgroundPressedColor": "#1A1A1A",
+ "CheckboxMouseOverColor": "#999999",
+ "ButtonBackgroundMouseoverColor": "#C2C2C2",
+ "ButtonBackgroundSelectedColor": "#F0F0F0",
+ "ButtonForegroundColor": "#000000",
+ "ToggleButtonOnColor": "#2e77ff"
+ },
+ "Matrix": {
+ "ComboBoxBackgroundColor": "#000000",
+ "LabelboxForegroundColor": "#FFEE58",
+ "MainForegroundColor": "#9CCC65",
+ "MainBackgroundColor": "#000000",
+ "LabelBackgroundColor": "#000000",
+ "LinkForegroundColor": "#add8e6",
+ "LinkHoverForegroundColor": "#FFFFFF",
+ "ComboBoxForegroundColor": "#FFEE58",
- "CheckBoxBulletDecoratorFontSize": "14",
- "CheckBoxMargin": "15,0,0,2",
+ "ProgressBarForegroundColor": "#222222",
+ "ProgressBarBackgroundColor": "Transparent",
+ "ProgressBarTextColor": "#cccccc",
- "TabButtonFontSize": "14",
- "TabButtonWidth": "100",
- "TabButtonHeight": "25",
- "TabRowHeightInPixels": "50",
- "IconFontSize": "14",
- "IconButtonSize": "35",
- "WinUtilIconSize": "Auto",
- "SettingsIconFontSize": "18",
+ "ButtonInstallBackgroundColor": "#222222",
+ "ButtonTweaksBackgroundColor": "#333333",
+ "ButtonConfigBackgroundColor": "#444444",
+ "ButtonUpdatesBackgroundColor": "#555555",
+ "ButtonInstallForegroundColor": "#FFFFFF",
+ "ButtonTweaksForegroundColor": "#FFFFFF",
+ "ButtonConfigForegroundColor": "#FFFFFF",
+ "ButtonUpdatesForegroundColor": "#FFFFFF",
+ "ButtonBackgroundColor": "#000019",
+ "ButtonBackgroundPressedColor": "#FFFFFF",
+ "ButtonBackgroundMouseoverColor": "#A55A64",
+ "ButtonBackgroundSelectedColor": "#FF5733",
+ "ButtonForegroundColor": "#9CCC65",
+ "ToggleButtonOnColor": "#2e77ff",
- "MicroWinLogoSize": "10",
+ "BorderColor": "#FFAC1C",
+ "BorderOpacity": "0.8",
+ "ShadowPulse": "0:0:3"
+ },
+ "Dark": {
+ "ComboBoxBackgroundColor": "#000000",
+ "LabelboxForegroundColor": "#FFEE58",
+ "MainForegroundColor": "#9CCC65",
+ "MainBackgroundColor": "#000000",
+ "LabelBackgroundColor": "#000000",
+ "LinkForegroundColor": "#add8e6",
+ "LinkHoverForegroundColor": "#FFFFFF",
+ "ComboBoxForegroundColor": "#FFEE58",
- "ProgressBarForegroundColor": "#222222",
- "ProgressBarBackgroundColor": "Transparent",
- "ProgressBarTextColor": "#cccccc",
+ "ProgressBarForegroundColor": "#222222",
+ "ProgressBarBackgroundColor": "Transparent",
+ "ProgressBarTextColor": "#cccccc",
- "ComboBoxBackgroundColor": "#000000",
- "LabelboxForegroundColor": "#FFEE58",
- "MainForegroundColor": "#9CCC65",
- "MainBackgroundColor": "#000000",
- "LabelBackgroundColor": "#000000",
- "LinkForegroundColor": "#add8e6",
- "LinkHoverForegroundColor": "#FFFFFF",
- "ComboBoxForegroundColor": "#FFEE58",
+ "ButtonInstallBackgroundColor": "#222222",
+ "ButtonTweaksBackgroundColor": "#333333",
+ "ButtonConfigBackgroundColor": "#444444",
+ "ButtonUpdatesBackgroundColor": "#555555",
+ "ButtonInstallForegroundColor": "#FFFFFF",
+ "ButtonTweaksForegroundColor": "#FFFFFF",
+ "ButtonConfigForegroundColor": "#FFFFFF",
+ "ButtonUpdatesForegroundColor": "#FFFFFF",
+ "ButtonBackgroundColor": "#000019",
+ "ButtonBackgroundPressedColor": "#9CCC65",
+ "ButtonBackgroundMouseoverColor": "#FF5733",
+ "ButtonBackgroundSelectedColor": "#FF5733",
+ "ButtonForegroundColor": "#9CCC65",
+ "ToggleButtonOnColor": "#2e77ff",
- "ButtonFontSize": "12",
- "ButtonFontFamily": "Arial",
- "ButtonWidth": "200",
- "ButtonHeight": "25",
- "ConfigTabButtonFontSize": "16",
-
- "SearchBarWidth": "200",
- "SearchBarHeight": "25",
- "SearchBarTextBoxFontSize": "16",
- "SearchBarClearButtonFontSize": "14",
-
- "ButtonInstallBackgroundColor": "#222222",
- "ButtonTweaksBackgroundColor": "#333333",
- "ButtonConfigBackgroundColor": "#444444",
- "ButtonUpdatesBackgroundColor": "#555555",
- "ButtonInstallForegroundColor": "#FFFFFF",
- "ButtonTweaksForegroundColor": "#FFFFFF",
- "ButtonConfigForegroundColor": "#FFFFFF",
- "ButtonUpdatesForegroundColor": "#FFFFFF",
- "ButtonBackgroundColor": "#000019",
- "ButtonBackgroundPressedColor": "#FFFFFF",
- "ButtonBackgroundMouseoverColor": "#A55A64",
- "ButtonBackgroundSelectedColor": "#FF5733",
- "ButtonForegroundColor": "#9CCC65",
- "ToggleButtonOnColor": "#2e77ff",
-
- "ButtonBorderThickness": "1",
- "ButtonMargin": "1",
- "ButtonCornerRadius": "2",
- "BorderColor": "#FFAC1C",
- "BorderOpacity": "0.8",
- "ShadowPulse": "0:0:3"
- },
- "Dark": {
- "CustomDialogFontSize": "12",
- "CustomDialogFontSizeHeader": "14",
- "CustomDialogIconSize": "25",
- "CustomDialogWidth": "400",
- "CustomDialogHeight": "200",
-
- "FontSize": "12",
- "FontFamily": "Arial",
- "FontSizeHeading": "14",
- "HeaderFontFamily": "Consolas, Monaco",
-
- "CheckBoxBulletDecoratorFontSize": "14",
- "CheckBoxMargin": "15,0,0,2",
-
- "TabButtonFontSize": "14",
- "TabButtonWidth": "100",
- "TabButtonHeight": "25",
- "TabRowHeightInPixels": "50",
- "IconFontSize": "14",
- "IconButtonSize": "35",
- "WinUtilIconSize": "Auto",
- "SettingsIconFontSize": "18",
-
- "MicroWinLogoSize": "10",
-
- "ProgressBarForegroundColor": "#222222",
- "ProgressBarBackgroundColor": "Transparent",
- "ProgressBarTextColor": "#FFFFFF",
-
- "ComboBoxBackgroundColor": "#000000",
- "LabelboxForegroundColor": "#FFEE58",
- "MainForegroundColor": "#9CCC65",
- "MainBackgroundColor": "#000000",
- "LabelBackgroundColor": "#000000",
- "LinkForegroundColor": "#add8e6",
- "LinkHoverForegroundColor": "#FFFFFF",
- "ComboBoxForegroundColor": "#FFEE58",
-
- "ButtonFontSize": "12",
- "ButtonFontFamily": "Arial",
- "ButtonWidth": "200",
- "ButtonHeight": "25",
- "ConfigTabButtonFontSize": "16",
-
- "SearchBarWidth": "200",
- "SearchBarHeight": "25",
- "SearchBarTextBoxFontSize": "16",
- "SearchBarClearButtonFontSize": "14",
-
- "ButtonInstallBackgroundColor": "#222222",
- "ButtonTweaksBackgroundColor": "#333333",
- "ButtonConfigBackgroundColor": "#444444",
- "ButtonUpdatesBackgroundColor": "#555555",
- "ButtonInstallForegroundColor": "#FFFFFF",
- "ButtonTweaksForegroundColor": "#FFFFFF",
- "ButtonConfigForegroundColor": "#FFFFFF",
- "ButtonUpdatesForegroundColor": "#FFFFFF",
- "ButtonBackgroundColor": "#000019",
- "ButtonBackgroundPressedColor": "#9CCC65",
- "ButtonBackgroundMouseoverColor": "#FF5733",
- "ButtonBackgroundSelectedColor": "#FF5733",
- "ButtonForegroundColor": "#9CCC65",
- "ToggleButtonOnColor": "#2e77ff",
-
- "ButtonBorderThickness": "1",
- "ButtonMargin": "1",
- "ButtonCornerRadius": "2",
- "BorderColor": "#FFAC1C",
- "BorderOpacity": "0.2",
- "ShadowPulse": "Forever"
- }
+ "BorderColor": "#FFAC1C"
+ }
}
diff --git a/config/tweaks.json b/config/tweaks.json
index 07c17d85..104a70ce 100644
--- a/config/tweaks.json
+++ b/config/tweaks.json
@@ -3141,12 +3141,29 @@
],
"link": "https://christitustech.github.io/winutil/dev/tweaks/Essential-Tweaks/DVR"
},
- "WPFTweaksTeredo": {
- "Content": "Disable Teredo",
- "Description": "Teredo network tunneling is a ipv6 feature that can cause additional latency.",
+ "WPFTweaksIPv46": {
+ "Content": "Prefer IPv4 over IPv6",
+ "Description": "To set the IPv4 preference can have latency and security benefits on private networks where IPv6 is not configured.",
"category": "Essential Tweaks",
"panel": "1",
"Order": "a005_",
+ "registry": [
+ {
+ "Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Services\\Tcpip6\\Parameters",
+ "Name": "DisabledComponents",
+ "Value": "32",
+ "OriginalValue": "0",
+ "Type": "DWord"
+ }
+ ],
+ "link": "https://christitustech.github.io/winutil/dev/tweaks/Essential-Tweaks/IPv46"
+ },
+ "WPFTweaksTeredo": {
+ "Content": "Disable Teredo",
+ "Description": "Teredo network tunneling is a ipv6 feature that can cause additional latency, but may cause problems with some games",
+ "category": "z__Advanced Tweaks - CAUTION",
+ "panel": "1",
+ "Order": "a023_",
"registry": [
{
"Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Services\\Tcpip6\\Parameters",
@@ -3162,7 +3179,7 @@
"UndoScript": [
"netsh interface teredo set state default"
],
- "link": "https://christitustech.github.io/winutil/dev/tweaks/Essential-Tweaks/Teredo"
+ "link": "https://christitustech.github.io/winutil/dev/tweaks/z--Advanced-Tweaks---CAUTION/Teredo"
},
"WPFTweaksDisableipsix": {
"Content": "Disable IPv6",
diff --git a/docs/dev/tweaks/Essential-Tweaks/IPv46.md b/docs/dev/tweaks/Essential-Tweaks/IPv46.md
new file mode 100644
index 00000000..471ca312
--- /dev/null
+++ b/docs/dev/tweaks/Essential-Tweaks/IPv46.md
@@ -0,0 +1,63 @@
+# Prefer IPv4 over IPv6
+
+Last Updated: 2024-08-27
+
+
+!!! info
+ The Development Documentation is auto generated for every compilation of WinUtil, meaning a part of it will always stay up-to-date. **Developers do have the ability to add custom content, which won't be updated automatically.**
+## Description
+
+To set the IPv4 preference can have latency and security benefits on private networks where IPv6 is not configured.
+
+
+
+
+
+
+Preview Code
+
+```json
+{
+ "Content": "Prefer IPv4 over IPv6",
+ "Description": "To set the IPv4 preference can have latency and security benefits on private networks where IPv6 is not configured.",
+ "category": "Essential Tweaks",
+ "panel": "1",
+ "Order": "a005_",
+ "registry": [
+ {
+ "Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Services\\Tcpip6\\Parameters",
+ "Name": "DisabledComponents",
+ "Value": "32",
+ "OriginalValue": "0",
+ "Type": "DWord"
+ }
+ ],
+ "link": "https://christitustech.github.io/winutil/dev/tweaks/Essential-Tweaks/IPv46"
+}
+```
+
+
+
+## Registry Changes
+Applications and System Components store and retrieve configuration data to modify windows settings, so we can use the registry to change many settings in one place.
+
+
+You can find information about the registry on [Wikipedia](https://www.wikiwand.com/en/Windows_Registry) and [Microsoft's Website](https://learn.microsoft.com/en-us/windows/win32/sysinfo/registry).
+
+### Registry Key: DisabledComponents
+
+**Type:** DWord
+
+**Original Value:** 0
+
+**New Value:** 32
+
+
+
+
+
+
+
+
+[View the JSON file](https://github.com/ChrisTitusTech/winutil/tree/main/config/tweaks.json)
+
diff --git a/docs/dev/tweaks/Essential-Tweaks/Teredo.md b/docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/Teredo.md
similarity index 84%
rename from docs/dev/tweaks/Essential-Tweaks/Teredo.md
rename to docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/Teredo.md
index 4206d514..428d8022 100644
--- a/docs/dev/tweaks/Essential-Tweaks/Teredo.md
+++ b/docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/Teredo.md
@@ -1,13 +1,13 @@
# Disable Teredo
-Last Updated: 2024-08-07
+Last Updated: 2024-08-27
!!! info
The Development Documentation is auto generated for every compilation of WinUtil, meaning a part of it will always stay up-to-date. **Developers do have the ability to add custom content, which won't be updated automatically.**
## Description
-Teredo network tunneling is a ipv6 feature that can cause additional latency.
+Teredo network tunneling is a ipv6 feature that can cause additional latency, but may cause problems with some games
@@ -19,10 +19,10 @@ Teredo network tunneling is a ipv6 feature that can cause additional latency.
```json
{
"Content": "Disable Teredo",
- "Description": "Teredo network tunneling is a ipv6 feature that can cause additional latency.",
- "category": "Essential Tweaks",
+ "Description": "Teredo network tunneling is a ipv6 feature that can cause additional latency, but may cause problems with some games",
+ "category": "z__Advanced Tweaks - CAUTION",
"panel": "1",
- "Order": "a005_",
+ "Order": "a023_",
"registry": [
{
"Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Services\\Tcpip6\\Parameters",
@@ -38,7 +38,7 @@ Teredo network tunneling is a ipv6 feature that can cause additional latency.
"UndoScript": [
"netsh interface teredo set state default"
],
- "link": "https://christitustech.github.io/winutil/dev/tweaks/Essential-Tweaks/Teredo"
+ "link": "https://christitustech.github.io/winutil/dev/tweaks/z--Advanced-Tweaks---CAUTION/Teredo"
}
```
diff --git a/docs/devdocs.md b/docs/devdocs.md
index 9a73d996..7efd5d62 100644
--- a/docs/devdocs.md
+++ b/docs/devdocs.md
@@ -13,6 +13,7 @@
- [Disable IPv6](dev/tweaks/z--Advanced-Tweaks---CAUTION/Disableipsix.md)
- [Disable Microsoft Copilot](dev/tweaks/z--Advanced-Tweaks---CAUTION/RemoveCopilot.md)
- [Disable Notification Tray/Calendar](dev/tweaks/z--Advanced-Tweaks---CAUTION/DisableNotifications.md)
+- [Disable Teredo](dev/tweaks/z--Advanced-Tweaks---CAUTION/Teredo.md)
- [DNS](dev/tweaks/z--Advanced-Tweaks---CAUTION/changedns.md)
- [Remove ALL MS Store Apps - NOT RECOMMENDED](dev/tweaks/z--Advanced-Tweaks---CAUTION/DeBloat.md)
- [Remove Home and Gallery from explorer](dev/tweaks/z--Advanced-Tweaks---CAUTION/RemoveHomeGallery.md)
@@ -30,6 +31,7 @@
- [Create Restore Point](dev/tweaks/Essential-Tweaks/RestorePoint.md)
- [Debloat Edge](dev/tweaks/Essential-Tweaks/EdgeDebloat.md)
- [Delete Temporary Files](dev/tweaks/Essential-Tweaks/DeleteTempFiles.md)
+- [Prefer IPv4 over IPv6](dev/tweaks/Essential-Tweaks/IPv46.md)
- [Disable Activity History](dev/tweaks/Essential-Tweaks/AH.md)
- [Disable ConsumerFeatures](dev/tweaks/Essential-Tweaks/ConsumerFeatures.md)
- [Disable GameDVR](dev/tweaks/Essential-Tweaks/DVR.md)
@@ -39,7 +41,6 @@
- [Disable Powershell 7 Telemetry](dev/tweaks/Essential-Tweaks/Powershell7Tele.md)
- [Disable Storage Sense](dev/tweaks/Essential-Tweaks/Storage.md)
- [Disable Telemetry](dev/tweaks/Essential-Tweaks/Tele.md)
-- [Disable Teredo](dev/tweaks/Essential-Tweaks/Teredo.md)
- [Disable Wifi-Sense](dev/tweaks/Essential-Tweaks/Wifi.md)
- [Enable End Task With Right Click](dev/tweaks/Essential-Tweaks/EndTaskOnTaskbar.md)
- [Run Disk Cleanup](dev/tweaks/Essential-Tweaks/DiskCleanup.md)
diff --git a/functions/private/Get-TabXaml.ps1 b/functions/private/Get-TabXaml.ps1
deleted file mode 100644
index 5eef6417..00000000
--- a/functions/private/Get-TabXaml.ps1
+++ /dev/null
@@ -1,221 +0,0 @@
-function Get-TabXaml {
- <#
- .SYNOPSIS
- Generates XAML for a tab in the WinUtil GUI
- This function is used to generate the XAML for the applications tab in the WinUtil GUI
- It takes the tabname and the number of columns to display the applications in as input and returns the XAML for the tab as output
-
- .PARAMETER tabname
- The name of the tab to generate XAML for
- Note: the 'tabname' parameter must equal one of the json files found in $sync.configs variable
- Otherwise, it'll throw an exception
-
- .PARAMETER columncount
- The number of columns to display the applications in, default is 0
-
- .OUTPUTS
- The XAML for the tab
-
- .EXAMPLE
- Get-TabXaml "applications" 3
- #>
-
-
- param(
- [Parameter(Mandatory, position=0)]
- [string]$tabname,
-
- [Parameter(position=1)]
- [ValidateRange(0,10)] # 10 panels as max number is more then enough
- [int]$columncount = 0
- )
-
- # Validate tabname
- if ($sync.configs.$tabname -eq $null) {
- throw "Invalid parameter passed, can't find '$tabname' in '`$sync.configs' variable, please double check any calls to 'Get-TabXaml' function."
- }
-
- $organizedData = @{}
- # Iterate through JSON data and organize by panel and category
- foreach ($appName in $sync.configs.$tabname.PSObject.Properties.Name) {
- $appInfo = $sync.configs.$tabname.$appName
-
- # Create an object for the application
- $appObject = [PSCustomObject]@{
- Name = $appName
- Category = $appInfo.Category
- Content = $appInfo.Content
- Choco = $appInfo.choco
- Winget = $appInfo.winget
- Panel = if ($columncount -gt 0 ) { "0" } else {$appInfo.panel}
- Link = $appInfo.link
- Description = $appInfo.description
- # Type is (Checkbox,Toggle,Button,Combobox ) (Default is Checkbox)
- Type = $appInfo.type
- ComboItems = $appInfo.ComboItems
- # Checked is the property to set startup checked status of checkbox (Default is false)
- Checked = $appInfo.Checked
- ButtonWidth = $appInfo.ButtonWidth
- }
-
- if (-not $organizedData.ContainsKey($appObject.panel)) {
- $organizedData[$appObject.panel] = @{}
- }
-
- if (-not $organizedData[$appObject.panel].ContainsKey($appObject.Category)) {
- $organizedData[$appObject.panel][$appObject.Category] = @{}
- }
-
- # Store application data in a sub-array under the category
- # Add Order property to keep the original order of tweaks and features
- $organizedData[$appObject.panel][$appInfo.Category]["$($appInfo.order)$appName"] = $appObject
- }
-
- # Same tab amount in last line of 'inputXML.xaml' file
- # TODO: Get the base repeat (amount) of tabs from last line (or even lines)
- # so it can dynamicly react to whatever is before this generated XML string.
- # .. may be solve this even before calling this function, and pass the result as a parameter?
- $tab_repeat = 7
- $spaces_per_tab = 4 # The convenction used across the code base
- $tab_as_spaces = $(" " * $spaces_per_tab)
- $precal_indent = $($tab_as_spaces * $tab_repeat)
- $precal_indent_p1 = $($tab_as_spaces * ($tab_repeat + 1))
- $precal_indent_p2 = $($tab_as_spaces * ($tab_repeat + 2))
- $precal_indent_m1 = $($tab_as_spaces * ($tab_repeat - 1))
- $precal_indent_m2 = $($tab_as_spaces * ($tab_repeat - 2))
-
- # Calculate the needed number of panels
- $panelcount = 0
- $paneltotal = $organizedData.Keys.Count
- if ($columncount -gt 0) {
- $appcount = $sync.configs.$tabname.PSObject.Properties.Name.count + $organizedData["0"].Keys.count
- $maxcount = [Math]::Round( $appcount / $columncount + 0.5)
- $paneltotal = $columncount
- }
- # add ColumnDefinitions to evenly draw colums
- $blockXml = ""
- $blockXml += $("`r`n" + " " * ($spaces_per_tab * $tab_repeat) +
- "") * $paneltotal
- $blockXml += $("`r`n" + " " * ($spaces_per_tab * ($tab_repeat - 1))) +
- "" + "`r`n"
-
- # Iterate through 'organizedData' by panel, category, and application
- $count = 0
- foreach ($panel in ($organizedData.Keys | Sort-Object)) {
- $blockXml += $precal_indent_m1 + "" + "`r`n"
- $blockXml += $precal_indent + "" + "`r`n"
- $panelcount++
- foreach ($category in ($organizedData[$panel].Keys | Sort-Object)) {
- $count++
- if ($columncount -gt 0) {
- $panelcount2 = [Int](($count)/$maxcount-0.5)
- if ($panelcount -eq $panelcount2 ) {
- $blockXml += $precal_indent_p2 + "" + "`r`n"
- $blockXml += $precal_indent_p1 + "" + "`r`n"
- $blockXml += $precal_indent_p1 + "" + "`r`n"
- $blockXml += $precal_indent_p2 + "" + "`r`n"
- $panelcount++
- }
- }
-
- # Dot-source the Get-WPFObjectName function
- . "$($sync.PSScriptRoot)\functions\private\Get-WPFObjectName.ps1"
-
- $categorycontent = $($category -replace '^.__', '')
- $categoryname = Get-WPFObjectName -type "Label" -name $categorycontent
- $blockXml += $("`r`n" + " " * ($spaces_per_tab * $tab_repeat)) +
- "" + "`r`n" + "`r`n"
- $sortedApps = $organizedData[$panel][$category].Keys | Sort-Object
- foreach ($appName in $sortedApps) {
- $count++
-
- if ($columncount -gt 0) {
- $panelcount2 = [Int](($count)/$maxcount-0.5)
- # Verify the indentation actually works...
- if ($panelcount -eq $panelcount2 ) {
- $blockXml += $precal_indent_m1 +
- "" + "`r`n"
- $blockXml += $precal_indent_m2 +
- "" + "`r`n"
- $blockXml += $precal_indent_m2 +
- "" + "`r`n"
- $blockXml += $precal_indent_m1 +
- "" + "`r`n"
- $panelcount++
- }
- }
-
- $appInfo = $organizedData[$panel][$category][$appName]
- switch ($appInfo.Type) {
- "Toggle" {
- $blockXml += $precal_indent_m1 +
- "" + "`r`n"
- $blockXml += $precal_indent +
- "" + "`r`n"
- $blockXml += $precal_indent +
- "" + "`r`n"
- $blockXml += $precal_indent_m1 +
- "" + "`r`n"
- }
-
- "Combobox" {
- $blockXml += $precal_indent_m1 +
- "" + "`r`n"
- $blockXml += $precal_indent + "" + "`r`n"
- $blockXml += $precal_indent +
- "" + "`r`n"
-
- $addfirst="IsSelected=""True"""
- foreach ($comboitem in ($appInfo.ComboItems -split " ")) {
- $blockXml += $precal_indent_p1 +
- "" + "`r`n"
- $addfirst=""
- }
-
- $blockXml += $precal_indent_p1 + "" + "`r`n"
- $blockXml += $precal_indent + "" + "`r`n"
- }
-
- "Button" {
- if ($appInfo.ButtonWidth -ne $null) {
- $ButtonWidthStr = "Width=""$($appInfo.ButtonWidth)"""
- }
- $blockXml += $precal_indent +
- "" + "`r`n"
- }
-
- # else it is a checkbox
- default {
- $checkedStatus = If ($appInfo.Checked -eq $null) {""} else {" IsChecked=""$($appInfo.Checked)"""}
- if ($appInfo.Link -eq $null) {
- $blockXml += $precal_indent +
- "" + "`r`n"
- } else {
- $blockXml += $precal_indent +
- "" + "`r`n"
- $blockXml += $precal_indent_p1 +
- "" + "`r`n"
- $blockXml += $precal_indent_p1 +
- "" + "`r`n"
- $blockXml += $precal_indent +
- "" + "`r`n"
- }
- }
- }
- }
- }
-
- $blockXml += $precal_indent_p1 + "" + "`r`n"
- $blockXml += $precal_indent + "" + "`r`n"
- }
- return ($blockXml)
-}
diff --git a/functions/private/Invoke-WinUtilMicroWin-Helper.ps1 b/functions/private/Invoke-WinUtilMicroWin-Helper.ps1
index b568b839..f3ffbd9c 100644
--- a/functions/private/Invoke-WinUtilMicroWin-Helper.ps1
+++ b/functions/private/Invoke-WinUtilMicroWin-Helper.ps1
@@ -248,7 +248,7 @@ function Remove-FileOrDirectory([string]$pathToDelete, [string]$mask = "", [swit
function New-Unattend {
param (
- [Parameter(Mandatory, Position = 0)] [string] $userName,
+ [Parameter(Mandatory, Position = 0)] [string]$userName,
[Parameter(Position = 1)] [string] $userPassword
)
diff --git a/functions/private/Invoke-WinUtilSnapFlyout.ps1 b/functions/private/Invoke-WinUtilSnapFlyout.ps1
index bfb83c31..39d1335b 100644
--- a/functions/private/Invoke-WinUtilSnapFlyout.ps1
+++ b/functions/private/Invoke-WinUtilSnapFlyout.ps1
@@ -14,7 +14,7 @@ function Invoke-WinUtilSnapFlyout {
Write-Host "Disabling Snap Assist Flyout On startup"
$value = 0
}
- # taskkill.exe /F /IM "explorer.exe"
+
$Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
taskkill.exe /F /IM "explorer.exe"
Set-ItemProperty -Path $Path -Name EnableSnapAssistFlyout -Value $value
diff --git a/functions/private/Set-WinUtilUITheme.ps1 b/functions/private/Set-WinUtilUITheme.ps1
new file mode 100644
index 00000000..c71ae88c
--- /dev/null
+++ b/functions/private/Set-WinUtilUITheme.ps1
@@ -0,0 +1,83 @@
+function Set-WinUtilUITheme {
+ <#
+ .SYNOPSIS
+ Sets the theme of the XAML file
+
+ .PARAMETER inputXML
+ A string representing the XAML object to modify
+
+ .PARAMETER customThemeName
+ The name of the custom theme to set the XAML to. Defaults to 'matrix'
+
+ .PARAMETER defaultThemeName
+ The name of the default theme to use when setting the XAML. Defaults to '_default'
+
+ .EXAMPLE
+ $returnVal = Set-WinUtilUITheme -inputXAML $inputXAML
+ if ($returnVal[0] -eq "") {
+ Write-Host "Failed to process inputXML"
+ } else {
+ $inputXML = $returnVal[0]
+ }
+ # to know which theme this function has used, access the second item in returned value.
+ Write-Host "Theme used in processing: $($returnVal[1])"
+ #>
+
+ param (
+ [Parameter(Mandatory, position=0)]
+ [string]$inputXML,
+
+ [Parameter(position=1)]
+ [string]$customThemeName = 'matrix',
+
+ [Parameter(position=2)]
+ [string]$defaultThemeName = '_default'
+ )
+
+ try {
+ # Note:
+ # Reason behind not caching the '$sync.configs.themes` object into a variable,
+ # because this code can modify the themes object.. meaning it's better to access it
+ # using the more verbose way, rather than introduce possible bugs into the code, just for the sake of readability.
+ #
+ if (-NOT $sync.configs.themes) {
+ throw [GenericException]::new("[Set-WinUtilTheme] Did not find 'config.themes' inside `$sync variable.")
+ }
+
+ if (-NOT $sync.configs.themes.$defaultThemeName) {
+ throw [GenericException]::new("[Set-WinUtilTheme] Did not find '$defaultThemeName' theme in the themes config file.")
+ }
+
+ $themeToUse = $customThemeName
+ if ($sync.configs.themes.$themeToUse) {
+ # Loop through every default theme option, and modify the custom theme in $sync variable,
+ # so that it has full options available for other functions to use.
+ foreach ($option in $sync.configs.themes.$defaultThemeName.PSObject.Properties) {
+ $optionName = $option.Name
+ $optionValue = $option.Value
+ if (-NOT $sync.configs.themes.$themeToUse.$optionName) {
+ $sync.configs.themes.$themeToUse | Add-Member -MemberType NoteProperty -Name $optionName -Value $optionValue
+ }
+ }
+ } else {
+ Write-Debug "[Set-WinUtilTheme] Theme '$customThemeName' was not found, using '$defaultThemeName' instead."
+ $themeToUse = $defaultThemeName
+ }
+
+ foreach ($property in $sync.configs.themes.$themeToUse.PSObject.Properties) {
+ $key = $property.Name
+ $value = $property.Value
+ # Add curly braces around the key
+ $formattedKey = "{$key}"
+ # Replace the key with the value in the input XML
+ $inputXML = $inputXML.Replace($formattedKey, $value)
+ }
+ }
+ catch {
+ Write-Host "[Set-WinUtilTheme] Unable to apply theme" -ForegroundColor Red
+ Write-Host "$($psitem.Exception.Message)" -ForegroundColor Red
+ $inputXML = "" # Make inputXML equal an empty string, indicating something went wrong to the function caller.
+ }
+
+ return @($inputXML, $themeToUse);
+}
diff --git a/functions/private/Set-WinUtilUiTheme.ps1 b/functions/private/Set-WinUtilUiTheme.ps1
deleted file mode 100644
index 45db1ab4..00000000
--- a/functions/private/Set-WinUtilUiTheme.ps1
+++ /dev/null
@@ -1,50 +0,0 @@
-function Set-WinUtilUITheme {
- <#
- .SYNOPSIS
- Sets the theme of the XAML file
-
- .PARAMETER inputXML
- A string representing the XAML object to modify
-
- .PARAMETER themeName
- The name of the theme to set the XAML to. Defaults to 'matrix'
-
- .EXAMPLE
- Set-WinUtilUITheme -inputXAML $inputXAML
- #>
-
- param
- (
- [Parameter(Mandatory, position=0)]
- [string]$inputXML,
- [Parameter(position=1)]
- [string]$themeName = 'matrix'
- )
-
- try {
- # Convert the JSON to a PowerShell object
- $themes = $sync.configs.themes
- # Select the specified theme
- $selectedTheme = $themes.$themeName
-
- if ($selectedTheme) {
- # Loop through all key-value pairs in the selected theme
- foreach ($property in $selectedTheme.PSObject.Properties) {
- $key = $property.Name
- $value = $property.Value
- # Add curly braces around the key
- $formattedKey = "{$key}"
- # Replace the key with the value in the input XML
- $inputXML = $inputXML.Replace($formattedKey, $value)
- }
- } else {
- Write-Host "Theme '$themeName' not found."
- }
-
- } catch {
- Write-Warning "Unable to apply theme"
- Write-Warning $psitem.Exception.StackTrace
- }
-
- return $inputXML;
-}
diff --git a/functions/private/Update-WinUtilProgramWinget.ps1 b/functions/private/Update-WinUtilProgramWinget.ps1
index 0784657d..7f50d35e 100644
--- a/functions/private/Update-WinUtilProgramWinget.ps1
+++ b/functions/private/Update-WinUtilProgramWinget.ps1
@@ -11,7 +11,7 @@ Function Update-WinUtilProgramWinget {
$host.ui.RawUI.WindowTitle = """Winget Install"""
- Start-Transcript $ENV:TEMP\winget-update.log -Append
+ Start-Transcript "$logdir\winget-update_$dateTime.log" -Append
winget upgrade --all --accept-source-agreements --accept-package-agreements --scope=machine --silent
}
diff --git a/functions/public/Invoke-WPFButton.ps1 b/functions/public/Invoke-WPFButton.ps1
index ac5b2f8c..e3015f09 100644
--- a/functions/public/Invoke-WPFButton.ps1
+++ b/functions/public/Invoke-WPFButton.ps1
@@ -21,13 +21,13 @@ function Invoke-WPFButton {
Switch -Wildcard ($Button) {
"WPFTab?BT" {Invoke-WPFTab $Button}
- "WPFinstall" {Invoke-WPFInstall}
- "WPFuninstall" {Invoke-WPFUnInstall}
+ "WPFInstall" {Invoke-WPFInstall}
+ "WPFUninstall" {Invoke-WPFUnInstall}
"WPFInstallUpgrade" {Invoke-WPFInstallUpgrade}
- "WPFstandard" {Invoke-WPFPresets "Standard"}
- "WPFminimal" {Invoke-WPFPresets "Minimal"}
- "WPFclear" {Invoke-WPFPresets -preset $null -imported $true}
- "WPFclearWinget" {Invoke-WPFPresets -preset $null -imported $true -CheckBox "WPFInstall"}
+ "WPFStandard" {Invoke-WPFPresets "Standard" -checkboxfilterpattern "WPFTweak*"}
+ "WPFMinimal" {Invoke-WPFPresets "Minimal" -checkboxfilterpattern "WPFTweak*"}
+ "WPFClearTweaksSelection" {Invoke-WPFPresets -imported $true -checkboxfilterpattern "WPFTweak*"}
+ "WPFClearInstallSelection" {Invoke-WPFPresets -imported $true -checkboxfilterpattern "WPFInstall*"}
"WPFtweaksbutton" {Invoke-WPFtweaksbutton}
"WPFOOSUbutton" {Invoke-WPFOOSU}
"WPFAddUltPerf" {Invoke-WPFUltimatePerformance -State "Enable"}
diff --git a/functions/public/Invoke-WPFPresets.ps1 b/functions/public/Invoke-WPFPresets.ps1
index 1595a8f1..90493899 100644
--- a/functions/public/Invoke-WPFPresets.ps1
+++ b/functions/public/Invoke-WPFPresets.ps1
@@ -10,29 +10,36 @@ function Invoke-WPFPresets {
.PARAMETER imported
If the preset is imported from a file, defaults to false
- .PARAMETER checkbox
- The checkbox to set the options to, defaults to 'WPFTweaks'
+ .PARAMETER checkboxfilterpattern
+ The Pattern to use when filtering through CheckBoxes, defaults to "**"
#>
- param(
- $preset,
- [bool]$imported = $false
+ param (
+ [Parameter(position=0)]
+ [string]$preset = "",
+
+ [Parameter(position=1)]
+ [bool]$imported = $false,
+
+ [Parameter(position=2)]
+ [string]$checkboxfilterpattern = "**"
)
- if($imported -eq $true) {
+ if ($imported -eq $true) {
$CheckBoxesToCheck = $preset
} else {
$CheckBoxesToCheck = $sync.configs.preset.$preset
}
- $CheckBoxes = $sync.GetEnumerator() | Where-Object { $_.Value -is [System.Windows.Controls.CheckBox] -and $_.Name -notlike "WPFToggle*" }
- Write-Debug "Getting checkboxes to set $($CheckBoxes.Count)"
+ $CheckBoxes = ($sync.GetEnumerator()).where{ $_.Value -is [System.Windows.Controls.CheckBox] -and $_.Name -notlike "WPFToggle*" -and $_.Name -like "$checkboxfilterpattern"}
+ Write-Debug "Getting checkboxes to set, number of checkboxes: $($CheckBoxes.Count)"
- $CheckBoxesToCheck | ForEach-Object {
- if ($_ -ne $null) {
- Write-Debug $_
- }
+ if ($CheckBoxesToCheck -ne "") {
+ $debugMsg = "CheckBoxes to Check are: "
+ $CheckBoxesToCheck | ForEach-Object { $debugMsg += "$_, " }
+ $debugMsg = $debugMsg -replace (',\s*$', '')
+ Write-Debug "$debugMsg"
}
foreach ($CheckBox in $CheckBoxes) {
diff --git a/functions/public/Invoke-WPFToggle.ps1 b/functions/public/Invoke-WPFToggle.ps1
index d0b79da1..c4fbd105 100644
--- a/functions/public/Invoke-WPFToggle.ps1
+++ b/functions/public/Invoke-WPFToggle.ps1
@@ -15,23 +15,25 @@ function Invoke-WPFToggle {
# Use this to get the name of the button
#[System.Windows.MessageBox]::Show("$Button","Chris Titus Tech's Windows Utility","OK","Info")
+ $ToggleStatus = (Get-WinUtilToggleStatus $Button)
+
Switch -Wildcard ($Button) {
- "WPFToggleDarkMode" {Invoke-WinUtilDarkMode -DarkMoveEnabled $(Get-WinUtilToggleStatus WPFToggleDarkMode)}
- "WPFToggleBingSearch" {Invoke-WinUtilBingSearch $(Get-WinUtilToggleStatus WPFToggleBingSearch)}
- "WPFToggleNumLock" {Invoke-WinUtilNumLock $(Get-WinUtilToggleStatus WPFToggleNumLock)}
- "WPFToggleVerboseLogon" {Invoke-WinUtilVerboseLogon $(Get-WinUtilToggleStatus WPFToggleVerboseLogon)}
- "WPFToggleShowExt" {Invoke-WinUtilShowExt $(Get-WinUtilToggleStatus WPFToggleShowExt)}
- "WPFToggleSnapWindow" {Invoke-WinUtilSnapWindow $(Get-WinUtilToggleStatus WPFToggleSnapWindow)}
- "WPFToggleSnapFlyout" {Invoke-WinUtilSnapFlyout $(Get-WinUtilToggleStatus WPFToggleSnapFlyout)}
- "WPFToggleSnapSuggestion" {Invoke-WinUtilSnapSuggestion $(Get-WinUtilToggleStatus WPFToggleSnapSuggestion)}
- "WPFToggleMouseAcceleration" {Invoke-WinUtilMouseAcceleration $(Get-WinUtilToggleStatus WPFToggleMouseAcceleration)}
- "WPFToggleStickyKeys" {Invoke-WinUtilStickyKeys $(Get-WinUtilToggleStatus WPFToggleStickyKeys)}
- "WPFToggleTaskbarWidgets" {Invoke-WinUtilTaskbarWidgets $(Get-WinUtilToggleStatus WPFToggleTaskbarWidgets)}
- "WPFToggleTaskbarSearch" {Invoke-WinUtilTaskbarSearch $(Get-WinUtilToggleStatus WPFToggleTaskbarSearch)}
- "WPFToggleTaskView" {Invoke-WinUtilTaskView $(Get-WinUtilToggleStatus WPFToggleTaskView)}
- "WPFToggleHiddenFiles" {Invoke-WinUtilHiddenFiles $(Get-WinUtilToggleStatus WPFToggleHiddenFiles)}
- "WPFToggleTaskbarAlignment" {Invoke-WinUtilTaskbarAlignment $(Get-WinUtilToggleStatus WPFToggleTaskbarAlignment)}
- "WPFToggleDetailedBSoD" {Invoke-WinUtilDetailedBSoD $(Get-WinUtilToggleStatus WPFToggleDetailedBSoD)}
+ "WPFToggleDarkMode" {Invoke-WinUtilDarkMode $ToggleStatus}
+ "WPFToggleBingSearch" {Invoke-WinUtilBingSearch $ToggleStatus}
+ "WPFToggleNumLock" {Invoke-WinUtilNumLock $ToggleStatus}
+ "WPFToggleVerboseLogon" {Invoke-WinUtilVerboseLogon $ToggleStatus}
+ "WPFToggleShowExt" {Invoke-WinUtilShowExt $ToggleStatus}
+ "WPFToggleSnapWindow" {Invoke-WinUtilSnapWindow $ToggleStatus}
+ "WPFToggleSnapFlyout" {Invoke-WinUtilSnapFlyout $ToggleStatus}
+ "WPFToggleSnapSuggestion" {Invoke-WinUtilSnapSuggestion $ToggleStatus}
+ "WPFToggleMouseAcceleration" {Invoke-WinUtilMouseAcceleration $ToggleStatus}
+ "WPFToggleStickyKeys" {Invoke-WinUtilStickyKeys $ToggleStatus}
+ "WPFToggleTaskbarWidgets" {Invoke-WinUtilTaskbarWidgets $ToggleStatus}
+ "WPFToggleTaskbarSearch" {Invoke-WinUtilTaskbarSearch $ToggleStatus}
+ "WPFToggleTaskView" {Invoke-WinUtilTaskView $ToggleStatus}
+ "WPFToggleHiddenFiles" {Invoke-WinUtilHiddenFiles $ToggleStatus}
+ "WPFToggleTaskbarAlignment" {Invoke-WinUtilTaskbarAlignment $ToggleStatus}
+ "WPFToggleDetailedBSoD" {Invoke-WinUtilDetailedBSoD $ToggleStatus}
}
}
diff --git a/functions/public/Invoke-WPFUIElements.ps1 b/functions/public/Invoke-WPFUIElements.ps1
new file mode 100644
index 00000000..f8e9c7ba
--- /dev/null
+++ b/functions/public/Invoke-WPFUIElements.ps1
@@ -0,0 +1,326 @@
+function Invoke-WPFUIElements {
+ <#
+ .SYNOPSIS
+ Adds UI elements to a specified Grid in the WinUtil GUI based on a JSON configuration.
+ .PARAMETER configVariable
+ The variable/link containing the JSON configuration.
+ .PARAMETER targetGridName
+ The name of the grid to which the UI elements should be added.
+ .PARAMETER columncount
+ The number of columns to be used in the Grid. If not provided, a default value is used based on the panel.
+ .EXAMPLE
+ Invoke-WPFUIElements -configVariable $sync.configs.applications -targetGridName "install" -columncount 5
+ .NOTES
+ Future me/contributer: If possible please wrap this into a runspace to make it load all panels at the same time.
+ #>
+
+ param(
+ [Parameter(Mandatory, position=0)]
+ [PSCustomObject]$configVariable,
+
+ [Parameter(Mandatory, position=1)]
+ [string]$targetGridName,
+
+ [Parameter(Mandatory, position=2)]
+ [int]$columncount
+ )
+
+ $window = $sync["Form"]
+
+ $theme = $sync.configs.themes.$ctttheme
+ $borderstyle = $window.FindResource("BorderStyle")
+ $HoverTextBlockStyle = $window.FindResource("HoverTextBlockStyle")
+ $ColorfulToggleSwitchStyle = $window.FindResource("ColorfulToggleSwitchStyle")
+
+ if (!$borderstyle -or !$HoverTextBlockStyle -or !$ColorfulToggleSwitchStyle) {
+ throw "Failed to retrieve Styles using 'FindResource' from main window element."
+ }
+
+ $targetGrid = $window.FindName($targetGridName)
+
+ if (!$targetGrid) {
+ throw "Failed to retrieve Target Grid by name, provided name: $targetGrid"
+ }
+
+ # Clear existing ColumnDefinitions and Children
+ $targetGrid.ColumnDefinitions.Clear() | Out-Null
+ $targetGrid.Children.Clear() | Out-Null
+
+ # Add ColumnDefinitions to the target Grid
+ for ($i = 0; $i -lt $columncount; $i++) {
+ $colDef = New-Object Windows.Controls.ColumnDefinition
+ $colDef.Width = New-Object Windows.GridLength(1, [Windows.GridUnitType]::Star)
+ $targetGrid.ColumnDefinitions.Add($colDef) | Out-Null
+ }
+
+ # Convert PSCustomObject to Hashtable
+ $configHashtable = @{}
+ $configVariable.PSObject.Properties.Name | ForEach-Object {
+ $configHashtable[$_] = $configVariable.$_
+ }
+
+ $organizedData = @{}
+ # Iterate through JSON data and organize by panel and category
+ foreach ($entry in $configHashtable.Keys) {
+ $entryInfo = $configHashtable[$entry]
+
+ # Create an object for the application
+ $entryObject = [PSCustomObject]@{
+ Name = $entry
+ Order = $entryInfo.order
+ Category = $entryInfo.Category
+ Content = $entryInfo.Content
+ Choco = $entryInfo.choco
+ Winget = $entryInfo.winget
+ Panel = if ($entryInfo.Panel) { $entryInfo.Panel } else { "0" }
+ Link = $entryInfo.link
+ Description = $entryInfo.description
+ Type = $entryInfo.type
+ ComboItems = $entryInfo.ComboItems
+ Checked = $entryInfo.Checked
+ ButtonWidth = $entryInfo.ButtonWidth
+ }
+
+ if (-not $organizedData.ContainsKey($entryObject.Panel)) {
+ $organizedData[$entryObject.Panel] = @{}
+ }
+
+ if (-not $organizedData[$entryObject.Panel].ContainsKey($entryObject.Category)) {
+ $organizedData[$entryObject.Panel][$entryObject.Category] = @()
+ }
+
+ # Store application data in an array under the category
+ $organizedData[$entryObject.Panel][$entryObject.Category] += $entryObject
+
+ # Only apply the logic for distributing entries across columns if the targetGridName is "appspanel"
+ if ($targetGridName -eq "appspanel") {
+ $panelcount = 0
+ $entrycount = $configHashtable.Keys.Count + $organizedData["0"].Keys.Count
+ $maxcount = [Math]::Round($entrycount / $columncount + 0.5)
+ }
+ }
+
+ # Iterate through 'organizedData' by panel, category, and application
+ $count = 0
+ foreach ($panelKey in ($organizedData.Keys | Sort-Object)) {
+ # Create a Border for each column
+ $border = New-Object Windows.Controls.Border
+ $border.VerticalAlignment = "Stretch" # Ensure the border stretches vertically
+ [System.Windows.Controls.Grid]::SetColumn($border, $panelcount)
+ $border.style = $borderstyle
+ $targetGrid.Children.Add($border) | Out-Null
+
+ # Create a StackPanel inside the Border
+ $stackPanel = New-Object Windows.Controls.StackPanel
+ $stackPanel.Background = [Windows.Media.Brushes]::Transparent
+ $stackPanel.SnapsToDevicePixels = $true
+ $stackPanel.VerticalAlignment = "Stretch" # Ensure the stack panel stretches vertically
+ $border.Child = $stackPanel
+ $panelcount++
+
+ foreach ($category in ($organizedData[$panelKey].Keys | Sort-Object)) {
+ $count++
+ if ($targetGridName -eq "appspanel" -and $columncount -gt 0) {
+ $panelcount2 = [Int](($count) / $maxcount - 0.5)
+ if ($panelcount -eq $panelcount2) {
+ # Create a new Border for the new column
+ $border = New-Object Windows.Controls.Border
+ $border.VerticalAlignment = "Stretch" # Ensure the border stretches vertically
+ [System.Windows.Controls.Grid]::SetColumn($border, $panelcount)
+ $border.style = $borderstyle
+ $targetGrid.Children.Add($border) | Out-Null
+
+ # Create a new StackPanel inside the Border
+ $stackPanel = New-Object Windows.Controls.StackPanel
+ $stackPanel.Background = [Windows.Media.Brushes]::Transparent
+ $stackPanel.SnapsToDevicePixels = $true
+ $stackPanel.VerticalAlignment = "Stretch" # Ensure the stack panel stretches vertically
+ $border.Child = $stackPanel
+ $panelcount++
+ }
+ }
+
+ $label = New-Object Windows.Controls.Label
+ $label.Content = $category -replace ".*__", ""
+ $label.FontSize = $theme.FontSizeHeading
+ $label.FontFamily = $theme.HeaderFontFamily
+ $stackPanel.Children.Add($label) | Out-Null
+
+ $sync[$category] = $label
+
+ # Sort entries by Order and then by Name, but only display Name
+ $entries = $organizedData[$panelKey][$category] | Sort-Object Order, Name
+ foreach ($entryInfo in $entries) {
+ $count++
+ if ($targetGridName -eq "appspanel" -and $columncount -gt 0) {
+ $panelcount2 = [Int](($count) / $maxcount - 0.5)
+ if ($panelcount -eq $panelcount2) {
+ # Create a new Border for the new column
+ $border = New-Object Windows.Controls.Border
+ $border.VerticalAlignment = "Stretch" # Ensure the border stretches vertically
+ [System.Windows.Controls.Grid]::SetColumn($border, $panelcount)
+ $border.style = $borderstyle
+ $targetGrid.Children.Add($border) | Out-Null
+
+ # Create a new StackPanel inside the Border
+ $stackPanel = New-Object Windows.Controls.StackPanel
+ $stackPanel.Background = [Windows.Media.Brushes]::Transparent
+ $stackPanel.SnapsToDevicePixels = $true
+ $stackPanel.VerticalAlignment = "Stretch" # Ensure the stack panel stretches vertically
+ $border.Child = $stackPanel
+ $panelcount++
+ }
+ }
+
+ switch ($entryInfo.Type) {
+ "Toggle" {
+ $dockPanel = New-Object Windows.Controls.DockPanel
+ $checkBox = New-Object Windows.Controls.CheckBox
+ $checkBox.Name = $entryInfo.Name
+ $checkBox.HorizontalAlignment = "Right"
+ $dockPanel.Children.Add($checkBox) | Out-Null
+ $checkBox.Style = $ColorfulToggleSwitchStyle
+
+ $label = New-Object Windows.Controls.Label
+ $label.Content = $entryInfo.Content
+ $label.ToolTip = $entryInfo.Description
+ $label.HorizontalAlignment = "Left"
+ $label.FontSize = $theme.FontSize
+ $label.Foreground = $theme.MainForegroundColor
+ $dockPanel.Children.Add($label) | Out-Null
+ $stackPanel.Children.Add($dockPanel) | Out-Null
+
+ $sync[$entryInfo.Name] = $checkBox
+
+ $sync[$entryInfo.Name].IsChecked = Get-WinUtilToggleStatus $sync[$entryInfo.Name].Name
+
+ $sync[$entryInfo.Name].Add_Click({
+ [System.Object]$Sender = $args[0]
+ Invoke-WPFToggle $Sender.name
+ })
+ }
+
+ "ToggleButton" {
+ $toggleButton = New-Object Windows.Controls.ToggleButton
+ $toggleButton.Name = $entryInfo.Name
+ $toggleButton.Name = "WPFTab" + ($stackPanel.Children.Count + 1) + "BT"
+ $toggleButton.HorizontalAlignment = "Left"
+ $toggleButton.Height = $theme.TabButtonHeight
+ $toggleButton.Width = $theme.TabButtonWidth
+ $toggleButton.Background = $theme.ButtonInstallBackgroundColor
+ $toggleButton.Foreground = [Windows.Media.Brushes]::White
+ $toggleButton.FontWeight = [Windows.FontWeights]::Bold
+
+ $textBlock = New-Object Windows.Controls.TextBlock
+ $textBlock.FontSize = $theme.TabButtonFontSize
+ $textBlock.Background = [Windows.Media.Brushes]::Transparent
+ $textBlock.Foreground = $theme.ButtonInstallForegroundColor
+
+ $underline = New-Object Windows.Documents.Underline
+ $underline.Inlines.Add($entryInfo.name -replace "(.).*", "`$1")
+
+ $run = New-Object Windows.Documents.Run
+ $run.Text = $entryInfo.name -replace "^.", ""
+
+ $textBlock.Inlines.Add($underline)
+ $textBlock.Inlines.Add($run)
+
+ $toggleButton.Content = $textBlock
+
+ $stackPanel.Children.Add($toggleButton) | Out-Null
+
+ $sync[$entryInfo.Name] = $toggleButton
+ }
+
+ "Combobox" {
+ $horizontalStackPanel = New-Object Windows.Controls.StackPanel
+ $horizontalStackPanel.Orientation = "Horizontal"
+ $horizontalStackPanel.Margin = "0,5,0,0"
+
+ $label = New-Object Windows.Controls.Label
+ $label.Content = $entryInfo.Content
+ $label.HorizontalAlignment = "Left"
+ $label.VerticalAlignment = "Center"
+ $label.FontSize = $theme.ButtonFontSize
+ $horizontalStackPanel.Children.Add($label) | Out-Null
+
+ $comboBox = New-Object Windows.Controls.ComboBox
+ $comboBox.Name = $entryInfo.Name
+ $comboBox.Height = $theme.ButtonHeight
+ $comboBox.Width = $theme.ButtonWidth
+ $comboBox.HorizontalAlignment = "Left"
+ $comboBox.VerticalAlignment = "Center"
+ $comboBox.Margin = $theme.ButtonMargin
+
+ foreach ($comboitem in ($entryInfo.ComboItems -split " ")) {
+ $comboBoxItem = New-Object Windows.Controls.ComboBoxItem
+ $comboBoxItem.Content = $comboitem
+ $comboBoxItem.FontSize = $theme.ButtonFontSize
+ $comboBox.Items.Add($comboBoxItem) | Out-Null
+ }
+
+ $horizontalStackPanel.Children.Add($comboBox) | Out-Null
+ $stackPanel.Children.Add($horizontalStackPanel) | Out-Null
+
+ $comboBox.SelectedIndex = 0
+
+ $sync[$entryInfo.Name] = $comboBox
+ }
+
+ "Button" {
+ $button = New-Object Windows.Controls.Button
+ $button.Name = $entryInfo.Name
+ $button.Content = $entryInfo.Content
+ $button.HorizontalAlignment = "Left"
+ $button.Margin = $theme.ButtonMargin
+ $button.FontSize = $theme.ButtonFontSize
+ if ($entryInfo.ButtonWidth) {
+ $button.Width = $entryInfo.ButtonWidth
+ }
+ $stackPanel.Children.Add($button) | Out-Null
+
+ $sync[$entryInfo.Name] = $button
+ }
+
+ default {
+ $horizontalStackPanel = New-Object Windows.Controls.StackPanel
+ $horizontalStackPanel.Orientation = "Horizontal"
+
+ $checkBox = New-Object Windows.Controls.CheckBox
+ $checkBox.Name = $entryInfo.Name
+ $checkBox.Content = $entryInfo.Content
+ $checkBox.FontSize = $theme.FontSize
+ $checkBox.ToolTip = $entryInfo.Description
+ $checkBox.Margin = $theme.CheckBoxMargin
+ if ($entryInfo.Checked) {
+ $checkBox.IsChecked = $entryInfo.Checked
+ }
+ $horizontalStackPanel.Children.Add($checkBox) | Out-Null
+
+ if ($entryInfo.Link) {
+ $textBlock = New-Object Windows.Controls.TextBlock
+ $textBlock.Name = $checkBox.Name + "Link"
+ $textBlock.Text = "(?)"
+ $textBlock.ToolTip = $entryInfo.Link
+ $textBlock.Style = $HoverTextBlockStyle
+
+ # Add event handler for click to open link
+ $handler = [System.Windows.Input.MouseButtonEventHandler]{
+ param($sender, $e)
+ Start-Process $sender.ToolTip.ToString()
+ }
+ $textBlock.AddHandler([Windows.Controls.TextBlock]::MouseLeftButtonUpEvent, $handler)
+
+ $horizontalStackPanel.Children.Add($textBlock) | Out-Null
+
+ $sync[$textBlock.Name] = $textBlock
+ }
+
+ $stackPanel.Children.Add($horizontalStackPanel) | Out-Null
+ $sync[$entryInfo.Name] = $checkBox
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/overrides/main.html b/overrides/main.html
index f5f0eb39..9038d3e9 100644
--- a/overrides/main.html
+++ b/overrides/main.html
@@ -1,5 +1,12 @@
{% extends "base.html" %}
+{% block header %}
+ {{ super() }}
+
+ Announcement: We are currently not adding any applicatiosn to WinUtil and any apps that will be added through a PR will be declined by the maintainer.
+
+{% endblock %}
+
{% block footer %}
{# Empty block to override the footer #}
{% endblock %}
diff --git a/pester/configs.Tests.ps1 b/pester/configs.Tests.ps1
index dd2db7f3..f8e55c44 100644
--- a/pester/configs.Tests.ps1
+++ b/pester/configs.Tests.ps1
@@ -37,6 +37,12 @@ Describe "Config Files" -ForEach @(
$result = New-Object System.Collections.Generic.List[System.Object]
Foreach ($application in $applications) {
$compare = $global:importedconfigs.$name.$application | Get-Member -MemberType NoteProperty | Select-Object -ExpandProperty name
+ if (-not $compare) {
+ throw "Comparison object for application '$application' is null."
+ }
+ if (-not $template) {
+ throw "Template object for application '$application' is null."
+ }
if ($(Compare-Object $compare $template) -ne $null) {
$result.Add($application)
}
diff --git a/scripts/main.ps1 b/scripts/main.ps1
index e34bc9c1..32ccc67c 100644
--- a/scripts/main.ps1
+++ b/scripts/main.ps1
@@ -52,6 +52,7 @@ $sync.runspace.Open()
$inputXML = $inputXML -replace 'mc:Ignorable="d"', '' -replace "x:N", 'N' -replace '^ Terminal(Admin) ---" -Foregroundcolor Red
- Write-Host "===========================================" -Foregroundcolor Red
+if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
+ Write-Output "Winutil needs to be run as Administrator. Attempting to relaunch."
+
+ $script = if ($MyInvocation.MyCommand.Path) { "& '" + $MyInvocation.MyCommand.Path + "'" } else { "irm 'https://github.com/ChrisTitusTech/winutil/releases/latest/download/winutil.ps1' | iex"}
+ $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
+
break
}
diff --git a/windev.ps1 b/windev.ps1
index 3e1805f0..5bba017d 100644
--- a/windev.ps1
+++ b/windev.ps1
@@ -12,6 +12,18 @@
Run in Admin Powershell > ./windev.ps1
#>
+if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
+ Write-Output "Winutil needs to be run as Administrator. Attempting to relaunch."
+
+ $script = if ($MyInvocation.MyCommand.Path) { "& '" + $MyInvocation.MyCommand.Path + "'" } else { "irm 'https://github.com/ChrisTitusTech/winutil/raw/main/windev.ps1' | iex"}
+ $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
+
+ break
+}
+
# Function to fetch the latest release tag from the GitHub API
function Get-LatestRelease {
try {
diff --git a/xaml/inputXML.xaml b/xaml/inputXML.xaml
index 6a37ea66..6e541829 100644
--- a/xaml/inputXML.xaml
+++ b/xaml/inputXML.xaml
@@ -284,12 +284,12 @@
-
+
@@ -305,17 +305,17 @@
-
+
@@ -427,7 +427,11 @@
Width="34" Height="17">
+ HorizontalAlignment="Left" Width="10.8"
+ RenderTransformOrigin="0.5, 0.5">
+
+
+
@@ -438,12 +442,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
@@ -502,7 +529,7 @@
-