-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.rs
64 lines (57 loc) · 2.44 KB
/
build.rs
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<<<<<<< HEAD
use std::fs;
use std::env;
use winres::WindowsResource;
fn main() {
// Get the current build date and time
let build_date = chrono::Utc::now().format("%Y-%m-%d %H:%M:%S UTC").to_string();
// Write the build date to a file
let out_dir = env::var("OUT_DIR").unwrap();
let dest_path = format!("{}/build_date.txt", out_dir);
fs::write(&dest_path, &build_date).unwrap();
if env::var_os("CARGO_CFG_WINDOWS").is_some() {
// Add a version resource to the executable
let mut res = WindowsResource::new();
res.set_icon("assets/Bootstrapper.ico");
res.set_language(0x0409); // US English
res.set("FileVersion", env!("CARGO_PKG_VERSION"));
res.set("FileDescription", "SYNTAX 2 Windows Bootstrapper");
res.set("ProductName", "SYNTAX 2 Bootstrapper");
res.set("ProductVersion", env!("CARGO_PKG_VERSION"));
res.set("InternalName", "SYNTAX 2 Bootstrapper");
res.set("OriginalFilename", "SyntaxPlayerLauncher.exe");
res.set("CompanyName", "SYNTAX 2 Corporation");
res.set("LegalCopyright", "Copyright (c) 2024");
res.compile().unwrap();
}
println!("cargo:rerun-if-changed=build.rs");
}
=======
use std::fs;
use std::env;
use winres::WindowsResource;
fn main() {
// Get the current build date and time
let build_date = chrono::Utc::now().format("%Y-%m-%d %H:%M:%S UTC").to_string();
// Write the build date to a file
let out_dir = env::var("OUT_DIR").unwrap();
let dest_path = format!("{}/build_date.txt", out_dir);
fs::write(&dest_path, &build_date).unwrap();
if env::var_os("CARGO_CFG_WINDOWS").is_some() {
// Add a version resource to the executable
let mut res = WindowsResource::new();
res.set_icon("assets/Bootstrapper.ico");
res.set_language(0x0409); // US English
res.set("FileVersion", env!("CARGO_PKG_VERSION"));
res.set("FileDescription", "SYNTAX 2 Windows Bootstrapper");
res.set("ProductName", "SYNTAX 2 Bootstrapper");
res.set("ProductVersion", env!("CARGO_PKG_VERSION"));
res.set("InternalName", "SYNTAX 2 Bootstrapper");
res.set("OriginalFilename", "SyntaxPlayerLauncher.exe");
res.set("CompanyName", "SYNTAX 2 Corporation");
res.set("LegalCopyright", "Copyright (c) 2024");
res.compile().unwrap();
}
println!("cargo:rerun-if-changed=build.rs");
}
>>>>>>> 6678d3a6803a9db8309e3540b88277c10ce99f5f