The default: for the person installing
By default, Bach installs your app for the current Windows user, into:C:\Users\Sam\AppData\Local\Programs\Hello Notes. No administrator password is needed, because the folder belongs to the user. Other people who use the same computer don’t get the app; they run the setup file themselves if they want it.
Choose a different folder name with:
bach.toml
Letting users choose the folder
The install window shows the location with a Change button. A chosen location gets your folder name added to it: if the user picksD:\Apps, the app goes into D:\Apps\Hello Notes. To always use the default location:
bach.toml
--overwrite.
Install for every user
Some apps should be available to everyone on the computer, for example on shared office computers, or when your app includes a Windows service. Set:bach.toml
%ProgramFiles%\<folder> (usually C:\Program Files\Hello Notes). Before anything happens, Windows asks for permission once, or for an administrator’s password on a standard account. The uninstaller asks the same way.
What changes between the two:
Things to know before you choose it
- No background updates. A normal user can’t write into Program Files, so the app can’t update itself quietly. With
[updates], leaveautoout or set it to"never". You can still check for updates from your app, and Windows asks for permission when one installs. - The folder must be inside Program Files. Because the app runs and updates with administrator rights, setup refuses folders that other programs could change. If an old folder with loose permissions exists, setup says so; delete it or fix its permissions.
- Deleting data on uninstall only affects the account running the uninstaller, because data folders belong to one user.
- Decide before your first release. A per-user installation and a machine-wide one are two different installations to Windows. If you switch later, the update installs a second copy next to the first.
- Windows services and firewall rules need
scope = "machine". See[[services]]and[[firewall]]. - Silent installs need an elevated terminal or a deployment tool that runs as administrator. Otherwise Windows still shows its prompt, and declining it ends with exit code 1.
Only one step needs administrator rights
If your app installs for one user but also has to run one program with administrator rights, such as a runtime installer, keep the default and elevate only that step. See Run programs during setup.Check what you built
bach preview shows the window without asking for any rights.