From a0234065afafac54689ab2868d7bb4d975c2d354 Mon Sep 17 00:00:00 2001 From: Gabi <218829269+GabiNun2@users.noreply.github.com> Date: Thu, 23 Apr 2026 11:15:30 +0300 Subject: [PATCH 1/5] Update Update-WinUtilProgramWinget.ps1 --- .../private/Update-WinUtilProgramWinget.ps1 | 20 +------------------ 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/functions/private/Update-WinUtilProgramWinget.ps1 b/functions/private/Update-WinUtilProgramWinget.ps1 index 4a40e22096..2fb5d27430 100644 --- a/functions/private/Update-WinUtilProgramWinget.ps1 +++ b/functions/private/Update-WinUtilProgramWinget.ps1 @@ -1,21 +1,3 @@ Function Update-WinUtilProgramWinget { - - <# - - .SYNOPSIS - This will update all programs using WinGet - - #> - - [ScriptBlock]$wingetinstall = { - - $host.ui.RawUI.WindowTitle = """WinGet Install""" - - Start-Transcript "$logdir\winget-update_$dateTime.log" -Append - winget upgrade --all --accept-source-agreements --accept-package-agreements --scope=machine --silent - - } - - $global:WinGetInstall = Start-Process -Verb runas powershell -ArgumentList "-command invoke-command -scriptblock {$wingetinstall} -argumentlist '$($ProgramsToInstall -join ",")'" -PassThru - + Start-Process -FilePath winget.exe -ArgumentList 'upgrade --all --silent --include-unknown --accept-source-agreements --accept-package-agreements' -Wait -NoNewWindow } From b03a2f07b2e926399b7ade27a0cddf30df5c987b Mon Sep 17 00:00:00 2001 From: Gabi <218829269+GabiNun2@users.noreply.github.com> Date: Thu, 23 Apr 2026 11:21:56 +0300 Subject: [PATCH 2/5] Delete functions/private/Update-WinUtilProgramWinget.ps1 --- functions/private/Update-WinUtilProgramWinget.ps1 | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 functions/private/Update-WinUtilProgramWinget.ps1 diff --git a/functions/private/Update-WinUtilProgramWinget.ps1 b/functions/private/Update-WinUtilProgramWinget.ps1 deleted file mode 100644 index 2fb5d27430..0000000000 --- a/functions/private/Update-WinUtilProgramWinget.ps1 +++ /dev/null @@ -1,3 +0,0 @@ -Function Update-WinUtilProgramWinget { - Start-Process -FilePath winget.exe -ArgumentList 'upgrade --all --silent --include-unknown --accept-source-agreements --accept-package-agreements' -Wait -NoNewWindow -} From 33924a1f328170c13d3ad93d87f2da8db1655a6e Mon Sep 17 00:00:00 2001 From: Gabi <218829269+GabiNun2@users.noreply.github.com> Date: Thu, 23 Apr 2026 11:22:33 +0300 Subject: [PATCH 3/5] Delete functions/private/Get-WinUtilInstallerProcess.ps1 --- .../private/Get-WinUtilInstallerProcess.ps1 | 24 ------------------- 1 file changed, 24 deletions(-) delete mode 100644 functions/private/Get-WinUtilInstallerProcess.ps1 diff --git a/functions/private/Get-WinUtilInstallerProcess.ps1 b/functions/private/Get-WinUtilInstallerProcess.ps1 deleted file mode 100644 index c1103697de..0000000000 --- a/functions/private/Get-WinUtilInstallerProcess.ps1 +++ /dev/null @@ -1,24 +0,0 @@ -function Get-WinUtilInstallerProcess { - <# - - .SYNOPSIS - Checks if the given process is running - - .PARAMETER Process - The process to check - - .OUTPUTS - Boolean - True if the process is running - - #> - - param($Process) - - if ($Null -eq $Process) { - return $false - } - if (Get-Process -Id $Process.Id -ErrorAction SilentlyContinue) { - return $true - } - return $false -} From 49fe2bfff51cd44eae51922a19b58bb1652fb9a7 Mon Sep 17 00:00:00 2001 From: Gabi <218829269+GabiNun2@users.noreply.github.com> Date: Thu, 23 Apr 2026 11:24:04 +0300 Subject: [PATCH 4/5] Update Invoke-WPFInstallUpgrade.ps1 --- functions/public/Invoke-WPFInstallUpgrade.ps1 | 35 ++++++------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/functions/public/Invoke-WPFInstallUpgrade.ps1 b/functions/public/Invoke-WPFInstallUpgrade.ps1 index 0f262a0d64..eb63081677 100644 --- a/functions/public/Invoke-WPFInstallUpgrade.ps1 +++ b/functions/public/Invoke-WPFInstallUpgrade.ps1 @@ -1,36 +1,21 @@ function Invoke-WPFInstallUpgrade { - <# - - .SYNOPSIS - Invokes the function that upgrades all installed programs - - #> if ($sync.ChocoRadioButton.IsChecked) { + # Ensure Chocolatey is installed before upgrading 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 - } - 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 - } + Start-Process choco -ArgumentList 'upgrade all -y' -Wait -NoNewWindow + + Write-Host "===========================================" + Write-Host "-- Updates started ---" + Write-Host "===========================================" + } else { + # Ensure WinGet is installed before upgrading + Install-WinUtilWinget - Update-WinUtilProgramWinget + Start-Process -FilePath winget.exe -ArgumentList 'upgrade --all --silent --include-unknown --accept-source-agreements --accept-package-agreements' -Wait -NoNewWindow Write-Host "===========================================" Write-Host "-- Updates started ---" - Write-Host "-- You can close this window if desired ---" Write-Host "===========================================" } } From f9e288480fa493791257e533ab77f12714504ab6 Mon Sep 17 00:00:00 2001 From: Gabi <218829269+GabiNun2@users.noreply.github.com> Date: Thu, 23 Apr 2026 11:38:30 +0300 Subject: [PATCH 5/5] Update Invoke-WPFInstallUpgrade.ps1 --- functions/public/Invoke-WPFInstallUpgrade.ps1 | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/functions/public/Invoke-WPFInstallUpgrade.ps1 b/functions/public/Invoke-WPFInstallUpgrade.ps1 index eb63081677..2eb7148a6d 100644 --- a/functions/public/Invoke-WPFInstallUpgrade.ps1 +++ b/functions/public/Invoke-WPFInstallUpgrade.ps1 @@ -1,21 +1,19 @@ function Invoke-WPFInstallUpgrade { if ($sync.ChocoRadioButton.IsChecked) { - # Ensure Chocolatey is installed before upgrading - Install-WinUtilChoco - - Start-Process choco -ArgumentList 'upgrade all -y' -Wait -NoNewWindow + Install-WinUtilChoco # Ensure Chocolatey is installed before upgrading Write-Host "===========================================" Write-Host "-- Updates started ---" Write-Host "===========================================" - } else { - # Ensure WinGet is installed before upgrading - Install-WinUtilWinget - Start-Process -FilePath winget.exe -ArgumentList 'upgrade --all --silent --include-unknown --accept-source-agreements --accept-package-agreements' -Wait -NoNewWindow + 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 "===========================================" + + Start-Process -FilePath winget.exe -ArgumentList 'upgrade --all --include-unknown --silent --accept-source-agreements --accept-package-agreements' -Wait -NoNewWindow } }