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

# [[env]]: environment variables

> Set environment variables during install, with the naming rule that protects other programs, refused names and what happens on update and removal.

An environment variable is a named value that programs can read. `[[env]]` sets one during install, for example so scripts can find your tool. Each block is one variable, set for the user, or for the computer with a [machine-wide install](/docs/guides/machine-wide-installs.md).

```toml bach.toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[[env]]
name = "HELLO_NOTES_HOME"
value = "{app}"
```

| Setting | Required | Meaning |
| - | - | - |
| `name` | yes | Letters, digits and `_`, not starting with a digit, up to 128 characters. Must start with your app id in capitals plus `_`. |
| `value` | yes | Up to 4096 characters. `{app}` is the install folder. |
| `allow` | no | `true` lets the name differ from the required prefix. Default `false`. |

## The name prefix

The app id in capitals, with other characters as `_`: `Hello` gives `HELLO_`, `Hello Notes` gives `HELLO_NOTES_`. This stops one app from overwriting another's variables. To set a name that other programs read, add `allow = true`; Bach warns about it.

## Refused names

* Windows' own variables such as `PATH`, `PATHEXT`, `TEMP`, `TMP`, `USERPROFILE`, `APPDATA`, `LOCALAPPDATA`, `SYSTEMROOT`, `WINDIR` and `PROCESSOR_*`, and Bach's `BACH_*`. For `PATH`, use [`add_to_path`](/docs/reference/config/installer#options).
* Variables that load code into other programs or redirect their network traffic, even with `allow`: for example `COR_PROFILER` and other `COR_*` and `CORECLR_*` settings, `DOTNET_STARTUP_HOOKS`, `JAVA_TOOL_OPTIONS`, `NODE_OPTIONS`, `PYTHONPATH`, `HTTP_PROXY`, `HTTPS_PROXY`, `SSL_CERT_FILE` and `LD_PRELOAD`.

## Behavior

Programs started after the install see the new variable; running programs don't. Updates remove variables the new version no longer lists. Uninstalling removes a variable only while it still has the value setup gave it. `bach inspect` shows them as `Variable`.

Windows only.


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