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

# [[registry]]: registry values

> Write registry values during install with {app} for the install folder, handle 32-bit programs, and see which keys are refused and how removal works.

The Windows registry is a database where programs keep settings. `[[registry]]` writes a value when your app is installed, for example so another program can find where it is. Each block is one value. Values go to the current user (`HKCU`), or the computer (`HKLM`) for a [machine-wide install](/docs/guides/machine-wide-installs.md).

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

[[registry]]
key = 'Software\Your Name\Hello Notes'
name = "FirstRun"
type = "dword"
value = 1
```

| Setting | Default | Meaning |
| - | - | - |
| `key` | required | Below the hive, starting with `Software\`. Use single quotes. |
| `name` | the key's default value | Value name |
| `type` | `"string"` | `"string"`, `"expand"` (Windows fills in `%VARIABLES%` when read) or `"dword"` (0 to 4294967295) |
| `value` | required | Text for `string` and `expand`, a number for `dword`. `{app}` is the install folder. Up to 4096 characters. |
| `view` | `"64"` | `"64"`, `"32"` or `"both"` |

## 32-bit programs

Windows redirects a 32-bit program's reads of `HKLM\Software\...` to a separate area (`WOW6432Node`). So in a machine-wide install, values a 32-bit program reads need `view = "32"`, or `"both"`. Bach warns when your program is 32-bit, the install is machine-wide and a value has no `view`. You can't write `WOW6432Node` into the key yourself.

## Refused keys

Keys belonging to Windows, other programs or Bach: `Software\Classes`, `Software\Policies`, `Software\Wow6432Node`, `Software\Bach`, and everything under `Software\Microsoft`, `Google`, `Mozilla`, `MozillaPlugins`, `Chromium`, `RegisteredApplications`, `Clients` and `ODBC`. For file types and links, use [`[[protocols]]` and `[[file_types]]`](/docs/reference/config/protocols-and-file-types).

`bach check` warns if the key isn't under a folder named after your publisher, app name or id, which usually means a typo. The same key and name can only be set once.

## Updates and removal

Updates write the values again and remove values the new version no longer lists. Uninstalling removes a value only while it still holds exactly what setup wrote; changed values stay. Empty keys are removed. `bach inspect` shows values as `Registry`.

Windows only.


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