fix: embed a VERSIONINFO resource in the Windows binary (#11433)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ruben Fiszel
2026-09-30 09:20:58 +02:00
committed by GitHub
co-authored by Claude Opus 5.5
parent c728346a15
commit 9028432e8a
3 changed files with 28 additions and 0 deletions
+10
View File
@@ -14876,6 +14876,7 @@ dependencies = [
"windmill-worker-volumes",
"windows-service",
"windows-sys 0.52.0",
"winresource",
]
[[package]]
@@ -17382,6 +17383,15 @@ dependencies = [
"memchr",
]
[[package]]
name = "winresource"
version = "0.1.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0986a8b1d586b7d3e4fe3d9ea39fb451ae22869dcea4aa109d287a374d866087"
dependencies = [
"version_check",
]
[[package]]
name = "winsafe"
version = "0.0.19"
+3
View File
@@ -329,6 +329,9 @@ strum.workspace = true
windows-service = "0.7"
windows-sys = { version = "0.52", features = ["Win32_System_Services", "Win32_System_Console", "Win32_Foundation"] }
[target.'cfg(windows)'.build-dependencies]
winresource = { version = "0.1.31", default-features = false }
[target.'cfg(not(target_env = "msvc"))'.dependencies]
tikv-jemallocator = { optional = true, workspace = true }
tikv-jemalloc-sys = { optional = true, workspace = true }
+15
View File
@@ -2,4 +2,19 @@
fn main() {
// trigger recompilation when a new migration is added
println!("cargo:rerun-if-changed=migrations");
// Embed a VERSIONINFO resource so the exe's file properties carry the release
// version (from Cargo.toml), which Windows worker update scripts read.
// `cfg(windows)` is the host, matching the Windows-only build-dependency, so
// cross builds to Windows get no version resource.
#[cfg(windows)]
if std::env::var("CARGO_CFG_TARGET_OS").as_deref() == Ok("windows") {
winresource::WindowsResource::new()
.set("ProductName", "Windmill")
.set("FileDescription", "Windmill")
.set("CompanyName", "Windmill Labs, Inc.")
.set("LegalCopyright", "Copyright Windmill Labs, Inc.")
.compile()
.expect("failed to embed the Windows version resource");
}
}