Skip to content

Instantly share code, notes, and snippets.

@bplaat
Last active December 11, 2025 10:08
Show Gist options
  • Select an option

  • Save bplaat/d48f0c914f038dec4cb33a323203f40b to your computer and use it in GitHub Desktop.

Select an option

Save bplaat/d48f0c914f038dec4cb33a323203f40b to your computer and use it in GitHub Desktop.
Windows Rust Project with MSI installer example
[package]
name = "bassietest"
version = "0.1.0"
edition = "2024"
authors = ["Bastiaan van der Plaat <bastiaan.v.d.plaat@gmail.com>"]
[dependencies]
windows-sys = {version = "0.61.2", features = ["Win32_UI_WindowsAndMessaging"]}
#![cfg_attr(all(windows, not(debug_assertions)), windows_subsystem = "windows")]
use windows_sys::Win32::UI::WindowsAndMessaging::{HWND_DESKTOP, MB_OK, MessageBoxA};
fn main() {
unsafe {
MessageBoxA(
HWND_DESKTOP,
b"Hello Windows!\0".as_ptr(),
b"BassieTest\0".as_ptr(),
MB_OK,
);
}
}
cargo binstall cargo-wix -y
# Install https://github.com/wixtoolset/wix3/releases
cargo wix init --product-name BassieTest
cargo wix --target x86_64-pc-windows-msvc
# target/wix contains msi file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment