Skip to main content
In this tutorial you take a small Windows app and turn it into a Setup.exe that installs it, with a Start menu shortcut and an uninstaller. It takes about five minutes. If you have your own app, use it. If you don’t, the first step makes a tiny one. You need:
  • A Windows computer. The bach command also runs on macOS and Linux, but the preview and the test install here need Windows.
  • Bach installed. If you haven’t done that, follow Install Bach and check that bach --version prints a version number.

1. Get an app into a folder

Bach packages an app that’s already built. For this tutorial the project looks like this:
If you have your own app, make a folder like this with your files in build, and replace the names in the steps below with yours. The framework guides say where your tools put the build.
Windows can compile a tiny program for you. Open Windows PowerShell (the built-in one, version 5.1, not PowerShell 7), go to a folder where you keep projects, and paste this:
Run .\build\hello-notes.exe and a window with a text box opens. Close it again.

2. Create bach.toml

In the hello-notes folder (the one above build), run:
Bach writes a bach.toml and prints:
Open bach.toml in your editor. Most of it is commented out, with notes about options you can turn on later. The lines that matter now are these:
bach.toml
Bach guessed the name from the folder. Change publisher to your name or company, then save:
bach.toml
For your own app, also check that:
  • executable is the file name of your program inside the build folder
  • source is the path of your build folder, relative to bach.toml
The second line of the bach init message is about releasing from GitHub, which you can ignore for now. In a folder that’s already a GitHub repository, bach init also adds a release workflow and turns on automatic updates; delete the [updates] section if you don’t want that yet.

3. Check it

This tells you what the installer will do, and lists every file it will install. If something is wrong, you get one sentence naming the setting instead. Fix it and run bach check again.

4. Preview the window

The install window opens with the heading Install Hello Notes, the install location, a desktop shortcut option and an Install button. It’s the real window with every step pretended, so you can click Install and nothing happens to your computer. Close it when you’re done.

5. Build the setup file

At the end you see something like:
Your setup file is in the new dist folder:
Most of its 9 MB is the install window itself; your app is packed inside.

6. Test it

Running the setup file really installs the app on this computer. It’s harmless for this sample, and you remove it again at the end.
  1. Double-click Hello Notes-Setup-1.0.0.exe in the dist folder.
  2. Click Install. The window says Hello Notes is installed.
  3. Click Open Hello Notes, and the app starts.
Other people who download your file may first see Windows protected your PC, because it isn’t signed. They can click More info, then Run anyway. Check what it did:
  • The app is in %LOCALAPPDATA%\Programs\Hello Notes (paste that path into File Explorer’s address bar), next to an uninstall.exe.
  • Hello Notes is in the Start menu and, unless you unticked it, on the desktop.
  • It’s listed under Settings › Apps › Installed apps.
Now remove it: in Settings › Apps › Installed apps, find Hello Notes and choose Uninstall.

What you have now

You have one file that installs your app on Windows 11 and on Windows 10 version 1809 or newer, without an administrator password. Keep bach.toml with your project; every release is bach build again.

Next steps