-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.rs
36 lines (34 loc) · 1.01 KB
/
build.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#[cfg(target_os = "windows")]
use winres;
#[cfg(target_os = "windows")]
fn main() {
use std::io::Write;
// only build the resource for release builds
// as calling rc.exe might be slow
if std::env::var("PROFILE").unwrap() == "release" {
let mut res = winres::WindowsResource::new();
res.set_icon("resources\\ico\\fiscalidade_server.ico")
.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(error) => {
write!(std::io::stderr(), "{}", error).unwrap();
std::process::exit(1);
}
Ok(_) => {}
}
}
}
#[cfg(not(target_os = "windows"))]
fn main() {}