Skip to content

Commit

Permalink
fix dxgi.dll and add uninstall procedure
Browse files Browse the repository at this point in the history
  • Loading branch information
bigfarts committed Apr 23, 2023
1 parent be64f00 commit 09bd70d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
18 changes: 16 additions & 2 deletions chaudloader-installer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ struct Args {
}

const FILES_TO_COPY: &[&str] = &["dxgi.dll", "chaudloader.dll", "lua54.dll"];
const FILES_TO_DELETE: &[&str] = &["bnlc_mod_loader.dll"];

fn main() -> Result<(), anyhow::Error> {
let args = Args::parse();
Expand Down Expand Up @@ -94,11 +95,24 @@ fn main() -> Result<(), anyhow::Error> {
for path in paths {
let exe_path = path.join("exe");

for filename in FILES_TO_DELETE.iter() {
let path = exe_path.join(filename);
match std::fs::remove_file(&path) {
Ok(()) => {
println!("DELETE {}", path.display());
}
Err(e) if e.kind() == std::io::ErrorKind::NotFound => {}
Err(e) => {
return Err(e.into());
}
}
}

for (filename, contents) in files.iter() {
let path = exe_path.join(filename);
let mut f = std::fs::File::create(&path)?;
f.write_all(&contents)?;
println!("OK: {}", path.display());
println!("COPY {}", path.display());
}

let mods_path = exe_path.join("mods");
Expand All @@ -109,7 +123,7 @@ fn main() -> Result<(), anyhow::Error> {
return Err(e.into());
}
}
println!("OK: {}", mods_path.display());
println!("MKDIR {}", mods_path.display());
}
println!();

Expand Down
2 changes: 1 addition & 1 deletion make_dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def make_entries():
entries = [
Entry("README.md", "README.md"),
Entry("chaudloader.dll", "target/release/chaudloader.dll"),
Entry("dxgi.dll", "target/release/chaudloader.dll"),
Entry("dxgi.dll", "target/release/dxgi.dll"),
Entry("lua54.dll", "lua54.dll"),
]

Expand Down

0 comments on commit 09bd70d

Please sign in to comment.