[Fixes] Improve Error Handling + UI (#3437)

* add proper error handling + Taskbaritem support to WPFSystemRepair

* implement other fixes

- add Taskbarprogress to WPFFixesNetwork
- add Taskbarprogress to WPFFixesUpdate
- add Error handling + Taskbarprogress to WPFFixesWinget
- add finalisation in WPFSystemRepair
This commit is contained in:
MyDrift
2025-06-26 20:35:03 +02:00
committed by GitHub
parent 686e65adcb
commit 5e65505007
4 changed files with 50 additions and 16 deletions

View File

@ -8,7 +8,16 @@ function Invoke-WPFFixesWinget {
BravoNorris for the fantastic idea of a button to reinstall winget
#>
# Install Choco if not already present
Install-WinUtilChoco
Start-Process -FilePath "choco" -ArgumentList "install winget -y --force" -NoNewWindow -Wait
try {
Set-WinUtilTaskbaritem -state "Indeterminate" -overlay "logo"
Install-WinUtilChoco
Start-Process -FilePath "choco" -ArgumentList "install winget -y --force" -NoNewWindow -Wait
} catch {
Write-Error "Failed to install winget: $_"
Set-WinUtilTaskbaritem -state "Error" -overlay "warning"
} finally {
Write-Host "==> Finished Winget Repair"
Set-WinUtilTaskbaritem -state "None" -overlay "checkmark"
}
}