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

# Package a Godot or Unity game

> Export your Godot or Unity game for Windows, then make an installer with Bach. Covers the files that must ship, files to leave out and game styles.

This guide makes an installer for a game made with Godot or Unity. Export or build the game for Windows first; Bach packages the folder you get.

## Godot

1. In Godot, export your game with a **Windows Desktop** preset into a folder of its own, for example `export/win`.
2. In the project folder, run `bach init`.

Bach reads the game's name and version from `project.godot`, and the export path from your Windows preset. Without a preset it guesses `build`.

```toml bach.toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[app]
name = "Moon Garden"
version = "0.3.1"
publisher = "Moon Garden"
executable = "MoonGarden.exe"

[files]
source = "export/win"
exclude = ["*.pdb", "*.log"]
```

Godot doesn't store a studio name, so `publisher` is the game's name until you change it.

Make sure the `.pck` file next to the program is in the list that `bach check` prints. The game won't run without it.

## Unity

1. Build your game for Windows into a folder called `Build` at the top of your project.
2. In the project folder, run `bach init`.

Bach reads the product name, company and version from your player settings.

```toml bach.toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[app]
name = "Starfall"
version = "1.2.0"
publisher = "Tiny Moon"
executable = "Starfall.exe"

[files]
source = "Build"
exclude = ["*_BurstDebugInformation_DoNotShip/**", "*_BackUpThisFolder_ButDontShipItInYourBuild/**", "*.pdb"]
```

The two `DoNotShip` patterns keep out folders Unity creates for debugging.

## Check and build

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

## Saved games

Your game probably saves files in the user's profile. The uninstaller leaves them alone unless you list the folder and the user ticks the box to delete it:

```toml bach.toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[uninstall]
data = ['%USERPROFILE%\AppData\LocalLow\Tiny Moon\Starfall']
data_description = "Your saved games and settings."
```

See [Uninstalling and user data](/docs/guides/uninstall-and-user-data.md).

## Make the installer look like a game

Bach has built-in styles made for games. List them and try one without changing your config:

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

Set your choice with `style` under `[installer]`. See [Customize the install window](/docs/guides/customize-the-window.md).

## Large games

* Optional parts such as high-resolution textures can be [components](/docs/guides/choices-and-components.md), and even downloaded only when the user ticks them.
* Updates can send only the files that changed. See [Patches and staged rollouts](/docs/guides/patches-and-rollouts.md).


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