fix(windows): show UAC prompt for TUN service install/uninstall (#4959)

This commit is contained in:
Sline
2025-10-07 10:01:35 +08:00
committed by GitHub
Unverified
parent d25eb49bfe
commit c05395c258
2 changed files with 3 additions and 3 deletions

View File

@@ -45,7 +45,7 @@ async fn uninstall_service() -> Result<()> {
let token = Token::with_current_process()?;
let level = token.privilege_level()?;
let status = match level {
PrivilegeLevel::NotPrivileged => RunasCommand::new(uninstall_path).show(false).status()?,
PrivilegeLevel::NotPrivileged => RunasCommand::new(uninstall_path).show(true).status()?,
_ => StdCommand::new(uninstall_path)
.creation_flags(0x08000000)
.status()?,
@@ -80,7 +80,7 @@ async fn install_service() -> Result<()> {
let token = Token::with_current_process()?;
let level = token.privilege_level()?;
let status = match level {
PrivilegeLevel::NotPrivileged => RunasCommand::new(install_path).show(false).status()?,
PrivilegeLevel::NotPrivileged => RunasCommand::new(install_path).show(true).status()?,
_ => StdCommand::new(install_path)
.creation_flags(0x08000000)
.status()?,

View File

@@ -18,7 +18,7 @@ pub fn invoke_uwptools() -> Result<()> {
let level = token.privilege_level()?;
match level {
PrivilegeLevel::NotPrivileged => RunasCommand::new(tool_path).status()?,
PrivilegeLevel::NotPrivileged => RunasCommand::new(tool_path).show(true).status()?,
_ => StdCommand::new(tool_path).status()?,
};