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

# Move from Inno Setup, NSIS or an MSI to Bach

> Move an app from Inno Setup, NSIS or an MSI to Bach: find the old install's Uninstall key, add [[migrate]] and know what setup removes and what it leaves.

When an app moves to Bach, people who installed the old version would end up with it twice: once from the old installer, once from Bach. `[[migrate]]` makes the first Bach install remove the old one first. This page walks through finding the key Windows keeps for the old install and adding it.

> [!TIP]
>
> Start from the old script: [`bach import installer.iss`](/docs/reference/cli/import) (or `.nsi`) writes a first `bach.toml` from an Inno Setup or NSIS script and lists what it couldn't convert. The steps below then make the first Bach install remove the old one.

**1. Find the old install's entry**

Install the old version on a test computer and open `regedit`. Look below `HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall` (or `HKEY_LOCAL_MACHINE\...` for a machine-wide old install). The name of the entry is what you need:

| Made by | The entry is called |
| - | - |
| Inno Setup | `<AppId>_is1`, like `{8A69D345-D564-463C-AFF1-A69D9E530F96}_is1` |
| An MSI | The product code, like `{3F2504E0-4F89-11D3-9A0C-0305E82C3301}` |
| NSIS | Whatever name your script wrote, often the app's name |

**2. Add it to bach.toml**

```toml bach.toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[[migrate]]
uninstall_key = "{8A69D345-D564-463C-AFF1-A69D9E530F96}_is1"
```

If the entry has no `QuietUninstallString`, tell setup how to run the old uninstaller without a window: `arguments = "/VERYSILENT /NORESTART"` for Inno Setup, `arguments = "/S"` for NSIS. An MSI needs nothing: it is removed with `msiexec /x {code} /qn /norestart`.

**3. Keep the user's data**

The old uninstaller decides what it removes, and most keep the user's settings. Point `uninstall.data` and the app's own paths at the folders the old app used, so the new version finds them. See [The uninstaller and your users' data](/docs/guides/uninstall-and-user-data.md).

**4. Test it on a copy**

On a test computer with the old version installed, run the new setup file. It should remove the old install first and then install the new one, and Settings › Apps should list the app once. The log, `%TEMP%\<app id>-setup.log`, says what happened to each entry.

## What to expect

* Migration runs on a **first** install with Bach, before any file is placed. Updates of a Bach install skip it.
* It never stops the install. If the old install is not there, cannot be removed quietly or fails to go, the log says so and the new version installs anyway. Test with the old version once, so you know it goes.
* A machine-wide old install (under `HKLM`) is removed only when you add `elevated = true`, which makes Windows ask for administrator rights, and only if its uninstaller sits in Program Files or the Windows folder. A per-user old install is never run by a setup that already has administrator rights.
* If the old install and the new one use the same folder, nothing the old uninstaller deletes can be a file Bach just installed, because the old one goes first.

See the [`[[migrate]]`](/docs/reference/config/migrate) reference for every setting and the safety limits, and [machine-wide installs](/docs/guides/machine-wide-installs.md) if the old install was for every user.


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