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

# Variables and placeholders

> Every placeholder Bach fills in, from {name} and {version} in output paths and texts to {app} in registry values and {file} in download links.

Some settings contain placeholders in curly braces that Bach replaces. Which placeholders work depends on the setting. This page lists them all. Anything not listed here is passed through as written.

## In output file names

Used in `installer.output`, `installer.online_output`, `profiles.NAME.output` and `macos.output`:

| Placeholder | Replaced with |
| - | - |
| `{name}` | `app.name` |
| `{version}` | the version being built |
| `{id}` | `app.id` |

Characters that file names can't contain, such as `:` or `/`, become `-`.

```toml bach.toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[installer]
output = "releases/{name}-{version}-setup.exe"
```

## In window texts

`[text]` entries can use `{name}`, `{version}` and `{publisher}`. Some built-in texts also fill their own placeholders, such as `{old_version}` or `{path}`; you can use them in your replacement for that same text. `install_subtitle` can also use `{description}`. A placeholder a text can't fill is an error. [`[text]`](/docs/reference/config/text) lists them per text.

## In update and download links

| Setting | `{file}` | `{version}` | `{id}` | `{component}` |
| - | - | - | - | - |
| `updates.download_url` | file name, encoded for a link | app version | | |
| component `download` link | component file name | app version | app id | component id |

## In registry values and environment variables

| Placeholder | Replaced with |
| - | - |
| `{app}` | the install folder on the user's computer |

Used in `[[registry]]` values of type `string` or `expand` and in `[[env]]` values. In an MSI, `{app}` ends with a backslash.

```toml bach.toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[[registry]]
key = 'Software\Your Name\Hello Notes'
name = "InstallDir"
value = "{app}"
```

`%VARIABLES%` in an `expand` registry value or an environment variable are left for Windows to fill in when read.

## In signing arguments

| Placeholder | Replaced with |
| - | - |
| `{file}` | the setup file being signed (added at the end if you leave it out) |
| `{env:NAME}` | the environment variable `NAME`; the build fails if it's not set |

## In data folders and requirement paths

`uninstall.data` entries start with `%APPDATA%`, `%LOCALAPPDATA%` or `%USERPROFILE%`. A `file` requirement's `path` can use Windows environment variables such as `%SystemRoot%`.

## In menu entries

`[[context_menu]]` arguments can use `"%1"` for the clicked file or folder, and `"%V"` for the open folder in background entries.

## Not replaced

`[[run]]` and `[[services]]` arguments are passed to your program exactly as written.


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