diff --git a/app/core/native_render.py b/app/core/native_render.py index 8c397b2..b49ea21 100644 --- a/app/core/native_render.py +++ b/app/core/native_render.py @@ -32,6 +32,13 @@ def find_bridge_exe() -> str: if root: cands += [os.path.join(root, "binaries", BRIDGE_EXE), os.path.join(root, BRIDGE_EXE)] + # PyInstaller onedir: daw_engine.exe nam /daw_engine/, bridge + # sidecar nam canh app root (khong trong _MEIPASS) - tim ca exe_dir. + exe_dir = os.path.dirname(os.path.abspath(sys.executable)) + cands += [os.path.join(exe_dir, "binaries", BRIDGE_EXE), + os.path.join(exe_dir, BRIDGE_EXE), + os.path.join(os.path.dirname(exe_dir), "binaries", BRIDGE_EXE), + os.path.join(os.path.dirname(exe_dir), BRIDGE_EXE)] cands.append(os.path.join(settings.BASE_DIR, "install", BRIDGE_EXE)) for p in cands: if p and os.path.isfile(p): diff --git a/app/core/runtime.py b/app/core/runtime.py index 2d7ca87..29ef489 100644 --- a/app/core/runtime.py +++ b/app/core/runtime.py @@ -381,7 +381,16 @@ def _vst_render_available() -> bool: if env and os.path.isfile(env): return True exe = "daw_vst_bridge.exe" if os.name == "nt" else "daw_vst_bridge" - return os.path.isfile(os.path.join(settings.BASE_DIR, "install", exe)) + if os.path.isfile(os.path.join(settings.BASE_DIR, "install", exe)): + return True + # Frozen onedir: bridge sidecar nam canh app root (ngoai _MEIPASS) + if getattr(sys, "frozen", False): + exe_dir = os.path.dirname(os.path.abspath(sys.executable)) + for cand in (os.path.join(exe_dir, exe), + os.path.join(os.path.dirname(exe_dir), exe)): + if os.path.isfile(cand): + return True + return False def _lan_info() -> dict: