mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
use winres in portable
This commit is contained in:
@@ -1,17 +1,25 @@
|
||||
[package]
|
||||
name = "rustdesk-portable-packer"
|
||||
version = "0.1.0"
|
||||
version = "1.2.4"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
build = "build.rs"
|
||||
|
||||
[build-dependencies]
|
||||
embed-resource = "2.1"
|
||||
|
||||
[dependencies]
|
||||
brotli = "3.4"
|
||||
dirs = "5.0"
|
||||
md5 = "0.7"
|
||||
winapi = { version = "0.3", features = ["winbase"] }
|
||||
|
||||
[package.metadata.winres]
|
||||
LegalCopyright = "Copyright © 2024 Purslane, Inc."
|
||||
ProductName = "rustdesk"
|
||||
#ProductVersion = ""
|
||||
|
||||
[target.'cfg(target_os="windows")'.build-dependencies]
|
||||
winres = "0.1"
|
||||
winapi = { version = "0.3", features = [ "winnt", "pdh", "synchapi" ] }
|
||||
|
||||
|
||||
|
||||
@@ -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