fix: restore wine configuration

This commit is contained in:
2025-03-14 15:16:49 +01:00
parent e1ff28d4e0
commit 62edcdae08
13 changed files with 97 additions and 72 deletions

View File

@ -1,6 +1,7 @@
use anyhow::{anyhow, Result};
use serde::{Deserialize, Serialize};
use tauri::{AppHandle, Manager};
use tokio::process::Command;
use std::{path::{Path, PathBuf}, sync::OnceLock};
use crate::model::misc::Game;
@ -86,7 +87,7 @@ pub fn copy_directory(src: impl AsRef<Path>, dst: impl AsRef<Path>, recursive: b
#[cfg(target_os = "linux")]
pub async fn symlink(src: impl AsRef<Path>, dst: impl AsRef<Path>) -> std::io::Result<()> {
fs::symlink(src, dst).await
tokio::fs::symlink(src, dst).await
}
#[cfg(target_os = "windows")]
@ -100,8 +101,6 @@ pub static CREATE_NO_WINDOW: u32 = 0x08000000;
#[cfg(target_os = "windows")]
pub async fn pkill(process_name: &str) {
use tokio::process::Command;
_ = Command::new("taskkill.exe").arg("/f").arg("/im").arg(process_name)
.creation_flags(CREATE_NO_WINDOW).output().await;
}
@ -120,7 +119,10 @@ pub fn clean_up_opts(dir: impl AsRef<Path>) -> Result<()> {
let path = entry.path();
log::debug!("{:?}", path);
if path.is_symlink() {
#[cfg(target_os = "windows")]
std::fs::remove_dir(path)?;
#[cfg(not(target_os = "windows"))]
std::fs::remove_file(path)?;
} else {
log::error!("Not a symlink: {:?}", path);
}