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

# [[components]]: optional parts of your app

> Reference for [[components]] in bach.toml: id, title, description, files and default for optional parts the user can leave out of an install.

`[[components]]` declares optional parts of your app. Each one is shown as a box on the install page. Files that no component claims are always installed. You can repeat the table for as many components as you need.

```toml bach.toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[[components]]
id = "samples"                      # lowercase; also its name for --with
title = "Sample projects"           # or { en = "...", de = "..." }
description = "Examples to learn from."
files = ["samples/**"]              # patterns, like [files] exclude
default = true                      # ticked on a first install
```

| Setting | Meaning |
| - | - |
| `id` | A lowercase identifier. It is also the component's name for `--with` and `--without` in silent installs. |
| `title` | The box's label. Text, or one text per language. |
| `description` | A line under the label. Text, or one text per language. |
| `files` | Patterns for the files that belong to the component, like [`[files] exclude`](/docs/reference/config/files). |
| `default` | Whether the box is ticked on a first install. |

## Rules

* A file belongs to the first component whose pattern matches it.
* A component must match at least one file, or `bach check` reports it.
* `app.executable` cannot be in a component.
* Unticking a component on an update removes its files.
* On an update, the boxes start the way the user left them last time.

## Components that are downloaded

Language packs, HD textures or demo files that most people won't want don't have to make everybody's download bigger. Add `download` and the component's files stay out of the setup file; they are downloaded when somebody ticks the box.

```toml bach.toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[[components]]
id = "hd-textures"
title = "HD textures"
files = ["textures/hd/**"]
default = false
download = true                     # or an https link
```

`bach build` writes those files to a file of their own next to the setup file, like `dist/Hello-hd-textures-1.4.0.bachpack`. Upload it to the link the component names. The install page says how big the download is, setup checks it against the SHA-256 recorded in the setup file, and puts the files in place together with the others. A failed download changes nothing, and Cancel works while it downloads.

| `download` | Meaning |
| - | - |
| `true` | The link of [`[updates]`](/docs/reference/config/updates), with the file's name in place of `{file}`. |
| `"https://..."` | Any https link. `{file}`, `{version}`, `{id}` and `{component}` are filled in. |

* The file is checked, not the host: a changed file is refused.
* Updates download again only when a file of the component changed. `--with hd-textures` in a silent install downloads it too.
* A setup file locked with `[access]` can't have a downloaded component.
* `bach verify` checks the archive when it is next to the setup file; `bach build --json` lists them as `packs`.

## Silent installs

```powershell theme={"theme":{"light":"github-light","dark":"github-dark"}}
Start-Process .\Hello-Setup-1.4.0.exe -ArgumentList '--silent', '--without', 'samples' -Wait -PassThru
Start-Process .\Hello-Setup-1.4.0.exe -ArgumentList '--silent', '--with', 'samples' -Wait -PassThru
```

See [Silent installs](/docs/guides/silent-installs.md).


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