From f0f50381eca598b5c4df6241029fb92e1ce20dcb Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 24 Nov 2025 12:40:01 +0000 Subject: [PATCH] disable native mode for frozen builds to avoid pythonnet loader issues --- nice.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nice.py b/nice.py index 239bc26..0932f5f 100644 --- a/nice.py +++ b/nice.py @@ -715,6 +715,15 @@ def launch_app( logger.debug(f"Work dir: {WORK_DIR}") + # When running as a frozen executable, the native/webview backend + # (which depends on pythonnet) can fail to load inside the bundled + # runtime. Disable native mode automatically for frozen builds so the + # app falls back to launching in the browser and remains usable. + if getattr(sys, "frozen", False): + if native_mode: + logger.debug("Running frozen executable: disabling native mode to avoid pythonnet loader issues") + native_mode = False + if nng: socket_error = False try: