fix: watcher correctly uses AppData directory, not program files.
This commit is contained in:
@@ -319,9 +319,12 @@ def run_watcher(state: Dict[str, Any], stop_event: threading.Event) -> None:
|
|||||||
"""
|
"""
|
||||||
if getattr(sys, "frozen", False):
|
if getattr(sys, "frozen", False):
|
||||||
here = os.path.dirname(os.path.abspath(sys.executable))
|
here = os.path.dirname(os.path.abspath(sys.executable))
|
||||||
|
_appdata = os.environ.get("LOCALAPPDATA") or os.environ.get("APPDATA") or here
|
||||||
|
config_dir = os.path.join(_appdata, "Series3Watcher")
|
||||||
else:
|
else:
|
||||||
here = os.path.dirname(os.path.abspath(__file__)) or "."
|
here = os.path.dirname(os.path.abspath(__file__)) or "."
|
||||||
config_path = os.path.join(here, "config.ini")
|
config_dir = here
|
||||||
|
config_path = os.path.join(config_dir, "config.ini")
|
||||||
|
|
||||||
state["status"] = "starting"
|
state["status"] = "starting"
|
||||||
state["units"] = []
|
state["units"] = []
|
||||||
|
|||||||
Reference in New Issue
Block a user