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 0000000..db10bb8 Binary files /dev/null and b/static/favicon.ico differ diff --git a/static/img/logo.png b/static/img/logo.png deleted file mode 100644 index ed434cf..0000000 Binary files a/static/img/logo.png and /dev/null differ diff --git a/static/index.html b/static/index.html index be94b73..e61d8bf 100644 --- a/static/index.html +++ b/static/index.html @@ -7,6 +7,9 @@ yuzu Installer + + +