Skip to main content
[[migrate]] names an older install of your app that another installer made. A first install with Bach removes it before it places any file, using the uninstall command that Windows already holds for it under Settings › Apps. Without it, an app that moves to Bach would sit on each upgraded computer twice.
bach.toml

What setup does

  • It runs on a first install only, before any file is placed, so nothing the old uninstaller deletes can be a file Bach just installed. The progress label is the text step_migrating.
  • It runs only the command in that entry, never through a shell, and only if it is an absolute path to an .exe that exists. It waits for the old uninstaller (up to 15 minutes) and then until its entry is gone from Settings › Apps (up to 90 seconds), because some uninstallers hand over to a copy of themselves and exit at once.
  • It never stops an install. An old install that is not there, cannot be removed silently or fails to go is written to the log (%TEMP%\<app id>-setup.log) and left alone, and the new version installs anyway.
  • It does not touch the user’s data. The old uninstaller decides what it removes, and most keep settings. Keep uninstall.data pointed at the folders the old app used so the new version finds them.

What may run with administrator rights

The command comes from the registry, so what may run elevated is limited.
  • A per-user old install (under HKCU, which the user’s own programs can write) is never run by an elevated setup, such as a machine-wide install.
  • A machine-wide old install (under HKLM) runs only with elevated = true, or when setup is elevated already, and only if its uninstaller sits in Program Files or the Windows folder.
  • %SystemRoot% and msiexec come from Windows, not from environment variables.
  • Anything else is left alone, with a line in the log.
See Move from another installer for a walkthrough. bach inspect lists each entry as Replaces.