Compare commits

...

2 Commits

+9 -5
View File
@@ -450,8 +450,6 @@ pub async fn run_osu(folder: String, patch: bool) -> Result<(), String> {
}
};
#[cfg(windows)]
{
if patch {
let patcher_exe_path = PathBuf::from(&folder)
.join("EZPPLauncher")
@@ -459,8 +457,6 @@ pub async fn run_osu(folder: String, patch: bool) -> Result<(), String> {
.join("osu!.patcher.exe");
if patcher_exe_path.exists() {
#[cfg(windows)]
{
let mut sys = System::new_all();
loop {
@@ -486,12 +482,20 @@ pub async fn run_osu(folder: String, patch: bool) -> Result<(), String> {
sleep(Duration::from_millis(500)).await;
}
#[cfg(windows)]
{
let _ = Command::new(&patcher_exe_path)
.creation_flags(DETACHED_PROCESS | CREATE_NEW_PROCESS_GROUP)
.spawn()
.map_err(|e| format!("Failed to run patcher: {e}"))?;
}
#[cfg(not(windows))]
{
let _ = Command::new("osu-wine")
.arg("--wine")
.arg(&patcher_exe_path)
.spawn()
.map_err(|e| format!("Failed to run patcher: {}", e))?;
}
}
}