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

# [files]: what goes into the installer

> The source, exclude and allow_secrets settings, how patterns match, which files stop a build as secrets, which cause warnings and the folder rules.

`[files]` names the folder Bach packages and what to leave out of it. It's required for a Windows installer. For a walkthrough, see [Choose files](/docs/guides/choose-files.md).

```toml bach.toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[files]
source = "build"
exclude = ["*.pdb", "docs/**"]
allow_secrets = ["certs/server-ca.pem"]
```

## `source`

Folder path, required, relative to `bach.toml`. Everything in it, including subfolders, is installed into the install folder with the same structure.

## `exclude`

List of patterns, optional. Matching files are left out. `*` matches within one name, `**` across folders, `?` one character. A pattern without `/` matches file names in any folder; one with `/` matches from the top of `source`. Case doesn't matter. The setup file being written is always left out.

## `allow_secrets`

List of patterns, optional. Files that look like secrets but are meant to ship. Without it, such files stop `bach check` and `bach build` with a message naming the first one.

## Files treated as secrets

By name, anywhere in the folder:

* `.env`, `.env.*`, `*.env`
* `*.pfx`, `*.p12`, `*.pem`, `*.key`, `*.ppk`, `*.p8`, `*.snk`, `*.jks`, `*.keystore`, `*.kdbx`
* `id_rsa*`, `id_dsa*`, `id_ecdsa*`, `id_ed25519*`, `secring.gpg`, `trustdb.gpg`
* `*.tfstate`, `*.tfstate.*`, `*.tfvars`, `credentials`, `credentials.json`, `service-account*.json`, `serviceaccount*.json`, `local.settings.json`, `secrets.json`
* `.git-credentials`, `.npmrc`, `.yarnrc.yml`, `.pypirc`, `.netrc`, `.aws-credentials`, `.htpasswd`, `.dockercfg`, `.pgpass`, `.vault-token`, `.bash_history`, `.zsh_history`, `wallet.dat`
* a file called `.git`
* `bach.toml` and `bach-*.toml`

By folder: anything in `.git`, `.svn`, `.hg`, `.ssh`, `.aws`, `.azure`, `.gnupg`, `.docker`, `.kube` or `.terraform`, and `.m2/settings.xml`, `.m2/settings-security.xml`, `.gradle/gradle.properties`, `.gem/credentials`, `.config/gcloud/**`, `.config/gh/hosts.yml`.

By content: text files up to 256 KB with the extensions `json`, `yml`, `yaml`, `toml`, `ini`, `cfg`, `conf`, `config`, `properties`, `txt`, `xml`, `env`, `pem`, `ps1`, `sh`, `bat` or `cmd` are checked for a private key, an AWS access key, a GitHub token or a Slack token. Programs and libraries aren't read.

## Warnings

* Files that rarely belong in an installer: `*.pdb`, `*.log`, `.DS_Store`, `Thumbs.db`, and anything in `node_modules`, `target` or `__pycache__` folders.
* A file whose installed path would be longer than 259 characters, based on the usual install folder with a 20-character user name.
* A file list of more than about 2 MB (roughly 17,000 files).

## Folder rules

* `app.executable` must be in the folder and not excluded.
* At least one file.
* No symbolic links.
* No two files whose names differ only in case.
* No `uninstall.exe` at the top.
* Names Windows can create: at most 255 characters, no reserved device names such as `NUL` or `COM1`.

Files can be made optional with [`[[components]]`](/docs/reference/config/components).


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