🔀 Merge: pull request #5351 from menloresearch/fix/window-path-fix

🐛 Fix: window path name with a space lead to cannot find correct path to Jan datafolder
This commit is contained in:
Bui Quang Huy 2025-06-18 17:17:53 +07:00 committed by GitHub
commit f5971b9d03
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -247,7 +247,10 @@ pub fn setup_sidecar(app: &App) -> Result<(), String> {
]);
#[cfg(target_os = "windows")]
{
cmd = cmd.current_dir(app_handle_for_spawn.path().resource_dir().unwrap());
let resource_dir = app_handle_for_spawn.path().resource_dir().unwrap();
let normalized_path = resource_dir.to_string_lossy().replace(r"\\?\", "");
let normalized_pathbuf = PathBuf::from(normalized_path);
cmd = cmd.current_dir(normalized_pathbuf);
}
#[cfg(not(target_os = "windows"))]