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: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.- On a test computer, install the old version.
- Open Registry Editor (
regedit) and go toHKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall. If the old installer installed for all users, look underHKEY_LOCAL_MACHINEinstead. - Find your app’s entry and note the name of the key:
3. Tell Bach to remove it
bach.toml
QuietUninstallString), give the arguments:
bach.toml
An old installation for all users
If the old installer installed for every user, removing it needs administrator rights:bach.toml
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
- On a clean test computer, install the old version and use it.
- Run your new setup file.
- Check that Settings › Apps lists your app once, and that your settings are still there.
- If something’s off, read
%TEMP%\<app id>-setup.log.