fix: model run failed on windows (#5168)

* fix: model run failed on windows

* chore: fix dependency path on windows
This commit is contained in:
Louis 2025-06-03 00:03:10 +07:00 committed by GitHub
parent aeba895250
commit 817e3175f3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 13 deletions

View File

@ -241,19 +241,9 @@ pub fn setup_sidecar(app: &App) -> Result<(), String> {
"--api_keys", "--api_keys",
app_state.inner().app_token.as_deref().unwrap_or(""), app_state.inner().app_token.as_deref().unwrap_or(""),
]); ]);
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
{ {
cmd = cmd.env("PATH", { cmd = cmd.current_dir(app_handle.path().resource_dir().unwrap());
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)
});
} }
#[cfg(not(target_os = "windows"))] #[cfg(not(target_os = "windows"))]

View File

@ -82,9 +82,9 @@
"icons/icon.ico" "icons/icon.ico"
], ],
"resources": [ "resources": [
"binaries/engines/**/*",
"resources/pre-install/**/*", "resources/pre-install/**/*",
"resources/lib/" "resources/lib/",
"binaries/**/*"
], ],
"externalBin": [ "externalBin": [
"binaries/cortex-server", "binaries/cortex-server",