Files
guba-indicator/rust/build.rs

36 lines
1.1 KiB
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 std::io;
#[cfg(windows)]
fn main() -> io::Result<()> {
// 设置Windows子系统为windows不显示控制台
let mut res = winres::WindowsResource::new();
// 设置应用程序图标 - 使用项目根目录的图标
let icon_path = std::path::Path::new("../guba.ico");
if icon_path.exists() {
res.set_icon("../guba.ico");
println!("cargo:rerun-if-changed=../guba.ico");
} else {
println!("cargo:warning=图标文件未找到: ../guba.ico");
}
// 设置文件属性
res.set_language(0x0804); // 中文(简体)
res.set("FileDescription", "股吧人气指示器");
res.set("ProductName", "股吧人气指示器");
res.set("OriginalFilename", "guba.exe");
res.set("InternalName", "guba");
res.set("CompanyName", "Guba Developer");
res.set("LegalCopyright", "Copyright (C) 2024");
// 关键设置Windows子系统为windowsGUI程序不显示控制台
res.set("Subsystem", "windows");
res.compile()
}
#[cfg(not(windows))]
fn main() {
// 非Windows平台不需要特殊处理
}