> ## 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

> Where installed apps, shortcuts, registry entries, logs, downloads and temporary files go on users' computers, and where bach keeps its own files.

This page lists everything a Bach installer creates, so you can check or clean up a computer. A per-user install only writes to the user's folders and registry (`HKCU`).

## On users' computers

| What | Where (per user) | Machine-wide |
| - | - | - |
| App | `%LOCALAPPDATA%\Programs\<folder>` or the chosen folder | `%ProgramFiles%\<folder>` |
| Uninstaller | `uninstall.exe` in that folder | same |
| Settings › Apps entry | `HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\<id>` | `HKLM\...` |
| Shortcuts | user's desktop and Start menu | all users' |
| Start with Windows | value under `HKCU\...\Run` | `HKLM` |
| `PATH`, `[[env]]` | `HKCU\Environment` | the system environment |
| Link schemes, file types, right-click entries | `HKCU\Software\Classes`, marked `BachApp` | `HKLM` |
| `[[registry]]` | `HKCU\Software\<your key>` | `HKLM\Software\...` |
| Automatic updates | scheduled task `Bach\<app id>` | none |
| Downloaded updates | `%LOCALAPPDATA%\Bach\updates\<app id>` | |
| Update channel | `HKCU\Software\Bach\Channel` | |
| Saved access key | `HKCU\Software\Bach\Access` | |
| Logs | `%TEMP%\<app id>-setup.log`, `-update.log`, `-msi.log` | same |
| User data | only the folders you list in `[uninstall] data`, deleted only on request | |

In file names, spaces in the app id are written as `%20`.

## On a Mac

A Mac setup file installs for the current user, and setup never runs as root.

| What | Where |
| - | - |
| App | `~/Applications` for an app that is one bundle, otherwise `~/Applications/<folder>`. With `installer.scope = "machine"`, under `/Applications`. |
| Uninstaller | `~/Library/Application Support/Bach/uninstallers/<app id>/Uninstall <app>.app` |
| Install record | `~/Library/Application Support/Bach/installs/<app id>.json` |
| Shortcuts | links in Applications and on the Desktop, when chosen |
| Open at login | launch agent `app.bach.login.<app id>` in `~/Library/LaunchAgents` |
| Automatic updates | launch agent `app.bach.update.<app id>`, every four hours |
| Cleanup after moving to the Trash | launch agent `app.bach.guard.<app id>` |
| Background programs | launch agents `app.bach.agent.<app id>.<name>` for `[[macos.agents]]` |
| `PATH` | a marked block in `~/.zprofile`, and in `~/.bash_profile` if that file exists |
| Saved access key | the Keychain, as `Bach access key: <app id>` |
| Update channel | `~/Library/Application Support/Bach/channels/<app id>` |
| Downloaded updates | `~/Library/Application Support/Bach/updates/<app id>` |
| User data | only the folders in `macos.data`, deleted only on request |

## Temporary files

* While installing, new files are written as `<name>.bach-new` and old ones renamed to `<name>.bach-old`. A journal, `.bach-update`, lists moves so an interrupted update can be undone.
* A running uninstaller that updates itself is renamed to `uninstall.exe.bach-old` until it exits.
* Removing a per-user app runs a temporary copy, `<app id>-uninstall-<number>.exe` in `%TEMP%`, which deletes itself.

## On your computer

| What | Where |
| - | - |
| `bach` from `install.ps1` | `%LOCALAPPDATA%\Programs\bach-cli` |
| `bach` from `install.sh` | `~/.local/bin` |
| Downloaded setup program | `%LOCALAPPDATA%\bach\runtime\<version>` or `~/.cache/bach/runtime/<version>` |
| Update check | `%LOCALAPPDATA%\bach\update-check.json` |
| Setup files and feed | `dist/` by default |
| winget, Chocolatey, download page, Intune files | `winget/`, `choco/`, `download/`, `intune/` next to the setup file |


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