replace cmd.exe with rustdek.exe when check uac

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages 2022-10-22 16:56:21 +08:00
parent b14f457474
commit 41893e2ac2

View File

@ -1478,7 +1478,13 @@ pub fn run_uac(exe: &str, arg: &str) -> ResultType<bool> {
}
pub fn check_super_user_permission() -> ResultType<bool> {
run_uac("cmd", "/c /q")
run_uac(
std::env::current_exe()?
.to_string_lossy()
.to_string()
.as_str(),
"--version",
)
}
pub fn elevate(arg: &str) -> ResultType<bool> {