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

# bach.toml reference

> How bach.toml is structured, which settings are required, the shared rules for text, paths, patterns and options, and a map of every section.

`bach.toml` holds every setting Bach reads. This reference lists each section and setting. If you're new to the file, read [How bach.toml works](/docs/guides/write-bach-toml.md) first.

## Required settings

A Windows installer needs these:

```toml bach.toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[app]
name = "Hello Notes"
version = "1.0.0"
publisher = "Your Name"
executable = "hello-notes.exe"

[files]
source = "build"
```

A Mac-only app uses [`[macos]`](/docs/reference/config/macos) instead of `[files]`. A file needs at least one of the two.

## Sections

The app and its files:

| Section | Sets |
| - | - |
| [`[app]`](/docs/reference/config/app) | name, version, publisher, program, id, icon |
| [`[files]`](/docs/reference/config/files) | what goes into the installer |
| [`[installer]`](/docs/reference/config/installer) | output file, install location, options, languages, license |
| [`[uninstall]`](/docs/reference/config/uninstall) | data users can delete, feedback link |

The window:

| Section | Sets |
| - | - |
| [`[style]`](/docs/reference/config/style) | fonts, colors, corners, background |
| [`[layout]`](/docs/reference/config/layout) | size, arrangement, spacing, animation |
| [`[text]`](/docs/reference/config/text) | any text in the window |

Choices and Windows integration (blocks in `[[...]]` can repeat):

| Section | Sets |
| - | - |
| [`[[components]]`](/docs/reference/config/components) | optional parts |
| [`[[shortcuts]]`](/docs/reference/config/shortcuts) | extra Start menu shortcuts |
| [`[[protocols]]` and `[[file_types]]`](/docs/reference/config/protocols-and-file-types) | links and files your app opens |
| [`[[context_menu]]`](/docs/reference/config/context-menu) | right-click entries |
| [`[[requirements]]`](/docs/reference/config/requirements) | software that must be installed |

Changes to the system:

| Section | Sets |
| - | - |
| [`[[run]]`](/docs/reference/config/run) | programs run during setup |
| [`[[registry]]`](/docs/reference/config/registry) | registry values |
| [`[[env]]`](/docs/reference/config/env) | environment variables |
| [`[[services]]`](/docs/reference/config/services) | Windows services |
| [`[[firewall]]`](/docs/reference/config/firewall) | firewall rules |
| [`[[migrate]]`](/docs/reference/config/migrate) | old installations to remove |

Updates, keys, signing and other builds:

| Section | Sets |
| - | - |
| [`[updates]`](/docs/reference/config/updates) | automatic updates |
| [`[access]`](/docs/reference/config/access) | access keys and encryption |
| [`[signing]`](/docs/reference/config/signing) | signing program |
| [`[profiles.NAME]`](/docs/reference/config/profiles) | other variations of the build |
| [`[arch.arm64]`](/docs/reference/config/arch) | ARM64 files |
| [`[macos]`](/docs/reference/config/macos) | the Mac build |

## Top-level setting

### `config_version`

Number, optional. The format version of the file. The only value is `1`, and leaving it out means the same. Another number stops the build with a message to update Bach or read the changelog.

## Rules for every setting

* **Unknown settings are errors.** A typo is reported instead of ignored.
* **Paths are relative to `bach.toml`**, unless a setting says it's relative to the build folder.
* **Errors name the setting**, in one sentence, such as `installer.theme is "blue"; use "system", "light" or "dark"`.
* **The file** is TOML in UTF-8 (a byte order mark is fine) or UTF-16.

### Option values

`installer.desktop_shortcut` and similar settings take:

| Value | Window | Result |
| - | - | - |
| `true` | ticked box | done unless unticked |
| `false` | empty box | done only if ticked |
| `"always"` | not shown | always done |
| `"never"` | not shown | never done |

### Text in one or several languages

Where a setting is text shown to users, such as a component title or a `[text]` entry, give one text for all languages, or one per language:

```toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
title = "Sample notes"
```

Or one per language:

```toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
title = { en = "Sample notes", de = "Beispielnotizen" }
```

A language that isn't in `installer.languages` is an error.

### Patterns

Used by `files.exclude`, component `files` and others: `*` matches within one name, `**` across folders, `?` one character. A pattern without `/` matches file names anywhere; with `/` it matches from the top of the build folder. Case doesn't matter.

### Windows paths

Write them in single quotes so backslashes aren't treated as escapes: `'%APPDATA%\Hello Notes'`.

See also [Variables and placeholders](/docs/reference/variables.md).


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