mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-28 07:14:40 +08:00
fix: set GID environment variable during service installation on Linux
This commit is contained in:
@@ -158,12 +158,16 @@ fn install_service() -> Result<()> {
|
||||
}
|
||||
|
||||
let install_shell: String = install_path.to_string_lossy().replace(" ", "\\ ");
|
||||
let gid = tauri_plugin_clash_verge_sysinfo::current_gid();
|
||||
|
||||
let elevator = crate::utils::help::linux_elevator();
|
||||
let status = if linux_running_as_root() {
|
||||
StdCommand::new(&install_path).status()?
|
||||
StdCommand::new(&install_path)
|
||||
.env("CLASH_VERGE_SERVICE_GID", gid.to_string())
|
||||
.status()?
|
||||
} else {
|
||||
let result = StdCommand::new(&elevator)
|
||||
.env("CLASH_VERGE_SERVICE_GID", gid.to_string())
|
||||
.arg("sh")
|
||||
.arg("-c")
|
||||
.arg(&install_shell)
|
||||
|
||||
Reference in New Issue
Block a user