Skip to content

Commit 95025eb

Browse files
committed
reduce a bit the safeties around startup setting
1 parent 58f785e commit 95025eb

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

src/agstoolbox/core/settings.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,14 @@ def set_tools_install_dir(self, value):
121121
self.editor_install_dir = Path(os.path.join(self.tools_install_dir, 'Editor')).as_posix()
122122

123123
def set_run_when_os_starts(self, value: bool):
124-
if not value:
124+
if value is None:
125+
print("run_when_os_starts is None")
126+
127+
if value is False:
125128
remove_app_at_startup(__title__)
126129
self._run_when_os_starts = False
127-
else:
130+
131+
if value is True:
128132
self._run_when_os_starts = set_app_at_startup(__title__, get_app_path())
129133

130134
def get_tools_install_dir(self):

src/agstoolbox/core/utils/startup.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ def _win32_set_app_at_startup(app_name: str, app_path: str) -> bool:
3131
_win32_unsafe_remove_app_at_startup(app_name)
3232
except OSError:
3333
set_failed = True
34-
else:
35-
set_path = get_run_key(app_name)
36-
if set_path is None:
37-
return False
38-
39-
set_path_posix = Path(set_path).absolute().as_posix()
40-
app_path_posix = Path(app_path).absolute().as_posix()
41-
set_failed = not set_path_posix == app_path_posix
34+
# else:
35+
# set_path = get_run_key(app_name)
36+
# if set_path is None:
37+
# return False
38+
#
39+
# set_path_posix = Path(set_path).absolute().as_posix()
40+
# app_path_posix = Path(app_path).absolute().as_posix()
41+
# set_failed = not set_path_posix == app_path_posix
4242

4343
return not set_failed
4444

0 commit comments

Comments
 (0)