From c22e38f4a8464941de801c48c07a3f0f4be2d92a Mon Sep 17 00:00:00 2001 From: llama Date: Sat, 1 Nov 2025 22:42:46 +0800 Subject: [PATCH] launch anki embeddedly(?), fallback to usual launch --- qt/launcher/src/main.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/qt/launcher/src/main.rs b/qt/launcher/src/main.rs index 442a1fc64..e2db8d223 100644 --- a/qt/launcher/src/main.rs +++ b/qt/launcher/src/main.rs @@ -28,6 +28,7 @@ use crate::platform::get_exe_and_resources_dirs; use crate::platform::get_uv_binary_name; use crate::platform::launch_anki_normally; use crate::platform::respawn_launcher; +use crate::platform::run_anki_normally; mod platform; @@ -158,9 +159,11 @@ fn run() -> Result<()> { if !launcher_requested && !pyproject_has_changed && !different_launcher { // If no launcher request and venv is already up to date, launch Anki normally - let args: Vec = std::env::args().skip(1).collect(); - let cmd = build_python_command(&state, &args)?; - launch_anki_normally(cmd)?; + if std::env::var("ANKI_LAUNCHER_NO_EMBED").is_ok() || !run_anki_normally(&state) { + let args: Vec = std::env::args().skip(1).collect(); + let cmd = build_python_command(&state, &args)?; + launch_anki_normally(cmd)?; + } return Ok(()); }