// Embed Win32 VERSIONINFO so the Win11 "Select an app" picker shows the
// app as "rmfmail" instead of falling through to the host EXE's PE
// FileDescription. Keys here populate the picker's display.

#[cfg(windows)]
fn main() {
    let mut res = winres::WindowsResource::new();
    res.set("ProductName", "rmfmail");
    res.set("FileDescription", "rmfmail");
    res.set("CompanyName", "Bob Frankston");
    res.set("LegalCopyright", "MIT");
    res.set("OriginalFilename", "rmfmailto.exe");
    res.set("InternalName", "rmfmailto");
    // ICO can be picked up at registration time via DefaultIcon — embedding
    // here gets it on the picker tile too. The path resolves relative to
    // the crate root at build time.
    let ico = std::path::Path::new("../../client/icon.ico");
    if ico.exists() {
        res.set_icon(ico.to_str().unwrap());
    }
    if let Err(e) = res.compile() {
        eprintln!("winres compile failed: {e}");
    }
}

#[cfg(not(windows))]
fn main() {}
