From 4ea9df5db73c5b848510271734b1a2d5172bc82b Mon Sep 17 00:00:00 2001 From: fnrir Date: Fri, 18 Aug 2023 14:30:01 +0200 Subject: [PATCH] Implement wipe_registry --- src-tauri/src/system_helpers.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src-tauri/src/system_helpers.rs b/src-tauri/src/system_helpers.rs index d266bc9..45b0c98 100644 --- a/src-tauri/src/system_helpers.rs +++ b/src-tauri/src/system_helpers.rs @@ -599,7 +599,23 @@ pub fn stop_service(service: String) -> bool { .is_ok() } -#[cfg(unix)] +#[cfg(target_os = "linux")] +#[tauri::command] +pub fn wipe_registry(exec_name: String) { + println!("Wiping registry"); + let regpath = format!("HKCU\\Software\\miHoYo\\{}", exec_name); + let mut cmd = aagl_wine_run("reg", None); + cmd.args([ + "DELETE", + ®path, + "/f", + "/v", + "MIHOYOSDK_ADL_PROD_OVERSEA_h1158948810", + ]); + let _ = cmd.spawn_its_fine_really("Error wiping registry"); +} + +#[cfg(target_os = "macos")] #[tauri::command] pub fn wipe_registry(_exec_name: String) {}