The exe carried no icon resource and the tray drew a stand-in disc, so Explorer, the taskbar and the tray each guessed at what to show. The old front end's medallion was already in the tree and identical to the installer's icon.ico, so the whole shell now draws it: set_app_icon feeds icons/icon_full.png to rune before the event loop, the tray decodes the bundled 32 px, and build.rs bakes icon.ico into the exe for Explorer and shortcuts. The 128 px variants stay in tauri-app, which rune's own resizing makes redundant here.
12 lines
429 B
Rust
12 lines
429 B
Rust
//! Bakes `icons/icon.ico` into the exe as its resource, so Explorer, shortcuts and the
|
|
//! installer show the medallion the window and the tray also draw.
|
|
|
|
fn main() {
|
|
if std::env::var("CARGO_CFG_TARGET_OS").as_deref() != Ok("windows") {
|
|
return;
|
|
}
|
|
let mut resource = winresource::WindowsResource::new();
|
|
resource.set_icon("icons/icon.ico");
|
|
resource.compile().expect("the icon resource compiles");
|
|
}
|