Avoid if quitting Auto Repairs without running it

i.e. Opened the script, get to the main menu, and then exit.
This commit is contained in:
2Shirt 2021-10-15 01:04:36 -06:00
parent cc95bbe68b
commit 2f655787e5
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -167,9 +167,13 @@ def end_session():
LOG.error("Failed to remove scheduled task or it doesn't exist.")
# Disable Autologon
autologon_selected = reg_read_value(
'HKCU', AUTO_REPAIR_KEY, 'Use Autologon',
)
try:
autologon_selected = reg_read_value(
'HKCU', AUTO_REPAIR_KEY, 'Use Autologon',
)
except FileNotFoundError:
autologon_selected = False
# Assuming it isn't being used
if autologon_selected and is_autologon_enabled():
run_tool('Sysinternals', 'Autologon', download=True)
reg_set_value(