Skip to main content
[[run]] runs one of your packaged programs during install or removal, for things copying files can’t do. Walkthrough: Run programs during setup.
bach.toml

Behavior

  • Steps run one at a time, in the order listed, as the current user, in the program’s own folder.
  • Their output goes into the setup log (the last 8 KB of it), with the exit code.
  • A failed step during install stops it with couldn’t be set up (exit code N), and the previous state is restored. What the program itself already changed isn’t undone.
  • A failed step during removal never stops the removal.
  • A program that needs administrator rights but runs without elevated = true fails to start.

Elevated steps

In a per-user install, the install folder can be changed by the user’s other programs. Right before asking for rights, setup compares the program with its recorded checksum. Still, only elevate well-known, signed installers; bach check warns about elevated steps in per-user installs. An elevated step in a per-user setup can’t be ended on timeout, because Windows doesn’t let a normal program end an elevated one. Setup stops waiting and says so in the log. Declining the Windows prompt fails the step. bach inspect lists steps as Runs. The texts step_running and error_run can be changed. For the Mac build, use [[macos.run]].