mirror of
https://github.com/redstrate/Physis.git
synced 2025-04-24 21:37:46 +00:00
Extract InstallShield files in your temp dir instead of the current dir
This commit is contained in:
parent
102c8901cf
commit
eed1b5fe83
1 changed files with 8 additions and 2 deletions
|
@ -82,7 +82,10 @@ pub fn install_game(installer_path: &str, game_directory: &str) -> Result<(), In
|
||||||
let position = position.unwrap();
|
let position = position.unwrap();
|
||||||
|
|
||||||
if last_position != 0 {
|
if last_position != 0 {
|
||||||
let mut new_file = File::create(last_filename).unwrap();
|
let mut temp_dir = std::env::temp_dir();
|
||||||
|
temp_dir.push(last_filename);
|
||||||
|
|
||||||
|
let mut new_file = File::create(temp_dir).unwrap();
|
||||||
|
|
||||||
if last_filename == "data1.hdr" {
|
if last_filename == "data1.hdr" {
|
||||||
new_file.write_all(&installer_file[last_position + 30..position - 42])?;
|
new_file.write_all(&installer_file[last_position + 30..position - 42])?;
|
||||||
|
@ -95,7 +98,10 @@ pub fn install_game(installer_path: &str, game_directory: &str) -> Result<(), In
|
||||||
last_filename = filename;
|
last_filename = filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut new_file = File::create(last_filename).unwrap();
|
let mut temp_dir = std::env::temp_dir();
|
||||||
|
temp_dir.push(last_filename);
|
||||||
|
|
||||||
|
let mut new_file = File::create(temp_dir).unwrap();
|
||||||
|
|
||||||
new_file.write_all(&installer_file[last_position + 33..installer_file.len() - 42])?;
|
new_file.write_all(&installer_file[last_position + 33..installer_file.len() - 42])?;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue