Files
- Files can only be written inside the install folder. Paths with
..or absolute paths are refused. - The uninstaller deletes only files it installed, inside a folder that clearly holds your app. A file changed after install is kept.
- Data folders are deleted only if the user ticks the box. They must be your own folders inside
%APPDATA%,%LOCALAPPDATA%or%USERPROFILE%, neverDocuments, key folders such as.ssh, or other programs’ data. - A first install into a folder that already has files with the same names warns first; a silent install refuses without
--overwrite.
Administrator rights
- By default, setup never asks for them and only writes to the current user’s folders and registry.
- It asks only if you set
installer.scope = "machine", or mark a run step or a migrationelevated = true. - A machine-wide app must live in Program Files. Setup checks that only administrators can change the folder before running anything elevated.
- Setup files only load Windows’ own system libraries, never a DLL placed next to them.
Registry, environment and other programs
[[registry]]keys must be under your own key belowSoftware. Windows’ own areas, such asClassesandPolicies, and keys of Microsoft, Google and Mozilla are refused.- Environment variables must start with your app id, unless you set
allow = true. Variables that load code into other programs or redirect network traffic, such asCOR_PROFILERorHTTPS_PROXY, are never set. - Link schemes and file types registered by other programs are never taken over or deleted.
PATHis edited by adding or removing exactly one entry; the rest is left byte for byte.
Building
bach checkandbach buildrefuse build folders with files that look like secrets, unless you allow them.- The install window program used for your build is downloaded over
httpsonly and, in released versions ofbach, checked against a built-in checksum. [signing]names a program to run, so it only runs with--sign. Building someone else’sbach.tomlnever runs it.
Installing
- The setup file’s contents are validated when it starts. A damaged or edited file shows a message instead of installing.
- The compressed archive and every unpacked file are checked against checksums recorded at build time before anything is replaced.
- Run steps start only your app’s own files, without a shell. An elevated program is checked against its checksum right before Windows asks for rights.
- Migration runs only the uninstall command Windows has stored for the entry you named, and never stops your install.
Updates
- Downloads use
httpsonly. A downloaded file must match the checksum in the feed and be the same app and version, checked again right before it runs. - A patch is only applied if every file it relies on is exactly as expected.
- A mirror can’t announce a different version; it can only offer another place to get the same file.
- With signed feeds or a required signature, someone who controls your download host still can’t give users their own code.
Access keys
The key is checked before anything changes. Files are encrypted with it (Argon2id and ChaCha20-Poly1305). The key kept for updates is protected for the Windows user and only sent to your feed’s host.On macOS
The same rules apply to Mac builds, plus these:- Setup never runs as root.
- Symbolic links that point outside your app are refused, when building and when installing.
- Data folders must be your app’s own folders inside the user’s home folder.
- With
[updates] signer, an update runs only if it carries a Developer ID Application signature that Apple issued, with that name.