The source folder
bach.toml
source, including every subfolder, goes into the setup file and ends up in the install folder with the same structure. The path is relative to the folder that holds bach.toml.
To see exactly what will be packaged:
Leave files out
Useexclude with a list of patterns:
bach.toml
A pattern without
/ is compared with the file name only. A pattern with / is compared with the whole path, starting at the top of source. * stays within one folder, ** crosses folders, ? stands for one character. Upper and lower case don’t matter.
Files that look like secrets stop the build
It’s easy to pointsource at the wrong folder and ship a private key by accident. So when Bach finds a file that looks like a secret, it refuses to build:
.envfiles, certificates and private keys (.pfx,.pem,.key, SSH keys)- credential files such as
.npmrc,credentials.jsonor cloud service account keys - version control and cloud login folders such as
.git,.sshand.aws - your own
bach.toml - small text files (config files, scripts and similar, up to 256 KB) that contain a private key or an AWS, GitHub or Slack token
bach.toml
Warnings
These don’t stop the build, butbach check and bach build mention them:
- Clutter, such as
*.pdb,*.log,Thumbs.db,.DS_Store, ornode_modules,targetand__pycache__folders. - Long paths. A file whose installed path would be longer than 259 characters. Setup can write it, but shortcuts, File Explorer and many programs can’t open it. This often happens with
node_modules. - A very large file list, for example thousands of small files. Bach keeps the list in the setup file and again in the uninstaller on every computer, so packing files together (for Electron, into an
asararchive) keeps both smaller.
--strict.
Rules for the folder
- It must contain the program named in
app.executable, and that program can’t be excluded. - It must have at least one file.
- It can’t contain symbolic links.
- Two files can’t differ only in upper and lower case.
- A file named
uninstall.exeat the top isn’t allowed, because Bach adds its own.
Make some files optional
If users should be able to choose whether to install part of your app, such as sample projects or extra language packs, don’t exclude those files. Put them in a component instead.Different files for ARM64 or macOS
[files] is for the 64-bit Intel and AMD build. [arch.arm64] names a folder for ARM64, and [macos] one for the Mac version.