Skip to main content
Most apps only need the Start menu and desktop shortcuts Bach creates by default. This page covers the other ways your app can plug into Windows: extra shortcuts, links like hellonotes://, file types, right-click entries, starting at sign-in, PATH, and your own registry values. Everything here is added during install, removed during uninstall, and written only for the current user unless your app installs for every user.

The app’s own shortcuts

bach.toml
See Install options for the four possible values.

Extra Start menu shortcuts

If your app ships a second program, such as a settings tool, add a shortcut for it:
bach.toml
target is a file in your build folder. arguments is also available. These shortcuts follow the Start menu choice, and disappear if their file belongs to a component the user didn’t pick.
bach.toml
After installing, clicking hellonotes://open/123 starts your app with the whole link as its first argument. Your app has to read it. Schemes used by Windows or browsers, such as http or file, are refused. If another program already registered the scheme on the user’s computer, Bach leaves it alone.

Open your app’s files

bach.toml
Double-clicking a .hnote file opens your app with the file’s path as an argument. Your app also appears under Open with. Bach only makes your app the default for types that no other program opens yet, so installing never takes files away from another program. Types that run code, such as .exe, .bat or .ps1, are refused.

Right-click menu entries

bach.toml
on can be "files" (every file), "folders", "background" (the empty space inside a folder), a file extension, or a list of these. Your app receives the clicked path as an argument. Change what it receives with arguments. On Windows 11, such entries appear under Show more options.

Start when the user signs in

bach.toml

Add your tool to PATH

bach.toml
Users can then run your program from a new terminal window by its name.

Your own registry values and environment variables

If your app or another program reads settings from the registry, write them at install time:
bach.toml
For environment variables:
bach.toml
The variable name must start with your app id in capitals followed by _ (for Hello Notes, that’s HELLO_NOTES_), so installers don’t overwrite each other’s variables. To set another name on purpose, add allow = true. Some variables and registry areas that belong to Windows or could be used to attack other programs are always refused. See [[registry]] and [[env]] for the rules.

Services and firewall rules

Background services and firewall rules need administrator rights, so they require installer.scope = "machine". See [[services]] and [[firewall]].

What uninstalling does

The uninstaller removes the shortcuts, links, file types, right-click entries, PATH entry, autostart entry, registry values and variables that this install added. Registry keys for links and file types are marked as Bach’s, and anything without that mark is left alone, so another program’s settings are never deleted.