fix macos elevate (#1177)

This commit is contained in:
Sijie.Sun
2025-08-01 09:36:10 +08:00
committed by GitHub
parent 583c768f40
commit 43b9e6e6e9
7 changed files with 592 additions and 18 deletions

View File

@@ -1,6 +1,8 @@
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
mod elevate;
use std::collections::BTreeMap;
use easytier::{
@@ -128,7 +130,7 @@ fn toggle_window_visibility<R: tauri::Runtime>(app: &tauri::AppHandle<R>) {
#[cfg(not(target_os = "android"))]
fn check_sudo() -> bool {
let is_elevated = elevated_command::Command::is_elevated();
let is_elevated = elevate::Command::is_elevated();
if !is_elevated {
let exe_path = std::env::var("APPIMAGE")
.ok()
@@ -139,7 +141,7 @@ fn check_sudo() -> bool {
if args.contains(&AUTOSTART_ARG.to_owned()) {
stdcmd.arg(AUTOSTART_ARG);
}
elevated_command::Command::new(stdcmd)
elevate::Command::new(stdcmd)
.output()
.expect("Failed to run elevated command");
}