Native Windows GUI: Distributing

Here's two things you should really keep in mind distributing NWG binaries


Disable the console

By default Rust binary will show a console. Include

#![windows_subsystem = "windows"]

At the top of your program to disable it.

Include MSVC dependencies

Assuming you are using the MSVC toolchain (you should), the rust binary won't include the CRT dependencies (see link). This will may stop your binary from running on other computer. To fix this, create a file called .cargo\config in your projects root directory with the following contents:

[target.x86_64-pc-windows-msvc]
rustflags = ["-Ctarget-feature=+crt-static"]
[target.i686-pc-windows-msvc]
rustflags = ["-Ctarget-feature=+crt-static"]