.msi file (a Windows Installer package) instead of an .exe. This page shows how to build one, what it can’t carry, and how to prepare a deployment in Intune.
Do you need an MSI?
Often not. A Bach setup file installs silently with--silent, which most deployment tools can run. Build an MSI when your customer’s tool or policy requires one, for example Group Policy software installation.
For computers shared by many users, also consider installing for every user, ideally in a separate profile for companies:
bach.toml
Build an MSI
.msi with the same name next to it. The MSI is a real Windows Installer package, not a wrapper: Windows Installer installs, repairs, upgrades and removes it.
/qn or /qb) show nothing and use your defaults; the license page and most requirement checks only apply in the window.
Choose optional features with ADDLOCAL. Component ids are the feature names, with - written as _. The built-in options are called desktop_shortcut, start_menu, autostart and path.
What an MSI includes
Files, shortcuts, registry values, environment variables, link schemes, file types, right-click entries, components as features, start with Windows,PATH, run steps, a Windows version requirement, and upgrades from older versions. With installer.scope = "machine" it installs for every user; otherwise for one user.
What it can’t do
Bach stops the build when:- the version isn’t three numbers such as
1.4.2(at most 255.255.65535) - the app has an access key
- the app has
[[services]]or[[firewall]]rules - a file needs several components (
shared_files = "all") - there are more than 32,000 files or more than 2 GB
bach build lists them as not in the MSI: [[migrate]], [updates] (update an MSI by deploying a newer one), data folders, requirements other than a Windows version, extra success codes of run steps, and elevated run steps in a per-user package.
The text Windows Installer itself shows is in English, and bach build --sign doesn’t sign the MSI. Sign it with signtool.
Prepare Microsoft Intune
bach intune reads a finished setup file and writes what Intune asks for: the install and uninstall commands, whether to run as user or system, requirements, and a detection script. It prints where it put them, with a sheet that walks through the steps. See bach intune.
Logs
A silent setup file writes%TEMP%\<app id>-setup.log, or the file given with --log. When the window runs an MSI, Windows Installer’s own log is %TEMP%\<app id>-msi.log. For quiet MSI installs, use msiexec’s /l*v option to write a log.