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

# Where to host updates

> Publish the setup file and update feed on GitHub releases or any web host, add mirrors, serve private updates and combine x64, ARM64 and macOS.

Automatic updates read a small file called `latest.json` and download the setup file it points to. There's no update server to run: any place that serves files over `https` works. This page covers GitHub releases, your own hosting, and a few special setups.

## GitHub releases

For a public repository:

```toml bach.toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[updates]
github = "your-name/hello-notes"
```

Installed apps then read:

| File | Address |
| - | - |
| Update feed | `https://github.com/your-name/hello-notes/releases/latest/download/latest.json` |
| Setup file | `https://github.com/your-name/hello-notes/releases/download/v1.1.0/<file>` |

So each release needs the tag `v<version>`, the setup file and `latest.json`. The [release workflow](/docs/guides/releasing.md) or the [Bach GitHub Action](/docs/guides/ci.md) publishes exactly that.

Two details:

* GitHub renames uploaded files with spaces or unusual characters. With `github` set, Bach already names the file the way GitHub will serve it, so `Hello Notes` becomes `Hello-Notes-Setup-1.1.0.exe`.
* A **pre-release** isn't GitHub's "latest", so installed apps don't update to it. The same is true for a release you publish with "latest" turned off.

A private repository can't serve updates, because the installed app has no GitHub login. Use another host, or see [Private updates](#private-updates).

## Your own web host

Cloudflare R2, S3, Netlify, a plain web server: anything that serves two files at fixed addresses.

```toml bach.toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[updates]
feed = "https://example.com/hello-notes/latest.json"
download_url = "https://example.com/hello-notes/{file}"
```

After `bach build`, upload the setup file and `latest.json` from `dist/`. `{version}` can also be used in `download_url`, for example to keep each version in its own folder.

### Writing the feed yourself

`bach build` writes the feed when it knows the download address. To write it again, for example after signing:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
bach feed "dist/Hello Notes-Setup-1.1.0.exe" --notes "Faster search"
```

The address comes from `bach.toml`, or pass `--url`. `--notes-file` reads release notes from a file. See [`bach feed`](/docs/reference/cli/feed).

## Mirrors

A mirror is a second copy of the feed on another host, used when the first one can't be reached:

```toml bach.toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[updates]
feed = "https://example.com/hello-notes/latest.json"
download_url = "https://example.com/hello-notes/{file}"
mirrors = ["https://mirror.example.net/hello-notes/latest.json"]
```

Write the mirror's feed with its own download address:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
bach feed "dist/Hello Notes-Setup-1.1.0.exe" --url https://mirror.example.net/hello-notes/Hello%20Notes-Setup-1.1.0.exe --out mirror/latest.json
```

The first feed that answers decides which version is newest. A mirror can't announce a newer version when the main feed answers; it only offers another place to download the same file. When the main feed is down, the app trusts the first mirror that answers, so only list hosts you control, and consider [signing your feed](/docs/guides/update-security.md).

## Private updates

If only paying or approved users may download updates, use an [access key](/docs/guides/paid-apps.md). The installed app sends the key it was installed with as `Authorization: Bearer <key>`, and your server decides:

```toml bach.toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[access]
get_key_url = "https://example.com/buy"

[updates]
feed = "https://downloads.example.com/hello-notes/latest.json"
download_url = "https://downloads.example.com/hello-notes/{file}"
```

The key is only sent to the host of `feed`. Put your downloads on that same host. A redirect to another host, such as a storage bucket's signed link, is followed without the key.

## ARM64 and macOS in the same feed

If your `bach.toml` has [`[arch.arm64]`](/docs/reference/config/arch), `bach build` writes an x64 and an ARM64 setup file, and one feed listing both. Each computer takes the file for its processor. If the ARM64 entry is missing or invalid, ARM64 computers take the x64 file, which also runs there.

With a [`[macos]`](/docs/guides/macos) section, the same feed also lists the Mac file. A Mac only takes the macOS entry, and Windows computers ignore it. Build both in one run so the feed has both, or add one later with `bach feed ... --macos <file>`.

Upload every file the feed lists.

## The online installer

An online installer downloads the newest version from the same feed when someone runs it, so new users get the latest release without you changing your download link. See [Other builds](/docs/guides/other-builds.md#online-installer).


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