Add icon to exe in windows

This commit is contained in:
Philip Kristoffersen
2022-04-17 21:32:32 +02:00
parent f4a88a4fe9
commit 49a71c203b
4 changed files with 24 additions and 0 deletions
Generated
+10
View File
@@ -251,6 +251,7 @@ dependencies = [
"tokio",
"toml",
"winreg 0.10.1",
"winres",
]
[[package]]
@@ -3365,6 +3366,15 @@ dependencies = [
"winapi",
]
[[package]]
name = "winres"
version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b68db261ef59e9e52806f688020631e987592bd83619edccda9c47d42cde4f6c"
dependencies = [
"toml",
]
[[package]]
name = "x11-clipboard"
version = "0.5.3"
+3
View File
@@ -28,3 +28,6 @@ sysinfo = "0.23.10"
[target.'cfg(windows)'.dependencies]
winreg = "0.10.1"
[target.'cfg(windows)'.build-dependencies]
winres = "0.1"
+11
View File
@@ -0,0 +1,11 @@
use std::io;
#[cfg(windows)] use winres::WindowsResource;
fn main() -> io::Result<()> {
#[cfg(windows)] {
WindowsResource::new()
.set_icon("resources/logo.ico")
.compile()?;
}
Ok(())
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB