mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-07-17 21:56:07 -04:00
Added run at startup option for installed version
This commit is contained in:
@@ -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))
|
||||
|
Reference in New Issue
Block a user