Added run at startup option for installed version

This commit is contained in:
2016-08-05 15:31:22 -05:00
parent b2ebbf5b7a
commit 05a8cb7a28
4 changed files with 13 additions and 6 deletions

View File

@@ -31,11 +31,11 @@ def getAutoStart(app_name):
def setAutoStart(app_name, enable=True):
"""Configures automatic startup for the application, if the enable argument is set to True. If set to False, deletes the application AutoStart value."""
print paths.get_executable()
if getAutoStart(app_name) == enable:
return
key = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, RUN_REGKEY, 0, _winreg.KEY_WRITE)
if enable:
_winreg.SetValueEx(key, unicode(app_name), None, _winreg.REG_SZ, sys.argv[0])
_winreg.SetValueEx(key, unicode(app_name), None, _winreg.REG_SZ, paths.get_executable())
else:
_winreg.DeleteValue(key, unicode(app_name))