fix: try to fix install service

This commit is contained in:
MystiPanda
2024-07-16 11:28:04 +08:00
parent 3f321c8801
commit f2372a13e8
12 changed files with 219 additions and 103 deletions

View File

@@ -4,4 +4,3 @@ pub mod init;
pub mod resolve;
pub mod server;
pub mod tmpl;
pub mod unix_helper;

View File

@@ -8,6 +8,7 @@ use serde_yaml::Mapping;
use std::net::TcpListener;
use tauri::api::notification;
use tauri::{App, AppHandle, Manager};
#[cfg(not(target_os = "linux"))]
use window_shadows::set_shadow;
pub static VERSION: OnceCell<String> = OnceCell::new();

View File

@@ -1,14 +0,0 @@
#[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",
}
}