From bf2ce22de6294f3416f7dade807006162a5da68b Mon Sep 17 00:00:00 2001 From: James Date: Fri, 3 Aug 2018 22:21:34 +1000 Subject: [PATCH] Use favicon + winres when building target artifact --- Cargo.lock | 10 ++++++++++ Cargo.toml | 8 ++++++++ README.md | 5 ++++- build.rs | 13 +++++++++++++ src/assets.rs | 2 +- static/favicon.ico | Bin 0 -> 15086 bytes static/img/logo.png | Bin 1844 -> 0 bytes static/index.html | 3 +++ 8 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 build.rs create mode 100644 static/favicon.ico delete mode 100644 static/img/logo.png diff --git a/Cargo.lock b/Cargo.lock index 0b4154a..bfb8cae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -306,6 +306,7 @@ dependencies = [ "toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "web-view 0.2.1 (git+https://github.com/Boscop/web-view.git?rev=555f422d09cbb94e82a728d47e9e07ca91963f6e)", + "winres 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "zip 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1029,6 +1030,14 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "winres" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "ws2_32-sys" version = "0.2.1" @@ -1176,5 +1185,6 @@ dependencies = [ "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +"checksum winres 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "f07dabda4e79413ecac65bc9a2234ad3d85dc49f9d289f868cd9d8611d88f28d" "checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" "checksum zip 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "e7341988e4535c60882d5e5f0b7ad0a9a56b080ade8bdb5527cb512f7b2180e0" diff --git a/Cargo.toml b/Cargo.toml index 3e4a178..7a1af9b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,6 +5,11 @@ authors = ["James "] repository = "https://github.com/j-selby/liftinstall.git" documentation = "https://liftinstall.jselby.net" description = "An adaptable installer for your application." +build = "build.rs" + +[package.metadata.winres] +ProductName = "yuzu Installer" +FileDescription = "An interactive installer for yuzu" [dependencies] web-view = {git = "https://github.com/Boscop/web-view.git", rev = "555f422d09cbb94e82a728d47e9e07ca91963f6e"} @@ -31,3 +36,6 @@ zip = "0.2.8" [target.'cfg(windows)'.dependencies] # NFD is needed on Windows, as web-view doesn't work correctly here nfd = "0.0.4" + +[target.'cfg(windows)'.build-dependencies] +winres = "0.1" diff --git a/README.md b/README.md index 669eb72..0eb53d1 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,10 @@ This is designed to be a more modern interpretation of Qt's Installer Framework, Building -------- -Add your logo to `static/img/logo.png`, modify the configuration file, then run: +- Add your favicon to `static/favicon.ico` +- Modify the configuration file as needed +- Tweak `package.metadata.winres` metadata in `Cargo.toml` +- Run: ```bash cargo build --release diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..4adb23a --- /dev/null +++ b/build.rs @@ -0,0 +1,13 @@ +#[cfg(windows)] +extern crate winres; + +#[cfg(windows)] +fn main() { + let mut res = winres::WindowsResource::new(); + res.set_icon("static/favicon.ico"); + res.compile().unwrap(); +} + +#[cfg(not(windows))] +fn main() { +} diff --git a/src/assets.rs b/src/assets.rs index cd26629..3da54d7 100644 --- a/src/assets.rs +++ b/src/assets.rs @@ -33,9 +33,9 @@ pub fn file_from_string(file_path: &str) -> Option<(String, &'static [u8])> { let contents = include_files_as_assets!( file_path, "/index.html", + "/favicon.ico", "/css/bulma.min.css", "/css/main.css", - "/img/logo.png", "/js/helpers.js", "/js/vue.min.js" )?; diff --git a/static/favicon.ico b/static/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..db10bb8f02bfa16077a723c97de1e6f65ceb39d0 GIT binary patch literal 15086 zcmd6u3vdWxwF~3dmp*kkUR6s zcXszX=lh?tyXTxeyK$T%r`Q=Y#=(|3RTn$XSjTb7%FK2@$2rKpepnr!*VS>B;xG&! zvN*SZ_9uQHO`3D@ci05?0dV0IyaJoxTQC|*&V{CYVxrONR~;;mp=k`cIWt^B~ZUr$8ps|_wv)A`$F~D1H-M)xwPoWsNZVCPuJFR zXav<^2b9_4=gOiXC;ifgZx8q(G=b{y1f0{piTF9|H+ASqp4A}zaaa&V+y8fK&+af7 z#>1E38!*iui}-ozH+49leA_{Fh`~sIxoz1-Ust#Uz74;J{m=ks!G*`6$XhnC^VV;<{8lzuhb(_us+6KZhcoVGVlccx9 zk6<>u0PU*ZoP+V`w&&oUeA-;TXc`B*z_#~M(yL(tywCXPKG*_L=syqr&zN(d`ymlC zTRqTH1lPeKqpJzK33Lq=d-Jm$nSRAV^PNWjTi8+F*kNfj&4fBon;wIO5LkEiN3CDi zkmh@uTg(d6Z1>B@ z*53!+dyW28-q_wWI@Gs61k&CJ^PyE=?)A56e4^H0g7&`{{TpmtzeUF+s0Zoa0O$FA zg0}JN2>s6*{f}eQ+7t~XPzBPiJ}2j~0^g|hYd*Bo=wB1khF75DI7t6}K|W#oIza!2 z(f+d0zcfe(8Z?edyZX$W`dC{I{!zF8NVNaY=$~ujT1)&sup6X*GjzAdaU$QTL2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