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

# Preview, build and test your installer

> Check your config, try the install window without installing, build the setup file, look inside it and test a real install safely in Windows Sandbox.

This page covers the steps between writing `bach.toml` and handing out a setup file: checking it, looking at the window, building, and making sure a real install works.

## Check the config

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
bach check
```

This reads `bach.toml` and the build folder, then prints a summary and the list of files that will be installed. It changes nothing and works on every system. Look at the file list: anything in it ends up on your users' computers.

## Preview the window

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
bach preview
```

The real install window opens, built from your config. Every step is only pretended, so nothing is installed and you can click through it as often as you like. Useful variations:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
bach preview --uninstall          # the removal window
bach preview --theme dark         # light, dark or system
bach preview --lang de            # another language
```

If your app uses [`[access]`](/docs/guides/paid-apps), the preview asks for a key. Any key works there.

Preview needs Windows. On a Mac it shows the macOS window, and needs a [`[macos]`](/docs/guides/macos) section.

### Keep the preview open while you edit

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
bach watch
```

`bach watch` opens the preview and reopens it every time you save `bach.toml`, your logo, your license or another file it names. If the config has a mistake, it prints it and keeps the old window. Stop it with Ctrl+C.

## Build the setup file

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
bach build
```

The setup file is written to `dist/<name>-Setup-<version>.exe`, for example `dist/Hello Notes-Setup-1.0.0.exe`. Change the name or folder with [`installer.output`](/docs/reference/config/installer), or for one build with `--out`:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
bach build --out releases/hello-notes.exe
```

Bach compresses as small as it can by default. While you're testing, `bach build --fast` builds quicker and makes a slightly bigger file.

If the build fails, nothing is left half-written: an earlier setup file stays as it was.

## Look inside a setup file

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
bach inspect "dist/Hello Notes-Setup-1.0.0.exe"
```

This shows the app id, version, program, install folder, shortcuts, options and everything else the file carries. It works on an installed `uninstall.exe` too. `bach verify` checks that a setup file isn't damaged:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
bach verify "dist/Hello Notes-Setup-1.0.0.exe"
```

## Test a real install

Preview shows what your users see, but only a real install shows whether your app starts. A real install changes the computer it runs on, so the safest choice is a computer you can throw away.

### In Windows Sandbox

Windows 10 and 11 Pro, Enterprise and Education have Windows Sandbox, a temporary copy of Windows. Windows Home doesn't.

1. Turn on **Windows Sandbox** in "Turn Windows features on or off", if you haven't.
2. Build, then run:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
bach test
```

Bach opens a fresh sandbox, installs your setup file silently, starts your app for 5 seconds, removes it and prints what worked, plus any files or registry keys left behind. Add `--keep` to leave the sandbox open and look around. See [`bach test`](/docs/reference/cli/test) for all options.

### By hand

Copy the setup file to another computer or virtual machine and run it. Check that:

* the app starts from the Start menu
* features that need files next to the program work
* it appears under **Settings › Apps** and can be removed

If you test on your own computer, remember that it really installs. Remove it again from **Settings › Apps** afterwards.

## Read the log when something fails

Every install, update and removal writes a log to `%TEMP%\<app id>-setup.log`. To write it somewhere else:

```powershell theme={"theme":{"light":"github-light","dark":"github-dark"}}
& ".\Hello Notes-Setup-1.0.0.exe" --log C:\temp\setup.log
```

[Install problems](/docs/troubleshooting/install-problems.md) explains the most common errors.

## Before you share it

* [Sign your setup file](/docs/guides/signing.md) so Windows shows your name instead of "Unknown publisher".
* [Publish it](/docs/guides/releasing.md) somewhere your users can download it.
* Plan how you'll [ship the next version](/docs/guides/first-update.md).


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