Building a Privileges installer package using AutoPkg
2022-4-21 04:1:47 Author: derflounder.wordpress.com(查看原文) 阅读量:46 收藏

Home > AutoPkg, Mac administration, Packaging, Privileges.app > Building a Privileges installer package using AutoPkg

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.

Screen Shot 2022 04 20 at 3 45 38 PM

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.


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

Screen Shot 2022 04 20 at 3 02 36 PM

3. Install AutoPkg.

Screen Shot 2022 04 20 at 3 28 03 PM

Screen Shot 2022 04 20 at 3 28 18 PM

4. Open Terminal and run the following command:

autopkg repo-add rtrouton-recipes

Screen Shot 2022 04 20 at 3 38 58 PM

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

Screen Shot 2022 04 20 at 3 39 41 PM

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.

Screen Shot 2022 04 20 at 3 40 14 PM

7. Once the override file has been created, run the following command to create a Privileges installer package:

autopkg run local.pkg.Privileges

Screen Shot 2022 04 20 at 3 40 55 PM

You should then see output similar to this:


[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.

Screen Shot 2022 04 20 at 3 42 00 PM

8. Repeat process as needed for each new version of Privileges.


文章来源: https://derflounder.wordpress.com/2022/04/20/building-a-privileges-installer-package-using-autopkg/
如有侵权请联系:admin#unsafe.sh