You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/Winget-AutoUpdate/functions/Update-App.ps1
+7-5Lines changed: 7 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -96,12 +96,14 @@ Function Update-App ($app) {
96
96
#Test for a Pending Reboot (Component Based Servicing/WindowsUpdate/CCM_ClientUtilities)
97
97
$PendingReboot=Test-PendingReboot
98
98
if ($PendingReboot-eq$true) {
99
-
Write-ToLog"-> A Pending Reboot lingers and probably prohibited $($app.Name) from upgrading...`n-> ...an install for $($app.Name) is NOT executed!""Red"
100
-
continue
99
+
Write-ToLog"-> A Pending Reboot lingers and probably prohibited $($app.Name) from upgrading...`n-> ...limiting to 1 install attempt instead of 2""Yellow"
100
+
$retry=2
101
101
}
102
-
103
-
#If app failed to upgrade, run Install command (2 tries max - some apps get uninstalled after single "Install" command.)
104
-
$retry=1
102
+
else {
103
+
#If app failed to upgrade, run Install command (2 tries max - some apps get uninstalled after single "Install" command.)
104
+
$retry=1
105
+
}
106
+
105
107
While (($ConfirmInstall-eq$false) -and ($retry-le2)) {
106
108
107
109
Write-ToLog"-> An upgrade for $($app.Name) failed, now trying an install instead... ($retry/2)""DarkYellow"
Copy file name to clipboardExpand all lines: Sources/Winget-AutoUpdate/mods/README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,8 @@ The **-install** mod will be used for upgrades too if **-upgrade** doesn't exist
24
24
25
25
`AppID-install.ps1` is recommended because it's used in **both** scenarios.
26
26
27
+
If **AppID**`-preinstall.ps1` returns `$false`, the install/update for that **AppID** is skipped (checking if an App is running, etc...).
28
+
27
29
A script **Template** for an all-purpose mod (`_WAU-notinstalled-template.ps1`) is included in which actions can be taken if an upgrade/install fails for any **AppID** (any individual `AppID-notinstalled.ps1` overrides this global one)
0 commit comments