diff --git a/.github/workflows/close-discussion.yml b/.github/workflows/close-discussion.yml index de919c13..b0209efb 100644 --- a/.github/workflows/close-discussion.yml +++ b/.github/workflows/close-discussion.yml @@ -14,7 +14,7 @@ jobs: - name: Check if PR was merged if: github.event.pull_request.merged == true run: echo "PR was merged" - + - name: Extract Discussion Number & Close If any Were Found env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -23,7 +23,7 @@ jobs: run: | pr_body="${{ github.event.pull_request.body }}" discussion_ids=$(echo "$pr_body" | grep -oP '(?i)(resolve|fix|close)[s|d]? #\K[0-9]+') - + if [ -z "$discussion_ids" ]; then echo "No discussion IDs found." exit 0 @@ -34,7 +34,7 @@ jobs: response=$(curl -s -o /dev/null -w "%{http_code}" -X PATCH -H "Authorization: token $GITHUB_TOKEN" \ -d '{"state": "closed"}' \ "https://api.github.com/repos/${{ github.repository }}/discussions/$discussion_id") - + if [ "$response" -ne 200 ]; then echo "Failed to close discussion #$discussion_id. HTTP status code: $response" exit 1 diff --git a/.github/workflows/compile.yaml b/.github/workflows/compile.yaml index 5eb73b58..5e68042a 100644 --- a/.github/workflows/compile.yaml +++ b/.github/workflows/compile.yaml @@ -45,4 +45,4 @@ jobs: - uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: Compile Winutil - if: success() \ No newline at end of file + if: success() diff --git a/.github/workflows/createchangelog.yml b/.github/workflows/createchangelog.yml index 8cf058bc..65028a43 100644 --- a/.github/workflows/createchangelog.yml +++ b/.github/workflows/createchangelog.yml @@ -114,4 +114,4 @@ jobs: git config --global user.name 'github-actions[bot]' git config --global user.email 'github-actions[bot]@users.noreply.github.com' git add docs/changelog.md - git diff --quiet && git diff --staged --quiet || (git commit -m "Update changelog.md with all releases" && git push) \ No newline at end of file + git diff --quiet && git diff --staged --quiet || (git commit -m "Update changelog.md with all releases" && git push) diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index 486d1ed9..7737726e 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -2,7 +2,7 @@ name: GitHub Pages Deploy on: release: types: [published, prereleased] - workflow_dispatch: + workflow_dispatch: permissions: contents: write jobs: diff --git a/.github/workflows/pre-release.yaml b/.github/workflows/pre-release.yaml index 2b8835a7..7a3e1327 100644 --- a/.github/workflows/pre-release.yaml +++ b/.github/workflows/pre-release.yaml @@ -53,4 +53,4 @@ jobs: prerelease: true generate_release_notes: true env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/config/tweaks.json b/config/tweaks.json index 1866dbce..fcd0f307 100644 --- a/config/tweaks.json +++ b/config/tweaks.json @@ -2549,7 +2549,7 @@ "UndoScript": [ " Write-Host \"Install Microsoft Edge\" - Start-Process -FilePath winget -ArgumentList \"install -e --accept-source-agreements --accept-package-agreements --silent Microsoft.Edge \" -NoNewWindow -Wait + Start-Process -FilePath winget -ArgumentList \"install --force -e --accept-source-agreements --accept-package-agreements --silent Microsoft.Edge \" -NoNewWindow -Wait " ] }, diff --git a/docs/contribute.md b/docs/contribute.md index b5a76cc4..59d7d805 100644 --- a/docs/contribute.md +++ b/docs/contribute.md @@ -8,7 +8,7 @@ ```ps1 irm christitus.com/windev | iex ``` -    + !!! bug "Keep in mind" This is a pre-release and should be treated as such. It exists for developers to test the utility and report or fix bugs before they get added to the stable release. Don't use it in production! diff --git a/edgeremoval.ps1 b/edgeremoval.ps1 index 4df9cde5..362fe396 100644 --- a/edgeremoval.ps1 +++ b/edgeremoval.ps1 @@ -23,7 +23,7 @@ function Uninstall-Process { # Set Nation to 84 (France) temporarily [microsoft.win32.registry]::SetValue('HKEY_USERS\.DEFAULT\Control Panel\International\Geo', 'Nation', 68, [Microsoft.Win32.RegistryValueKind]::String) | Out-Null - + # credits to he3als for the Acl commands $fileName = "IntegratedServicesRegionPolicySet.json" $pathISRPS = [Environment]::SystemDirectory + "\" + $fileName @@ -33,19 +33,19 @@ function Uninstall-Process { if (Test-Path -Path $pathISRPS) { try { $admin = [System.Security.Principal.NTAccount]$(New-Object System.Security.Principal.SecurityIdentifier('S-1-5-32-544')).Translate([System.Security.Principal.NTAccount]).Value - + $aclISRPS.SetOwner($admin) $rule = New-Object System.Security.AccessControl.FileSystemAccessRule($admin, 'FullControl', 'Allow') $aclISRPS.AddAccessRule($rule) Set-Acl -Path $pathISRPS -AclObject $aclISRPS - + Rename-Item -Path $pathISRPS -NewName ($fileName + '.bak') -Force } catch { Write-Error "[$Mode] Failed to set owner for $pathISRPS" - } + } } - + $baseKey = 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate' $registryPath = $baseKey + '\ClientState\' + $Key @@ -84,16 +84,16 @@ function Uninstall-Process { if ((Get-ItemProperty -Path $baseKey).IsEdgeStableUninstalled -eq 1) { Write-Host "[$Mode] Edge Stable has been successfully uninstalled" - } + } } function Uninstall-Edge { Remove-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge" -Name "NoRemove" -ErrorAction SilentlyContinue | Out-Null - + [microsoft.win32.registry]::SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdateDev", "AllowUninstall", 1, [Microsoft.Win32.RegistryValueKind]::DWord) | Out-Null Uninstall-Process -Key '{56EB18F8-B008-4CBD-B6D2-8C97FE7E9062}' - + @( "$env:ProgramData\Microsoft\Windows\Start Menu\Programs", "$env:PUBLIC\Desktop", "$env:USERPROFILE\Desktop" ) | ForEach-Object { @@ -108,7 +108,7 @@ function Uninstall-Edge { function Uninstall-WebView { Remove-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft EdgeWebView" -Name "NoRemove" -ErrorAction SilentlyContinue | Out-Null - # Force to use system-wide WebView2 + # Force to use system-wide WebView2 # [microsoft.win32.registry]::SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\WebView2\BrowserExecutableFolder", "*", "%%SystemRoot%%\System32\Microsoft-Edge-WebView") Uninstall-Process -Key '{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}' @@ -135,4 +135,4 @@ function Uninstall-EdgeUpdate { Uninstall-Edge # "WebView" { Uninstall-WebView } - # "EdgeUpdate" { Uninstall-EdgeUpdate } \ No newline at end of file + # "EdgeUpdate" { Uninstall-EdgeUpdate } diff --git a/functions/private/Invoke-WinUtilDetailedBSoD.ps1 b/functions/private/Invoke-WinUtilDetailedBSoD.ps1 index 691313c9..21b0a84f 100644 --- a/functions/private/Invoke-WinUtilDetailedBSoD.ps1 +++ b/functions/private/Invoke-WinUtilDetailedBSoD.ps1 @@ -4,7 +4,7 @@ Function Invoke-WinUtilDetailedBSoD { .SYNOPSIS Enables/Disables Detailed BSoD (Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl' -Name 'DisplayParameters').DisplayParameters - + #> Param($Enabled) diff --git a/functions/private/Invoke-WinUtilWingetProgram.ps1 b/functions/private/Invoke-WinUtilWingetProgram.ps1 index e755e618..f3d495f7 100644 --- a/functions/private/Invoke-WinUtilWingetProgram.ps1 +++ b/functions/private/Invoke-WinUtilWingetProgram.ps1 @@ -16,7 +16,7 @@ Function Invoke-WinUtilWingetProgram { param( [Parameter(Mandatory, Position=0)]$Programs, - + [Parameter(Mandatory, Position=1)] [ValidateSet("Install", "Uninstall")] [String]$Action @@ -35,7 +35,7 @@ Function Invoke-WinUtilWingetProgram { .PARAMETER credential The PSCredential Object of the user that should be used to run winget - + .NOTES Invoke Winget uses the public variable $Action defined outside the function to determine if a Program should be installed or removed #> @@ -47,7 +47,7 @@ Function Invoke-WinUtilWingetProgram { $commonArguments = "--id $wingetId --silent" $arguments = if ($Action -eq "Install") { - "install $commonArguments --accept-source-agreements --accept-package-agreements $(if ($scope) {" --scope $scope"})" + "install $commonArguments --accept-source-agreements --accept-package-agreements $(if ($scope) {" --scope $scope"})" } else { "uninstall $commonArguments" } @@ -63,15 +63,15 @@ Function Invoke-WinUtilWingetProgram { if ($credential) { $processParams.credential = $credential } - - return (Start-Process @processParams).ExitCode + + return (Start-Process @processParams).ExitCode } Function Invoke-Install { <# .SYNOPSIS Contains the Install Logic and return code handling from winget - + .PARAMETER Program The Winget ID of the Program that should be installed #> @@ -117,14 +117,14 @@ Function Invoke-WinUtilWingetProgram { <# .SYNOPSIS Contains the Uninstall Logic and return code handling from winget - + .PARAMETER Program The Winget ID of the Program that should be uninstalled #> param ( [psobject]$Program ) - + try { $status = Invoke-Winget -wingetId $Program if ($status -eq 0) { @@ -142,21 +142,21 @@ Function Invoke-WinUtilWingetProgram { $count = $Programs.Count $failedPackages = @() - + Write-Host "===========================================" Write-Host "-- Configuring winget packages ---" Write-Host "===========================================" - + for ($i = 0; $i -lt $count; $i++) { $Program = $Programs[$i] $result = $false Set-WinUtilProgressBar -label "$Action $($Program)" -percent ($i / $count * 100) $sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -value ($i / $count)}) - + $result = switch ($Action) { "Install" {Invoke-Install -Program $Program} "Uninstall" {Invoke-Uninstall -Program $Program} - default {throw "[Install-WinUtilProgramWinget] Invalid action: $Action"} + default {throw "[Install-WinUtilProgramWinget] Invalid action: $Action"} } if (-not $result) { diff --git a/functions/private/Set-WinUtilProgressbar.ps1 b/functions/private/Set-WinUtilProgressbar.ps1 index 3984380f..e63bd202 100644 --- a/functions/private/Set-WinUtilProgressbar.ps1 +++ b/functions/private/Set-WinUtilProgressbar.ps1 @@ -1,12 +1,12 @@ function Set-WinUtilProgressbar{ <# .SYNOPSIS - This function is used to Update the Progress Bar displayed in the winutil GUI. - It will be automatically hidden if the user clicks something and no process is running + This function is used to Update the Progress Bar displayed in the winutil GUI. + It will be automatically hidden if the user clicks something and no process is running .PARAMETER Label The Text to be overlayed onto the Progress Bar .PARAMETER PERCENT - The percentage of the Progress Bar that should be filled (0-100) + The percentage of the Progress Bar that should be filled (0-100) .PARAMETER Hide If provided, the Progress Bar and the label will be hidden #> @@ -17,14 +17,14 @@ function Set-WinUtilProgressbar{ $Hide ) if ($hide) { - $sync.form.Dispatcher.Invoke([action]{$sync.ProgressBarLabel.Visibility = "Collapsed"}) - $sync.form.Dispatcher.Invoke([action]{$sync.ProgressBar.Visibility = "Collapsed"}) + $sync.form.Dispatcher.Invoke([action]{$sync.ProgressBarLabel.Visibility = "Collapsed"}) + $sync.form.Dispatcher.Invoke([action]{$sync.ProgressBar.Visibility = "Collapsed"}) } else { - $sync.form.Dispatcher.Invoke([action]{$sync.ProgressBarLabel.Visibility = "Visible"}) - $sync.form.Dispatcher.Invoke([action]{$sync.ProgressBar.Visibility = "Visible"}) + $sync.form.Dispatcher.Invoke([action]{$sync.ProgressBarLabel.Visibility = "Visible"}) + $sync.form.Dispatcher.Invoke([action]{$sync.ProgressBar.Visibility = "Visible"}) } - $sync.form.Dispatcher.Invoke([action]{$sync.ProgressBarLabel.Content.Text = $label}) - $sync.form.Dispatcher.Invoke([action]{$sync.ProgressBarLabel.Content.ToolTip = $label}) + $sync.form.Dispatcher.Invoke([action]{$sync.ProgressBarLabel.Content.Text = $label}) + $sync.form.Dispatcher.Invoke([action]{$sync.ProgressBarLabel.Content.ToolTip = $label}) $sync.form.Dispatcher.Invoke([action]{ $sync.ProgressBar.Value = $percent}) - + } diff --git a/functions/private/Show-CustomDialog.ps1 b/functions/private/Show-CustomDialog.ps1 index ab3b1519..7180b60c 100644 --- a/functions/private/Show-CustomDialog.ps1 +++ b/functions/private/Show-CustomDialog.ps1 @@ -221,7 +221,7 @@ $cttLogoPath = @" $hyperlink.Inlines.Add($match.Groups[2].Value) $hyperlink.TextDecorations = [Windows.TextDecorations]::None # Remove underline $hyperlink.Foreground = $sync.configs.themes.$ctttheme.LinkForegroundColor - + $hyperlink.Add_Click({ param($sender, $args) Start-Process $sender.NavigateUri.AbsoluteUri diff --git a/functions/private/Uninstall-WinUtilEdgeBrowser.ps1 b/functions/private/Uninstall-WinUtilEdgeBrowser.ps1 index 3219b656..ccc22a93 100644 --- a/functions/private/Uninstall-WinUtilEdgeBrowser.ps1 +++ b/functions/private/Uninstall-WinUtilEdgeBrowser.ps1 @@ -32,7 +32,7 @@ function Uninstall-Process { # Set Nation to 84 (France) temporarily [microsoft.win32.registry]::SetValue('HKEY_USERS\.DEFAULT\Control Panel\International\Geo', 'Nation', 68, [Microsoft.Win32.RegistryValueKind]::String) | Out-Null - + # credits to he3als for the Acl commands $fileName = "IntegratedServicesRegionPolicySet.json" $pathISRPS = [Environment]::SystemDirectory + "\" + $fileName @@ -42,19 +42,19 @@ function Uninstall-Process { if (Test-Path -Path $pathISRPS) { try { $admin = [System.Security.Principal.NTAccount]$(New-Object System.Security.Principal.SecurityIdentifier('S-1-5-32-544')).Translate([System.Security.Principal.NTAccount]).Value - + $aclISRPS.SetOwner($admin) $rule = New-Object System.Security.AccessControl.FileSystemAccessRule($admin, 'FullControl', 'Allow') $aclISRPS.AddAccessRule($rule) Set-Acl -Path $pathISRPS -AclObject $aclISRPS - + Rename-Item -Path $pathISRPS -NewName ($fileName + '.bak') -Force } catch { Write-Error "[$Mode] Failed to set owner for $pathISRPS" - } + } } - + $baseKey = 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate' $registryPath = $baseKey + '\ClientState\' + $Key @@ -93,16 +93,16 @@ function Uninstall-Process { if ((Get-ItemProperty -Path $baseKey).IsEdgeStableUninstalled -eq 1) { Write-Host "[$Mode] Edge Stable has been successfully uninstalled" - } + } } function Uninstall-Edge { Remove-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge" -Name "NoRemove" -ErrorAction SilentlyContinue | Out-Null - + [microsoft.win32.registry]::SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdateDev", "AllowUninstall", 1, [Microsoft.Win32.RegistryValueKind]::DWord) | Out-Null Uninstall-Process -Key '{56EB18F8-B008-4CBD-B6D2-8C97FE7E9062}' - + @( "$env:ProgramData\Microsoft\Windows\Start Menu\Programs", "$env:PUBLIC\Desktop", "$env:USERPROFILE\Desktop" ) | ForEach-Object { @@ -117,7 +117,7 @@ function Uninstall-Edge { function Uninstall-WebView { Remove-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft EdgeWebView" -Name "NoRemove" -ErrorAction SilentlyContinue | Out-Null - # Force to use system-wide WebView2 + # Force to use system-wide WebView2 # [microsoft.win32.registry]::SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\WebView2\BrowserExecutableFolder", "*", "%%SystemRoot%%\System32\Microsoft-Edge-WebView") Uninstall-Process -Key '{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}' @@ -149,4 +149,4 @@ Uninstall-Edge -} \ No newline at end of file +} diff --git a/functions/public/Invoke-WPFButton.ps1 b/functions/public/Invoke-WPFButton.ps1 index 92bec394..ac5b2f8c 100644 --- a/functions/public/Invoke-WPFButton.ps1 +++ b/functions/public/Invoke-WPFButton.ps1 @@ -17,9 +17,9 @@ function Invoke-WPFButton { if (-not $sync.ProcessRunning) { Set-WinUtilProgressBar -label "" -percent 0 -hide $true } - + Switch -Wildcard ($Button) { - + "WPFTab?BT" {Invoke-WPFTab $Button} "WPFinstall" {Invoke-WPFInstall} "WPFuninstall" {Invoke-WPFUnInstall} diff --git a/functions/public/Invoke-WPFInstall.ps1 b/functions/public/Invoke-WPFInstall.ps1 index 842681e8..0d880c93 100644 --- a/functions/public/Invoke-WPFInstall.ps1 +++ b/functions/public/Invoke-WPFInstall.ps1 @@ -48,7 +48,7 @@ function Invoke-WPFInstall { $errorPackages = @() if($packagesWinget.Count -gt 0) { Install-WinUtilWinget - $errorPackages += Invoke-WinUtilWingetProgram -Action Install -Programs $packagesWinget + $errorPackages += Invoke-WinUtilWingetProgram -Action Install -Programs $packagesWinget $errorPackages| ForEach-Object {if($_.choco -ne "na") {$packagesChoco += $_}} } if($packagesChoco.Count -gt 0) { diff --git a/functions/public/Invoke-WPFMicrowin.ps1 b/functions/public/Invoke-WPFMicrowin.ps1 index a91588b3..23a12fa2 100644 --- a/functions/public/Invoke-WPFMicrowin.ps1 +++ b/functions/public/Invoke-WPFMicrowin.ps1 @@ -416,11 +416,11 @@ public class PowerManagement { } Write-Host "[INFO] Using oscdimg.exe from: $oscdimgPath" - + $oscdimgProc = Start-Process -FilePath "$oscdimgPath" -ArgumentList "-m -o -u2 -udfver102 -bootdata:2#p0,e,b$mountDir\boot\etfsboot.com#pEF,e,b$mountDir\efi\microsoft\boot\efisys.bin `"$mountDir`" `"$($SaveDialog.FileName)`"" -Wait -PassThru -NoNewWindow - + $LASTEXITCODE = $oscdimgProc.ExitCode - + Write-Host "OSCDIMG Error Level : $($oscdimgProc.ExitCode)" if ($copyToUSB) { diff --git a/functions/public/Invoke-WPFtweaksbutton.ps1 b/functions/public/Invoke-WPFtweaksbutton.ps1 index a389bcee..a4f38193 100644 --- a/functions/public/Invoke-WPFtweaksbutton.ps1 +++ b/functions/public/Invoke-WPFtweaksbutton.ps1 @@ -36,7 +36,7 @@ function Invoke-WPFtweaksbutton { $sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Normal" -value 0.01 -overlay "logo" }) } # Execute other selected tweaks - + for ($i = 0; $i -lt $Tweaks.Count; $i++) { Set-WinUtilProgressBar -Label "Applying $($tweaks[$i])" -Percent ($i / $Tweaks.Count * 100) Invoke-WinUtilTweaks $tweaks[$i]$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -value ($i/$Tweaks.Count) }) diff --git a/functions/public/Invoke-WPFundoall.ps1 b/functions/public/Invoke-WPFundoall.ps1 index 826e1576..cb3ce7ba 100644 --- a/functions/public/Invoke-WPFundoall.ps1 +++ b/functions/public/Invoke-WPFundoall.ps1 @@ -29,7 +29,7 @@ function Invoke-WPFundoall { } else { $sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Normal" -value 0.01 -overlay "logo" }) } - + for ($i = 0; $i -lt $tweaks.Count; $i++) { Set-WinUtilProgressBar -Label "Undoing $($tweaks[$i])" -Percent ($i / $tweaks.Count * 100) @@ -39,7 +39,7 @@ function Invoke-WPFundoall { Set-WinUtilProgressBar -Label "Undo Tweaks Finished" -Percent 100 $sync.ProcessRunning = $false - $sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "None" -overlay "checkmark" }) + $sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "None" -overlay "checkmark" }) Write-Host "==================================" Write-Host "--- Undo Tweaks are Finished ---" Write-Host "==================================" diff --git a/mkdocs.yml b/mkdocs.yml index 85ca4367..9442e0d4 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -34,7 +34,7 @@ theme: # Palette toggle for light mode - media: "(prefers-color-scheme: light)" - scheme: default + scheme: default toggle: diff --git a/xaml/inputXML.xaml b/xaml/inputXML.xaml index 1db34258..2ba9d635 100644 --- a/xaml/inputXML.xaml +++ b/xaml/inputXML.xaml @@ -683,7 +683,7 @@ Maximum="100" Width="250" Height="{SearchBarHeight}" - Foreground="{ProgressBarForegroundColor}" Background="{ProgressBarBackgroundColor}" BorderBrush="{ProgressBarForegroundColor}" + Foreground="{ProgressBarForegroundColor}" Background="{ProgressBarBackgroundColor}" BorderBrush="{ProgressBarForegroundColor}" Visibility="Collapsed" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="2,0,0,0" BorderThickness="1" Padding="6,2,2,2" @@ -699,13 +699,13 @@ Visibility="Collapsed" Margin="2,0,0,0" BorderThickness="0" Padding="6,2,2,2" Name="ProgressBarLabel"> - - +