feat(Compat): Implemented spawning with umu (using umu-wrapper-lib)

Signed-off-by: quexeky <git@quexeky.dev>
This commit is contained in:
quexeky
2024-12-30 13:12:04 +11:00
parent 95f2174f8d
commit 88b2505e71
3 changed files with 16 additions and 1 deletions

View File

@ -10,6 +10,7 @@ use std::{
use log::{info, warn};
use serde::{Deserialize, Serialize};
use tauri::{AppHandle, Manager};
use umu_wrapper_lib::command_builder::UmuCommandBuilder;
use crate::{
db::{GameStatus, GameTransientStatus, DATA_ROOT_DIR},
@ -315,6 +316,7 @@ impl ProcessHandler for NativeGameLauncher {
}
}
const UMU_LAUNCHER_EXECUTABLE: &str = "umu-run";
struct UMULauncher;
impl ProcessHandler for UMULauncher {
fn launch_process(
@ -327,6 +329,11 @@ impl ProcessHandler for UMULauncher {
log_file: File,
error_file: File,
) -> Result<Child, String> {
todo!()
UmuCommandBuilder::new(UMU_LAUNCHER_EXECUTABLE, command)
.game_id(game_id.into())
.launch_args(args)
.build()
.spawn()
.map_err(|x| x.to_string())
}
}