mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-18 07:31:29 +03:00
use winres in portable
This commit is contained in:
@@ -1,10 +1,19 @@
|
||||
extern crate embed_resource;
|
||||
use std::fs;
|
||||
|
||||
fn main() {
|
||||
let runner_res_path = "Runner.res";
|
||||
match fs::metadata(runner_res_path) {
|
||||
Ok(_) => println!("cargo:rustc-link-lib=dylib:+verbatim=./libs/portable/Runner.res"),
|
||||
Err(_) => embed_resource::compile("icon.rc", embed_resource::NONE),
|
||||
#[cfg(windows)]
|
||||
{
|
||||
let mut res = winres::WindowsResource::new();
|
||||
res.set_icon("../../res/icon.ico")
|
||||
.set_language(winapi::um::winnt::MAKELANGID(
|
||||
winapi::um::winnt::LANG_ENGLISH,
|
||||
winapi::um::winnt::SUBLANG_ENGLISH_US,
|
||||
))
|
||||
.set_manifest_file("../../res/manifest.xml");
|
||||
match res.compile() {
|
||||
Err(e) => {
|
||||
write!(std::io::stderr(), "{}", e).unwrap();
|
||||
std::process::exit(1);
|
||||
}
|
||||
Ok(_) => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user