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>
This commit is contained in:
parent
bba771bd08
commit
68a9bbced0
|
|
@ -4,6 +4,7 @@ use std::path::{Path, PathBuf};
|
||||||
use std::process::{Command, Stdio};
|
use std::process::{Command, Stdio};
|
||||||
|
|
||||||
pub(crate) const APP_NAME: &str = "Graphite";
|
pub(crate) const APP_NAME: &str = "Graphite";
|
||||||
|
pub(crate) const APP_BIN: &str = "graphite";
|
||||||
|
|
||||||
pub(crate) fn workspace_path() -> PathBuf {
|
pub(crate) fn workspace_path() -> PathBuf {
|
||||||
PathBuf::from(env!("CARGO_WORKSPACE_DIR"))
|
PathBuf::from(env!("CARGO_WORKSPACE_DIR"))
|
||||||
|
|
@ -34,7 +35,7 @@ pub(crate) fn build_bin(package: &str, bin: Option<&str>) -> Result<PathBuf, Box
|
||||||
}
|
}
|
||||||
run_command("cargo", &args)?;
|
run_command("cargo", &args)?;
|
||||||
let profile_path = profile_path();
|
let profile_path = profile_path();
|
||||||
let mut bin_path = if let Some(bin) = bin { profile_path.join(bin) } else { profile_path.join(package) };
|
let mut bin_path = if let Some(bin) = bin { profile_path.join(bin) } else { profile_path.join(APP_BIN) };
|
||||||
if cfg!(target_os = "windows") {
|
if cfg!(target_os = "windows") {
|
||||||
bin_path.set_extension("exe");
|
bin_path.set_extension("exe");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,8 @@ use std::error::Error;
|
||||||
|
|
||||||
use crate::common::*;
|
use crate::common::*;
|
||||||
|
|
||||||
const PACKAGE: &str = "graphite-desktop-platform-linux";
|
|
||||||
|
|
||||||
pub fn main() -> Result<(), Box<dyn Error>> {
|
pub fn main() -> Result<(), Box<dyn Error>> {
|
||||||
let app_bin = build_bin(PACKAGE, None)?;
|
let app_bin = build_bin("graphite-desktop-platform-linux", None)?;
|
||||||
|
|
||||||
// TODO: Implement bundling for linux
|
// TODO: Implement bundling for linux
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,6 @@ use crate::common::*;
|
||||||
|
|
||||||
const APP_ID: &str = "art.graphite.Graphite";
|
const APP_ID: &str = "art.graphite.Graphite";
|
||||||
|
|
||||||
const PACKAGE: &str = "graphite-desktop-platform-mac";
|
|
||||||
const HELPER_BIN: &str = "graphite-desktop-platform-mac-helper";
|
|
||||||
|
|
||||||
const ICONS_FILE_NAME: &str = "graphite.icns";
|
const ICONS_FILE_NAME: &str = "graphite.icns";
|
||||||
|
|
||||||
const EXEC_PATH: &str = "Contents/MacOS";
|
const EXEC_PATH: &str = "Contents/MacOS";
|
||||||
|
|
@ -18,8 +15,8 @@ const RESOURCES_PATH: &str = "Contents/Resources";
|
||||||
const CEF_FRAMEWORK: &str = "Chromium Embedded Framework.framework";
|
const CEF_FRAMEWORK: &str = "Chromium Embedded Framework.framework";
|
||||||
|
|
||||||
pub fn main() -> Result<(), Box<dyn Error>> {
|
pub fn main() -> Result<(), Box<dyn Error>> {
|
||||||
let app_bin = build_bin(PACKAGE, None)?;
|
let app_bin = build_bin("graphite-desktop-platform-mac", None)?;
|
||||||
let helper_bin = build_bin(PACKAGE, Some(HELPER_BIN))?;
|
let helper_bin = build_bin("graphite-desktop-platform-mac", Some("helper"))?;
|
||||||
|
|
||||||
let profile_path = profile_path();
|
let profile_path = profile_path();
|
||||||
let app_dir = bundle(&profile_path, &app_bin, &helper_bin);
|
let app_dir = bundle(&profile_path, &app_bin, &helper_bin);
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,10 @@ use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
use crate::common::*;
|
use crate::common::*;
|
||||||
|
|
||||||
const PACKAGE: &str = "graphite-desktop-platform-win";
|
const EXECUTABLE: &str = "Graphite.exe";
|
||||||
const EXECUTABLE: &str = "graphite.exe";
|
|
||||||
|
|
||||||
pub fn main() -> Result<(), Box<dyn Error>> {
|
pub fn main() -> Result<(), Box<dyn Error>> {
|
||||||
let app_bin = build_bin(PACKAGE, None)?;
|
let app_bin = build_bin("graphite-desktop-platform-win", None)?;
|
||||||
|
|
||||||
let executable = bundle(&profile_path(), &app_bin);
|
let executable = bundle(&profile_path(), &app_bin);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,5 +8,9 @@ repository = ""
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
rust-version = "1.87"
|
rust-version = "1.87"
|
||||||
|
|
||||||
|
[[bin]]
|
||||||
|
name = "graphite"
|
||||||
|
path = "src/main.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
graphite-desktop = { path = "../.." }
|
graphite-desktop = { path = "../.." }
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,11 @@ edition = "2024"
|
||||||
rust-version = "1.87"
|
rust-version = "1.87"
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "graphite-desktop-platform-mac-helper"
|
name = "graphite"
|
||||||
|
path = "src/main.rs"
|
||||||
|
|
||||||
|
[[bin]]
|
||||||
|
name = "helper"
|
||||||
path = "src/helper.rs"
|
path = "src/helper.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,10 @@ repository = ""
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
rust-version = "1.87"
|
rust-version = "1.87"
|
||||||
|
|
||||||
|
[[bin]]
|
||||||
|
name = "graphite"
|
||||||
|
path = "src/main.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
graphite-desktop = { path = "../.." }
|
graphite-desktop = { path = "../.." }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,30 @@ fn main() {
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
{
|
{
|
||||||
let mut res = winres::WindowsResource::new();
|
let mut res = winres::WindowsResource::new();
|
||||||
|
|
||||||
res.set_icon("../../../branding/app-icons/graphite.ico");
|
res.set_icon("../../../branding/app-icons/graphite.ico");
|
||||||
|
|
||||||
|
res.set_language(0x0409); // English (US)
|
||||||
|
|
||||||
|
// TODO: Replace with actual version
|
||||||
|
res.set_version_info(winres::VersionInfo::FILEVERSION, {
|
||||||
|
const MAJOR: u64 = 0;
|
||||||
|
const MINOR: u64 = 999;
|
||||||
|
const PATCH: u64 = 0;
|
||||||
|
const RELEASE: u64 = 0;
|
||||||
|
(MAJOR << 48) | (MINOR << 32) | (PATCH << 16) | RELEASE
|
||||||
|
});
|
||||||
|
res.set("FileVersion", "0.999.0.0");
|
||||||
|
res.set("ProductVersion", "0.999.0.0");
|
||||||
|
|
||||||
|
res.set("OriginalFilename", "Graphite.exe");
|
||||||
|
|
||||||
|
res.set("FileDescription", "Graphite");
|
||||||
|
res.set("ProductName", "Graphite");
|
||||||
|
|
||||||
|
res.set("LegalCopyright", "Copyright © 2025 Graphite Labs, LLC");
|
||||||
|
res.set("CompanyName", "Graphite Labs, LLC");
|
||||||
|
|
||||||
res.compile().expect("Failed to compile Windows resources");
|
res.compile().expect("Failed to compile Windows resources");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue