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

# bach sign: sign a setup file

> bach sign: sign a setup file with the program [signing] in bach.toml names. Optional, and it only runs when you call it or build with --sign.

`bach sign` signs a setup file you built earlier, with the program and arguments that [`[signing]`](/docs/reference/config/signing) in your `bach.toml` names. Signing is optional: Bach never signs by itself, and `bach build` signs only with `--sign`.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
bach sign dist/Hello-Setup-1.4.0.exe
bach sign dist/Hello-Setup-1.4.0.exe --config path/to/bach.toml
```

| Argument or flag | Default | Meaning |
| - | - | - |
| `FILE` | required | The setup file to sign |
| `--config PATH` | `bach.toml` | The config file that has `[signing]` |

## Output

Bach prints the command it runs, with `{env:NAME}` shown as written and never as its value, and then `Signed <file>`.

## Errors

* A `bach.toml` without `[signing]` is an error, with a sentence that says so.
* A signing program that cannot be started is reported by name.
* A signer that fails makes `bach sign` fail with its exit code, and the file stays unsigned.

After signing, write the update feed again with [`bach feed`](/docs/reference/cli/feed), because signing changes the file and its SHA-256. See [Signing](/docs/guides/signing.md).


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