diff --git a/src/installer/utils/file_utils/binary_utils.rs b/src/installer/utils/file_utils/binary_utils.rs index ca26652..bd4d1ec 100644 --- a/src/installer/utils/file_utils/binary_utils.rs +++ b/src/installer/utils/file_utils/binary_utils.rs @@ -2,9 +2,6 @@ use std::env::consts; use std::path::PathBuf; use std::fs; -#[cfg(target_os = "windows")] -use std::os::windows::fs::symlink_file; - fn file_is_executable(path: &PathBuf) -> bool { if consts::FAMILY == "windows" { match path.extension() { @@ -49,7 +46,13 @@ pub fn create_symlink_of_binary_files(install_package_folder: &PathBuf, binary_p let output_path = binary_package_folder.join(file.file_name().ok_or(format!("Failed to get filename"))?); #[cfg(target_os = "windows")] - symlink_file(file.as_os_str(), output_path.as_os_str()).map_err(|_| format!("Failed to create symlink"))?; + { + let file_path = file.as_os_str().to_str().ok_or(format!("Failed to get filename str"))?; + fs::write(output_path, format!(" + @echo off + {} %* + ", file_path)).map_err(|_| format!("Failed to create symlink"))?; + } } Ok(())