Skip to main content
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:
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. There is no import for MSI or WiX; write bach.toml yourself, following your first installer.

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:

3. Tell Bach to remove it

bach.toml
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:
bach.toml
An MSI needs no arguments.

An old installation for all users

If the old installer installed for every user, removing it needs administrator rights:
bach.toml
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.

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.