Turn it on
bach.toml
get_key_url is optional. It adds a Get a key button to the key page.
Make keys and build
Keys are never written intobach.toml. Make one:
keys.txt holds a random key. Send it to your customer. Keep the file private and out of Git. Instead of a file, you can put one key into the BACH_ACCESS_KEY environment variable.
To give every customer their own key, make many at once:
- _ . ~ + / = :. Random keys from bach key are much harder to guess.
What users see
After requirements and before the license, a page asks for the key. They can type or paste it. A wrong key shows That key doesn’t fit and nothing on the computer changes. Silent installs take the key with--key-file <file> or the BACH_ACCESS_KEY environment variable, never as a plain argument, because other programs can read arguments:
Private updates
With[updates], the key is kept on the user’s computer, protected so only that Windows account can read it, and sent with update requests:
bach.toml
Authorization: Bearer <key> and can answer 401 or 403 to refuse. The key only goes to the host of feed. See Where to host updates.
Taking a key back
Remove the line fromkeys.txt and build again. Copies of the old setup file still open with the old key, but your server can refuse its update requests.
What this protects, and what it doesn’t
It protects the setup file and the download: without a key, nobody can unpack your files. It doesn’t protect an installed app. After installing, the files are ordinary files on the user’s computer, and file names and sizes are visible even without a key. If you need licensing, check the license inside your app. Access keys can’t be combined with downloaded components (while files are encrypted), portable ZIPs or MSI packages. For every setting, see[access].