fn main() {
    if std::env::var("CARGO_CFG_TARGET_OS").unwrap_or_default() == "windows" {
        let mut res = winres::WindowsResource::new();
        res.set_icon("veritas_icon.ico");
        res.set("ProductName", "Veritas SpoolerReset");
        res.set("FileDescription", "Veritas SpoolerReset — Windows Druckspooler & Warteschlangen-Reparatur");
        res.set("LegalCopyright", "Copyright © 2026 Veritas Suite");
        
        // Embed Windows UAC Manifest requiring Administrator privileges on launch
        res.set_manifest(r#"
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
      </requestedPrivileges>
    </security>
  </trustInfo>
</assembly>
"#);

        if let Err(e) = res.compile() {
            eprintln!("Warning: Failed to embed Windows resource icon / manifest: {}", e);
        }
    }
}
