diff options
author | GeckoEidechse <gecko.eidechse+git@pm.me> | 2022-09-09 23:03:39 +0200 |
---|---|---|
committer | GeckoEidechse <gecko.eidechse+git@pm.me> | 2022-09-09 23:03:39 +0200 |
commit | 8d5a7eba98fc01999d54ee89d1455ed024801359 (patch) | |
tree | cb870c29da8cf5a181c52d013863f7525a6452bd /src-tauri/src/main.rs | |
parent | 4db6b3d79b7289717a16603c527bc0d5e3ea0594 (diff) | |
download | FlightCore-8d5a7eba98fc01999d54ee89d1455ed024801359.tar.gz FlightCore-8d5a7eba98fc01999d54ee89d1455ed024801359.zip |
Add initial Northstar install support
still Steam version only
Diffstat (limited to 'src-tauri/src/main.rs')
-rw-r--r-- | src-tauri/src/main.rs | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index c83ddaeb..9328d7ce 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -9,7 +9,10 @@ use std::{ time::Duration, }; -use app::{check_is_valid_game_path, find_game_install_location, get_northstar_version_number}; +use app::{ + check_is_valid_game_path, find_game_install_location, get_northstar_version_number, + install_northstar, +}; use tauri::{Manager, State}; use tokio::time::sleep; @@ -50,7 +53,8 @@ fn main() { get_northstar_version_number_caller, check_is_northstar_outdated, verify_install_location, - get_host_os + get_host_os, + install_northstar_caller ]) .run(tauri::generate_context!()) .expect("error while running tauri application"); @@ -154,3 +158,16 @@ fn verify_install_location(game_path: String) -> bool { fn get_host_os() -> String { env::consts::OS.to_string() } + +#[tauri::command] +/// Installs Northstar to the given path +async fn install_northstar_caller(game_path: String) -> bool { + println!("Running"); + match install_northstar(&game_path).await { + Ok(_) => true, + Err(err) => { + println!("{}", err); + false + } + } +} |