Un-modding successful
This commit is contained in:
26
src/main.rs
26
src/main.rs
@@ -1,4 +1,4 @@
|
|||||||
use std::path::Path;
|
use std::path::{Path, PathBuf};
|
||||||
use std::str;
|
use std::str;
|
||||||
use std::*;
|
use std::*;
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ impl From<&str> for AmongUsVersion {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn attempt_run_among_us(install_path: &path::Path) {
|
fn attempt_run_among_us(install_path: &Path) {
|
||||||
let executable_path: path::PathBuf = [install_path.to_str().unwrap(), "Among Us.exe"]
|
let executable_path: path::PathBuf = [install_path.to_str().unwrap(), "Among Us.exe"]
|
||||||
.iter()
|
.iter()
|
||||||
.collect();
|
.collect();
|
||||||
@@ -42,6 +42,25 @@ fn attempt_run_among_us(install_path: &path::Path) {
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn unmod_among_us_folder(folder_path: &Path) {
|
||||||
|
let doorstop_path: PathBuf = [folder_path.to_str().unwrap(), "doorstop_config.ini"]
|
||||||
|
.iter()
|
||||||
|
.collect();
|
||||||
|
let steam_appid_path: PathBuf = [folder_path.to_str().unwrap(), "steam_appid.txt"]
|
||||||
|
.iter()
|
||||||
|
.collect();
|
||||||
|
let winhttp_path: PathBuf = [folder_path.to_str().unwrap(), "winhttp.dll"]
|
||||||
|
.iter()
|
||||||
|
.collect();
|
||||||
|
let bepinex_path: PathBuf = [folder_path.to_str().unwrap(), "BepInEx"].iter().collect();
|
||||||
|
let mono_path: PathBuf = [folder_path.to_str().unwrap(), "mono"].iter().collect();
|
||||||
|
fs::remove_file(doorstop_path).unwrap_or_default();
|
||||||
|
fs::remove_file(steam_appid_path).unwrap_or_default();
|
||||||
|
fs::remove_file(winhttp_path).unwrap_or_default();
|
||||||
|
fs::remove_dir_all(bepinex_path).unwrap_or_default();
|
||||||
|
fs::remove_dir_all(mono_path).unwrap_or_default();
|
||||||
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
// CREATE PROGRAM DIRECTORY
|
// CREATE PROGRAM DIRECTORY
|
||||||
let mut data_path = dirs::data_dir().unwrap();
|
let mut data_path = dirs::data_dir().unwrap();
|
||||||
@@ -138,6 +157,9 @@ fn main() {
|
|||||||
.iter()
|
.iter()
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
|
// Un-mod whatever we found if it's modded
|
||||||
|
unmod_among_us_folder(&among_us_path);
|
||||||
|
|
||||||
println!(
|
println!(
|
||||||
"Rename {} to {}",
|
"Rename {} to {}",
|
||||||
among_us_path.to_str().unwrap(),
|
among_us_path.to_str().unwrap(),
|
||||||
|
|||||||
Reference in New Issue
Block a user