Skip to content

Commit dc096a6

Browse files
committed
Better logic in App Skipping
1 parent 6aee2e1 commit dc096a6

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Sources/Winget-AutoUpdate/mods/_AppID-template.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ $RunSwitch = ""
2121
$RunWait = $True
2222

2323
# Beginning of Process Name to check for if running - optional wildcard (*) after, without .exe, multiple: "proc1*","proc2"
24-
# If found, it will return $False, stop this script and request for the main script to skip the app.
25-
$Skip = @("")
24+
# If found, it will return $False (to $preInstall-/UninstallResult), stop this script and request for the main script to skip the app.
25+
$SkipApp = @("")
2626

2727
# Beginning of Process Name to Stop - optional wildcard (*) after, without .exe, multiple: "proc1*","proc2"
2828
$Proc = @("")
@@ -104,9 +104,9 @@ $User = $True
104104
if ($RunSystem) {
105105
Invoke-ModsApp $RunSystem $RunSwitch $RunWait ""
106106
}
107-
if ($Skip) {
108-
$result = Skip-ModsProc $Skip
109-
if ($result -eq $false) { return $false }
107+
if ($SkipApp) {
108+
$result = Skip-ModsProc $SkipApp
109+
if ($result -eq $true) { return $false }
110110
}
111111
if ($Proc) {
112112
Stop-ModsProc $Proc

Sources/Winget-AutoUpdate/mods/_Mods-Functions.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ function Invoke-ModsApp ($Run, $RunSwitch, $RunWait, $User) {
1818
Return
1919
}
2020

21-
function Skip-ModsProc ($Skip) {
22-
foreach ($process in $Skip) {
21+
function Skip-ModsProc ($SkipApp) {
22+
foreach ($process in $SkipApp) {
2323
$running = Get-Process -Name $process -ErrorAction SilentlyContinue
2424
if ($running) {
25-
Return $false
25+
Return $true
2626
}
2727
}
2828
Return

0 commit comments

Comments
 (0)