Improve cross-platform path resolution for bundled executables

This commit is contained in:
2026-05-06 06:51:57 +02:00
parent 0ab5011c22
commit 161d0c12aa

View File

@@ -458,12 +458,18 @@ fn should_start_backend_sidecar() -> bool {
fn bundled_executable_path(name: &str) -> Option<PathBuf> {
let exe_path = std::env::current_exe().ok()?;
let exe_dir = exe_path.parent()?;
let mut path = exe_dir.join(name);
#[cfg(not(windows))]
let path = exe_dir.join(name);
#[cfg(windows)]
{
let mut path = exe_dir.join(name);
path.set_extension("exe");
path.exists().then_some(path)
}
#[cfg(not(windows))]
{
path.exists().then_some(path)
}
path.exists().then_some(path)
}
fn app_managed_data_dir(app: &AppHandle) -> Result<PathBuf, String> {