Skip to content

Commit 1d73c04

Browse files
committed
Only --once if --install succeeds
1 parent 4209daa commit 1d73c04

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

RemoveWindowsLockScreenAds/RemoveWindowsLockScreenAds.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,10 @@ def install(self, path):
205205
except Exception as e:
206206
logger.error("Installation failed: {}".format(e))
207207
self.uninstall()
208-
return
208+
return False
209209

210210
logger.info("Successfully installed.")
211+
return True
211212

212213
def uninstall(self):
213214
# Remove autorun
@@ -261,8 +262,8 @@ def main(argv):
261262
adrem = AdRemover(dry_run=args.dry_run, remove_credits=args.remove_credits)
262263

263264
if args.install:
264-
adrem.install(args.path)
265-
adrem.remove_ads_path(args.path)
265+
if adrem.install(args.path):
266+
adrem.remove_ads_path(args.path)
266267
elif args.uninstall:
267268
adrem.uninstall()
268269
elif args.watch:

0 commit comments

Comments
 (0)