Skip to content

Label layers

A label layer is an extra configuration profile that adds apps to App Auto-Patch’s IgnoredLabels, RequiredLabels and OptionalLabels lists. Scope one layer per group, such as a department or a project, and App Auto-Patch combines them on each Mac. You don’t have to build a combined profile for every overlap. Label layers are new in 4.0.0 (132).

Say every Mac gets your main App Auto-Patch profile, and a department asks you not to patch AppA, AppB and AppC. Jonny is in that department and also works on a project that keeps AppX and AppY at a fixed version. The obvious fix is a second profile that sets IgnoredLabels to AppX and AppY. On Jonny’s Mac it doesn’t work.

macOS keeps one value per key for each preference domain. All the profiles for xyz.techitout.appAutoPatch end up in one file, /Library/Managed Preferences/xyz.techitout.appAutoPatch.plist. When two of them set IgnoredLabels, the Mac keeps one list and drops the other, without an error. Which one it keeps isn’t defined. App Auto-Patch only ever sees the list macOS kept, so it can’t combine them. The same goes for every other key the two profiles both set.

A layer uses a preference domain of its own, so macOS keeps its lists whole in a file of their own, and App Auto-Patch adds them to the main lists:

Profile Preference domain Scoped to Sets
Main profile xyz.techitout.appAutoPatch every Mac all your settings
Department X xyz.techitout.appAutoPatch.labels.deptx Department X IgnoredLabels: appa appb appc
Project Y xyz.techitout.appAutoPatch.labels.projecty Project Y IgnoredLabels: appx appy

On Jonny’s Mac, App Auto-Patch ignores appa, appb, appc, appx and appy. When Department X’s list changes, you edit that one profile. Removing a layer’s profile removes its labels at the next check.

We looked at two other ways to do this:

  • A second key, such as IgnoredLabelsAdditional. That works for two profiles. A third profile collides with one of them again.
  • Numbered or suffixed keys (IgnoredLabels2, IgnoredLabels_DeptX) in the main domain. The keys don’t collide, but the profiles share one domain. A layer that also sets any other App Auto-Patch key collides on that key, and a Jamf Pro custom schema can’t describe key names that are open-ended.
  • A layer’s domain is xyz.techitout.appAutoPatch.labels. followed by a name of your choice: letters, digits, dots or hyphens, for example xyz.techitout.appAutoPatch.labels.projecty. Each layer needs its own name.
  • App Auto-Patch reads only IgnoredLabels, RequiredLabels and OptionalLabels from a layer. They take the same forms as in the main profile: an array with one label per string, one space-separated string, or an array holding one space-separated string. Wildcards work as usual. Any other key in a layer is ignored, and the log says so.
  • Each list is the main profile’s list followed by every layer’s labels it doesn’t already have. Layers are read in order of their domain names, computer-level profiles first, then user-level ones. The order only affects how the list is shown.
  • The rules between the lists don’t change. RequiredLabels and OptionalLabels win over IgnoredLabels, whichever profile each label comes from. So a layer that ignores zoom* doesn’t skip zoom if any profile requires it, and a layer that ignores * skips everything except the required and optional labels.
  • Only your MDM writes to /Library/Managed Preferences, so a user can’t add a layer. A layer doesn’t make the main key managed. If the main profile doesn’t set IgnoredLabels, users can still ignore apps of their own in Settings, and the layer’s labels are added to theirs.
  • Settings shows a layer’s labels under each list as Also from label layer profiles. Users can’t edit them there, and saving Settings never writes them to the user’s preferences.
  • The root helper combines the lists the same way, including user-level layers for the user logged in at the console.

You’ll find two example files in the downloads:

In Jamf Pro, create a configuration profile with an Application & Custom Settings payload for each layer, and set its Preference Domain to the layer’s domain. Then do one of these:

  • choose Upload and add the .plist (not the .mobileconfig, whose lists would end up one level down, where App Auto-Patch doesn’t read them); or
  • choose External Applications > Add with Custom Schema as the source, and paste xyz.techitout.appAutoPatch.labels.jamf.json, which describes the three lists.

Scope each profile to its group. Leave the main profile scoped as it was.

The Configuration Helper builds layers too, from 1.0.2.11: add them in All Options > Label Layers. Each layer with a label is exported as its own profile and plist, and uploaded to Jamf Pro as its own profile, or as its own blueprint, so each one can have its own scope.

Every installed layer is a file of its own:

Terminal window
ls "/Library/Managed Preferences/" | grep xyz.techitout.appAutoPatch.labels

App Auto-Patch logs the layers it found each time they change, and the lists that result:

PreferenceManager: 2 label layers add to IgnoredLabels, RequiredLabels and OptionalLabels: xyz.techitout.appAutoPatch.labels.deptx: ignored [appa appb appc]; xyz.techitout.appAutoPatch.labels.projecty: ignored [appx appy]
PreferenceManager: ignoredLabels = ["slack", "appa", "appb", "appc", "appx", "appy"]

A warning says when a layer sets a key it can’t set, has a list that isn’t text, or holds a whole profile under PayloadContent.