-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/delete-old-mode-before-update
- Loading branch information
Showing
10 changed files
with
60 additions
and
293 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,8 +71,7 @@ async fn do_install( | |
} | ||
} | ||
}, | ||
) | ||
.unwrap(); | ||
)?; | ||
|
||
window | ||
.emit( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
/// Windows specific code | ||
use anyhow::{anyhow, Result}; | ||
|
||
use crate::{check_is_valid_game_path, constants::TITANFALL2_ORIGIN_IDS}; | ||
#[cfg(target_os = "windows")] | ||
use winreg::{enums::HKEY_LOCAL_MACHINE, RegKey}; | ||
|
||
use crate::check_is_valid_game_path; | ||
|
||
/// Gets Titanfall2 install location on Origin | ||
pub fn origin_install_location_detection() -> Result<String, anyhow::Error> { | ||
// Iterate over known Titanfall2 Origin IDs | ||
for origin_id in TITANFALL2_ORIGIN_IDS { | ||
match game_scanner::origin::find(origin_id) { | ||
// Origin ID found as installed game | ||
Ok(game) => { | ||
if game.path.is_some() { | ||
let game_path = game.path.unwrap(); | ||
let game_path_str = game_path.to_str().unwrap(); | ||
match check_is_valid_game_path(game_path_str) { | ||
Ok(()) => { | ||
return Ok(game_path_str.to_string()); | ||
} | ||
Err(err) => { | ||
log::warn!("{}", err); | ||
continue; // Not a valid game path | ||
} | ||
#[cfg(target_os = "windows")] | ||
{ | ||
let hklm = RegKey::predef(HKEY_LOCAL_MACHINE); | ||
match hklm.open_subkey("SOFTWARE\\Respawn\\Titanfall2") { | ||
Ok(tf) => { | ||
let game_path_str: String = tf.get_value("Install Dir")?; | ||
|
||
match check_is_valid_game_path(&game_path_str) { | ||
Ok(()) => { | ||
return Ok(game_path_str.to_string()); | ||
} | ||
Err(err) => { | ||
log::warn!("{err}"); | ||
} | ||
} | ||
} | ||
Err(err) => { | ||
log::warn!("Couldn't find {origin_id}: {err}") | ||
log::warn!("{err}"); | ||
} | ||
} | ||
} | ||
|
||
Err(anyhow!("No Origin install path found")) | ||
Err(anyhow!("No Origin / EA App install path found")) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters