fix(windows): show UAC prompt for TUN service install/uninstall (#4959)
This commit is contained in:
@@ -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()?,
|
||||
|
||||
@@ -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()?,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user