# Catalog format The catalog says what deployr can install and how. One copy is compiled into the binary (`internal/catalog/data/apps.yaml`); overlays let you add or override entries on a machine without rebuilding. ## Where overlays are loaded from In increasing order of precedence: 1. `C:\ProgramData\Deployr\catalog.d\*.yaml` (Windows) `/var/lib/deployr/catalog.d/*.yaml` and `/etc/deployr/catalog.d/*.yaml` (Unix) 2. The per-user cache directory's `catalog.d` (used automatically when the machine-wide path is not writable) 3. Anything passed with `--catalog FILE_OR_DIR` (repeatable) An overlay app whose `id` matches a shipped app **replaces it entirely** — no deep merge — so what you read in the file is exactly what will run. Profiles are replaced by name the same way. Check an overlay before you ship it: ``` deployr catalog validate ./my-apps.yaml ``` ## Document shape ```yaml apps: - id: my-app # required, unique, lowercase name: My Application # required, human name description: ... homepage: https://... categories: [line-of-business] aliases: [myapp] # alternative names accepted on the command line windows: # one or more of windows / darwin / linux sources: [...] # required, tried in order detect: {...} # how to tell it is already installed notes: ... # shown by `deployr info` profiles: onboarding: [my-app, chrome, 7zip] ``` ## Sources Sources are tried top to bottom. The first provider that **exists on the machine** is used; if it fails, deployr moves to the next one (unless `--strict`). Put the route you trust most first. ### Package manager sources ```yaml sources: - provider: winget # winget|choco|brew|cask|apt|dnf|zypper|pacman|flatpak|snap id: Google.Chrome # the provider's own package identifier args: ["--locale", "en-US"] # optional extra arguments arch: [amd64] # optional: restrict to these GOARCH values repo: flathub # optional: flatpak remote ``` ### Direct vendor downloads ```yaml sources: - provider: direct url: https://vendor.example/app-setup.msi urls: # or per-architecture, overriding url amd64: https://vendor.example/app-x64.msi arm64: https://vendor.example/app-arm64.msi kind: msi # msi|exe|msu|dmg|pkg|deb|rpm|zip|tar.gz|appimage # inferred from the URL when omitted silent_args: ["/S"] # REQUIRED for kind: exe sha256: 9f2c... # optional; enforced when set, required by --require-checksum app_name: MyApp.app # dmg/zip on macOS: the bundle to copy to /Applications dest: "%ProgramFiles%/MyApp" # zip/tar.gz: extraction target uninstall_id: my-app # Linux: package name to remove; Windows: registry DisplayName ``` Notes that matter in practice: - **`kind: exe` without `silent_args` is rejected.** A bare vendor `.exe` opens a wizard on someone's screen and then hangs until the timeout — refusing is the correct behaviour, not a limitation. - **Evergreen URLs cannot be checksum-pinned.** A vendor "latest" link changes content on every release. Pin `sha256` only for versioned URLs, and use `--require-checksum` on sites where an unpinned download is unacceptable. - **`.dmg` handling**: a `.pkg` inside the image wins; otherwise the `.app` named by `app_name` (or the only one present) is copied to `/Applications` with `ditto`, replacing any existing bundle. - **`.deb` installs go through `apt-get install ./file`**, so dependencies resolve instead of leaving a half-configured dpkg state. ## Detection Detection is how deployr decides an app is *already installed*, no matter who installed it. It runs before any provider is touched, which is why `deployr install chrome` is fast and idempotent on a machine that already has Chrome from an image. ```yaml detect: registry: ["Google Chrome"] # Windows uninstall entries, case-insensitive substring paths: # files or directories; env vars and globs allowed - "%ProgramFiles%/Google/Chrome/Application/chrome.exe" - "/Applications/Google Chrome.app" commands: [google-chrome-stable] # executables that must resolve on PATH ``` Evaluation order is registry, then paths, then commands — first hit wins. The registry scan covers 64-bit, 32-bit and per-user uninstall keys; missing one of those is the classic reason a "not installed" check is wrong. Version reporting comes from, in order: the provider's own query, the registry's `DisplayVersion`, or a macOS bundle's `CFBundleShortVersionString`. An app with no version available still reports correctly as installed. If `detect` is omitted entirely, deployr cannot skip work it does not need to do, and `update` / `uninstall` will always run the provider. Always write one. ## A complete overlay example `C:\ProgramData\Deployr\catalog.d\atomit.yaml` ```yaml apps: - id: linemgr name: LineManager Client description: Line-of-business client for the accounting team categories: [line-of-business] windows: sources: - provider: direct url: https://files.example.com/linemgr/LineManagerSetup-4.8.2.msi kind: msi sha256: 5f0d9a3c1e... silent_args: ["SERVER=lm01.corp.example.com"] detect: registry: ["LineManager Client"] # Override a shipped app: force Chrome through Chocolatey only. - id: chrome name: Google Chrome categories: [browser] windows: sources: - provider: choco id: googlechrome detect: registry: ["Google Chrome"] profiles: accounting: [linemgr, chrome, adobereader, 7zip] ``` Then: ``` deployr install @accounting --json ```