Skip to content

Commit

Permalink
feat(core): slightly improved crash reporter restoring
Browse files Browse the repository at this point in the history
  • Loading branch information
krypt0nn committed Jun 18, 2023
1 parent 0b0d7d2 commit b5d2aad
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,15 @@ fn main() {

// Patch was renaming crash reporter to disable it
if game_path.join("UnityCrashHandler64.exe.bak").exists() {
std::fs::remove_file(game_path.join("UnityCrashHandler64.exe.bak"))
.expect("Failed to delete 'UnityCrashHandler64.exe.bak' file");
if game_path.join("UnityCrashHandler64.exe").exists() {
std::fs::remove_file(game_path.join("UnityCrashHandler64.exe.bak"))
.expect("Failed to delete 'UnityCrashHandler64.exe.bak' file");
}

else {
std::fs::rename(game_path.join("UnityCrashHandler64.exe.bak"), game_path.join("UnityCrashHandler64.exe"))
.expect("Failed to rename 'UnityCrashHandler64.exe.bak' file to 'UnityCrashHandler64.exe'");
}
}

// End of temporary workaround ^
Expand Down

0 comments on commit b5d2aad

Please sign in to comment.