bugfix: log directory now writes to appdata folder, avoiding permissions issues. log folder accessible from tray icon.
doc: deployment/build doc added
This commit is contained in:
@@ -126,13 +126,21 @@ def apply_update(download_url):
|
||||
|
||||
# --------------- Paths ---------------
|
||||
|
||||
# When frozen by PyInstaller, __file__ points to a temp extraction dir.
|
||||
# sys.executable is always the real .exe location — use that instead.
|
||||
# Executable location — used for bundled assets (icon.ico etc.)
|
||||
if getattr(sys, "frozen", False):
|
||||
HERE = os.path.dirname(os.path.abspath(sys.executable))
|
||||
else:
|
||||
HERE = os.path.dirname(os.path.abspath(__file__))
|
||||
CONFIG_PATH = os.path.join(HERE, "config.ini")
|
||||
|
||||
# config.ini lives in AppData so normal users can write it without UAC issues.
|
||||
# Fall back to the exe directory when running from source (dev mode).
|
||||
if getattr(sys, "frozen", False):
|
||||
_appdata = os.environ.get("LOCALAPPDATA") or os.environ.get("APPDATA") or HERE
|
||||
CONFIG_DIR = os.path.join(_appdata, "Series3Watcher")
|
||||
os.makedirs(CONFIG_DIR, exist_ok=True)
|
||||
else:
|
||||
CONFIG_DIR = HERE
|
||||
CONFIG_PATH = os.path.join(CONFIG_DIR, "config.ini")
|
||||
|
||||
|
||||
# --------------- Icon drawing ---------------
|
||||
|
||||
Reference in New Issue
Block a user