Skip to main content
Every setup file you build accepts these options. They don’t need anything in bach.toml. The uninstaller has its own options: see Uninstaller options. A setup file is a windows program, so a terminal doesn’t wait for it. To wait and get the exit code:
In Command Prompt: start /wait "" Hello-Setup-1.4.0.exe --silent, then echo %ERRORLEVEL%.

Options

/NORESTART, /SP-, /SUPPRESSMSGBOXES, /NOCANCEL, /NCRC, /CLOSEAPPLICATIONS, /NOCLOSEAPPLICATIONS, /RESTARTAPPLICATIONS and /NORESTARTAPPLICATIONS from Inno Setup and NSIS are accepted and ignored, so existing scripts keep working.

Option ids

Only options the window would offer can be changed. An unknown id ends with exit code 2 and lists the valid ones.

Preview options

--preview shows the window without installing. With it, --uninstall shows removal, and --style NAME and --layout NAME try other looks. bach preview uses these.

On macOS

On a Mac, the program that takes these options is inside the Setup app:
The installed uninstaller is Contents/MacOS/bach-setup inside Uninstall Hello.app, in ~/Library/Application Support/Bach/uninstallers/<app id>. The options are the same, with these differences:
  • Use the -- spellings. /S and the Inno Setup and NSIS switches are for Windows.
  • The log goes to the temporary folder by default.
  • desktop-shortcut is a link on the Desktop, start-menu a link in Applications, and autostart means open at login.
  • A shell waits for the program, so $? holds the exit code.
  • Downloaded updates are kept in ~/Library/Application Support/Bach/updates/<app id>.
The uninstaller also has --cleanup-if-removed, which the watcher left by setup runs. When the app has been moved to the Trash, it removes what setup added around it (links, launch agents, the PATH block, the install record and the uninstaller), but never the user’s data.

How the command line is read

Values follow a space or = (--dir "D:\Apps\Hello" or --dir="D:\Apps\Hello"). Options ignore case and can start with -- or /. --with and --without can repeat. Any mistake stops with exit code 2 before anything happens: an unknown option, a stray word, a missing value, a value where none belongs, a bad --theme, or --style without --preview. In a terminal the message is printed; a double-clicked file shows a message box; services get only the exit code.