Skip to content

Commit 6f0c63e

Browse files
committed
handle file copying when tff gives in-use error
1 parent b8ca82c commit 6f0c63e

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src-tauri/src/constants.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,4 @@ pub const SAMP_USERDATA_PATH: &str = r"\GTA San Andreas User Files\SAMP\USERDATA
5353
pub const ERROR_DIRECTORY_EXISTS: i32 = 183;
5454
pub const ERROR_ACCESS_DENIED: i32 = 5;
5555
pub const ERROR_ELEVATION_REQUIRED: i32 = 740;
56+
pub const ERROR_FILE_BEING_USED: i32 = 32;

src-tauri/src/helpers.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ pub fn copy_files(src: impl AsRef<Path>, dest: impl AsRef<Path>) -> crate::error
9696
match e.raw_os_error() {
9797
Some(ERROR_DIRECTORY_EXISTS) => {
9898
info!("Directory {} already exists", dir_path.display());
99-
return Ok(());
10099
}
101100
Some(ERROR_ACCESS_DENIED) => {
102101
return Err(crate::errors::LauncherError::AccessDenied(format!(
@@ -120,6 +119,13 @@ pub fn copy_files(src: impl AsRef<Path>, dest: impl AsRef<Path>) -> crate::error
120119
dest_path.display()
121120
)))
122121
}
122+
Some(ERROR_FILE_BEING_USED) => {
123+
if let Some(ext) = entry.path().extension() {
124+
if ext == "ttf" {
125+
info!("Unable to copy \"{}\"", entry.path().display());
126+
}
127+
}
128+
}
123129
_ => return Err(crate::errors::LauncherError::from(e)),
124130
}
125131
}

0 commit comments

Comments
 (0)