mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-03 08:02:19 +00:00
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:
co-authored by
Claude Opus 5.5
parent
c728346a15
commit
9028432e8a
Generated
+10
@@ -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"
|
||||
|
||||
@@ -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 }
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user