Skip to content

Commit

Permalink
Added equireAdministrator manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
b1nhack committed Jun 4, 2023
1 parent 6df4218 commit 0c8dd50
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ once_cell = "1.17.2"
sysinfo = "0.29.0"
windows-sys = { version = "0.48.0", features = ["Win32_System_Services", "Win32_Security", "Win32_Foundation", "Win32_Storage_FileSystem"] }

[build-dependencies]
winres = "0.1.12"

[profile.release]
opt-level = "s"
debug = 0
Expand Down
24 changes: 24 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
use std::io::Write;

fn main() {
let mut res = winres::WindowsResource::new();
res.set_manifest(r#"
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
"#);

match res.compile() {
Err(e) => {
write!(std::io::stderr(), "{}", e).unwrap();
std::process::exit(1);
}
Ok(_) => ()
}
}

0 comments on commit 0c8dd50

Please sign in to comment.