Skip to main content
This page explains where Bach puts your app, when your users are asked for an administrator password, and how to install for everyone on a computer instead.

The default: for the person installing

By default, Bach installs your app for the current Windows user, into:
For a user named Sam and an app called Hello Notes, that’s 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 picks D:\Apps, the app goes into D:\Apps\Hello Notes. To always use the default location:
bach.toml
Updates always go where the app already is. If a first install would overwrite files that are already in the chosen folder and aren’t part of your app, the window warns the user first. A silent install refuses unless it gets --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
Then the app goes into %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], leave auto out 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

For a machine-wide app, the summary shows:
bach preview shows the window without asking for any rights.