Posted on 09-30-2022 10:07 AM
Hey JAMF'ers-
Is there a good way to bundle multiple .pkgs into one pkg file using composer? So like say I have a bunch of instrument packs I've downloaded the .pkg files from the vendor and I want to deploy to some of our machines, is there a way to bundle those dozen or so pkgs into one pkg file using composer?
09-30-2022 10:55 AM - edited 10-01-2022 11:05 AM
Yes, place all the packages into the folder you want to deploy the packages too on your packaging machine, drag and drop all of the packages at once into composer.
This will create one package, containing all of your packages. Once deployed, they will exist as packages in that directory.
Inside composer, create a postinstall script for this package.
(Click > next to Package name in Composer, Right Click "Scripts" folder, Hover over "Add Shell Script", select "postinstall script")
Target each package to install in the correct order, use the following command in the postinstall to install the extra packages
sudo /usr/sbin/installer -pkg "/Directory/Location/Folder/Package1.pkg" -target /
sudo /usr/sbin/installer -pkg "/Directory/Location/Folder/Package2.pkg" -target /
sudo /usr/sbin/installer -pkg "/Directory/Location/Folder/Package3.pkg" -target /
Posted on 10-03-2022 11:37 AM
It's been awhile, but I used Packages in the past. There is a way to combine a bunch of separate packages into in the GUI, just can't recall step by step.
Posted on 10-05-2022 10:43 AM
I have performed this exact thing to support Non-Universial Applications. I manually create two folders, one for each arch within a single root folder that I name the app I am trying to deploy. This has helped for Patching where you can only have a single .pkg file associated to a definition.
APPs
#!/bin/sh
## postinstall
pathToScript=$0
pathToPackage=$1
targetLocation=$2
targetVolume=$3
mkdir -p "${3}/Applications/IntelliJ IDEA.app"
rm -rf "${3}/Applications/IntelliJ IDEA.app/Contents"
if sysctl machdep.cpu.brand_string | grep -w "Intel" ; then
rsync -aE --delete --link-dest="/private/tmp/intellij/x86_64/IntelliJ IDEA.app" -- "/private/tmp/intellij/x86_64/IntelliJ IDEA.app/" "/Applications/IntelliJ IDEA.app"
fi
if sysctl machdep.cpu.brand_string | grep -w "Apple" ; then
rsync -aE --delete --link-dest="/private/tmp/intellij/arm64/IntelliJ IDEA.app" -- "/private/tmp/intellij/arm64/IntelliJ IDEA.app/" "/Applications/IntelliJ IDEA.app"
fi
rm -rf "/private/tmp/intellij/" 2>/dev/null
exit 0 ## Success
exit 1 ## Failure
PKGs
#!/bin/sh
## postinstall
pathToScript=$0
pathToPackage=$1
targetLocation=$2
targetVolume=$3
if sysctl machdep.cpu.brand_string | grep -w "Intel" ; then
sudo -S installer -allowUntrusted -verboseR -pkg "/private/tmp/ringcentral/x86_64/RingCentral.pkg" -target /
fi
if sysctl machdep.cpu.brand_string | grep -w "Apple" ; then
sudo -S installer -allowUntrusted -verboseR -pkg "/private/tmp/ringcentral/arm64/RingCentral-arm64.pkg" -target /
fi
rm -rf "/private/tmp/ringcentral/" 2>/dev/null
exit 0 ## Success
exit 1 ## Failure
Posted on 10-05-2022 10:50 AM
Screenshots since the editor butchers my code and the edit button doesn't seem to work.
Composer should look like this, PKGs or APPs, then the example post install scripts below that.
Apps - Post Install should look something like this
PKGs - Post Install should look something like this