From e8d2c5773a87cb1223832dca8a8443c9d18a54b6 Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Tue, 22 Sep 2026 23:28:19 +0000 Subject: [PATCH] Exit fast on Velopack hook args; name ZIP artifact win64-portable Velopack runs the app with --veloapp-install/-updated/-uninstall during those operations; without fast-exit handling the full GUI booted mid-install (also clobbering config via the first-run setup flow) and the installer reported hook errors. The post-install launch has no hook args and still starts the app normally. --- mediahive/winmain.py | 4 ++++ scripts/guibuild.py | 3 +++ 2 files changed, 7 insertions(+) diff --git a/mediahive/winmain.py b/mediahive/winmain.py index ad15709..d89534a 100644 --- a/mediahive/winmain.py +++ b/mediahive/winmain.py @@ -978,6 +978,10 @@ def _show_fatal_error(exc: BaseException) -> None: def gui_main() -> None: """Run the GUI, rendering fatal exceptions as a TraceRite HTML window.""" + # Velopack runs the app with --veloapp-* hook arguments during install, + # update, and uninstall; these must exit fast instead of starting the GUI. + if any(arg.startswith("--veloapp-") for arg in sys.argv[1:]): + return try: winmain() except Exception as exc: diff --git a/scripts/guibuild.py b/scripts/guibuild.py index 313c3ad..e567a0b 100755 --- a/scripts/guibuild.py +++ b/scripts/guibuild.py @@ -338,6 +338,9 @@ def create_zip(version: str) -> Path: raise FileNotFoundError(f"Distribution folder not found: {dist_folder}") zip_name = f"MediaHive-{version}-{_platform_zip_suffix()}.zip" + if sys.platform == "win32": + # Distinguish from the Velopack installer (MediaHive-*-win64-setup.exe) + zip_name = zip_name.replace("-win64.zip", "-win64-portable.zip") zip_path = repo_root / "build" / zip_name zip_path.parent.mkdir(parents=True, exist_ok=True)