#[path = "src/resources.rs"] mod resources; use std::env; use resources::*; use winresource::WindowsResource; const MANIFEST: &str = r#" UTF-8 true permonitorv2 SegmentHeap "#; fn main() { // Update manifest with package name and version from Cargo.toml. let name = env::var("CARGO_PKG_NAME").unwrap(); let version = [ env::var("CARGO_PKG_VERSION_MAJOR").unwrap(), env::var("CARGO_PKG_VERSION_MINOR").unwrap(), env::var("CARGO_PKG_VERSION_PATCH").unwrap(), "0".to_string(), ] .join("."); let manifest = MANIFEST.to_string(); let manifest = manifest.replace("?NAME?", &name); let manifest = manifest.replace("?VERSION?", &version); // Minimize XML let manifest = manifest.replace('\r', ""); let manifest = manifest.replace('\n', ""); let manifest = manifest.replace(" ", ""); WindowsResource::new() .set_manifest(&manifest) .set_icon_with_id("icons/keyboard.ico", &format!("{}", ICON_KEYBOARD)) // icon for the .exe file .set_icon_with_id( "icons/keyboard_delete.ico", &format!("{}", ICON_KEYBOARD_DELETE), ) .compile() .unwrap(); }