Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

The config file

pack takes a long command line. Put the options in a TOML file instead and pass --config:

# everything from the file
.\target\release\installer_builder.exe pack --config .\pack.toml

# file as a base, override one value on the CLI
.\target\release\installer_builder.exe pack --config .\pack.toml --to-version 1.1

Keys are flat and snake_case, matching the CLI long names. Unknown keys are rejected, which catches typos. Booleans are true or false.

Merge rules

CLI arguments override the file. Anything absent from both uses the built-in default, or fails with a message naming the missing key if it is required.

  • Scalars and paths. The CLI value wins; otherwise the file value; otherwise the default.
  • The assoc list. A CLI --assoc list replaces the file's list entirely when given. It does not merge.
  • Booleans (force_reinstall, purge_unknown_files, skip_license, skip_path, upgrade_minimal_ui, show_uninstall_complete, reuse_stub). Either source can turn them on.
  • Tables ([[shortcut]], [[registry]], [[plugin]], [[feature]]) and feature_mode are config-file only. There are no CLI equivalents.

Required keys

Via CLI or file: product, product_id, publisher, to_version, input, out, and exactly one of priv_key / priv_key_literal. In toolchain mode, one of pub_key / pub_key_literal is also required. An invalid product_id fails the build; see Full installers.

Key reference

Identity and content

KeyTypeDescription
productstringDisplay name.
product_idstringRegistry-safe id, stable across versions.
publisherstringVendor name.
hintway_tenant_idstringOptional Hintway tenant UUID. Enables the Hintway build in toolchain mode; see Install analytics.
to_versionstringVersion being packaged.
inputpathDirectory of files to install.
exestringMain executable, relative to input.
outpathOutput installer path.

Signing and stub

KeyTypeDescription
priv_keypathEd25519 private key file.
priv_key_literalstringPrivate key as 64 hex chars. Mutually exclusive with priv_key.
pub_keypathPublic key file, compiled into the stub. Ignored in toolchain-free mode.
pub_key_literalstringPublic key as 64 hex chars. Mutually exclusive with pub_key.
installer_stubpathPrebuilt installer.exe. Switches to toolchain-free mode; requires uninstaller.
uninstallerpathPrebuilt uninstall.exe, paired with installer_stub.
reuse_stubboolSkip rebuilding the stub and uninstaller when they already exist (toolchain mode).

Patch mode

KeyTypeDescription
from_versionstringPrevious version. Required together with from_dir.
from_dirpathPrevious version's files, for delta generation.

Wizard and install behavior

KeyTypeDefaultDescription
licensepathbuilt-in placeholderUTF-8 EULA text shown on the License page.
bannerpathflat gray headerPNG painted across the wizard header. See Branding.
assocarray[]File associations, entries of the form ".ext:Description".
default_install_dirstring%LOCALAPPDATA%\Programs\<product>Install path the UI proposes. %VAR% env tokens are expanded.
skip_licenseboolfalseHide the License page.
skip_pathboolfalseHide the Choose-location page.
install_dir_restrictionstringenforceWhether a fresh interactive install may target a non-empty folder: enforce, default_dir_only, or bypass. See Wizard pages and install location.
launch_optionstringcheckedThe "launch now" checkbox on the final page: checked, unchecked, or hidden.
upgrade_minimal_uiboolfalseUpgrades use the compact minimal UI; a first install still gets the wizard.
show_uninstall_completeboolfalseShow a confirmation message box at the end of an interactive uninstall.
min_installer_versionstring1.0.0Minimum installer stub version allowed to run this payload.
purge_unknown_filesboolfalseOn a full install over an existing copy, remove files not in this build. Ignored for patches.
force_reinstallboolfalseDev: rewrite all files, remove orphans, skip the from-version check.
feature_modestringstickyHow an upgrade seeds the active feature set: sticky or override. See Feature packs.

Tables

Declared as arrays of tables. Standard TOML ordering applies: put all flat keys above them, then the table blocks at the end of the file.

TablePurpose
[[shortcut]]Shortcuts to create. See Shortcuts.
[[registry]]Free-form registry entries. See Registry keys.
[[plugin]]Native DLL plugins. See Plugins.
[[feature]]Feature packs mapping path globs to a feature id. See Feature packs.

Complete example

# pack.toml
product    = "My App"
product_id = "myapp"
publisher  = "My Company"
hintway_tenant_id = "your-tenant-id" # optional
to_version = "1.0"
input      = "build/myapp-1.0"
exe        = "myapp.exe"
out        = "dist/setup-myapp-1.0.exe"

priv_key = "keys/priv.key"
pub_key  = "keys/pub.key"

license = "legal/EULA-myapp-en.txt"
banner  = "branding/header-1400x144.png"
assoc   = [".myx:MyApp Document", ".myz:MyApp Archive"]

default_install_dir = "%LOCALAPPDATA%\\Programs\\MyApp"
launch_option       = "checked"

# Patch mode: uncomment to build a patch instead of a full installer.
# from_version = "0.9"
# from_dir     = "build/myapp-0.9"

# Toolchain-free mode: point at prebuilt binaries instead of cargo builds.
# pub_key above is then ignored; the stub carries its own baked-in key.
# installer_stub = "kit/installer.exe"
# uninstaller    = "kit/uninstall.exe"

[[shortcut]]
dir    = "%DESKTOP%"
name   = "%PRODUCT%"
target = "%EXE%"

[[shortcut]]
dir    = "%START_MENU%"
name   = "%PRODUCT%"
target = "%EXE%"

[[registry]]
hive  = "HKCU"
key   = "%APP_KEY%"
name  = "InstallDir"
type  = "sz"
value = "%INSTALL_DIR%"