Files
myGarminApp/packaging/launcher.py
Riaan Doorduin 39ce4e73a0 Windows installer; ship the dashboard template
- packaging/: PyInstaller spec (one folder, windowed, Python included), Inno Setup script
  (per-user install, Start menu, optional desktop icon, WebView2 check), build.ps1, app icon.
- Bundled exe also runs the CLI (output to %LOCALAPPDATA%\myGarmin\cli.log).
- Fix: .gitignore pattern dashboard*.html also hid src/mygarmin/report/dashboard.html, so the
  template was never committed and fresh clones could not build a dashboard. Patterns anchored;
  data file types (*.gpx, *.csv, *.json, *.gz, *.log) ignored too.
- Self-test runs beside an open app (own WebView2 data folder, no single-instance check).
- Neutral example values in a docstring and the tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 14:10:05 +02:00

20 lines
855 B
Python

# Entry point of the bundled myGarmin.exe (PyInstaller).
# No arguments: the app window. With arguments: the mygarmin command line (myGarmin.exe import <library> <path> ...);
# the exe has no console, so its output goes to %LOCALAPPDATA%\myGarmin\cli.log.
import os, sys
if len(sys.argv) > 1:
log = os.path.join(os.environ.get('LOCALAPPDATA', os.path.expanduser('~')), 'myGarmin', 'cli.log')
os.makedirs(os.path.dirname(log), exist_ok=True)
sys.stdout = sys.stderr = open(log, 'a', encoding='utf-8', buffering=1)
print('>', ' '.join(sys.argv[1:]))
from mygarmin.cli import main
try: main(sys.argv[1:])
except SystemExit as e:
if e.code not in (None, 0): print('exit:', e.code); raise
except Exception:
import traceback; traceback.print_exc(); sys.exit(1)
else:
from mygarmin.app import main
main()