diff --git a/Cargo.lock b/Cargo.lock index 04f7aa62f2a..1e42590aa24 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -314,7 +314,7 @@ dependencies = [ "cargo_metadata", "flate2", "tar", - "toml", + "toml 0.9.7", ] [[package]] @@ -388,7 +388,7 @@ dependencies = [ "tempfile", "thiserror 2.0.17", "time", - "toml", + "toml 0.9.7", "toml_edit", "tracing", "tracing-chrome", @@ -400,6 +400,7 @@ dependencies = [ "walkdir", "windows-sys 0.61.1", "winnow", + "winres", ] [[package]] @@ -493,7 +494,7 @@ dependencies = [ "snapbox", "tar", "time", - "toml", + "toml 0.9.7", "url", "walkdir", "windows-sys 0.61.1", @@ -532,7 +533,7 @@ dependencies = [ "serde_json", "snapbox", "thiserror 2.0.17", - "toml", + "toml 0.9.7", "unicode-xid", "url", ] @@ -4516,6 +4517,15 @@ dependencies = [ "tokio", ] +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + [[package]] name = "toml" version = "0.9.7" @@ -5255,6 +5265,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "winres" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b68db261ef59e9e52806f688020631e987592bd83619edccda9c47d42cde4f6c" +dependencies = [ + "toml 0.5.11", +] + [[package]] name = "wit-bindgen" version = "0.46.0" diff --git a/Cargo.toml b/Cargo.toml index 5f1830ddf34..fefb6b84227 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -242,6 +242,9 @@ openssl = { workspace = true, optional = true } [target.'cfg(windows)'.dependencies] cargo-credential-wincred.workspace = true +[target.'cfg(windows)'.build-dependencies] +winres = "0.1" + [target.'cfg(windows)'.dependencies.windows-sys] workspace = true features = [ diff --git a/build.rs b/build.rs index 9b1e2662eaf..2d0cf48cb25 100644 --- a/build.rs +++ b/build.rs @@ -4,9 +4,24 @@ use std::fs; use std::path::Path; use std::process::Command; +// Function which adds ferris as a ICON for Cargo +#[cfg(windows)] +fn add_icon_windows() { + // ICON Link + // https://github.com/ShadowDara/photos-upload/tree/main/ferris + // https://raw.githubusercontent.com/ShadowDara/photos-upload/refs/heads/main/ferris/cargo.ico + let mut res = winres::WindowsResource::new(); + res.set_icon("cargo.ico"); + res.compile().unwrap(); +} + fn main() { commit_info(); compress_man(); + + #[cfg(windows)] + add_icon_windows(); + windows_manifest(); // ALLOWED: Accessing environment during build time shouldn't be prohibited. #[allow(clippy::disallowed_methods)] diff --git a/cargo.ico b/cargo.ico new file mode 100644 index 00000000000..d1e388b492a Binary files /dev/null and b/cargo.ico differ