Skip to content

Commit

Permalink
Set an icon on .exe in Windows, move platform-specific stuff into r…
Browse files Browse the repository at this point in the history
…esources subdirectories
  • Loading branch information
nazar-pc committed Dec 16, 2023
1 parent 846cb0c commit f950a61
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 2 deletions.
10 changes: 10 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ include = [

# TODO: Menu shortcut will not be generated automatically in case of re-init: https://github.com/volks73/cargo-wix/issues/141
[package.metadata.wix]
product-icon = "res/space-acres.ico"
product-icon = "res/windows/space-acres.ico"
# TODO: This option will not have effect until https://github.com/volks73/cargo-wix/issues/270 is fixed in case of re-init
product-name = "Space Acres"

Expand Down Expand Up @@ -68,6 +68,9 @@ tokio = { version = "1.34.0", features = ["fs", "time"] }
tracing = "0.1.40"
tracing-subscriber = "0.3.18"

[target.'cfg(windows)'.build-dependencies]
winres = "0.1.12"

# The list of dependencies below (which can be both direct and indirect dependencies) are crates
# that are suspected to be CPU-intensive, and that are unlikely to require debugging (as some of
# their debug info might be missing) or to require to be frequently recompiled. We compile these
Expand Down
8 changes: 8 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
fn main() {
#[cfg(windows)]
{
let mut res = winres::WindowsResource::new();
res.set_icon("res\\windows\\space-acres.ico");
res.compile().unwrap();
}
}
File renamed without changes.
File renamed without changes
File renamed without changes.
2 changes: 1 addition & 1 deletion wix/space-acres.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@
Add/Remove Programs control panel requires commenting out or
removing the following `Icon` and `Property` tags.
-->
<Icon Id='ProductICO' SourceFile='res/space-acres.ico'/>
<Icon Id='ProductICO' SourceFile='res\windows\space-acres.ico'/>
<Property Id='ARPPRODUCTICON' Value='ProductICO' />

<Property Id='ARPHELPLINK' Value='https://github.com/nazar-pc/space-acres'/>
Expand Down

0 comments on commit f950a61

Please sign in to comment.