Files
punktfunk/clients/session/build.rs
T
enricobuehlerandClaude Fable 5 f508d3213f polish(clients/windows): name the session exe "Punktfunk Session" in its version info
UAC prompts, Task Manager and Properties→Details show FileDescription; without one the exe
appeared as its raw filename.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 10:57:41 +02:00

25 lines
1.2 KiB
Rust

//! Embed the Windows version-info + icon resources into `punktfunk-session.exe`. The
//! icon drives Explorer, and `pf-presenter`'s `win32::stamp_window_icon` loads it by
//! ordinal 1 onto the SDL window's title bar / taskbar / Alt-Tab (SDL's own window-class
//! icon is the generic default).
fn main() {
// cfg(windows) is the HOST (skips Linux/macOS builds of this cross-platform binary);
// CARGO_CFG_WINDOWS is the TARGET (x64 and cross-compiled ARM64 both pass).
#[cfg(windows)]
if std::env::var_os("CARGO_CFG_WINDOWS").is_some() {
let icon = "../../packaging/windows/branding/punktfunk.ico";
println!("cargo:rerun-if-changed={icon}");
winresource::WindowsResource::new()
// Ordinal 1 — pf-presenter's win32.rs loads it by this id for WM_SETICON.
.set_icon_with_id(icon, "1")
// The version-info strings Windows surfaces for the bare exe — UAC prompts,
// Task Manager and Properties→Details all show FileDescription (without one
// the exe appears as its raw filename).
.set("FileDescription", "Punktfunk Session")
.set("ProductName", "Punktfunk")
.compile()
.expect("embed windows icon resource");
}
}