aboutsummaryrefslogtreecommitdiff
path: root/src-tauri/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src-tauri/src/main.rs')
-rw-r--r--src-tauri/src/main.rs27
1 files changed, 1 insertions, 26 deletions
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
index 1d20bf74..93f67a33 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -122,7 +122,7 @@ fn main() {
get_flightcore_version_number,
northstar::get_northstar_version_number,
check_is_northstar_outdated,
- verify_install_location,
+ repair_and_verify::verify_install_location,
platform_specific::get_host_os,
northstar::install::install_northstar_wrapper,
northstar::install::update_northstar,
@@ -266,18 +266,6 @@ async fn check_is_northstar_outdated(
}
}
-/// Checks if is valid Titanfall2 install based on certain conditions
-#[tauri::command]
-async fn verify_install_location(game_path: String) -> bool {
- match check_is_valid_game_path(&game_path) {
- Ok(()) => true,
- Err(err) => {
- log::warn!("{}", err);
- false
- }
- }
-}
-
/// Installs the specified mod
#[tauri::command]
async fn install_mod_wrapper(
@@ -418,16 +406,3 @@ pub struct NorthstarMod {
pub enabled: bool,
pub directory: String,
}
-
-/// Checks whether the provided path is a valid Titanfall2 gamepath by checking against a certain set of criteria
-pub fn check_is_valid_game_path(game_install_path: &str) -> Result<(), String> {
- let path_to_titanfall2_exe = format!("{game_install_path}/Titanfall2.exe");
- let is_correct_game_path = std::path::Path::new(&path_to_titanfall2_exe).exists();
- log::info!("Titanfall2.exe exists in path? {}", is_correct_game_path);
-
- // Exit early if wrong game path
- if !is_correct_game_path {
- return Err(format!("Incorrect game path \"{game_install_path}\"")); // Return error cause wrong game path
- }
- Ok(())
-}