From 817e3175f388c084fc3d170c9580bbed9cf554f0 Mon Sep 17 00:00:00 2001 From: Louis Date: Tue, 3 Jun 2025 00:03:10 +0700 Subject: [PATCH] fix: model run failed on windows (#5168) * fix: model run failed on windows * chore: fix dependency path on windows --- src-tauri/src/core/setup.rs | 12 +----------- src-tauri/tauri.conf.json | 4 ++-- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src-tauri/src/core/setup.rs b/src-tauri/src/core/setup.rs index 21863a199..e1b575b4d 100644 --- a/src-tauri/src/core/setup.rs +++ b/src-tauri/src/core/setup.rs @@ -241,19 +241,9 @@ pub fn setup_sidecar(app: &App) -> Result<(), String> { "--api_keys", app_state.inner().app_token.as_deref().unwrap_or(""), ]); - #[cfg(target_os = "windows")] { - cmd = cmd.env("PATH", { - let exe_path = env::current_exe().expect("Failed to get current exe path"); - let exe_parent_path = exe_path - .parent() - .expect("Executable must have a parent directory"); - let bin_path = exe_parent_path.to_path_buf(); - let dest = bin_path.display(); - let path = std::env::var("PATH").unwrap_or_default(); - format!("{}{}{}", path, std::path::MAIN_SEPARATOR, dest) - }); + cmd = cmd.current_dir(app_handle.path().resource_dir().unwrap()); } #[cfg(not(target_os = "windows"))] diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 4219d61c8..18108d34e 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -82,9 +82,9 @@ "icons/icon.ico" ], "resources": [ - "binaries/engines/**/*", "resources/pre-install/**/*", - "resources/lib/" + "resources/lib/", + "binaries/**/*" ], "externalBin": [ "binaries/cortex-server",