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

> Every component setting, how files are assigned, files that need several components, downloaded components and how silent installs pick them.

A component is an optional part of your app that users can leave out. Each `[[components]]` block adds one box to the install window. Files that no component claims are always installed. Walkthrough: [Options and components](/docs/guides/choices-and-components.md).

```toml bach.toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[[components]]
id = "samples"
title = "Sample notes"
description = "A few notes to look around in."
files = ["samples/**"]
default = true
```

## `id`

Required. Lowercase letters, digits, `-` and `_`, unique. Used by `--with` and `--without`. Can't be one of Bach's own option ids (`desktop-shortcut`, `start-menu`, `autostart`, `path`, `auto-update`).

## `title`

Required. The label of the box. Text, or text per language.

## `description`

Optional. A line under the label. Text, or text per language.

## `files`

Required. At least one [pattern](/docs/reference/config/overview.md#patterns), relative to `files.source`. Each component must match at least one file. `app.executable` can't be included.

## `default`

`true` or `false` (default). Whether the box is ticked on a first install. On updates, users' earlier choice is kept; a component new in this version uses `default`.

## `download`

`true` or an `https` link. The component's files aren't packed into the setup file but downloaded when the box is ticked. See [Downloaded components](#downloaded-components).

## How files are assigned

A file belongs to the first component whose patterns match it. Unticking a component on an update removes its files. A [`[[run]]`](/docs/reference/config/run) step whose program is in a component runs only when it's installed, and a [`[[shortcuts]]`](/docs/reference/config/shortcuts) entry for it is removed with it.

## Files that need several components

With this setting, a file matched by several components is installed only when all of them are ticked:

```toml bach.toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[installer]
shared_files = "all"

[[components]]
id = "tools"
title = "Tools"
files = ["vendor*/tools/**"]

[[components]]
id = "vendor1"
title = "Vendor 1"
files = ["vendor1/**"]
default = true
```

| File | Installed when ticked |
| - | - |
| `vendor1/tools/manual.pdf` | `tools` and `vendor1` |
| `vendor1/editor.exe` | `vendor1` |

* `bach check` shows such files with all their components, such as `(tools + vendor1)`.
* The order of the blocks doesn't change what's installed.
* Needs Bach 0.11.1 or newer. If you use the online installer, publish a newly built one together with the first release that uses `"all"`, because older online installers don't know the rule.
* `bach build --msi` refuses this setting.

## Downloaded components

```toml bach.toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[updates]
github = "your-name/hello"

[[components]]
id = "hd-textures"
title = "HD textures"
files = ["textures/hd/**"]
download = true
```

`bach build` writes the files to a separate file next to the setup file, such as `Hello-hd-textures-1.4.0.bachpack` (with the profile or `arm64` added for those builds). Upload it where the setup file expects it:

| `download` | Address |
| - | - |
| `true` | `updates.download_url` with the file name for `{file}` (needs `github` or `download_url`) |
| `"https://..."` | your link; `{file}`, `{version}`, `{id}` and `{component}` are replaced |

* The window shows the download size. The file must match the checksum recorded in the setup file.
* A failed download changes nothing, and **Cancel** works during it.
* Updates download again only if the component's files changed.
* Not allowed with `[access]` encryption. `bach verify` checks the file when it's next to the setup file; `bach build --json` lists them as `packs`.
* With `shared_files = "all"`, a shared file travels in the download of the first component that has `download`.

## Silent installs

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

`--without samples` leaves it out. See [Silent installs](/docs/guides/silent-installs.md).


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