Skip to content

Commit 5df3299

Browse files
committed
Possible to skip updates from $ModsPreInstall
1 parent 4ca0710 commit 5df3299

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Sources/Winget-AutoUpdate/functions/Update-App.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ Function Update-App ($app) {
2828
#If PreInstall script exist
2929
if ($ModsPreInstall) {
3030
Write-ToLog "Modifications for $($app.Id) before upgrade are being applied..." "DarkYellow"
31-
& "$ModsPreInstall"
31+
$preInstallResult = & "$ModsPreInstall"
32+
if ($preInstallResult -eq $false) {
33+
Write-ToLog "PreInstall script for $($app.Id) requested to skip this update" "Yellow"
34+
continue # Skip to next app in the parent loop
35+
}
3236
}
3337

3438
# Define upgrade base parameters

0 commit comments

Comments
 (0)