Home > AutoPkg, Mac administration, Packaging, Privileges.app > Building a Privileges installer package using AutoPkg
In working with folks who want to build installer packages to install the Privileges app, I’ve noticed that a number of them have experienced problems with manually building an installer package for Privileges which correctly installs the Privileges app’s helper tool.
The result of an installer which does not install the helper tool correctly is that when a user requests administrator privileges using the Privileges app, the app prompts them to install the helper tool. This requires administrative rights, which sets up a chicken and egg situation where admin privileges are being required to get admin privileges.
Fortunately, there is an automated method for building the installer package which (so far) has worked correctly in each case I’m familiar with. There are AutoPkg recipes available for creating a Privileges installer package and AutoPkg is able to build a correctly working Privileges installer package.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
computername:~ username$ autopkg search com.github.rtrouton.Privileges | |
Name Repo Path | |
—- —- —- | |
Privileges.munki.recipe apfelwerk-recipes Privileges/Privileges.munki.recipe | |
Privileges.install.recipe rtrouton-recipes Privileges/Privileges.install.recipe | |
Privileges.munki.recipe rtrouton-recipes Privileges/Privileges.munki.recipe | |
Privileges.jss.recipe rtrouton-recipes JSS/Privileges.jss.recipe | |
Privileges.pkg.recipe rtrouton-recipes Privileges/Privileges.pkg.recipe | |
Privileges.download.recipe rtrouton-recipes Privileges/Privileges.download.recipe | |
To add a new recipe repo, use 'autopkg repo-add <repo name>' | |
computername:~ username$ |
For more details, please see below the jump.
For those not familiar with using AutoPkg, please follow the process below to build a working Privileges installer package:
Note: If you do not want to install AutoPkg on your own Mac, AutoPkg also runs fine in a macOS virtual machine.
1. If Git is not already installed, install Git.
Note: Git must be installed before installing AutoPkg because AutoPkg uses Git for many of AutoPkg’s functions.
Git is included with Xcode or the Xcode Command Line Tools, so installing either Xcode or the Xcode Command Line Tools will also install the necessary Git support.
2. Download the latest AutoPkg installer from https://autopkg.github.io/autopkg
3. Install AutoPkg.
4. Open Terminal and run the following command:
autopkg repo-add rtrouton-recipes
5. Once the repo has been added, run the following command to create an AutoPkg override of the AutoPkg recipe which creates the installer package:
autopkg make-override com.github.rtrouton.pkg.privileges
6. An AutoPkg override file should be created with the following recipe identifier:
local.pkg.Privileges
You can verify this by opening the override file in a text editor and looking for the Identifier key.
7. Once the override file has been created, run the following command to create a Privileges installer package:
autopkg run local.pkg.Privileges
You should then see output similar to this:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[email protected] ~ % autopkg run local.pkg.Privileges | |
Processing local.pkg.Privileges… | |
The following new items were downloaded: | |
Download Path | |
————- | |
/Users/username/Library/AutoPkg/Cache/local.pkg.Privileges/downloads/Privileges-1.5.2.zip | |
The following packages were built: | |
Identifier Version Pkg Path | |
———- ——- ——– | |
com.sap.privileges 1.5.2 /Users/username/Library/AutoPkg/Cache/local.pkg.Privileges/Privileges-1.5.2.pkg | |
[email protected] ~ % |
The newly-created Privileges installer package should be stored be in ~/Library/AutoPkg/Cache/local.pkg.Privileges.
8. Repeat process as needed for each new version of Privileges.