-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathbuild.rs
More file actions
38 lines (34 loc) · 1.54 KB
/
build.rs
File metadata and controls
38 lines (34 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Build script to embed Windows resources and metadata
// This helps reduce antivirus false positives by making the executable look more legitimate
fn main() {
// Only compile resources on Windows
#[cfg(target_os = "windows")]
{
// Embed Windows resource file with version info and metadata
let mut res = winres::WindowsResource::new();
res.set_icon("icon.ico")
.set("ProductName", "Deadlock API Ingest")
.set(
"FileDescription",
"Monitors your Steam HTTP cache for Deadlock game replay files and automatically submits match metadata to the Deadlock API",
)
.set("CompanyName", "Deadlock API")
.set(
"LegalCopyright",
"Copyright (c) 2025 Deadlock API Contributors",
)
.set("OriginalFilename", "deadlock-api-ingest.exe")
.set("InternalName", "deadlock-api-ingest")
.set("ProductVersion", env!("CARGO_PKG_VERSION"))
.set("FileVersion", env!("CARGO_PKG_VERSION"));
// Compile the resource file
if let Err(e) = res.compile() {
// Don't fail the build if icon is missing, just warn
eprintln!("Warning: Failed to compile Windows resources: {}", e);
eprintln!("This is not critical, but the executable will lack version metadata.");
}
}
// Rerun if Cargo.toml changes (for version updates)
println!("cargo:rerun-if-changed=Cargo.toml");
println!("cargo:rerun-if-changed=icon.ico");
}