Last active
December 11, 2025 10:08
-
-
Save bplaat/d48f0c914f038dec4cb33a323203f40b to your computer and use it in GitHub Desktop.
Windows Rust Project with MSI installer example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [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"]} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #![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, | |
| ); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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