diff --git a/src-tauri/src/core/service.rs b/src-tauri/src/core/service.rs index 6981b11d..f414f8ef 100644 --- a/src-tauri/src/core/service.rs +++ b/src-tauri/src/core/service.rs @@ -89,20 +89,18 @@ pub async fn reinstall_service() -> Result<()> { let install_shell: String = install_path.to_string_lossy().replace(" ", "\\ "); let uninstall_shell: String = uninstall_path.to_string_lossy().replace(" ", "\\ "); - let elevator = crate::utils::help::linux_elevator(); let _ = match get_effective_uid() { 0 => StdCommand::new(uninstall_path).status()?, - _ => StdCommand::new(elevator) + _ => StdCommand::new("sudo") .arg("sh") .arg("-c") .arg(uninstall_shell) .status()?, }; - let elevator = crate::utils::help::linux_elevator(); let status = match get_effective_uid() { 0 => StdCommand::new(install_shell).status()?, - _ => StdCommand::new(elevator) + _ => StdCommand::new("sudo") .arg("sh") .arg("-c") .arg(install_shell) diff --git a/src-tauri/src/utils/help.rs b/src-tauri/src/utils/help.rs index ee47fa8b..3583540a 100644 --- a/src-tauri/src/utils/help.rs +++ b/src-tauri/src/utils/help.rs @@ -105,21 +105,6 @@ pub fn open_file(app: tauri::AppHandle, path: PathBuf) -> Result<()> { Ok(()) } -#[cfg(target_os = "linux")] -pub fn linux_elevator() -> &'static str { - use std::process::Command; - match Command::new("which").arg("pkexec").output() { - Ok(output) => { - if output.stdout.is_empty() { - "sudo" - } else { - "pkexec" - } - } - Err(_) => "sudo", - } -} - #[macro_export] macro_rules! error { ($result: expr) => {