mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-01-13 00:10:36 -06:00
Compare commits
13 Commits
d49b21f881
...
f4d4bdad3c
Author | SHA1 | Date | |
---|---|---|---|
|
f4d4bdad3c | ||
|
9d47514190 | ||
|
4fc34e44b3 | ||
|
c33946bde2 | ||
|
4466720493 | ||
|
1d0e3bfd5c | ||
|
83450aef7b | ||
|
e2ce998426 | ||
|
cf7f161a06 | ||
|
d6c1fbe4a2 | ||
|
0779dd9096 | ||
|
d48f212be4 | ||
|
9c52f01204 |
10
.github/ISSUE_TEMPLATE/bug_report.md
vendored
10
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@ -9,12 +9,11 @@ assignees: ''
|
||||
## Describe the bug
|
||||
<!-- A clear and concise description of what the bug is. -->
|
||||
|
||||
## To Reproduce
|
||||
Steps to reproduce the behavior:
|
||||
## Steps to reproduce
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
4. See the error.
|
||||
|
||||
## Expected behavior
|
||||
<!-- A clear and concise description of what you expected to happen. -->
|
||||
@ -24,3 +23,8 @@ Steps to reproduce the behavior:
|
||||
|
||||
## Additional context
|
||||
<!-- Add any other context about the problem here. -->
|
||||
|
||||
## Issue validation
|
||||
- [ ] I checked for duplicate issues.
|
||||
- [ ] I checked for already existing discussions.
|
||||
- [ ] I checked for an already existing pull request addressing the issue.
|
||||
|
14
.github/ISSUE_TEMPLATE/feature_request.md
vendored
14
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@ -4,17 +4,21 @@ about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: 'enhancement'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
## 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**
|
||||
## Describe the solution you'd like
|
||||
<!-- A clear and concise description of what you want to happen. -->
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
## Describe alternatives you've considered
|
||||
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
|
||||
|
||||
**Additional context**
|
||||
## Additional context
|
||||
<!-- Add any other context or screenshots about the feature request here. -->
|
||||
|
||||
## Issue validation
|
||||
- [ ] I checked for duplicate issues.
|
||||
- [ ] I checked for already existing discussions.
|
||||
- [ ] I checked for an already existing pull request addressing the issue.
|
||||
|
4
.github/workflows/close-old-issues.yaml
vendored
4
.github/workflows/close-old-issues.yaml
vendored
@ -28,8 +28,8 @@ jobs:
|
||||
days-before-pr-stale: -1
|
||||
days-before-pr-close: -1
|
||||
# Sends a message for both the Stale and Close events of an issue.
|
||||
stale-issue-message: "This issue was marked as stale because it has been inactive for 7 days"
|
||||
close-issue-message: "This issue was closed because it has been inactive for 7 days since it was marked as stale"
|
||||
stale-issue-message: "This issue was marked as stale due to inactivity."
|
||||
close-issue-message: "This issue was closed after remaining stale without updates."
|
||||
# Increase this value if the project receives a lot of
|
||||
# PRs (yes.. apparently they're processed no matter what) & Issues.
|
||||
# Default value for it (according to the docs) is 30
|
||||
|
@ -1,11 +1,11 @@
|
||||
name: Close issue on /close
|
||||
name: Issue slash commands
|
||||
|
||||
on:
|
||||
issue_comment:
|
||||
types: [created, edited]
|
||||
|
||||
jobs:
|
||||
closeIssueOnClose:
|
||||
issueCommands:
|
||||
# Skip this job if the comment was created/edited on a PR
|
||||
if: ${{ !github.event.issue.pull_request }}
|
||||
runs-on: ubuntu-latest
|
||||
@ -17,6 +17,30 @@ jobs:
|
||||
steps:
|
||||
- run: echo "command=false" >> $GITHUB_ENV
|
||||
|
||||
- name: Check for /label command
|
||||
id: check_label_command
|
||||
run: |
|
||||
if [[ "${{ contains(github.event.comment.body, '/label') }}" == "true" ]]; then
|
||||
echo "command=true" >> $GITHUB_ENV
|
||||
LABEL_NAME=$(echo "${{ github.event.comment.body }}" | awk -F"/label" '/\/label/ { match($2, /'\''([^'\'']*)'\''/, arr); if (arr[1] != "") print arr[1] }')
|
||||
echo "label_command=true" >> $GITHUB_ENV
|
||||
echo "label_name=${LABEL_NAME}" >> $GITHUB_ENV
|
||||
else
|
||||
echo "label_command=false" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Check for /unlabel command
|
||||
id: check_unlabel_command
|
||||
run: |
|
||||
if [[ "${{ contains(github.event.comment.body, '/unlabel') }}" == "true" ]]; then
|
||||
echo "command=true" >> $GITHUB_ENV
|
||||
UNLABEL_NAME=$(echo "${{ github.event.comment.body }}" | awk -F"/unlabel" '/\/unlabel/ { match($2, /'\''([^'\'']*)'\''/, arr); if (arr[1] != "") print arr[1] }')
|
||||
echo "unlabel_command=true" >> $GITHUB_ENV
|
||||
echo "unlabel_name=${UNLABEL_NAME}" >> $GITHUB_ENV
|
||||
else
|
||||
echo "unlabel_command=false" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Check for /close command
|
||||
id: check_close_command
|
||||
run: |
|
||||
@ -43,15 +67,15 @@ jobs:
|
||||
id: check_user
|
||||
if: env.command == 'true'
|
||||
run: |
|
||||
ALLOWED_USERS=("ChrisTitusTech" "og-mrk" "Marterich" "MyDrift-user" "Real-MullaC")
|
||||
ALLOWED_USERS=("ChrisTitusTech" "og-mrk" "Marterich" "MyDrift-user" "Real-MullaC" "CodingWonders")
|
||||
if [[ " ${ALLOWED_USERS[@]} " =~ " ${{ github.event.comment.user.login }} " ]]; then
|
||||
echo "user=true" >> $GITHUB_ENV
|
||||
else
|
||||
echo "user=false" >> $GITHUB_ENV
|
||||
exit 0
|
||||
fi
|
||||
|
||||
- name: Close issue if conditions are met
|
||||
if: env.close_command == 'true' && env.user == 'true'
|
||||
- name: Close issue
|
||||
if: env.close_command == 'true'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
||||
@ -63,11 +87,29 @@ jobs:
|
||||
gh issue close $ISSUE_NUMBER --repo ${{ github.repository }}
|
||||
fi
|
||||
|
||||
- name: Reopen issue if conditions are met
|
||||
if: env.reopen_command == 'true' && env.user == 'true'
|
||||
- name: Reopen issue
|
||||
if: env.reopen_command == 'true'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
||||
run: |
|
||||
echo Reopening the issue...
|
||||
gh issue reopen $ISSUE_NUMBER --repo ${{ github.repository }}
|
||||
|
||||
- name: Label issue
|
||||
if: env.label_command == 'true'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
||||
run: |
|
||||
echo Labeling the issue...
|
||||
gh issue edit $ISSUE_NUMBER --repo ${{ github.repository }} --add-label "${{ env.label_name }}"
|
||||
|
||||
- name: Remove labels
|
||||
if: env.unlabel_command == 'true'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
||||
run: |
|
||||
echo Unlabeling the issue...
|
||||
gh issue edit $ISSUE_NUMBER --repo ${{ github.repository }} --remove-label "${{ env.unlabel_name }}"
|
@ -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.
|
||||
|
||||
<!-- sponsors --><a href="https://github.com/TriHydera"><img src="https://avatars.githubusercontent.com/u/39857764?u=5dbda638f45530582eee1703b4473f2a5e229e28&v=4" width="60px" alt="TriHydera" /></a><a href="https://github.com/jozozovko"><img src="https://avatars.githubusercontent.com/u/3272468?u=4391ed4655e4fd8b56e23b4169e44e2ac9b6cd97&v=4" width="60px" alt="" /></a><a href="https://github.com/DelDongo"><img src="https://avatars.githubusercontent.com/u/127976398?v=4" width="60px" alt="" /></a><a href="https://github.com/markamos"><img src="https://avatars.githubusercontent.com/u/9561861?u=3cca179dcff0413538591e57a3abea116d65ce56&v=4" width="60px" alt="Mark Amos" /></a><a href="https://github.com/dwelfusius"><img src="https://avatars.githubusercontent.com/u/54533224?u=a49ea000a8f52adb31382ea69a1a7501b27fefdd&v=4" width="60px" alt="" /></a><a href="https://github.com/mews-se"><img src="https://avatars.githubusercontent.com/u/58894405?v=4" width="60px" alt="" /></a><a href="https://github.com/jdiegmueller"><img src="https://avatars.githubusercontent.com/u/18660571?u=601d0a23040a271c86b5d40339f899a6dbf27086&v=4" width="60px" alt="Jason A. Diegmueller" /></a><a href="https://github.com/AlanTristar"><img src="https://avatars.githubusercontent.com/u/105566568?v=4" width="60px" alt="" /></a><a href="https://github.com/zepled112"><img src="https://avatars.githubusercontent.com/u/65176625?v=4" width="60px" alt="wyatt" /></a><a href="https://github.com/altugtekiner"><img src="https://avatars.githubusercontent.com/u/105917451?u=ee73ff639c7bd9feb4708ab4ba7b14eff80196f7&v=4" width="60px" alt="" /></a><a href="https://github.com/robertsandrock"><img src="https://avatars.githubusercontent.com/u/12015331?v=4" width="60px" alt="RMS" /></a><a href="https://github.com/mmomega"><img src="https://avatars.githubusercontent.com/u/71956566?v=4" width="60px" alt="" /></a><a href="https://github.com/KenichiQaz"><img src="https://avatars.githubusercontent.com/u/31177857?u=efdbae734a4c60a7bb95df4659d0535e60a6fd57&v=4" width="60px" alt="Stefan" /></a><a href="https://github.com/paulsheets"><img src="https://avatars.githubusercontent.com/u/45240946?u=d4db66f8e8d7a2606fe7a5521daf48ca9f097105&v=4" width="60px" alt="Paul" /></a><a href="https://github.com/djones369"><img src="https://avatars.githubusercontent.com/u/4107092?v=4" width="60px" alt="Dave Jones" /></a><a href="https://github.com/anthonymendez"><img src="https://avatars.githubusercontent.com/u/19240897?u=f82b4be098cac65c8421421b70ebd2d1da85c67e&v=4" width="60px" alt="Anthony Mendez" /></a><a href="https://github.com/claudemods"><img src="https://avatars.githubusercontent.com/u/73653396?u=d64c656fb8db24ef56bb000197532df9b618d06c&v=4" width="60px" alt="Claudemods" /></a><a href="https://github.com/FatBastard0"><img src="https://avatars.githubusercontent.com/u/173957728?v=4" width="60px" alt="" /></a><a href="https://github.com/Ascent7910"><img src="https://avatars.githubusercontent.com/u/118260621?v=4" width="60px" alt="Max" /></a><a href="https://github.com/DursleyGuy"><img src="https://avatars.githubusercontent.com/u/140165544?v=4" width="60px" alt="DursleyGuy" /></a><a href="https://github.com/YamiSandman616"><img src="https://avatars.githubusercontent.com/u/183505690?u=c3bd20157058b6215e28f7568d4f8c4fbbe92838&v=4" width="60px" alt="Sandman616" /></a><a href="https://github.com/realmuddy"><img src="https://avatars.githubusercontent.com/u/30978236?v=4" width="60px" alt="Phillip Waters" /></a><a href="https://github.com/Tariq-Al-Zahrani"><img src="https://avatars.githubusercontent.com/u/187593049?v=4" width="60px" alt="" /></a><a href="https://github.com/quaszi"><img src="https://avatars.githubusercontent.com/u/51266738?u=2e3185214607e51239c5969c866ddd5eb1bdee48&v=4" width="60px" alt="" /></a><!-- sponsors -->
|
||||
<!-- sponsors --><a href="https://github.com/TriHydera"><img src="https://avatars.githubusercontent.com/u/39857764?u=5dbda638f45530582eee1703b4473f2a5e229e28&v=4" width="60px" alt="TriHydera" /></a><a href="https://github.com/jozozovko"><img src="https://avatars.githubusercontent.com/u/3272468?u=4391ed4655e4fd8b56e23b4169e44e2ac9b6cd97&v=4" width="60px" alt="" /></a><a href="https://github.com/DelDongo"><img src="https://avatars.githubusercontent.com/u/127976398?v=4" width="60px" alt="" /></a><a href="https://github.com/markamos"><img src="https://avatars.githubusercontent.com/u/9561861?u=3cca179dcff0413538591e57a3abea116d65ce56&v=4" width="60px" alt="Mark Amos" /></a><a href="https://github.com/dwelfusius"><img src="https://avatars.githubusercontent.com/u/54533224?u=a49ea000a8f52adb31382ea69a1a7501b27fefdd&v=4" width="60px" alt="" /></a><a href="https://github.com/mews-se"><img src="https://avatars.githubusercontent.com/u/58894405?v=4" width="60px" alt="" /></a><a href="https://github.com/jdiegmueller"><img src="https://avatars.githubusercontent.com/u/18660571?u=601d0a23040a271c86b5d40339f899a6dbf27086&v=4" width="60px" alt="Jason A. Diegmueller" /></a><a href="https://github.com/AlanTristar"><img src="https://avatars.githubusercontent.com/u/105566568?v=4" width="60px" alt="" /></a><a href="https://github.com/zepled112"><img src="https://avatars.githubusercontent.com/u/65176625?v=4" width="60px" alt="wyatt" /></a><a href="https://github.com/altugtekiner"><img src="https://avatars.githubusercontent.com/u/105917451?u=ee73ff639c7bd9feb4708ab4ba7b14eff80196f7&v=4" width="60px" alt="" /></a><a href="https://github.com/robertsandrock"><img src="https://avatars.githubusercontent.com/u/12015331?v=4" width="60px" alt="RMS" /></a><a href="https://github.com/mmomega"><img src="https://avatars.githubusercontent.com/u/71956566?v=4" width="60px" alt="" /></a><a href="https://github.com/KenichiQaz"><img src="https://avatars.githubusercontent.com/u/31177857?u=efdbae734a4c60a7bb95df4659d0535e60a6fd57&v=4" width="60px" alt="Stefan" /></a><a href="https://github.com/paulsheets"><img src="https://avatars.githubusercontent.com/u/45240946?u=d4db66f8e8d7a2606fe7a5521daf48ca9f097105&v=4" width="60px" alt="Paul" /></a><a href="https://github.com/djones369"><img src="https://avatars.githubusercontent.com/u/4107092?v=4" width="60px" alt="Dave Jones" /></a><a href="https://github.com/anthonymendez"><img src="https://avatars.githubusercontent.com/u/19240897?u=f82b4be098cac65c8421421b70ebd2d1da85c67e&v=4" width="60px" alt="Anthony Mendez" /></a><a href="https://github.com/claudemods"><img src="https://avatars.githubusercontent.com/u/73653396?u=d64c656fb8db24ef56bb000197532df9b618d06c&v=4" width="60px" alt="Claudemods" /></a><a href="https://github.com/FatBastard0"><img src="https://avatars.githubusercontent.com/u/173957728?v=4" width="60px" alt="" /></a><a href="https://github.com/Ascent7910"><img src="https://avatars.githubusercontent.com/u/118260621?v=4" width="60px" alt="Max" /></a><a href="https://github.com/DursleyGuy"><img src="https://avatars.githubusercontent.com/u/140165544?v=4" width="60px" alt="DursleyGuy" /></a><a href="https://github.com/YamiSandman616"><img src="https://avatars.githubusercontent.com/u/183505690?u=c3bd20157058b6215e28f7568d4f8c4fbbe92838&v=4" width="60px" alt="Sandman616" /></a><a href="https://github.com/realmuddy"><img src="https://avatars.githubusercontent.com/u/30978236?v=4" width="60px" alt="Phillip Waters" /></a><a href="https://github.com/quaszi"><img src="https://avatars.githubusercontent.com/u/51266738?u=2e3185214607e51239c5969c866ddd5eb1bdee48&v=4" width="60px" alt="" /></a><a href="https://github.com/Psyhackological"><img src="https://avatars.githubusercontent.com/u/47569716?u=66dc5e86731eaf8c6bc78a1bff34420ed2e5402b&v=4" width="60px" alt="Konrad Konieczny" /></a><!-- sponsors -->
|
||||
|
||||
## 🏅 Thanks to all Contributors
|
||||
Thanks a lot for spending your time helping Winutil grow. Thanks a lot! Keep rocking 🍻.
|
||||
|
28
Test-WingetInstall.ps1
Normal file
28
Test-WingetInstall.ps1
Normal file
@ -0,0 +1,28 @@
|
||||
# Import the function (adjust the path according to your setup)
|
||||
. "./functions/private/Get-WinUtilWingetLatest.ps1"
|
||||
|
||||
# Set up Information stream to be visible
|
||||
$InformationPreference = "Continue"
|
||||
|
||||
Write-Host "Starting Winget installation test..." -ForegroundColor Cyan
|
||||
|
||||
try {
|
||||
# Test the function with verbose output
|
||||
Write-Host "Attempting to run Get-WinUtilWingetLatest..." -ForegroundColor Cyan
|
||||
Get-WinUtilWingetLatest -Verbose
|
||||
|
||||
# Verify Winget is working
|
||||
if (Get-Command winget -ErrorAction SilentlyContinue) {
|
||||
Write-Host "Success! Winget is installed and accessible." -ForegroundColor Green
|
||||
|
||||
# Display Winget version
|
||||
Write-Host "`nWinget version:" -ForegroundColor Cyan
|
||||
winget --version
|
||||
} else {
|
||||
Write-Host "Warning: Winget is installed but not accessible in the current session. You may need to restart your terminal." -ForegroundColor Yellow
|
||||
}
|
||||
} catch {
|
||||
Write-Host "Error occurred during testing: $($_.Exception.Message)" -ForegroundColor Red
|
||||
Write-Host "Stack Trace:" -ForegroundColor Red
|
||||
$_.ScriptStackTrace
|
||||
}
|
@ -439,6 +439,14 @@
|
||||
"link": "https://dotnet.microsoft.com/download/dotnet/8.0",
|
||||
"winget": "Microsoft.DotNet.DesktopRuntime.8"
|
||||
},
|
||||
"dotnet9": {
|
||||
"category": "Microsoft Tools",
|
||||
"choco": "dotnet-9.0-runtime",
|
||||
"content": ".NET Desktop Runtime 9",
|
||||
"description": ".NET Desktop Runtime 9 is a runtime environment required for running applications developed with .NET 9.",
|
||||
"link": "https://dotnet.microsoft.com/download/dotnet/9.0",
|
||||
"winget": "Microsoft.DotNet.DesktopRuntime.9"
|
||||
},
|
||||
"dmt": {
|
||||
"winget": "GNE.DualMonitorTools",
|
||||
"choco": "dual-monitor-tools",
|
||||
|
@ -14,7 +14,6 @@
|
||||
"WPFTweaksDeleteTempFiles",
|
||||
"WPFTweaksEndTaskOnTaskbar",
|
||||
"WPFTweaksRestorePoint",
|
||||
"WPFTweaksIPv46",
|
||||
"WPFTweaksPowershell7Tele"
|
||||
],
|
||||
"Minimal": [
|
||||
|
@ -2,12 +2,12 @@
|
||||
"shared":{
|
||||
"CustomDialogFontSize": "12",
|
||||
"CustomDialogFontSizeHeader": "14",
|
||||
"CustomDialogIconSize": "25",
|
||||
"CustomDialogLogoSize": "25",
|
||||
"CustomDialogWidth": "400",
|
||||
"CustomDialogHeight": "200",
|
||||
"FontSize": "12",
|
||||
"FontFamily": "Arial",
|
||||
"FontSizeHeading": "16",
|
||||
"HeadingFontSize": "16",
|
||||
"HeaderFontFamily": "Consolas, Monaco",
|
||||
"CheckBoxBulletDecoratorSize": "14",
|
||||
"CheckBoxMargin": "15,0,0,2",
|
||||
@ -27,7 +27,7 @@
|
||||
"ButtonFontFamily": "Arial",
|
||||
"ButtonWidth": "200",
|
||||
"ButtonHeight": "25",
|
||||
"ConfigTabButtonFontSize": "16",
|
||||
"ConfigUpdateButtonFontSize": "14",
|
||||
"SearchBarWidth": "200",
|
||||
"SearchBarHeight": "26",
|
||||
"SearchBarTextBoxFontSize": "12",
|
||||
@ -44,7 +44,7 @@
|
||||
"MainForegroundColor": "#232629",
|
||||
"MainBackgroundColor": "#F7F7F7",
|
||||
"LabelBackgroundColor": "#F7F7F7",
|
||||
"LinkForegroundColor": "#232629",
|
||||
"LinkForegroundColor": "#484848",
|
||||
"LinkHoverForegroundColor": "#232629",
|
||||
"ScrollBarBackgroundColor": "#4A4D52",
|
||||
"ScrollBarHoverColor": "#5A5D62",
|
||||
|
@ -2320,17 +2320,10 @@
|
||||
"microsoft.windowscommunicationsapps",
|
||||
"Microsoft.WindowsFeedbackHub",
|
||||
"Microsoft.WindowsMaps",
|
||||
"Microsoft.YourPhone",
|
||||
"Microsoft.WindowsSoundRecorder",
|
||||
"Microsoft.XboxApp",
|
||||
"Microsoft.ConnectivityStore",
|
||||
"Microsoft.ScreenSketch",
|
||||
"Microsoft.Xbox.TCUI",
|
||||
"Microsoft.XboxGameOverlay",
|
||||
"Microsoft.XboxGameCallableUI",
|
||||
"Microsoft.XboxSpeechToTextOverlay",
|
||||
"Microsoft.MixedReality.Portal",
|
||||
"Microsoft.XboxIdentityProvider",
|
||||
"Microsoft.ZuneMusic",
|
||||
"Microsoft.ZuneVideo",
|
||||
"Microsoft.Getstarted",
|
||||
@ -3201,9 +3194,9 @@
|
||||
"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",
|
||||
"category": "z__Advanced Tweaks - CAUTION",
|
||||
"panel": "1",
|
||||
"Order": "a005_",
|
||||
"Order": "a023_",
|
||||
"registry": [
|
||||
{
|
||||
"Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Services\\Tcpip6\\Parameters",
|
||||
@ -3302,6 +3295,38 @@
|
||||
"panel": "2",
|
||||
"Order": "a100_",
|
||||
"Type": "Toggle",
|
||||
"registry": [
|
||||
{
|
||||
"Path": "HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize",
|
||||
"Name": "AppsUseLightTheme",
|
||||
"Value": "0",
|
||||
"OriginalValue": "1",
|
||||
"Type": "DWord"
|
||||
},
|
||||
{
|
||||
"Path": "HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize",
|
||||
"Name": "SystemUsesLightTheme",
|
||||
"Value": "0",
|
||||
"OriginalValue": "1",
|
||||
"Type": "DWord"
|
||||
}
|
||||
],
|
||||
"InvokeScript": [
|
||||
"
|
||||
Invoke-WinUtilExplorerUpdate
|
||||
if ($sync.ThemeButton.Content -eq [char]0xF08C) {
|
||||
Invoke-WinutilThemeChange -theme \"Auto\"
|
||||
}
|
||||
"
|
||||
],
|
||||
"UndoScript": [
|
||||
"
|
||||
Invoke-WinUtilExplorerUpdate
|
||||
if ($sync.ThemeButton.Content -eq [char]0xF08C) {
|
||||
Invoke-WinutilThemeChange -theme \"Auto\"
|
||||
}
|
||||
"
|
||||
],
|
||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/DarkMode"
|
||||
},
|
||||
"WPFToggleBingSearch": {
|
||||
@ -3311,6 +3336,15 @@
|
||||
"panel": "2",
|
||||
"Order": "a101_",
|
||||
"Type": "Toggle",
|
||||
"registry": [
|
||||
{
|
||||
"Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Search",
|
||||
"Name": "BingSearchEnabled",
|
||||
"Value": "1",
|
||||
"OriginalValue": "0",
|
||||
"Type": "DWord"
|
||||
}
|
||||
],
|
||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/BingSearch"
|
||||
},
|
||||
"WPFToggleNumLock": {
|
||||
@ -3320,6 +3354,22 @@
|
||||
"panel": "2",
|
||||
"Order": "a102_",
|
||||
"Type": "Toggle",
|
||||
"registry": [
|
||||
{
|
||||
"Path": "HKU:\\.Default\\Control Panel\\Keyboard",
|
||||
"Name": "InitialKeyboardIndicators",
|
||||
"Value": "2",
|
||||
"OriginalValue": "0",
|
||||
"Type": "DWord"
|
||||
},
|
||||
{
|
||||
"Path": "HKCU:\\Control Panel\\Keyboard",
|
||||
"Name": "InitialKeyboardIndicators",
|
||||
"Value": "2",
|
||||
"OriginalValue": "0",
|
||||
"Type": "DWord"
|
||||
}
|
||||
],
|
||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/NumLock"
|
||||
},
|
||||
"WPFToggleVerboseLogon": {
|
||||
@ -3329,6 +3379,15 @@
|
||||
"panel": "2",
|
||||
"Order": "a103_",
|
||||
"Type": "Toggle",
|
||||
"registry": [
|
||||
{
|
||||
"Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System",
|
||||
"Name": "VerboseStatus",
|
||||
"Value": "1",
|
||||
"OriginalValue": "0",
|
||||
"Type": "DWord"
|
||||
}
|
||||
],
|
||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/VerboseLogon"
|
||||
},
|
||||
"WPFToggleSnapWindow": {
|
||||
@ -3338,6 +3397,15 @@
|
||||
"panel": "2",
|
||||
"Order": "a104_",
|
||||
"Type": "Toggle",
|
||||
"registry": [
|
||||
{
|
||||
"Path": "HKCU:\\Control Panel\\Desktop",
|
||||
"Name": "WindowArrangementActive",
|
||||
"Value": "1",
|
||||
"OriginalValue": "0",
|
||||
"Type": "String"
|
||||
}
|
||||
],
|
||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/SnapWindow"
|
||||
},
|
||||
"WPFToggleSnapFlyout": {
|
||||
@ -3347,6 +3415,25 @@
|
||||
"panel": "2",
|
||||
"Order": "a105_",
|
||||
"Type": "Toggle",
|
||||
"registry": [
|
||||
{
|
||||
"Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
|
||||
"Name": "EnableSnapAssistFlyout",
|
||||
"Value": "1",
|
||||
"OriginalValue": "0",
|
||||
"Type": "DWord"
|
||||
}
|
||||
],
|
||||
"InvokeScript": [
|
||||
"
|
||||
Invoke-WinUtilExplorerUpdate -action \"restart\"
|
||||
"
|
||||
],
|
||||
"UndoScript": [
|
||||
"
|
||||
Invoke-WinUtilExplorerUpdate -action \"restart\"
|
||||
"
|
||||
],
|
||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/SnapFlyout"
|
||||
},
|
||||
"WPFToggleSnapSuggestion": {
|
||||
@ -3356,6 +3443,25 @@
|
||||
"panel": "2",
|
||||
"Order": "a106_",
|
||||
"Type": "Toggle",
|
||||
"registry": [
|
||||
{
|
||||
"Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
|
||||
"Name": "SnapAssist",
|
||||
"Value": "1",
|
||||
"OriginalValue": "0",
|
||||
"Type": "DWord"
|
||||
}
|
||||
],
|
||||
"InvokeScript": [
|
||||
"
|
||||
Invoke-WinUtilExplorerUpdate -action \"restart\"
|
||||
"
|
||||
],
|
||||
"UndoScript": [
|
||||
"
|
||||
Invoke-WinUtilExplorerUpdate -action \"restart\"
|
||||
"
|
||||
],
|
||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/SnapSuggestion"
|
||||
},
|
||||
"WPFToggleMouseAcceleration": {
|
||||
@ -3365,6 +3471,29 @@
|
||||
"panel": "2",
|
||||
"Order": "a107_",
|
||||
"Type": "Toggle",
|
||||
"registry": [
|
||||
{
|
||||
"Path": "HKCU:\\Control Panel\\Mouse",
|
||||
"Name": "MouseSpeed",
|
||||
"Value": "1",
|
||||
"OriginalValue": "0",
|
||||
"Type": "DWord"
|
||||
},
|
||||
{
|
||||
"Path": "HKCU:\\Control Panel\\Mouse",
|
||||
"Name": "MouseThreshold1",
|
||||
"Value": "6",
|
||||
"OriginalValue": "0",
|
||||
"Type": "DWord"
|
||||
},
|
||||
{
|
||||
"Path": "HKCU:\\Control Panel\\Mouse",
|
||||
"Name": "MouseThreshold2",
|
||||
"Value": "10",
|
||||
"OriginalValue": "0",
|
||||
"Type": "DWord"
|
||||
}
|
||||
],
|
||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/MouseAcceleration"
|
||||
},
|
||||
"WPFToggleStickyKeys": {
|
||||
@ -3374,6 +3503,15 @@
|
||||
"panel": "2",
|
||||
"Order": "a108_",
|
||||
"Type": "Toggle",
|
||||
"registry": [
|
||||
{
|
||||
"Path": "HKCU:\\Control Panel\\Accessibility\\StickyKeys",
|
||||
"Name": "Flags",
|
||||
"Value": "510",
|
||||
"OriginalValue": "58",
|
||||
"Type": "DWord"
|
||||
}
|
||||
],
|
||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/StickyKeys"
|
||||
},
|
||||
"WPFToggleHiddenFiles": {
|
||||
@ -3383,6 +3521,25 @@
|
||||
"panel": "2",
|
||||
"Order": "a200_",
|
||||
"Type": "Toggle",
|
||||
"registry": [
|
||||
{
|
||||
"Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
|
||||
"Name": "Hidden",
|
||||
"Value": "1",
|
||||
"OriginalValue": "0",
|
||||
"Type": "DWord"
|
||||
}
|
||||
],
|
||||
"InvokeScript": [
|
||||
"
|
||||
Invoke-WinUtilExplorerUpdate -action \"restart\"
|
||||
"
|
||||
],
|
||||
"UndoScript": [
|
||||
"
|
||||
Invoke-WinUtilExplorerUpdate -action \"restart\"
|
||||
"
|
||||
],
|
||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/HiddenFiles"
|
||||
},
|
||||
"WPFToggleShowExt": {
|
||||
@ -3392,6 +3549,25 @@
|
||||
"panel": "2",
|
||||
"Order": "a201_",
|
||||
"Type": "Toggle",
|
||||
"registry": [
|
||||
{
|
||||
"Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
|
||||
"Name": "HideFileExt",
|
||||
"Value": "0",
|
||||
"OriginalValue": "1",
|
||||
"Type": "DWord"
|
||||
}
|
||||
],
|
||||
"InvokeScript": [
|
||||
"
|
||||
Invoke-WinUtilExplorerUpdate -action \"restart\"
|
||||
"
|
||||
],
|
||||
"UndoScript": [
|
||||
"
|
||||
Invoke-WinUtilExplorerUpdate -action \"restart\"
|
||||
"
|
||||
],
|
||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/ShowExt"
|
||||
},
|
||||
"WPFToggleTaskbarSearch": {
|
||||
@ -3401,6 +3577,15 @@
|
||||
"panel": "2",
|
||||
"Order": "a202_",
|
||||
"Type": "Toggle",
|
||||
"registry": [
|
||||
{
|
||||
"Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Search",
|
||||
"Name": "SearchboxTaskbarMode",
|
||||
"Value": "1",
|
||||
"OriginalValue": "0",
|
||||
"Type": "DWord"
|
||||
}
|
||||
],
|
||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/TaskbarSearch"
|
||||
},
|
||||
"WPFToggleTaskView": {
|
||||
@ -3410,6 +3595,15 @@
|
||||
"panel": "2",
|
||||
"Order": "a203_",
|
||||
"Type": "Toggle",
|
||||
"registry": [
|
||||
{
|
||||
"Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
|
||||
"Name": "ShowTaskViewButton",
|
||||
"Value": "1",
|
||||
"OriginalValue": "0",
|
||||
"Type": "DWord"
|
||||
}
|
||||
],
|
||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/TaskView"
|
||||
},
|
||||
"WPFToggleTaskbarWidgets": {
|
||||
@ -3419,6 +3613,15 @@
|
||||
"panel": "2",
|
||||
"Order": "a204_",
|
||||
"Type": "Toggle",
|
||||
"registry": [
|
||||
{
|
||||
"Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
|
||||
"Name": "TaskbarDa",
|
||||
"Value": "1",
|
||||
"OriginalValue": "0",
|
||||
"Type": "DWord"
|
||||
}
|
||||
],
|
||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/TaskbarWidgets"
|
||||
},
|
||||
"WPFToggleTaskbarAlignment": {
|
||||
@ -3428,6 +3631,15 @@
|
||||
"panel": "2",
|
||||
"Order": "a204_",
|
||||
"Type": "Toggle",
|
||||
"registry": [
|
||||
{
|
||||
"Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
|
||||
"Name": "TaskbarAl",
|
||||
"Value": "1",
|
||||
"OriginalValue": "0",
|
||||
"Type": "DWord"
|
||||
}
|
||||
],
|
||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/TaskbarAlignment"
|
||||
},
|
||||
"WPFToggleDetailedBSoD": {
|
||||
@ -3437,6 +3649,22 @@
|
||||
"panel": "2",
|
||||
"Order": "a205_",
|
||||
"Type": "Toggle",
|
||||
"registry": [
|
||||
{
|
||||
"Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\CrashControl",
|
||||
"Name": "DisplayParameters",
|
||||
"Value": "1",
|
||||
"OriginalValue": "0",
|
||||
"Type": "DWord"
|
||||
},
|
||||
{
|
||||
"Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\CrashControl",
|
||||
"Name": "DisableEmoticon",
|
||||
"Value": "1",
|
||||
"OriginalValue": "0",
|
||||
"Type": "DWord"
|
||||
}
|
||||
],
|
||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/DetailedBSoD"
|
||||
},
|
||||
"WPFOOSUbutton": {
|
||||
|
@ -13,75 +13,48 @@ Function Get-WinUtilToggleStatus {
|
||||
#>
|
||||
|
||||
Param($ToggleSwitch)
|
||||
if($ToggleSwitch -eq "WPFToggleDarkMode") {
|
||||
$app = (Get-ItemProperty -path 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize').AppsUseLightTheme
|
||||
$system = (Get-ItemProperty -path 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize').SystemUsesLightTheme
|
||||
return $app -eq 0 -and $system -eq 0
|
||||
}
|
||||
if($ToggleSwitch -eq "WPFToggleBingSearch") {
|
||||
$bingsearch = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Search').BingSearchEnabled
|
||||
return $bingsearch -ne 0
|
||||
}
|
||||
if($ToggleSwitch -eq "WPFToggleNumLock") {
|
||||
$numlockvalue = (Get-ItemProperty -path 'HKCU:\Control Panel\Keyboard').InitialKeyboardIndicators
|
||||
return $numlockvalue -eq 2
|
||||
}
|
||||
if($ToggleSwitch -eq "WPFToggleVerboseLogon") {
|
||||
$VerboseStatusvalue = (Get-ItemProperty -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System').VerboseStatus
|
||||
return $VerboseStatusvalue -eq 1
|
||||
}
|
||||
if($ToggleSwitch -eq "WPFToggleShowExt") {
|
||||
$hideextvalue = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced').HideFileExt
|
||||
return $hideextvalue -eq 0
|
||||
}
|
||||
if($ToggleSwitch -eq "WPFToggleSnapWindow") {
|
||||
$hidesnap = (Get-ItemProperty -path 'HKCU:\Control Panel\Desktop').WindowArrangementActive
|
||||
return $hidesnap -ne 0
|
||||
}
|
||||
if($ToggleSwitch -eq "WPFToggleSnapFlyout") {
|
||||
$hidesnap = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced').EnableSnapAssistFlyout
|
||||
return $hidesnap -ne 0
|
||||
}
|
||||
if($ToggleSwitch -eq "WPFToggleSnapSuggestion") {
|
||||
$hidesnap = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced').SnapAssist
|
||||
return $hidesnap -ne 0
|
||||
}
|
||||
if($ToggleSwitch -eq "WPFToggleMouseAcceleration") {
|
||||
$MouseSpeed = (Get-ItemProperty -path 'HKCU:\Control Panel\Mouse').MouseSpeed
|
||||
$MouseThreshold1 = (Get-ItemProperty -path 'HKCU:\Control Panel\Mouse').MouseThreshold1
|
||||
$MouseThreshold2 = (Get-ItemProperty -path 'HKCU:\Control Panel\Mouse').MouseThreshold2
|
||||
|
||||
return $MouseSpeed -eq 1 -and $MouseThreshold1 -eq 6 -and $MouseThreshold2 -eq 10
|
||||
}
|
||||
if($ToggleSwitch -eq "WPFToggleTaskbarSearch") {
|
||||
$SearchButton = (Get-ItemProperty -path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search").SearchboxTaskbarMode
|
||||
return $SearchButton -ne 0
|
||||
}
|
||||
if ($ToggleSwitch -eq "WPFToggleStickyKeys") {
|
||||
$StickyKeys = (Get-ItemProperty -path 'HKCU:\Control Panel\Accessibility\StickyKeys').Flags
|
||||
return $StickyKeys -ne 58
|
||||
}
|
||||
if ($ToggleSwitch -eq "WPFToggleTaskView") {
|
||||
$TaskView = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced').ShowTaskViewButton
|
||||
return $TaskView -ne 0
|
||||
$ToggleSwitchReg = $sync.configs.tweaks.$ToggleSwitch.registry
|
||||
|
||||
try {
|
||||
if (($ToggleSwitchReg.path -imatch "hku") -and !(Get-PSDrive -Name HKU -ErrorAction SilentlyContinue)) {
|
||||
$null = (New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS)
|
||||
if (Get-PSDrive -Name HKU -ErrorAction SilentlyContinue) {
|
||||
Write-Debug "HKU drive created successfully"
|
||||
} else {
|
||||
Write-Debug "Failed to create HKU drive"
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
Write-Error "An error occurred regarding the HKU Drive: $_"
|
||||
return $false
|
||||
}
|
||||
|
||||
if ($ToggleSwitch -eq "WPFToggleHiddenFiles") {
|
||||
$HiddenFiles = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced').Hidden
|
||||
return $HiddenFiles -ne 0
|
||||
}
|
||||
if ($ToggleSwitchReg) {
|
||||
$count = 0
|
||||
|
||||
if ($ToggleSwitch -eq "WPFToggleTaskbarWidgets") {
|
||||
$TaskbarWidgets = (Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced").TaskBarDa
|
||||
return $TaskbarWidgets -ne 0
|
||||
}
|
||||
if ($ToggleSwitch -eq "WPFToggleTaskbarAlignment") {
|
||||
$TaskbarAlignment = (Get-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced").TaskbarAl
|
||||
return $TaskbarAlignment -ne 0
|
||||
}
|
||||
if ($ToggleSwitch -eq "WPFToggleDetailedBSoD") {
|
||||
$DetailedBSoD1 = (Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl').DisplayParameters
|
||||
$DetailedBSoD2 = (Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl').DisableEmoticon
|
||||
return !(($DetailedBSoD1 -eq 0) -or ($DetailedBSoD2 -eq 0) -or !$DetailedBSoD1 -or !$DetailedBSoD2)
|
||||
foreach ($regentry in $ToggleSwitchReg) {
|
||||
try {
|
||||
$regstate = (Get-ItemProperty -path $regentry.Path).$($regentry.Name)
|
||||
if ($regstate -eq $regentry.Value) {
|
||||
$count += 1
|
||||
Write-Debug "$($regentry.Name) is true (state: $regstate, value: $($regentry.Value), original: $($regentry.OriginalValue))"
|
||||
} else {
|
||||
Write-Debug "$($regentry.Name) is false (state: $regstate, value: $($regentry.Value), original: $($regentry.OriginalValue))"
|
||||
}
|
||||
} catch {
|
||||
Write-Error "An error occurred while accessing registry entry $($regentry.Path): $_"
|
||||
}
|
||||
}
|
||||
|
||||
if ($count -eq $ToggleSwitchReg.Count) {
|
||||
Write-Debug "$($ToggleSwitchReg.Name) is true (count: $count)"
|
||||
return $true
|
||||
} else {
|
||||
Write-Debug "$($ToggleSwitchReg.Name) is false (count: $count)"
|
||||
return $false
|
||||
}
|
||||
} else {
|
||||
return $false
|
||||
}
|
||||
}
|
||||
|
@ -1,26 +1,104 @@
|
||||
function Get-WinUtilWingetLatest {
|
||||
[CmdletBinding()]
|
||||
param()
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Uses GitHub API to check for the latest release of Winget.
|
||||
.DESCRIPTION
|
||||
This function grabs the latest version of Winget and returns the download path to Install-WinUtilWinget for installation.
|
||||
This function first attempts to update WinGet using winget itself, then falls back to manual installation if needed.
|
||||
#>
|
||||
# Invoke-WebRequest is notoriously slow when the byte progress is displayed. The following lines disable the progress bar and reset them at the end of the function
|
||||
$PreviousProgressPreference = $ProgressPreference
|
||||
$ProgressPreference = "silentlyContinue"
|
||||
$ProgressPreference = "SilentlyContinue"
|
||||
$InformationPreference = 'Continue'
|
||||
|
||||
try {
|
||||
# Grabs the latest release of Winget from the Github API for the install process.
|
||||
$response = Invoke-RestMethod -Uri "https://api.github.com/repos/microsoft/Winget-cli/releases/latest" -Method Get -ErrorAction Stop
|
||||
$latestVersion = $response.tag_name #Stores version number of latest release.
|
||||
$licenseWingetUrl = $response.assets.browser_download_url | Where-Object {$_ -like "*License1.xml"} #Index value for License file.
|
||||
Write-Host "Latest Version:`t$($latestVersion)`n"
|
||||
Write-Host "Downloading..."
|
||||
$assetUrl = $response.assets.browser_download_url | Where-Object {$_ -like "*Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"}
|
||||
Invoke-WebRequest -Uri $licenseWingetUrl -OutFile $ENV:TEMP\License1.xml
|
||||
# The only pain is that the msixbundle for winget-cli is 246MB. In some situations this can take a bit, with slower connections.
|
||||
Invoke-WebRequest -Uri $assetUrl -OutFile $ENV:TEMP\Microsoft.DesktopAppInstaller.msixbundle
|
||||
} catch {
|
||||
throw [WingetFailedInstall]::new('Failed to get latest Winget release and license')
|
||||
$wingetCmd = Get-Command winget -ErrorAction Stop
|
||||
Write-Information "Attempting to update WinGet using WinGet..."
|
||||
$result = Start-Process -FilePath "`"$($wingetCmd.Source)`"" -ArgumentList "install -e --accept-source-agreements --accept-package-agreements Microsoft.AppInstaller" -Wait -NoNewWindow -PassThru
|
||||
if ($result.ExitCode -ne 0) {
|
||||
throw "WinGet update failed with exit code: $($result.ExitCode)"
|
||||
}
|
||||
return $true
|
||||
}
|
||||
catch {
|
||||
Write-Information "WinGet not found or update failed. Attempting to install from Microsoft Store..."
|
||||
try {
|
||||
# Try to close any running WinGet processes
|
||||
Get-Process -Name "DesktopAppInstaller", "winget" -ErrorAction SilentlyContinue | ForEach-Object {
|
||||
Write-Information "Stopping running WinGet process..."
|
||||
$_.Kill()
|
||||
Start-Sleep -Seconds 2
|
||||
}
|
||||
|
||||
# Try to load Windows Runtime assemblies more reliably
|
||||
$null = [System.Runtime.WindowsRuntime.WindowsRuntimeSystemExtensions]
|
||||
Add-Type -AssemblyName System.Runtime.WindowsRuntime
|
||||
|
||||
# Load required assemblies from Windows SDK
|
||||
$null = @(
|
||||
[Windows.Management.Deployment.PackageManager, Windows.Management.Deployment, ContentType = WindowsRuntime]
|
||||
[Windows.Foundation.Uri, Windows.Foundation, ContentType = WindowsRuntime]
|
||||
[Windows.Management.Deployment.DeploymentOptions, Windows.Management.Deployment, ContentType = WindowsRuntime]
|
||||
)
|
||||
|
||||
# Initialize PackageManager
|
||||
$packageManager = New-Object Windows.Management.Deployment.PackageManager
|
||||
|
||||
# Rest of the Microsoft Store installation logic
|
||||
$appxPackage = "https://aka.ms/getwinget"
|
||||
$uri = New-Object Windows.Foundation.Uri($appxPackage)
|
||||
$deploymentOperation = $packageManager.AddPackageAsync($uri, $null, "Add")
|
||||
|
||||
# Add timeout check for deployment operation
|
||||
$timeout = 300
|
||||
$timer = [System.Diagnostics.Stopwatch]::StartNew()
|
||||
|
||||
while ($deploymentOperation.Status -eq 0) {
|
||||
if ($timer.Elapsed.TotalSeconds -gt $timeout) {
|
||||
throw "Installation timed out after $timeout seconds"
|
||||
}
|
||||
Start-Sleep -Milliseconds 100
|
||||
}
|
||||
|
||||
if ($deploymentOperation.Status -eq 1) {
|
||||
Write-Information "Successfully installed WinGet from Microsoft Store"
|
||||
return $true
|
||||
} else {
|
||||
throw "Installation failed with status: $($deploymentOperation.Status)"
|
||||
}
|
||||
}
|
||||
catch [System.Management.Automation.RuntimeException] {
|
||||
Write-Information "Windows Runtime components not available. Attempting manual download..."
|
||||
try {
|
||||
# Try to close any running WinGet processes
|
||||
Get-Process -Name "DesktopAppInstaller", "winget" -ErrorAction SilentlyContinue | ForEach-Object {
|
||||
Write-Information "Stopping running WinGet process..."
|
||||
$_.Kill()
|
||||
Start-Sleep -Seconds 2
|
||||
}
|
||||
|
||||
# Fallback to direct download from GitHub
|
||||
$apiUrl = "https://api.github.com/repos/microsoft/winget-cli/releases/latest"
|
||||
$release = Invoke-RestMethod -Uri $apiUrl
|
||||
$msixBundleUrl = ($release.assets | Where-Object { $_.name -like "*.msixbundle" }).browser_download_url
|
||||
|
||||
$tempFile = Join-Path $env:TEMP "Microsoft.DesktopAppInstaller.msixbundle"
|
||||
Invoke-WebRequest -Uri $msixBundleUrl -OutFile $tempFile
|
||||
|
||||
Add-AppxPackage -Path $tempFile -ErrorAction Stop
|
||||
Remove-Item $tempFile -Force
|
||||
|
||||
Write-Information "Successfully installed WinGet from GitHub release"
|
||||
return $true
|
||||
}
|
||||
catch {
|
||||
Write-Error "Failed to install WinGet: $_"
|
||||
return $false
|
||||
}
|
||||
}
|
||||
catch {
|
||||
Write-Error "Failed to install WinGet: $_"
|
||||
return $false
|
||||
}
|
||||
}
|
||||
$ProgressPreference = $PreviousProgressPreference
|
||||
}
|
||||
|
@ -1,28 +0,0 @@
|
||||
function Get-WinUtilWingetPrerequisites {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Downloads the Winget Prereqs.
|
||||
.DESCRIPTION
|
||||
Downloads Prereqs for Winget. Version numbers are coded as variables and can be updated as uncommonly as Microsoft updates the prereqs.
|
||||
#>
|
||||
|
||||
# I don't know of a way to detect the prereqs automatically, so if someone has a better way of defining these, that would be great.
|
||||
# Microsoft.VCLibs version rarely changes, but for future compatibility I made it a variable.
|
||||
$versionVCLibs = "14.00"
|
||||
$fileVCLibs = "https://aka.ms/Microsoft.VCLibs.x64.${versionVCLibs}.Desktop.appx"
|
||||
# Write-Host "$fileVCLibs"
|
||||
# Microsoft.UI.Xaml version changed recently, so I made the version numbers variables.
|
||||
$versionUIXamlMinor = "2.8"
|
||||
$versionUIXamlPatch = "2.8.6"
|
||||
$fileUIXaml = "https://github.com/microsoft/microsoft-ui-xaml/releases/download/v${versionUIXamlPatch}/Microsoft.UI.Xaml.${versionUIXamlMinor}.x64.appx"
|
||||
# Write-Host "$fileUIXaml"
|
||||
|
||||
try {
|
||||
Write-Host "Downloading Microsoft.VCLibs Dependency..."
|
||||
Invoke-WebRequest -Uri $fileVCLibs -OutFile $ENV:TEMP\Microsoft.VCLibs.x64.Desktop.appx
|
||||
Write-Host "Downloading Microsoft.UI.Xaml Dependency...`n"
|
||||
Invoke-WebRequest -Uri $fileUIXaml -OutFile $ENV:TEMP\Microsoft.UI.Xaml.x64.appx
|
||||
} catch {
|
||||
throw [WingetFailedInstall]::new('Failed to install prerequsites')
|
||||
}
|
||||
}
|
@ -35,15 +35,8 @@ function Install-WinUtilWinget {
|
||||
|
||||
# Install Winget via GitHub method.
|
||||
# Used part of my own script with some modification: ruxunderscore/windows-initialization
|
||||
Write-Host "Downloading Winget Prerequsites`n"
|
||||
Get-WinUtilWingetPrerequisites
|
||||
Write-Host "Downloading Winget and License File`r"
|
||||
Get-WinUtilWingetLatest
|
||||
Write-Host "Installing Winget w/ Prerequsites`r"
|
||||
Add-AppxProvisionedPackage -Online -PackagePath $ENV:TEMP\Microsoft.DesktopAppInstaller.msixbundle -DependencyPackagePath $ENV:TEMP\Microsoft.VCLibs.x64.Desktop.appx, $ENV:TEMP\Microsoft.UI.Xaml.x64.appx -LicensePath $ENV:TEMP\License1.xml
|
||||
Write-Host "Manually adding Winget Sources, from Winget CDN."
|
||||
Add-AppxPackage -Path https://cdn.winget.microsoft.com/cache/source.msix #Seems some installs of Winget don't add the repo source, this should makes sure that it's installed every time.
|
||||
Write-Host "Winget Installed" -ForegroundColor Green
|
||||
Write-Host "Enabling NuGet and Module..."
|
||||
Install-PackageProvider -Name NuGet -Force
|
||||
Install-Module -Name Microsoft.WinGet.Client -Force
|
||||
@ -51,18 +44,7 @@ function Install-WinUtilWinget {
|
||||
Write-Output "Refreshing Environment Variables...`n"
|
||||
$ENV:PATH = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
|
||||
} catch {
|
||||
Write-Host "Failure detected while installing via GitHub method. Continuing with Chocolatey method as fallback." -ForegroundColor Red
|
||||
# In case install fails via GitHub method.
|
||||
try {
|
||||
# Install Choco if not already present
|
||||
Install-WinUtilChoco
|
||||
Start-Process -Verb runas -FilePath powershell.exe -ArgumentList "choco install winget-cli"
|
||||
Write-Host "Winget Installed" -ForegroundColor Green
|
||||
Write-Output "Refreshing Environment Variables...`n"
|
||||
$ENV:PATH = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
|
||||
} catch {
|
||||
throw [WingetFailedInstall]::new('Failed to install!')
|
||||
}
|
||||
Write-Error "Failed to install Winget: $($_.Exception.Message)"
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,30 +0,0 @@
|
||||
function Invoke-WinUtilBingSearch {
|
||||
<#
|
||||
|
||||
.SYNOPSIS
|
||||
Disables/Enables Bing Search
|
||||
|
||||
.PARAMETER Enabled
|
||||
Indicates whether to enable or disable Bing Search
|
||||
|
||||
#>
|
||||
Param($Enabled)
|
||||
try {
|
||||
if ($Enabled -eq $false) {
|
||||
Write-Host "Enabling Bing Search"
|
||||
$value = 1
|
||||
} else {
|
||||
Write-Host "Disabling Bing Search"
|
||||
$value = 0
|
||||
}
|
||||
$Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search"
|
||||
Set-ItemProperty -Path $Path -Name BingSearchEnabled -Value $value
|
||||
} catch [System.Security.SecurityException] {
|
||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
||||
} catch [System.Management.Automation.ItemNotFoundException] {
|
||||
Write-Warning $psitem.Exception.ErrorRecord
|
||||
} catch {
|
||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
||||
Write-Warning $psitem.Exception.StackTrace
|
||||
}
|
||||
}
|
@ -43,7 +43,7 @@ Function Invoke-WinUtilCurrentSystem {
|
||||
|
||||
if($CheckBox -eq "tweaks") {
|
||||
|
||||
if(!(Test-Path 'HKU:\')) {New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS}
|
||||
if(!(Test-Path 'HKU:\')) {$null = (New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS)}
|
||||
$ScheduledTasks = Get-ScheduledTask
|
||||
|
||||
$sync.configs.tweaks | Get-Member -MemberType NoteProperty | ForEach-Object {
|
||||
|
@ -1,37 +0,0 @@
|
||||
Function Invoke-WinUtilDarkMode {
|
||||
<#
|
||||
|
||||
.SYNOPSIS
|
||||
Enables/Disables Dark Mode
|
||||
|
||||
.PARAMETER DarkMoveEnabled
|
||||
Indicates the current dark mode state
|
||||
|
||||
#>
|
||||
Param($DarkMoveEnabled)
|
||||
try {
|
||||
if ($DarkMoveEnabled -eq $false) {
|
||||
Write-Host "Enabling Dark Mode"
|
||||
$DarkMoveValue = 0
|
||||
} else {
|
||||
Write-Host "Disabling Dark Mode"
|
||||
$DarkMoveValue = 1
|
||||
}
|
||||
|
||||
$Path = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize"
|
||||
Set-ItemProperty -Path $Path -Name AppsUseLightTheme -Value $DarkMoveValue
|
||||
Set-ItemProperty -Path $Path -Name SystemUsesLightTheme -Value $DarkMoveValue
|
||||
Invoke-WinUtilExplorerRefresh
|
||||
# Update Winutil Theme if the Theme Button shows the Icon for Auto
|
||||
if ($sync.ThemeButton.Content -eq [char]0xF08C) {
|
||||
Invoke-WinutilThemeChange -theme "Auto"
|
||||
}
|
||||
} catch [System.Security.SecurityException] {
|
||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
||||
} catch [System.Management.Automation.ItemNotFoundException] {
|
||||
Write-Warning $psitem.Exception.ErrorRecord
|
||||
} catch {
|
||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
||||
Write-Warning $psitem.Exception.StackTrace
|
||||
}
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
Function Invoke-WinUtilDetailedBSoD {
|
||||
<#
|
||||
|
||||
.SYNOPSIS
|
||||
Enables/Disables Detailed BSoD
|
||||
(Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl' -Name 'DisplayParameters').DisplayParameters
|
||||
|
||||
|
||||
#>
|
||||
Param($Enabled)
|
||||
try {
|
||||
if ($Enabled -eq $false) {
|
||||
Write-Host "Enabling Detailed BSoD"
|
||||
$value = 1
|
||||
} else {
|
||||
Write-Host "Disabling Detailed BSoD"
|
||||
$value =0
|
||||
}
|
||||
|
||||
$Path = "HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl"
|
||||
$dwords = ("DisplayParameters", "DisableEmoticon")
|
||||
foreach ($name in $dwords) {
|
||||
Set-ItemProperty -Path $Path -Name $name -Value $value
|
||||
}
|
||||
Set-ItemProperty -Path $Path -Name DisplayParameters -Value $value
|
||||
} catch [System.Security.SecurityException] {
|
||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
||||
} catch [System.Management.Automation.ItemNotFoundException] {
|
||||
Write-Warning $psitem.Exception.ErrorRecord
|
||||
} catch {
|
||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
||||
Write-Warning $psitem.Exception.StackTrace
|
||||
}
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
function Invoke-WinUtilExplorerRefresh {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Refreshes the Windows Explorer
|
||||
#>
|
||||
|
||||
Invoke-WPFRunspace -DebugPreference $DebugPreference -ScriptBlock {
|
||||
# Send the WM_SETTINGCHANGE message to all windows
|
||||
Add-Type -TypeDefinition @"
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
public class Win32 {
|
||||
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)]
|
||||
public static extern IntPtr SendMessageTimeout(
|
||||
IntPtr hWnd,
|
||||
uint Msg,
|
||||
IntPtr wParam,
|
||||
string lParam,
|
||||
uint fuFlags,
|
||||
uint uTimeout,
|
||||
out IntPtr lpdwResult);
|
||||
}
|
||||
"@
|
||||
|
||||
$HWND_BROADCAST = [IntPtr]0xffff
|
||||
$WM_SETTINGCHANGE = 0x1A
|
||||
$SMTO_ABORTIFHUNG = 0x2
|
||||
$timeout = 100
|
||||
|
||||
# Send the broadcast message to all windows
|
||||
[Win32]::SendMessageTimeout($HWND_BROADCAST, $WM_SETTINGCHANGE, [IntPtr]::Zero, "ImmersiveColorSet", $SMTO_ABORTIFHUNG, $timeout, [ref]([IntPtr]::Zero))
|
||||
}
|
||||
}
|
43
functions/private/Invoke-WinUtilExplorerUpdate.ps1
Normal file
43
functions/private/Invoke-WinUtilExplorerUpdate.ps1
Normal file
@ -0,0 +1,43 @@
|
||||
function Invoke-WinUtilExplorerUpdate {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Refreshes the Windows Explorer
|
||||
#>
|
||||
|
||||
param (
|
||||
[string]$action = "refresh"
|
||||
)
|
||||
|
||||
if ($action -eq "refresh") {
|
||||
Invoke-WPFRunspace -DebugPreference $DebugPreference -ScriptBlock {
|
||||
# Send the WM_SETTINGCHANGE message to all windows
|
||||
Add-Type -TypeDefinition @"
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
public class Win32 {
|
||||
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)]
|
||||
public static extern IntPtr SendMessageTimeout(
|
||||
IntPtr hWnd,
|
||||
uint Msg,
|
||||
IntPtr wParam,
|
||||
string lParam,
|
||||
uint fuFlags,
|
||||
uint uTimeout,
|
||||
out IntPtr lpdwResult);
|
||||
}
|
||||
"@
|
||||
|
||||
$HWND_BROADCAST = [IntPtr]0xffff
|
||||
$WM_SETTINGCHANGE = 0x1A
|
||||
$SMTO_ABORTIFHUNG = 0x2
|
||||
$timeout = 100
|
||||
|
||||
# Send the broadcast message to all windows
|
||||
[Win32]::SendMessageTimeout($HWND_BROADCAST, $WM_SETTINGCHANGE, [IntPtr]::Zero, "ImmersiveColorSet", $SMTO_ABORTIFHUNG, $timeout, [ref]([IntPtr]::Zero))
|
||||
}
|
||||
} elseif ($action -eq "restart") {
|
||||
# Restart the Windows Explorer
|
||||
taskkill.exe /F /IM "explorer.exe"
|
||||
Start-Process "explorer.exe"
|
||||
}
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
function Invoke-WinUtilHiddenFiles {
|
||||
<#
|
||||
|
||||
.SYNOPSIS
|
||||
Enable/Disable Hidden Files
|
||||
|
||||
.PARAMETER Enabled
|
||||
Indicates whether to enable or disable Hidden Files
|
||||
|
||||
#>
|
||||
Param($Enabled)
|
||||
try {
|
||||
if ($Enabled -eq $false) {
|
||||
Write-Host "Enabling Hidden Files"
|
||||
$value = 1
|
||||
} else {
|
||||
Write-Host "Disabling Hidden Files"
|
||||
$value = 0
|
||||
}
|
||||
$Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
|
||||
Set-ItemProperty -Path $Path -Name Hidden -Value $value
|
||||
} catch [System.Security.SecurityException] {
|
||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
||||
} catch [System.Management.Automation.ItemNotFoundException] {
|
||||
Write-Warning $psitem.Exception.ErrorRecord
|
||||
} catch {
|
||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
||||
Write-Warning $psitem.Exception.StackTrace
|
||||
}
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
Function Invoke-WinUtilMouseAcceleration {
|
||||
<#
|
||||
|
||||
.SYNOPSIS
|
||||
Enables/Disables Mouse Acceleration
|
||||
|
||||
.PARAMETER DarkMoveEnabled
|
||||
Indicates the current Mouse Acceleration State
|
||||
|
||||
#>
|
||||
Param($MouseAccelerationEnabled)
|
||||
try {
|
||||
if ($MouseAccelerationEnabled -eq $false) {
|
||||
Write-Host "Enabling Mouse Acceleration"
|
||||
$MouseSpeed = 1
|
||||
$MouseThreshold1 = 6
|
||||
$MouseThreshold2 = 10
|
||||
} else {
|
||||
Write-Host "Disabling Mouse Acceleration"
|
||||
$MouseSpeed = 0
|
||||
$MouseThreshold1 = 0
|
||||
$MouseThreshold2 = 0
|
||||
|
||||
}
|
||||
|
||||
$Path = "HKCU:\Control Panel\Mouse"
|
||||
Set-ItemProperty -Path $Path -Name MouseSpeed -Value $MouseSpeed
|
||||
Set-ItemProperty -Path $Path -Name MouseThreshold1 -Value $MouseThreshold1
|
||||
Set-ItemProperty -Path $Path -Name MouseThreshold2 -Value $MouseThreshold2
|
||||
} catch [System.Security.SecurityException] {
|
||||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
||||
} catch [System.Management.Automation.ItemNotFoundException] {
|
||||
Write-Warning $psitem.Exception.ErrorRecord
|
||||
} catch {
|
||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
||||
Write-Warning $psitem.Exception.StackTrace
|
||||
}
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
|