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:
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: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./Sand the Inno Setup and NSIS switches are for Windows. - The log goes to the temporary folder by default.
desktop-shortcutis a link on the Desktop,start-menua link in Applications, andautostartmeans 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>.
--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.