Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

Commit

Permalink
feat: add icon and manifest to launcher exe at build time
Browse files Browse the repository at this point in the history
  • Loading branch information
joelgomes1994 committed Feb 13, 2022
1 parent 79b6882 commit 94b0f47
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 28 deletions.
22 changes: 11 additions & 11 deletions source/launcher/Cargo.lock

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

17 changes: 12 additions & 5 deletions source/launcher/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
[package]
name = "bgarmor"
version = "0.1.0"
version = "0.0.6"
edition = "2018"
build = "build.rs"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
winres = "0.1.12"
clap = "2.33.3"
subprocess = "0.2.8"
subprocess = "0.2.8"

[build-dependencies]
winres = "0.1.12"

[package.metadata.winres]
FileDescription = "BGArmor: BGE and UPBGE game packer and launcher."
ProductName = "BGArmor"
OriginalFilename = "BGArmor.exe"
LegalCopyright = "MIT"
CompanyName = "BGEmpire"
10 changes: 10 additions & 0 deletions source/launcher/bgarmor.manifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level='asInvoker' uiAccess='false' />
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
20 changes: 8 additions & 12 deletions source/launcher/build.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
use std::io;
#[cfg(windows)]
use winres::WindowsResource;
extern crate winres;

fn main() -> io::Result<()> {
#[cfg(windows)]
{
WindowsResource::new()
.set_icon("../icons/icon-launcher.ico")
.compile()
.expect("X Could not set icon");
}
Ok(())
fn main() {
if cfg!(target_os = "windows") {
let mut res = winres::WindowsResource::new();
res.set_icon("../icons/icon-launcher.ico");
res.set_manifest_file("./bgarmor.manifest.xml");
res.compile().unwrap();
}
}

0 comments on commit 94b0f47

Please sign in to comment.