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:
serversdwn
2026-03-17 01:10:40 -04:00
parent e67b6eb89f
commit 504ee1d470
5 changed files with 137 additions and 6 deletions

View File

@@ -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 ---------------