Files
JoyD/Windows/CS/Framework4.0/BootLoader/build.rs
2026-04-08 09:07:49 +08:00

29 lines
964 B
Rust
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

use winres::WindowsResource;
fn main() {
// 仅在 Windows 上处理资源文件
#[cfg(windows)]
{
let mut res = WindowsResource::new();
// 设置 FileVersion = 1.0.0.0
// 编码方式高32位 = (major << 16 | minor)低32位 = (patch << 16 | build)
// 1.0.0.0 => 0x0001_0000_0000_0000
res.set_version_info(winres::VersionInfo::FILEVERSION, 0x0001_0000_0000_0000);
res.set_version_info(winres::VersionInfo::PRODUCTVERSION, 0x0001_0000_0000_0000);
// 设置产品名和公司名
res.set("ProductName", "BootLoader");
res.set("CompanyName", "JoyD");
res.set("FileDescription", "BootLoader Application");
res.set("LegalCopyright", "Copyright JoyD");
if let Err(e) = res.compile() {
eprintln!("Failed to compile resource file: {}", e);
std::process::exit(1);
}
}
println!("cargo:rerun-if-changed=build.rs");
}