> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Bach builds Windows installers from one bach.toml with the bach command: bach init, bach check, bach preview, bach build. Installs are per user and need no administrator rights by default. installer.scope = "machine" installs for every user after one Windows prompt. On Windows, run setup files with Start-Process -Wait -PassThru in PowerShell, and give signtool arguments that start with the word sign.

# Shortcuts, links, file types and PATH

> Add extra Start menu shortcuts, open your app from links or files, add right-click entries, start with Windows, set PATH and registry values.

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](/docs/guides/machine-wide-installs.md).

## The app's own shortcuts

```toml bach.toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[installer]
start_menu_shortcut = "always"   # the default
desktop_shortcut = true          # offered, ticked (the default)
```

See [Install options](/docs/guides/choices-and-components.md) 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:

```toml bach.toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[[shortcuts]]
name = "Hello Notes Settings"
target = "settings.exe"
description = "Change how Hello Notes works"
```

`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.

## Open your app from a link

```toml bach.toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[[protocols]]
scheme = "hellonotes"
description = "Hello Notes link"
```

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

```toml bach.toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[[file_types]]
extension = ".hnote"
description = "Hello Notes note"
```

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

```toml bach.toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[[context_menu]]
name = "Add to Hello Notes"
on = [".txt", ".md"]
```

`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

```toml bach.toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[installer]
start_with_windows = true        # offered, ticked
```

## Add your tool to PATH

```toml bach.toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[installer]
add_to_path = "always"
path_folder = "bin"              # if your tools are in a subfolder
```

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:

```toml bach.toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[[registry]]
key = 'Software\Your Name\Hello Notes'
name = "InstallDir"
value = "{app}"                  # {app} is the install folder
```

For environment variables:

```toml bach.toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
[[env]]
name = "HELLO_NOTES_HOME"
value = "{app}"
```

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]]`](/docs/reference/config/registry) and [`[[env]]`](/docs/reference/config/env) for the rules.

## Services and firewall rules

Background services and firewall rules need administrator rights, so they require `installer.scope = "machine"`. See [`[[services]]`](/docs/reference/config/services) and [`[[firewall]]`](/docs/reference/config/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.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.