make-profile-pkg icon indicating copy to clipboard operation
make-profile-pkg copied to clipboard

Re-installing profiles

Open majorsl opened this issue 10 years ago • 1 comments

I'm trying to build a package to do the following, all in one shot, I don't know if this tool can do it however. Everything else I've tried has been a complete failure.

I need to:

  1. remove existing profiles if they exist.
  2. install the trust profile.
  3. install the enrollment profile.

I want a single pkg that our tier 1 techs can just double-click and be done with.

Thoughts anyone?

majorsl avatar May 14 '15 13:05 majorsl

This tool has some of the bits you need, but you'll need to do some work to build a single pkg that meet your needs.

make-profile-pkg builds a single pkg for a single profile, so you could potentially use it to build your two packages, and then use productbuild to put them together into a single distribution pkg.

For removing existing profiles, you could add a preinstall script to one of the packages or add a third package that handles the removal using a preinstall script. If you build a pkg using pkgbuild and use the --nopayload option, it won't leave behind a receipt, and so can instead be used as a vehicle for running scripts.

Note that if your new profile has the same identifier as the old versions, those will be "updated" so you don't necessarily need to remove old ones first. But, only if the identifiers are the same.

timsutton avatar May 15 '15 13:05 timsutton