Composer- bundling multiple pkgs into one pkg

kbreed27
Contributor

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? 

4 REPLIES 4

Hugonaut
Valued Contributor II

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 /

________________
Looking for a Jamf Managed Service Provider? Look no further than Rocketman
________________


Virtual MacAdmins Monthly Meetup - First Friday, Every Month

obi-k
Valued Contributor III

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.

http://s.sudre.free.fr/Software/Packages/about.html

cmccormack
New Contributor II

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

cmccormack
New Contributor II

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.

cmccormack_2-1664992159572.png

Apps - Post Install should look something like this

cmccormack_1-1664992017163.png

 

PKGs - Post Install should look something like this

cmccormack_0-1664991982125.png