Add HImage application icon and Windows packaging resources

This commit is contained in:
2026-11-02 19:12:18 +08:00
parent ac85474438
commit 58b47746df
27 changed files with 1356 additions and 1 deletions
+16
View File
@@ -0,0 +1,16 @@
fn main() {
println!("cargo:rerun-if-changed=assets/icon.ico");
println!("cargo:rerun-if-env-changed=HIMAGE_GENERATE_ICON");
if std::env::var_os("HIMAGE_GENERATE_ICON").is_some() {
return;
}
if std::env::var("CARGO_CFG_TARGET_OS").as_deref() == Ok("windows") {
#[cfg(windows)]
winresource::WindowsResource::new()
.set_icon("assets/icon.ico")
.set("FileDescription", "HImage 图片浏览器")
.set("ProductName", "HImage")
.compile()
.expect("failed to compile Windows icon resource");
}
}