Skip to main content
The install window can ask your users a few questions: do they want a desktop shortcut, should the app start with Windows, do they want the sample projects? This page explains how you decide which questions appear and what happens to the answers.

Built-in options

These are settings under [installer]: Each takes one of four values: For example, a chat app that suggests starting with Windows, without forcing it:
bach.toml
With [updates], there’s also an Automatic updates box, controlled by updates.auto. add_to_path adds your install folder to the user’s PATH. If your command-line tools are in a subfolder, set path_folder:
bach.toml
Bach adds or removes exactly one PATH entry and leaves the rest unchanged.

Optional components

A component is a part of your app that users can leave out. Each one appears as a box in the install window.
bach.toml
  • id is a short name in lowercase. Silent installs use it: --with samples or --without samples.
  • title and description are what the user reads. They can be translated.
  • files are patterns relative to files.source.
  • default = true means the box starts ticked. The default is unticked.
Files that no component claims are always installed. Your main program can’t be part of a component.

What happens on updates

The window remembers what each user chose. When they update:
  • Boxes start the way they left them.
  • A new component starts at its default.
  • Unticking a component removes its files and any shortcut to them.

Download a component only when it’s wanted

Large optional parts, such as texture packs or language models, can stay out of the setup file and be downloaded when someone ticks them:
bach.toml
bach build then writes the component into its own file next to the setup file, such as Hello-Notes-textures-1.0.0.bachpack. Upload it with your release, to the same place as your setup file. download = true uses the download link from [updates]; you can also give a full https link. The setup file checks the downloaded file against a checksum recorded when you built it. Downloaded components can’t be combined with an access key that encrypts files.

A file that needs two components

By default, a file matched by several components belongs to the first one. If you want a file installed only when all of them are ticked, set:
bach.toml
Here vendor1/tools/... is installed only if both Tools and Vendor 1 are ticked. This needs Bach 0.11.1 or newer. [[components]] lists all the rules.

Try it

Tick and untick the boxes. Preview installs nothing. To see which files belong to which component, run bach check: the component’s id appears next to each file.