> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Bach builds Windows installers from one bach.toml with the bach command: bach init, bach check, bach preview, bach build. Installs are per user and need no administrator rights by default. installer.scope = "machine" installs for every user after one Windows prompt. On Windows, run setup files with Start-Process -Wait -PassThru in PowerShell, and give signtool arguments that start with the word sign.

# Files, folders and registry keys Bach creates

> Where Bach and its setup files put things: install folder, uninstall.exe, log, temporary files, runtime cache and the HKCU registry keys they use.

Bach installs for the current user and writes only to the user's own folders and `HKCU`. An app that sets `installer.scope = "machine"` installs for every user instead and uses the matching machine-wide places, listed below. This page lists every place a Bach installer or the `bach` command touches, so you can audit or clean up with confidence.

## On the end user's computer

| What | Where |
| - | - |
| The app | `%LOCALAPPDATA%\Programs\<folder>`, where `<folder>` is `installer.folder` (default: the app id). The user may pick another place unless `change_folder = false`. |
| The uninstaller | `uninstall.exe` in the install folder. It is `bach-setup.exe` again, with the manifest of what was installed and the user's choices, and no archive. |
| The Apps entry | `HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\<id>` |
| Start with Windows | A value under `HKCU\...\Run` |
| `PATH` | The user's `PATH` under `HKCU\Environment`. Exactly one entry is added or removed. |
| Link schemes and file types | Registry keys under `HKCU` carrying a `BachApp` mark |
| Right-click entries | `[[context_menu]]`: keys below `HKCU\Software\Classes` (`*`, `Directory`, `Directory\Background` or `SystemFileAssociations\<ext>`) carrying a `BachApp` mark |
| Registry values and variables | `[[registry]]` values below `HKCU\Software\<your key>`, and `[[env]]` variables under `HKCU\Environment`. Only what `bach.toml` lists. |
| Shortcuts | The desktop and the Start menu (inside `start_menu_folder` when set) |
| Automatic updates | A per-user scheduled task named `Bach\<app id>`, when the user keeps "Automatic updates" ticked. It runs `uninstall.exe --auto-update`. |
| A downloaded update | `%LOCALAPPDATA%\Bach\updates\<app id>`: the setup file and `staged.json`. Deleted once installed, and when the app is removed. |
| The log | `%TEMP%\<app id>-setup.log`, or the file given with `--log`. Update runs write `%TEMP%\<app id>-update.log` instead. |
| User data | The folders listed in `[uninstall] data`, inside `%APPDATA%`, `%LOCALAPPDATA%` or `%USERPROFILE%`. Deleted only on request. |

### A machine-wide install

With `installer.scope = "machine"`, everything above moves to the computer's side:

| What | Where |
| - | - |
| The app | `%ProgramFiles%\<folder>` |
| The Apps entry | `HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\<id>` |
| Start with Windows, link schemes, file types, right-click entries | The same keys below `HKLM` |
| `PATH` and `[[env]]` | The computer's environment under `HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment` |
| `[[registry]]` | `HKLM\Software\<your key>` |
| Shortcuts | The shared Start menu and the public desktop |
| Automatic updates | None. `[updates] auto` must be `"never"`. |

See [machine-wide installs](/docs/guides/machine-wide-installs.md).

### Temporary files during an install

* Each chosen file is unpacked next to its target as `<name>.bach-new`, then swapped into place with the old file stepping aside as `<name>.bach-old`. These disappear when the install completes. While files move, a journal named `.bach-update` in the install folder lists them; if an update was cut short by a power cut or a crash, the next install, update or removal puts back what was half moved, and deletes the journal. An update that is run by the installed `uninstall.exe` renames it to `uninstall.exe.bach-old`, which is deleted once that process has ended.
* In the names of these scratch files and folders (the log, the staged update folder, the online installer's download folder, the uninstaller's temp copy), a space in the app id is written `%20`: `My App` gives `My%20App`. No id can contain `%`, so `My App` and `My-App` never share a folder. Ids without a space are used as they are.
* During removal of a per-user install, the uninstaller copies itself to the temp folder as `<app id>-uninstall-<process id>.exe`, and a hidden helper deletes that copy once it has exited. A machine-wide uninstaller runs elevated and removes from where it is, so no copy in the user's temp folder is ever started with administrator rights. A hidden helper deletes `uninstall.exe` once it has exited.

## On the developer's computer

| What | Where |
| - | - |
| The `bach` command, installed by `install.ps1` | `%LOCALAPPDATA%\Programs\bach-cli`, with a `.bach-cli` mark file. Its own `bach.exe` and `bach-setup.exe`. |
| The `bach` command, installed by `install.sh` | `~/.local/bin` (or `$BACH_INSTALL_DIR`) |
| The downloaded runtime | `%LOCALAPPDATA%\bach\runtime\<version>\bach-setup.exe` on Windows, `$XDG_CACHE_HOME/bach/runtime/<version>` (or `~/.cache/...`) elsewhere |
| The update check | `%LOCALAPPDATA%\bach\update-check.json` on Windows, `$XDG_CACHE_HOME/bach/update-check.json` (or `~/.cache/...`) elsewhere: when `bach` last looked for a newer release and what it found. |
| An update in progress | `.bach-update-<process id>` beside `bach`, removed when `bach update` ends. Windows keeps the replaced `bach.exe` as `bach.exe.old` until the next run of `bach` removes it. |
| The setup file | `dist/{name}-Setup-{version}.exe` by default |
| The update feed | `latest.json` next to the setup file |
| The winget manifests | `winget/<id>/<version>` next to the setup file |

## What Bach never touches

* Anything outside the install folder, the data folders you list, the user's shortcuts and the `HKCU` keys above.
* Registry keys without the `BachApp` mark, and `PATH` entries other than its own.
* Anything that needs administrator rights, unless the app asks for it with `installer.scope = "machine"` or an `elevated` step in [`[[run]]`](/docs/reference/config/run).

See [Safety rules](/docs/concepts/safety.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.