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",