diff --git a/Cargo.lock b/Cargo.lock index 41e75c4..61bd2f5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1117,6 +1117,20 @@ dependencies = [ "bytemuck", ] +[[package]] +name = "embed-resource" +version = "2.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6985554d0688b687c5cb73898a34fbe3ad6c24c58c238a4d91d5e840670ee9d" +dependencies = [ + "cc", + "memchr", + "rustc_version", + "toml", + "vswhom", + "winreg 0.52.0", +] + [[package]] name = "encoding_rs" version = "0.8.33" @@ -3328,7 +3342,7 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "winreg", + "winreg 0.50.0", ] [[package]] @@ -4180,6 +4194,7 @@ dependencies = [ "anyhow", "arboard", "eframe", + "embed-resource", "futures", "glib", "glutin 0.31.2", @@ -4260,6 +4275,26 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "vswhom" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be979b7f07507105799e854203b470ff7c78a1639e330a58f183b5fea574608b" +dependencies = [ + "libc", + "vswhom-sys", +] + +[[package]] +name = "vswhom-sys" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b17ae1f6c8a2b28506cd96d412eebf83b4a0ff2cbefeeb952f2f9dfa44ba18" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "waker-fn" version = "1.1.1" @@ -4841,6 +4876,16 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "winreg" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + [[package]] name = "x11-dl" version = "2.21.0" diff --git a/desktop/Cargo.toml b/desktop/Cargo.toml index 4fd1b75..2291f56 100644 --- a/desktop/Cargo.toml +++ b/desktop/Cargo.toml @@ -27,5 +27,8 @@ serde_json = "1.0.113" gtk = "0.18" glib = "0.18" +[target.'cfg(target_os = "windows")'.build-dependencies] +embed-resource = "2.4.2" + [features] console = [] diff --git a/desktop/README.md b/desktop/README.md index 66f6fb2..279e76d 100644 --- a/desktop/README.md +++ b/desktop/README.md @@ -1,2 +1,7 @@ # Desktop app Crate containing source code for Windows/mac/linux app. + +# Building + +## Installer +cargo wix --package urldebloater diff --git a/desktop/build.rs b/desktop/build.rs new file mode 100644 index 0000000..c06988a --- /dev/null +++ b/desktop/build.rs @@ -0,0 +1,4 @@ +fn main() { + #[cfg(windows)] + embed_resource::compile("./wix/urldebloater.rc", embed_resource::NONE); +} diff --git a/desktop/wix/icon.ico b/desktop/wix/icon.ico new file mode 100644 index 0000000..11f9e3f Binary files /dev/null and b/desktop/wix/icon.ico differ diff --git a/desktop/wix/icon.png b/desktop/wix/icon.png new file mode 100644 index 0000000..4df0768 Binary files /dev/null and b/desktop/wix/icon.png differ diff --git a/desktop/wix/main.wxs b/desktop/wix/main.wxs new file mode 100644 index 0000000..f7e9ac0 --- /dev/null +++ b/desktop/wix/main.wxs @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + 1 + + + + \ No newline at end of file diff --git a/desktop/wix/urldebloater.rc b/desktop/wix/urldebloater.rc new file mode 100644 index 0000000..765477f --- /dev/null +++ b/desktop/wix/urldebloater.rc @@ -0,0 +1 @@ +DEBLOATER_ICON ICON "icon.ico"