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

# [[requirements]]: what the app needs on the computer

> Reference for [[requirements]] in bach.toml: webview2, dotnet, vcredist, file, registry and windows kinds, their fields and what setup does when one is missing.

`[[requirements]]` declares something your app needs on the computer before it runs. Setup only looks (read-only, no administrator rights), and when the item is missing it shows a page with a button to its download and a "Try again" button that looks again. A silent install stops with exit code `1` instead.

```toml bach.toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[[requirements]]
kind = "webview2"            # Tauri and WebView2 apps

[[requirements]]
kind = "dotnet"              # a .NET runtime
version = "8.0"
desktop = true               # the Windows Desktop runtime (WinForms, WPF)

[[requirements]]
kind = "vcredist"            # the Visual C++ 2015-2022 redistributable (x64)

[[requirements]]
kind = "file"                # any file; %VARIABLES% are filled in
path = '%SystemRoot%\System32\vcruntime140.dll'
name = "Visual C++ runtime"
url = "https://aka.ms/vs/17/release/vc_redist.x64.exe"

[[requirements]]
kind = "registry"            # any key under HKLM\ or HKCU\
key = 'HKLM\SOFTWARE\Vendor\Thing'
name = "Vendor Thing"
url = "https://vendor.example/download"

[[requirements]]
kind = "windows"             # this Windows build number or newer
build = 19041                # 10240 Windows 10, 17763 1809, 19041 2004, 22000 Windows 11
```

## Fields

| Field | Used by | Meaning |
| - | - | - |
| `kind` | all | One of `webview2`, `dotnet`, `vcredist`, `file`, `registry`, `windows` |
| `build` | `windows` | The lowest Windows build number that works, from 10000 to 99999. It is read from `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion`. |
| `version` | `dotnet` | The runtime's major and minor version, like `8.0` |
| `desktop` | `dotnet` | `true` for the Windows Desktop runtime (WinForms, WPF) |
| `path` | `file` | The file to look for. `%VARIABLES%` are filled in. |
| `key` | `registry` | A key under `HKLM\` or `HKCU\` |
| `name` | `file`, `registry` | What to call it in the window |
| `url` | `file`, `registry` | An `https` download page |

`webview2`, `dotnet`, `vcredist` and `windows` know their name and download page (`windows` is named "Windows (build N or newer)" and points at microsoft.com/windows). `file` and `registry` need a `name` and an `https` `url`.

## Which Windows Bach supports

Setup files are made for Windows 10 version 1809 (build 17763) and newer, and Windows 11. They are tested on Windows 11, on Windows on ARM and on Windows Server 2022; Windows 10 itself is not in the automated tests, because GitHub offers no Windows 10 image. A `windows` requirement with a `build` below 17763 makes `bach check` and `bach build` warn: the setup window may not run there, so the requirement does not help those users. Ask for a newer build when your own app needs one.

## When a requirement is there but not found

Setup looks in the usual places (for .NET: the host's registry entry, `DOTNET_ROOT` and the Program Files folders; for the Visual C++ runtime the one for the computer's architecture; registry keys also in the 32-bit view). An unusual install can still be missed. The requirement page then has **Continue anyway**, which goes on to the install page and writes the skipped requirements to the log. The app may not start without them. A silent install takes `--skip-requirements` for the same, and names what it passed over in the terminal and the log.

## Behaviour

* Requirements are checked before anything changes on disk.
* The window shows a requirement page with the name from `[text] requirement_title` and its siblings. See [`[text]`](/docs/reference/config/text).
* `bach inspect` lists them as `Requires`.

See [Requirements](/docs/guides/requirements.md) for the guide.


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