From 334539dbf8c2c9c8b47c201e16092c9e519b5ccd Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Sat, 23 Dec 2023 16:24:05 +0200 Subject: [PATCH] feat: some workarounds with "kill game process" --- src/ui/main/mod.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/ui/main/mod.rs b/src/ui/main/mod.rs index 59f3380..3cd3312 100644 --- a/src/ui/main/mod.rs +++ b/src/ui/main/mod.rs @@ -523,6 +523,8 @@ impl SimpleComponent for App { })); let result = std::process::Command::new("pkill") + .arg("-f") // full text search + .arg("-i") // case-insensitive .arg("GenshinImpact|YuanShen|unlocker\\.exe") .spawn(); @@ -533,18 +535,26 @@ impl SimpleComponent for App { }); } + // Old warning message which I don't really understand now: + // // Doesn't work on all the systems // e.g. won't work if you didn't install wine system-wide // there's some reasons for it + // + // UPD: I've tried this, and the problem is that it's completely pointless + // For whatever reason it just doesn't work // match Config::get() { // Ok(config) => { // match config.get_selected_wine() { // Ok(Some(version)) => { - // use anime_launcher_sdk::wincompatlib::prelude::*; + // let result = version + // .to_wine(&config.components.path, Some(&config.game.wine.builds.join(&version.name))) + // .with_prefix(config.get_wine_prefix_path()) + // .stop_processes(true); - // let result = version.to_wine(config.components.path, Some(config.game.wine.builds.join(&version.name))) - // .stop_processes(false); + // dbg!(String::from_utf8_lossy(&result.as_ref().ok().unwrap().stdout)); + // dbg!(String::from_utf8_lossy(&result.as_ref().ok().unwrap().stderr)); // if let Err(err) = result { // sender.input(AppMsg::Toast {