diff options
author | GeckoEidechse <gecko.eidechse+git@pm.me> | 2022-09-10 00:16:59 +0200 |
---|---|---|
committer | GeckoEidechse <gecko.eidechse+git@pm.me> | 2022-09-10 00:16:59 +0200 |
commit | 6cf9f19406dc4eb9463927bba85c71633f8f6fdb (patch) | |
tree | 034012e9fb1bf585363d6e6f61e1a5aaf31fa09b /src-tauri/src/lib.rs | |
parent | c7edfc4b008ac88937ab04cae1f66813d55040cd (diff) | |
download | FlightCore-6cf9f19406dc4eb9463927bba85c71633f8f6fdb.tar.gz FlightCore-6cf9f19406dc4eb9463927bba85c71633f8f6fdb.zip |
Implement manually selecting TF|2 install location
Diffstat (limited to 'src-tauri/src/lib.rs')
-rw-r--r-- | src-tauri/src/lib.rs | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index cf1213d1..d0c76d8e 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -1,4 +1,5 @@ use anyhow::{anyhow, Context, Result}; +use thermite::install; use zip::ZipArchive; #[derive(Debug)] @@ -47,16 +48,9 @@ pub fn find_game_install_location() -> Result<(String, InstallType), anyhow::Err } /// Returns the current Northstar version number as a string -pub fn get_northstar_version_number() -> Result<String, anyhow::Error> { - // TODO: if `find_game_install_location` is unable to find game_path then function will fail to detect - // Northstar install, even if game_path is known due to user entering it manually - let (install_location, install_type) = match find_game_install_location() { - Ok((path, install_type)) => (path, install_type), - Err(err) => return Err(err), - }; - - println!("{}", install_location); - println!("{:?}", install_type); +pub fn get_northstar_version_number(game_path: String) -> Result<String, anyhow::Error> { + println!("{}", game_path); + // println!("{:?}", install_type); // TODO: // Check if NorthstarLauncher.exe exists and check its version number @@ -68,7 +62,7 @@ pub fn get_northstar_version_number() -> Result<String, anyhow::Error> { ]; let initial_version_number = match check_mod_version_number(format!( "{}/{}/mods/{}", - install_location, profile_folder, core_mods[0] + game_path, profile_folder, core_mods[0] )) { Ok(version_number) => version_number, Err(err) => return Err(err), @@ -77,7 +71,7 @@ pub fn get_northstar_version_number() -> Result<String, anyhow::Error> { for core_mod in core_mods { let current_version_number = match check_mod_version_number(format!( "{}/{}/mods/{}", - install_location, profile_folder, core_mod + game_path, profile_folder, core_mod )) { Ok(version_number) => version_number, Err(err) => return Err(err), |