feat: some workarounds with "kill game process"

This commit is contained in:
Observer KRypt0n_ 2023-12-23 16:24:05 +02:00
parent c59261c28d
commit 334539dbf8
No known key found for this signature in database
GPG key ID: 844DA47BA25FE1E2

View file

@ -523,6 +523,8 @@ impl SimpleComponent for App {
})); }));
let result = std::process::Command::new("pkill") let result = std::process::Command::new("pkill")
.arg("-f") // full text search
.arg("-i") // case-insensitive
.arg("GenshinImpact|YuanShen|unlocker\\.exe") .arg("GenshinImpact|YuanShen|unlocker\\.exe")
.spawn(); .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 // Doesn't work on all the systems
// e.g. won't work if you didn't install wine system-wide // e.g. won't work if you didn't install wine system-wide
// there's some reasons for it // 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() { // match Config::get() {
// Ok(config) => { // Ok(config) => {
// match config.get_selected_wine() { // match config.get_selected_wine() {
// Ok(Some(version)) => { // 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))) // dbg!(String::from_utf8_lossy(&result.as_ref().ok().unwrap().stdout));
// .stop_processes(false); // dbg!(String::from_utf8_lossy(&result.as_ref().ok().unwrap().stderr));
// if let Err(err) = result { // if let Err(err) = result {
// sender.input(AppMsg::Toast { // sender.input(AppMsg::Toast {