Browse Source

add icon to exe #873

pull/852/head
o2sh 3 years ago
parent
commit
584574fb66
  1. 3
      .github/workflows/windows-installer.iss
  2. 10
      Cargo.lock
  3. 3
      Cargo.toml
  4. 6
      build.rs

3
.github/workflows/windows-installer.iss

@ -25,7 +25,8 @@ DisableProgramGroupPage=yes @@ -25,7 +25,8 @@ DisableProgramGroupPage=yes
;PrivilegesRequired=lowest
OutputDir=..\..
OutputBaseFilename=onefetch-setup
SetupIconFile=..\..\assets\onefetch.ico
SetupIconFile=..\..\assets\onefetch.ico
UninstallDisplayIcon={app}\{#MyAppExeName}
Compression=lzma
SolidCompression=yes
WizardStyle=modern

10
Cargo.lock generated

@ -2057,6 +2057,7 @@ dependencies = [ @@ -2057,6 +2057,7 @@ dependencies = [
"time",
"time-humanize",
"tokei",
"winres",
"yaml-rust",
]
@ -3300,6 +3301,15 @@ version = "0.40.0" @@ -3300,6 +3301,15 @@ version = "0.40.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a0c9c6df55dd1bfa76e131cef44bdd8ec9c819ef3611f04dfe453fd5bfeda28"
[[package]]
name = "winres"
version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b68db261ef59e9e52806f688020631e987592bd83619edccda9c47d42cde4f6c"
dependencies = [
"toml",
]
[[package]]
name = "xz2"
version = "0.1.7"

3
Cargo.toml

@ -58,6 +58,9 @@ serde_json = "1" @@ -58,6 +58,9 @@ serde_json = "1"
serde_yaml = "0.9"
tera = { version = "1", default-features = false }
[target.'cfg(windows)'.build-dependencies]
winres = "0.1"
[target.'cfg(windows)'.dependencies]
enable-ansi-support = "0.1.2"

6
build.rs

@ -8,6 +8,12 @@ use std::path::Path; @@ -8,6 +8,12 @@ use std::path::Path;
use tera::{Context, Tera};
fn main() -> Result<(), Box<dyn Error>> {
#[cfg(windows)]
{
let mut res = winres::WindowsResource::new();
res.set_icon("assets/onefetch.ico");
res.compile()?;
}
let out_dir = env::var("OUT_DIR").expect("No OUT_DIR variable.");
let mut tera = Tera::default();
tera.register_filter("strip_color_tokens", strip_color_tokens_filter);

Loading…
Cancel
Save