Skip to content

Custom Installomator

Build 48: documents how MDM admins can pin App Auto-Patch (AAP) 4.x to an internal Installomator fork instead of upstream. Two workflows are supported; pick the one that matches how tightly your environment controls Installomator source.

AAP shells out to Installomator.sh plus the matching fragments/labels/* directory for every patch run. Out of the box AAP fetches Installomator from the upstream Installomator/Installomator repository and keeps it under /Library/Application Support/AppAutoPatch/Installomator. That default is appropriate for consumer Macs and for most managed fleets.

Some environments need to deviate from that default:

  • Internal fork: your IT team maintains a fork that adds labels for in-house apps, tweaks blocking-process behavior, or pins upstream labels to vetted releases.
  • Air-gapped or proxied networks: the target Macs cannot reach github.com directly and you stage the Installomator payload from your software-distribution server.
  • Change-control: you must vet every change to Installomator before it lands on production Macs.

AAP 4.x exposes two workflows for these cases. They are independent of each other; pick whichever fits.

Section titled “Workflow A — InstallomatorVersion managed preferences (recommended)”

The simplest option. AAP’s preference schema exposes a handful of keys that point its built-in updater at a non-default Installomator source:

Key Type Notes
InstallomatorVersion string release, main, or custom. custom enables the next two keys.
InstallomatorVersionCustomRepoPath string Your fork on GitHub: owner/repository (e.g. MyOrg/Installomator) or https://github.com/MyOrg/Installomator. Other hosts aren’t supported.
InstallomatorVersionCustomBranchName string Branch of that repository. Blank or unset is main.
InstallomatorUpdateDisable bool When true, AAP never updates Installomator on its own. See below.
InstallomatorAssembleFromFragments bool Defaults to true. false keeps a main or custom repository’s own Installomator.sh. See below.

Deploy these via the same configuration profile you use for the rest of AAP’s settings — the manifest in xyz.techitout.appAutoPatch.json (ProfileCreator / iMazing) and xyz.techitout.appAutoPatch.jamf.json (Jamf Pro) already include these keys.

When InstallomatorUpdateDisable is false (the default), the root helper keeps the on-disk copy aligned with InstallomatorVersion. For main and custom it compares the branch’s current commit with source-commit next to Installomator.sh. That sees a same-day push and a fragments/ change that did not regenerate Installomator.sh. For release it compares fragments/version.sh with the latest Installomator release tag. A difference re-downloads that source as a GitHub archive. The check runs when the helper starts and about once a day after that. Restarting the helper checks again immediately. Turning InstallomatorUpdateDisable off while Installomator.sh is missing retries within a minute. If the check cannot reach the source, the installed copy stays.

InstallomatorVersionCustomRepoPath is a GitHub owner/repository (MyOrg/Installomator). A https://github.com/owner/repository URL for that same repository is accepted too. Only GitHub is supported: a URL on another host, such as a self-hosted Git server, is refused with an error in the log, and the installed copy stays. To ship a fork that isn’t on GitHub, use Workflow B.

When InstallomatorUpdateDisable is true, the helper does not download or replace Installomator.sh or fragments/. It still refreshes LabelVersionHelper.zsh. This is the mode to combine with Workflow B when you want full change-control over the Installomator payload. A string TRUE or FALSE from a 3.x profile is accepted.

Building Installomator.sh from the label fragments

Section titled “Building Installomator.sh from the label fragments”

Installomator’s label fragments in fragments/labels are its source. Upstream regenerates Installomator.sh from them only from time to time, so on main a fragment can change before the script does. App Auto-Patch checks for updates and stages installers from the fragment, but the install runs Installomator.sh. When the two disagree, an install can fail: in #217 the Shottr fragment was a pkg while the script still installed a dmg.

When InstallomatorAssembleFromFragments is true (the default), the root helper rebuilds Installomator.sh after it downloads main or a custom branch. It joins the downloaded fragments in the same order as Installomator’s utils/assemble.sh and keeps the script’s VERSIONDATE. A copy downloaded by an earlier App Auto-Patch build is rebuilt on the first upkeep pass. If a fragment is missing or the result fails zsh -n, the downloaded script is kept. An assembled-from-fragments file next to the script records the rebuild.

Set InstallomatorAssembleFromFragments to false when a custom repository carries changes in Installomator.sh that are not in its fragments. The downloaded script is then used as it is. If the script had already been rebuilt, the helper downloads the source again to restore it. The key has no effect on release, whose script and fragments ship together, or when InstallomatorUpdateDisable is true. The setting is also in the Installomator tab of Settings, and a managed value locks that toggle.

GitHubAPIAuthEnabled and GitHubAPIToken authenticate the api.github.com calls that check main, custom, and release. Turn authentication on when a fleet or a custom repository is hitting the unauthenticated limit of 60 requests an hour. A fine-grained token needs Contents: Read on the repositories being queried. Archive downloads on github.com stay unauthenticated. Both keys can be set in Settings or in a profile. A managed value wins. The token is not written to the log.

Workflow B — Deploy Installomator yourself

Section titled “Workflow B — Deploy Installomator yourself”

Some environments bypass AAP’s built-in updater and deliver Installomator through their own software-distribution pipeline, for example as a signed package from the MDM. App Auto-Patch does not ship a tool for this. How you build, sign, and deliver the payload is up to you. This section covers what AAP expects to find once it lands.

AAP runs whatever is in /Library/Application Support/AppAutoPatch/Installomator. Install these there, owned by root:wheel:

  • Installomator.sh, executable.
  • fragments/functions.sh. LabelVersionHelper.zsh sources it for the fast version check. Without it every label exits 2 and falls back to a full Installomator run, and AAP logs one warning.
  • fragments/labels/, from the same commit as Installomator.sh.

Other files in that folder, such as LabelVersionHelper.zsh, belong to AAP. Leave them in place.

AAP writes source-commit only for copies it downloads itself, so keep your own record of which commit each payload came from.

Pair Workflow B with InstallomatorUpdateDisable=true

Section titled “Pair Workflow B with InstallomatorUpdateDisable=true”

If you push your own payload but leave AAP’s built-in updater enabled, the next helper start or daily check re-downloads the configured InstallomatorVersion and overwrites whatever you deployed. Set InstallomatorUpdateDisable=true in the AAP managed-preferences profile to disable that download. AAP will then only use the on-disk copy your distribution pipeline maintains.

Replace the label folder, do not unzip over it

Section titled “Replace the label folder, do not unzip over it”

Replace fragments/ and Installomator.sh as a whole rather than extracting on top of the old copy. A package whose postinstall runs unzip -o into the target never removes a file. When upstream deletes or renames a label, the old file stays, and discovery and staging read it while Installomator.sh runs something else. In #227 a leftover audacity.sh staged Audacity 4 while Installomator.sh ran the audacity3 label and failed with exit 8 on every cycle. A safe pattern is to extract to a folder beside the target, check it, then move the new fragments/ in and the old one out.

Since build 96, App Auto-Patch also skips a label file whose case pattern is not the one Installomator.sh runs for that label, and logs one AppDiscoveryService: Skipped … label file(s) that Installomator.sh does not run warning listing them. Treat that warning as a sign that the payload left stale files behind.

A user piloting build 47 (TechTrekkie) asked whether the custom- Installomator workflow breaks AAP’s LabelVersionHelper.zsh. The short answer: no, the two are independent.

LabelVersionHelper.zsh is the small helper AAP installs alongside Installomator (also under /Library/Application Support/AppAutoPatch/) that AAP uses internally to derive an Installomator label’s appNewVersion when the label’s own metadata doesn’t expose it. It is installed and refreshed by the AAP root-helper daemon’s ensureInstallomator() path, independent of which Installomator source AAP is using.

In practice this means:

  • Workflow A (custom managed-pref repo) refreshes both Installomator.sh and LabelVersionHelper.zsh on the same daemon sweep. No action required from the admin.
  • Workflow B (pushed payload + InstallomatorUpdateDisable=true) controls Installomator.sh, fragments/functions.sh, and fragments/labels/. LabelVersionHelper.zsh is still installed and kept current by AAP’s helper because InstallomatorUpdateDisable is intentionally scoped to the Installomator payload, not to the helper’s own bootstrap files. Redeploy any payload that leaves out functions.sh. Until that file is on disk, AAP logs one warning and uses the slow Installomator fallback for every label.

If you completely lock down /Library/Application Support/AppAutoPatch/ via filesystem permissions, you must whitelist LabelVersionHelper.zsh so the helper can drop it in place; otherwise the discovery pipeline degrades to metadata-only version comparisons.

After deploying either workflow:

Terminal window
# Which Installomator AAP is actually running:
ls -la "/Library/Application Support/AppAutoPatch/Installomator/Installomator.sh"
/usr/bin/sed -nE 's/^VERSION="([^"]+)".*/\1/p' \
"/Library/Application Support/AppAutoPatch/Installomator/Installomator.sh" | head -n 1
/usr/bin/sed -nE 's/^VERSIONDATE="([^"]+)".*/\1/p' \
"/Library/Application Support/AppAutoPatch/Installomator/Installomator.sh" | head -n 1
# Commit installed for main or custom. Absent on a Workflow B payload.
cat "/Library/Application Support/AppAutoPatch/Installomator/source-commit"

The version line should match the commit / tag your distribution pipeline expects. For main and custom, source-commit is the commit the helper installed. For Workflow B, compare the version lines with your own record of what you deployed.

  • MDM-ServiceManagement.md — approves the helper LaunchDaemon. The helper is what writes Installomator to disk; this profile must be in place for either workflow to run silently.
  • MDM-AppManagement.md — pre-approves the Sequoia App Management TCC permission so Installomator can actually replace .app bundles after writing the new ones.