From 14d6d07dc792c5e01d8cfeec4869710af74f3980 Mon Sep 17 00:00:00 2001 From: "Mr.k" Date: Fri, 22 Mar 2024 02:00:07 +0300 Subject: [PATCH] Fixing an issue related to winget install & Improving winget uninstall command (#1662) * Add the argument '--accept-source-agreements' to the Uninstall command of Winget Added '--accept-source-agreements' to insure that the Package Uninstall process is completely unattended. * Improve the Wording of the 'WPFInstall' function and 'inputXML.xaml' file --- functions/private/Install-WinUtilProgramWinget.ps1 | 6 +++--- functions/public/Invoke-WPFInstall.ps1 | 8 ++++---- xaml/inputXML.xaml | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/functions/private/Install-WinUtilProgramWinget.ps1 b/functions/private/Install-WinUtilProgramWinget.ps1 index 1d535aa8..24d3b266 100644 --- a/functions/private/Install-WinUtilProgramWinget.ps1 +++ b/functions/private/Install-WinUtilProgramWinget.ps1 @@ -33,12 +33,12 @@ Function Install-WinUtilProgramWinget { Start-Process -FilePath winget -ArgumentList "install -e --accept-source-agreements --accept-package-agreements --scope=machine --silent $Program" -NoNewWindow -Wait } if($manage -eq "Uninstalling"){ - Start-Process -FilePath winget -ArgumentList "uninstall -e --purge --force --silent $Program" -NoNewWindow -Wait - } + Start-Process -FilePath winget -ArgumentList "uninstall -e --accept-source-agreements --purge --force --silent $Program" -NoNewWindow -Wait + } $X++ } Write-Progress -Activity "$manage Applications" -Status "Finished" -Completed -} \ No newline at end of file +} diff --git a/functions/public/Invoke-WPFInstall.ps1 b/functions/public/Invoke-WPFInstall.ps1 index 29ebe7b4..54d0ed1d 100644 --- a/functions/public/Invoke-WPFInstall.ps1 +++ b/functions/public/Invoke-WPFInstall.ps1 @@ -2,12 +2,12 @@ function Invoke-WPFInstall { <# .SYNOPSIS - Installs the selected programs using winget + Installs the selected programs using winget, if one or more of the selected programs are already installed on the system, winget will try and perform an upgrade if there's a newer version to install. #> if($sync.ProcessRunning){ - $msg = "[Invoke-WPFInstall] Install process is currently running." + $msg = "[Invoke-WPFInstall] An Install process is currently running." [System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning) return } @@ -15,7 +15,7 @@ function Invoke-WPFInstall { $WingetInstall = (Get-WinUtilCheckBoxes)["Install"] if ($wingetinstall.Count -eq 0) { - $WarningMsg = "Please select the program(s) to install" + $WarningMsg = "Please select the program(s) to install or upgrade" [System.Windows.MessageBox]::Show($WarningMsg, $AppTitle, [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning) return } @@ -41,4 +41,4 @@ function Invoke-WPFInstall { Start-Sleep -Seconds 5 $sync.ProcessRunning = $False } -} \ No newline at end of file +} diff --git a/xaml/inputXML.xaml b/xaml/inputXML.xaml index 2b99468e..6d3b9405 100644 --- a/xaml/inputXML.xaml +++ b/xaml/inputXML.xaml @@ -690,7 +690,7 @@ -