Skip to main content
Bach can build a Mac version of your installer from the same bach.toml: a Setup app inside a .dmg with the same window as on Windows. This guide takes you from your Mac app to a file Mac users can open. You need your app already built for macOS, usually as an app bundle such as Hello.app.

1. Add a [macos] section

bach.toml
Your name, version, publisher, texts, look, choices and updates are shared with the Windows build. Windows-only settings, such as registry values, services, requirements and extra shortcuts, don’t apply to the Mac build. See [macos].
This now lists both builds.

2. Build

This writes dist/Hello-Setup-1.0.0.dmg. Making a .dmg needs a Mac; on Windows or Linux you get a .zip of the Setup app instead. Without --platform, bach build builds every platform in bach.toml. If your Mac files come from a computer that doesn’t keep Unix file permissions, such as a Windows checkout, list the programs in executables.

3. Try it on a Mac

Open the .dmg and double-click Install Hello. If your app is a single app bundle, it goes straight into ~/Applications and the window only asks you to click Install. To remove it, move it to the Trash. Bach then cleans up what it added (links, background agents and its install record) and keeps your user data. On a Mac, bach preview shows the Mac window.

Sign and notarize

Without signing, macOS asks users to confirm before opening your app the first time. Removing that prompt needs the Apple Developer Program (99 US dollars a year):
  1. Create a Developer ID Application certificate and keep it in your keychain.
  2. Save your notarization login once: xcrun notarytool store-credentials example-notary.
  3. Add:
bach.toml
Bach signs the app and the .dmg, sends it to Apple for notarization and attaches the result. This must run on a Mac.

Many Macs at once

Administrators can install without a window:
--dir, --with, --without, --log, --uninstall and the exit codes work like on Windows. For management tools such as Jamf, Intune, Kandji or Munki, build an installer package:
The .pkg installs into /Applications for every user. To sign it, add a Developer ID Installer certificate as installer_identity and use --sign.

Updates

One latest.json serves Windows and Mac. A Mac only downloads the Mac entry, checks it, and runs the Setup app without a window. Build both platforms in one run so the feed lists both. See Where to host updates.

Release from GitHub

Add a Mac build to the release workflow:
A second job on a Mac builds the Setup app after the Windows release and adds it to the same release and feed. Without secrets, the app is signed “ad hoc” (not for distribution without the confirmation prompt). To sign and notarize, add [macos.signing] with notarize = "bach-notary" and these repository secrets: