Fix using bash forcefully even if it doesn't exist for launching with wine
This commit is contained in:
1 file changed
+15
-4
+15
-4
@@ -427,8 +427,7 @@ fn launch_game(
|
|||||||
//if already running on macos, it'll auto take the user to that proccess
|
//if already running on macos, it'll auto take the user to that proccess
|
||||||
#[cfg(any(target_os = "windows", target_os = "linux"))]
|
#[cfg(any(target_os = "windows", target_os = "linux"))]
|
||||||
{
|
{
|
||||||
use tauri_plugin_dialog::DialogExt;
|
use tauri_plugin_dialog::{DialogExt, MessageDialogKind};
|
||||||
use tauri_plugin_dialog::MessageDialogKind;
|
|
||||||
|
|
||||||
if !use_wine && is_running_by_path(&exe_path) {
|
if !use_wine && is_running_by_path(&exe_path) {
|
||||||
app.dialog()
|
app.dialog()
|
||||||
@@ -449,13 +448,25 @@ fn launch_game(
|
|||||||
let quoted_path = format!("\"{}\"", exe_path.to_string_lossy());
|
let quoted_path = format!("\"{}\"", exe_path.to_string_lossy());
|
||||||
let cmd = wine_command.replace("%path%", "ed_path);
|
let cmd = wine_command.replace("%path%", "ed_path);
|
||||||
|
|
||||||
if let Err(_) = Command::new("bash")
|
if let Err(e) =
|
||||||
|
Command::new(&std::env::var("SHELL").unwrap_or_else(|_| "/bin/sh".to_string()))
|
||||||
.arg("-c")
|
.arg("-c")
|
||||||
.arg(cmd)
|
.arg(cmd)
|
||||||
.current_dir(&game_folder)
|
.current_dir(&game_folder)
|
||||||
.spawn()
|
.spawn()
|
||||||
{
|
{
|
||||||
eprintln!("Failed to launch game with Wine");
|
use tauri_plugin_dialog::{DialogExt, MessageDialogKind};
|
||||||
|
|
||||||
|
eprintln!("Failed to launch game with Wine: {}", e);
|
||||||
|
|
||||||
|
app.dialog()
|
||||||
|
.message(format!(
|
||||||
|
"{} failed to launch with Wine\n\n{}",
|
||||||
|
display_name, e
|
||||||
|
))
|
||||||
|
.kind(MessageDialogKind::Error)
|
||||||
|
.title("Game already running")
|
||||||
|
.show(|_| {});
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in new issue
Block a user