Implement auto-update routine
This commit is contained in:
@@ -19,6 +19,16 @@
|
||||
fn main() {
|
||||
println!("cargo:rerun-if-changed=build.rs");
|
||||
println!("cargo:rerun-if-changed=resources/icon.ico");
|
||||
// winres derives FileVersion / ProductVersion from `CARGO_PKG_VERSION`,
|
||||
// which is sourced from `Cargo.toml`. Without this directive, cargo
|
||||
// happily skips the build script when only the version field changed
|
||||
// (build.rs and the .ico are byte-identical), and the resulting EXE
|
||||
// ships with stale "FileVersion" / "ProductVersion" properties — the
|
||||
// binary itself is the new build, but Explorer's Properties dialog
|
||||
// and any Authenticode tooling that reads the resource block see the
|
||||
// previous version. Forcing a re-run on Cargo.toml changes is cheap
|
||||
// (winres compile is sub-second) and bulletproof.
|
||||
println!("cargo:rerun-if-changed=Cargo.toml");
|
||||
|
||||
let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap_or_default();
|
||||
if target_os != "windows" {
|
||||
|
||||
Reference in New Issue
Block a user