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

# Check requirements like WebView2 and .NET before installing

> Declare what your app needs on the computer, such as WebView2, a .NET runtime or the Visual C++ redistributable, and let setup check it read-only before installing.

Some apps need something on the computer before they run: WebView2 for a Tauri app, a .NET runtime, the Visual C++ redistributable or a vendor file. Bach lets you declare these as `[[requirements]]`. Setup only looks, read-only and without administrator rights, and when something is missing it shows a page with a button to the download and a "Try again" button that looks again.

## What happens when a requirement is missing

* In the window, the install stops on a requirement page. It names the missing item, offers a button to its download page, and lets the user press "Try again" once it is installed.
* In a [silent install](/docs/guides/silent-installs.md), setup stops with exit code `1` instead.
* Requirements are checked before anything changes on disk, together with free space, the app not running and the archive checksum.

## The five kinds

```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"
```

| Kind | Needs | Notes |
| - | - | - |
| `webview2` | nothing else | Knows its name and download page |
| `dotnet` | `version`, optionally `desktop` | `desktop = true` checks the Windows Desktop runtime |
| `vcredist` | nothing else | The Visual C++ 2015-2022 redistributable (x64) |
| `file` | `path`, `name`, an https `url` | `%VARIABLES%` in `path` are filled in |
| `registry` | `key`, `name`, an https `url` | The key must be under `HKLM\` or `HKCU\` |

`webview2`, `dotnet` and `vcredist` know their own name and download page. `file` and `registry` need a `name` and an `https` `url`.

> [!TIP]
>
> If your .NET app is published self-contained, you do not need a `dotnet` requirement. `bach init` writes one as a suggestion and says so in a comment.

## Check it

`bach check` reports a requirement with a missing field as a sentence such as `requirements[0].` followed by the problem. Give `kind` one of the five values above, and give `file` and `registry` a `name` and an https `url`.

## Next step

> [card] [Preview and build](/docs/guides/preview-and-build.md)
>
> Look at every page of the window, then write the setup file.


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