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

> Turn an old installer script into a bach.toml, and remove the old installation on first install so users don't end up with your app twice.

If your app already ships with another installer, switching to Bach has two parts: writing a `bach.toml`, and making sure users who have the old version don't end up with two copies. This page covers both.

## 1. Start from your old script

If you use Inno Setup or NSIS, let Bach write a first config from the script:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
bach import installer.iss
bach import installer.nsi
```

It writes a `bach.toml` next to the script with the app's name, files, shortcuts, license and run steps, and lists everything it couldn't convert. Read that list: custom script logic has no Bach equivalent. Add `--dry-run` to see the result without writing it. See [`bach import`](/docs/reference/cli/import).

There is no import for MSI or WiX; write `bach.toml` yourself, following [your first installer](/docs/quickstart.md).

## 2. Find the old installation's name

Windows lists every installed program in the registry. Bach needs the name of your old entry.

1. On a test computer, install the old version.
2. Open **Registry Editor** (`regedit`) and go to `HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall`. If the old installer installed for all users, look under `HKEY_LOCAL_MACHINE` instead.
3. Find your app's entry and note the name of the key:

| Made by | The key is usually called |
| - | - |
| Inno Setup | your `AppId` followed by `_is1`, such as `{8A69D345-D564-463C-AFF1-A69D9E530F96}_is1` |
| MSI | the product code, such as `{3F2504E0-4F89-11D3-9A0C-0305E82C3301}` |
| NSIS | whatever your script chose, often the app's name |

## 3. Tell Bach to remove it

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

On a user's first Bach install, setup runs the old uninstaller without a window, then installs your app. It uses the command Windows has stored for it. If the entry has no silent command (`QuietUninstallString`), give the arguments:

```toml bach.toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[[migrate]]
uninstall_key = "Hello Notes"
arguments = "/S"                    # NSIS; for Inno Setup use "/VERYSILENT /NORESTART"
```

An MSI needs no arguments.

### An old installation for all users

If the old installer installed for every user, removing it needs administrator rights:

```toml bach.toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[[migrate]]
uninstall_key = "Hello Notes"
arguments = "/S"
elevated = true
```

Windows asks the user for permission. For safety, Bach only does this if the old uninstaller is inside Program Files or the Windows folder.

## What can go wrong

Migration never stops your install. If the old entry isn't found, can't be removed quietly, or fails, setup writes that to the log and installs the new version anyway, so the user could end up with both. Test with the real old version before you release.

Updates of a Bach install skip migration.

## Keep the user's data

Your new version should read settings from the same place the old one wrote them. Most old uninstallers keep user data; check yours. To offer deleting it on removal, see [Uninstalling](/docs/guides/uninstall-and-user-data.md).

## Test it

1. On a clean test computer, install the old version and use it.
2. Run your new setup file.
3. Check that Settings › Apps lists your app once, and that your settings are still there.
4. If something's off, read `%TEMP%\<app id>-setup.log`.


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