[files] section names the folder Bach installs and the files in it to leave out. It is required.
bach.toml
Exclude patterns
*matches within a name.**matches across folders.?matches one character.- A pattern without
/matches file names anywhere, like*.pdb. - A pattern with
/matches from the top ofsource, likedocs/**. - Case does not matter.
*.pdb, *.d, *.rlib, build/**, deps/**, incremental/**, .fingerprint/**, examples/** and bundle/**. bach init writes these for Rust and Tauri projects, and *.pdb, *.log, Thumbs.db and .DS_Store for the other stacks it recognises.
Secrets
bach check and bach build stop when source holds a file that looks like a secret, because a key that ships in a setup file is burnt. The message names the first file and why. These are refused:
.env,.env.*and*.env*.pfx,*.p12,*.pem,*.key,*.ppk,*.p8,*.snk,*.jks,*.keystoreand*.kdbxid_rsa*,id_dsa*,id_ecdsa*andid_ed25519*secring.gpgandtrustdb.gpg*.tfstate,*.tfvars,credentials,credentials.json,service-account*.jsonandlocal.settings.json.git-credentials,.npmrc,.yarnrc.yml,.pypirc,.netrc,.htpasswd,.dockercfg,.pgpass,.vault-token,.aws-credentials,.bash_history,.zsh_history,wallet.datandsecrets.json- a file called
.git bach.tomlandbach-*.toml, which hold your signing commands and feed addresses- anything inside a
.git,.svn,.hg,.ssh,.aws,.azure,.gnupg,.docker,.kubeor.terraformfolder .m2/settings.xml,.gradle/gradle.properties,.gem/credentialsand anything inside.config/gcloud
.json, .yml, .yaml, .toml, .ini, .cfg, .conf, .config, .properties, .txt, .xml, .env, .pem and scripts, up to 256 KiB) are also read for a private key block, an AWS access key (AKIA...), a GitHub token (ghp_..., github_pat_...) or a Slack token (xoxb-...). Programs and libraries are never read.
Leave the file out with exclude, or name it in allow_secrets to ship it on purpose:
bach.toml
*.pdb, *.log, Thumbs.db, .DS_Store and anything inside node_modules, target or __pycache__.
Rules
- Every file and folder name must be one Windows can create: at most 255 characters, counted as Windows counts them, and not a device name such as
NUL,CON,COM1orLPT1, with or without an extension.bach checkreports the first one that is not. - The source folder cannot contain symbolic links. Copy real files into it. Bach reports the offending path.
- The source folder cannot contain a file named
uninstall.exeat its top, because Bach adds its own. - Every file you leave in is installed, unless a component the user unticks claims it.
- Windows’ classic limit for a whole path is 260 characters. Setup writes longer paths, but shortcuts, Explorer and many programs stop there unless Windows’ long path support is on.
bach checkadds up the usual install folder (%LOCALAPPDATA%\Programs\<folder>with a 20-character user name, orC:\Program Files\<folder>) and the longest packaged path, and warns above 259 characters. Flatten deep trees such asnode_modules. - A file list of more than about 2 MB (roughly 17,000 files) also warns: the list is stored in the setup file and again in
uninstall.exe. Fewer, larger files keep both smaller, for example an asar archive for an Electron app.