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
bachcommand 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 --versionprints 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:build, and replace the names in the steps below with yours. The framework guides say where your tools put the build.
Make the sample app (Windows PowerShell)
Make the sample app (Windows PowerShell)
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 thehello-notes folder (the one above build), run:
bach.toml and prints:
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
publisher to your name or company, then save:
bach.toml
executableis the file name of your program inside the build foldersourceis the path of your build folder, relative tobach.toml
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
bach check again.
4. Preview the window
5. Build the setup file
dist folder:
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.
- Double-click
Hello Notes-Setup-1.0.0.exein thedistfolder. - Click Install. The window says Hello Notes is installed.
- Click Open Hello Notes, and the app starts.
- The app is in
%LOCALAPPDATA%\Programs\Hello Notes(paste that path into File Explorer’s address bar), next to anuninstall.exe. - Hello Notes is in the Start menu and, unless you unticked it, on the desktop.
- It’s listed under Settings › Apps › Installed apps.
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. Keepbach.toml with your project; every release is bach build again.
Next steps
- Understand bach.toml
- Make the window yours: logo, colors, languages, license
- Ship an update
- Sign your setup file to avoid the Windows warning
- Publish releases from GitHub