Skip to content

Commit 68a9bbc

Browse files
Desktop: Update metadata for compiled application binaries (#3453)
* change bin names * set win product name * Update Windows metadata --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
1 parent bba771b commit 68a9bbc

File tree

8 files changed

+43
-13
lines changed

8 files changed

+43
-13
lines changed

desktop/bundle/src/common.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use std::path::{Path, PathBuf};
44
use std::process::{Command, Stdio};
55

66
pub(crate) const APP_NAME: &str = "Graphite";
7+
pub(crate) const APP_BIN: &str = "graphite";
78

89
pub(crate) fn workspace_path() -> PathBuf {
910
PathBuf::from(env!("CARGO_WORKSPACE_DIR"))
@@ -34,7 +35,7 @@ pub(crate) fn build_bin(package: &str, bin: Option<&str>) -> Result<PathBuf, Box
3435
}
3536
run_command("cargo", &args)?;
3637
let profile_path = profile_path();
37-
let mut bin_path = if let Some(bin) = bin { profile_path.join(bin) } else { profile_path.join(package) };
38+
let mut bin_path = if let Some(bin) = bin { profile_path.join(bin) } else { profile_path.join(APP_BIN) };
3839
if cfg!(target_os = "windows") {
3940
bin_path.set_extension("exe");
4041
}

desktop/bundle/src/linux.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@ use std::error::Error;
22

33
use crate::common::*;
44

5-
const PACKAGE: &str = "graphite-desktop-platform-linux";
6-
75
pub fn main() -> Result<(), Box<dyn Error>> {
8-
let app_bin = build_bin(PACKAGE, None)?;
6+
let app_bin = build_bin("graphite-desktop-platform-linux", None)?;
97

108
// TODO: Implement bundling for linux
119

desktop/bundle/src/mac.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ use crate::common::*;
77

88
const APP_ID: &str = "art.graphite.Graphite";
99

10-
const PACKAGE: &str = "graphite-desktop-platform-mac";
11-
const HELPER_BIN: &str = "graphite-desktop-platform-mac-helper";
12-
1310
const ICONS_FILE_NAME: &str = "graphite.icns";
1411

1512
const EXEC_PATH: &str = "Contents/MacOS";
@@ -18,8 +15,8 @@ const RESOURCES_PATH: &str = "Contents/Resources";
1815
const CEF_FRAMEWORK: &str = "Chromium Embedded Framework.framework";
1916

2017
pub fn main() -> Result<(), Box<dyn Error>> {
21-
let app_bin = build_bin(PACKAGE, None)?;
22-
let helper_bin = build_bin(PACKAGE, Some(HELPER_BIN))?;
18+
let app_bin = build_bin("graphite-desktop-platform-mac", None)?;
19+
let helper_bin = build_bin("graphite-desktop-platform-mac", Some("helper"))?;
2320

2421
let profile_path = profile_path();
2522
let app_dir = bundle(&profile_path, &app_bin, &helper_bin);

desktop/bundle/src/win.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ use std::path::{Path, PathBuf};
44

55
use crate::common::*;
66

7-
const PACKAGE: &str = "graphite-desktop-platform-win";
8-
const EXECUTABLE: &str = "graphite.exe";
7+
const EXECUTABLE: &str = "Graphite.exe";
98

109
pub fn main() -> Result<(), Box<dyn Error>> {
11-
let app_bin = build_bin(PACKAGE, None)?;
10+
let app_bin = build_bin("graphite-desktop-platform-win", None)?;
1211

1312
let executable = bundle(&profile_path(), &app_bin);
1413

desktop/platform/linux/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,9 @@ repository = ""
88
edition = "2024"
99
rust-version = "1.87"
1010

11+
[[bin]]
12+
name = "graphite"
13+
path = "src/main.rs"
14+
1115
[dependencies]
1216
graphite-desktop = { path = "../.." }

desktop/platform/mac/Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ edition = "2024"
99
rust-version = "1.87"
1010

1111
[[bin]]
12-
name = "graphite-desktop-platform-mac-helper"
12+
name = "graphite"
13+
path = "src/main.rs"
14+
15+
[[bin]]
16+
name = "helper"
1317
path = "src/helper.rs"
1418

1519
[dependencies]

desktop/platform/win/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ repository = ""
88
edition = "2024"
99
rust-version = "1.87"
1010

11+
[[bin]]
12+
name = "graphite"
13+
path = "src/main.rs"
14+
1115
[dependencies]
1216
graphite-desktop = { path = "../.." }
1317

desktop/platform/win/build.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,30 @@ fn main() {
22
#[cfg(target_os = "windows")]
33
{
44
let mut res = winres::WindowsResource::new();
5+
56
res.set_icon("../../../branding/app-icons/graphite.ico");
7+
8+
res.set_language(0x0409); // English (US)
9+
10+
// TODO: Replace with actual version
11+
res.set_version_info(winres::VersionInfo::FILEVERSION, {
12+
const MAJOR: u64 = 0;
13+
const MINOR: u64 = 999;
14+
const PATCH: u64 = 0;
15+
const RELEASE: u64 = 0;
16+
(MAJOR << 48) | (MINOR << 32) | (PATCH << 16) | RELEASE
17+
});
18+
res.set("FileVersion", "0.999.0.0");
19+
res.set("ProductVersion", "0.999.0.0");
20+
21+
res.set("OriginalFilename", "Graphite.exe");
22+
23+
res.set("FileDescription", "Graphite");
24+
res.set("ProductName", "Graphite");
25+
26+
res.set("LegalCopyright", "Copyright © 2025 Graphite Labs, LLC");
27+
res.set("CompanyName", "Graphite Labs, LLC");
28+
629
res.compile().expect("Failed to compile Windows resources");
730
}
831
}

0 commit comments

Comments
 (0)