Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions functions/private/Get-WinUtilInstallerProcess.ps1

This file was deleted.

21 changes: 0 additions & 21 deletions functions/private/Update-WinUtilProgramWinget.ps1

This file was deleted.

35 changes: 9 additions & 26 deletions functions/public/Invoke-WPFInstallUpgrade.ps1
Original file line number Diff line number Diff line change
@@ -1,36 +1,19 @@
function Invoke-WPFInstallUpgrade {
<#

.SYNOPSIS
Invokes the function that upgrades all installed programs

#>
if ($sync.ChocoRadioButton.IsChecked) {
Install-WinUtilChoco
$chocoUpgradeStatus = (Start-Process "choco" -ArgumentList "upgrade all -y" -Wait -PassThru -NoNewWindow).ExitCode
if ($chocoUpgradeStatus -eq 0) {
Write-Host "Upgrade Successful"
}
else{
Write-Host "Error Occurred. Return Code: $chocoUpgradeStatus"
}
}
else{
if((Test-WinUtilPackageManager -winget) -eq "not-installed") {
return
}
Install-WinUtilChoco # Ensure Chocolatey is installed before upgrading

if(Get-WinUtilInstallerProcess -Process $global:WinGetInstall) {
$msg = "[Invoke-WPFInstallUpgrade] Install process is currently running. Please check for a powershell window labeled 'Winget Install'"
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
return
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no reason to check if winget install process is running because you can't click upgrade when installing apps since there is the "installing apps" pop out

Write-Host "==========================================="
Write-Host "-- Updates started ---"
Write-Host "==========================================="

Update-WinUtilProgramWinget
Start-Process -FilePath choco.exe -ArgumentList 'upgrade all -y' -Wait -NoNewWindow
} else {
Install-WinUtilWinget # Ensure WinGet is installed before upgrading

Write-Host "==========================================="
Write-Host "-- Updates started ---"
Write-Host "-- You can close this window if desired ---"
Write-Host "==========================================="

Start-Process -FilePath winget.exe -ArgumentList 'upgrade --all --include-unknown --silent --accept-source-agreements --accept-package-agreements' -Wait -NoNewWindow
}
}