Skip to main content
This guide makes a setup file for a program built with Cargo, whether it’s a desktop app or a command-line tool.

1. Build in release mode

Your program is in target/release.

2. Create bach.toml

Bach reads Cargo.toml for the name, version, first author and program name. For a package called note-pad you get (without the commented-out options):
bach.toml
If your version comes from a workspace (version.workspace = true), Bach can’t read it and writes 1.0.0. Set it yourself, or pass it at build time with bach build --app-version 0.3.1. target/release can hold other programs from the same workspace, test files and leftovers from earlier builds. A folder with only what you ship is safer:
bach.toml
Copy any assets your program loads at run time into the same folder.

The Visual C++ runtime

Rust programs built for Windows with the default (MSVC) toolchain usually need the Visual C++ runtime (vcruntime140.dll). Many computers have it, some don’t. You have two options. Build the runtime into your program:
.cargo/config.toml
Or ask the installer to check for it:
bach.toml

Command-line tools

For a tool people type in a terminal, put it on PATH and skip the desktop shortcut:
bach.toml
After installing, users can run note-pad from any new terminal window.

3. Check and build

Next steps