From 3ee371998a7b32fb31cdf8a09362c9f10e61462b Mon Sep 17 00:00:00 2001 From: Lncvrt Date: Tue, 24 Mar 2026 19:01:44 -0700 Subject: [PATCH] Should fix linux/macos BIE support? --- src-tauri/src/lib.rs | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index a03d748..8f36137 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -558,7 +558,12 @@ fn launch_game( } } - if platform() == "macos" { + let bepinex_folder = match app.path().app_local_data_dir() { + Ok(p) => p.join("game").join(&name).join("BepInEx"), + Err(_) => return, + }; + + if platform() == "macos" && !bepinex_folder.exists() { if let Err(_) = Command::new("open") .arg(&executable) .current_dir(&game_folder) @@ -567,8 +572,18 @@ fn launch_game( eprintln!("Failed to launch game on macOS"); } } else { - if let Err(_) = Command::new(&exe_path).current_dir(&game_folder).spawn() { - eprintln!("Failed to launch game"); + if (platform() == "macos" || platform() == "linux") && bepinex_folder.exists() { + if let Err(_) = Command::new("./run_bepinex.sh") + .arg(&executable) + .current_dir(&game_folder) + .spawn() + { + eprintln!("Failed to launch game"); + } + } else { + if let Err(_) = Command::new(&exe_path).current_dir(&game_folder).spawn() { + eprintln!("Failed to launch game"); + } } } }