fix: model run failed on windows (#5168)
* fix: model run failed on windows * chore: fix dependency path on windows
This commit is contained in:
parent
aeba895250
commit
817e3175f3
@ -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"))]
|
||||||
|
|||||||
@ -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",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user