From 806758088d7701a39571ab6e1051046b0a418c12 Mon Sep 17 00:00:00 2001 From: Spencer <36741900+Spencer-0003@users.noreply.github.com> Date: Fri, 13 Jun 2025 07:30:55 +0100 Subject: [PATCH] maint: use UMU if found (#11) --- src/main.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index c52f04b..d399b0f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -549,9 +549,18 @@ fn launch(file_path: &PathBuf, args: &str) { fn launch(file_path: &PathBuf, args: &str) { println!("\n\nJoin the AlterWare Discord server:\nhttps://discord.gg/2ETE8engZM\n\n"); crate::println_info!("Launching {} {args}", file_path.display()); - let exit_status = if misc::is_program_in_path("wine") { - println!("Found wine, launching game using wine.\nIf you run into issues or want to launch a different way, run {} manually.", file_path.display()); - std::process::Command::new("wine") + + let launcher = if misc::is_program_in_path("umu-run") { + Some("umu-run") + } else if misc::is_program_in_path("wine") { + Some("wine") + } else { + None + }; + + let exit_status = if let Some(launcher) = launcher { + println!("Found {launcher}, launching game using {launcher}.\nIf you run into issues or want to launch a different way, run {} manually.", file_path.display()); + std::process::Command::new(launcher) .args([file_path.to_str().unwrap(), args.trim()]) .current_dir(file_path.parent().unwrap()) .spawn()