Skip to main content
These are optional ways to make updates smaller or safer once your app has users. All of them need automatic updates.

Release to some users first

A staged rollout offers a new version to only a percentage of computers. If something is wrong with it, fewer people are affected.
Upload this feed. About 10% of installed apps update in the background; the rest wait. Later, raise it with --rollout 50, and finally write the feed without --rollout to give it to everyone. How it behaves:
  • Each computer gets a number from 0 to 99 for that version, so a computer in the first 10% stays included as you raise the percentage. A different version picks a different group.
  • Computers outside the rollout count as up to date for --check-update, --download-update and background updates.
  • --update, which a person starts, always installs.
  • New installs from the online installer always get the newest version.
Apps never go back to an older version. To stop a bad release, publish the previous version’s feed again: computers that haven’t updated stay where they are, and computers that did wait for a higher version.

Offer beta versions

bach.toml
Build a beta with a version like 2.0.0-beta.1, and write its feed to the beta file:
Each installed copy chooses its channel. Your app could offer it as a setting that runs:
The choice survives updates and is deleted on uninstall. Switching back to stable doesn’t downgrade: the beta stays until a newer stable version is released. An app built without beta_feed answers --channel beta with exit code 1.

Make updates smaller with patches

A patch is a small setup file that contains only what changed since an earlier version. It helps when your app is large and most files stay the same, like an Electron app. Keep the setup file you published for the old version, and build with it. For an app called Hello, going from 1.3.0 to 1.4.0:
Upload the patch next to the setup file. The feed lists both, and each computer picks:
  • A computer on exactly the old version, with its files unchanged, downloads the patch.
  • Everyone else downloads the full setup file.
  • Before changing anything, the patch checks that every file it relies on is exactly as expected. If one isn’t, nothing is touched and the app downloads the full file instead.
Details:
  • A changed file of 64 KB or more is stored as a binary delta, only what differs from the old file, when that’s clearly smaller. So a big program with a few changes costs little.
  • A patch is itself a setup file, so it’s never smaller than about 10 MB. bach build only adds it to the feed if it’s at least a fifth smaller than the full file, and says so when it doesn’t.
  • The feed offers one patch. Make it from the version most of your users have.
  • If you sign after building, write the feed again with the signed patch: bach feed <setup file> --patch <patch file>.
  • The window opened by --update without --silent always uses the full file. First installs and the online installer do too.
  • With the GitHub Action, pass args: --patch-from OLD.exe.