Copy the extra content files into a temporary folder (I always used /tmp) then add them to Composer and use a postinstall script like the following to initiate the installations.
#!/bin/sh
/usr/sbin/installer -pkg "$3/tmp/GarageBandBasicContent.pkg" -target "$3"
/usr/sbin/installer -pkg "$3/tmp/JamPack1.pkg" -target "$3"
/usr/sbin/installer -pkg "$3/tmp/JamPack4_Instruments.pkg" -target "$3"
rm -rf "$3/tmp/GarageBandBasicContent.pkg"
rm -rf "$3/tmp/JamPack1.pkg"
rm -rf "$3/tmp/JamPack4_Instruments.pkg"
exit 0
Note: the rm commands are not necessary if you use /tmp since that directory is cleaned on reboot.
Thank you for the post by the way; looks like it'll do exactly what I need it to!
EDIT: Nevermind that first part; I've since learned to RTFM. :)
Thanks msblake for the lead pointers. This approach worked really well, though I ended up using the $1 variable (mount point) in place of the $3 variable (user), because I kept getting invalid path errors with the $3 variable. e.g.```
/usr/sbin/installer -pkg "$1/private/tmp/LogicContent/JamPack1.pkg" -target "$1"
/usr/sbin/installer -pkg "$1/private/tmp/LogicContent/MAContent10_InstrumentsBass.pkg" -target "$1"
/usr/sbin/installer -pkg "$1/private/tmp/LogicContent/MAContent10_ProducerClassicSixtiesKit.pkg" -target "$
The issue with installing all of the packages from the tmp folder and then either removing them or allowing them to be removed at reboot is that it doubles the storage space needed to install the downloaded packages. So I decided to rm each package immediately after it was installed. I created a loop that goes through the directory where my pkg files are installed by the policy (/private/tmp/LogicContent) and installs and deletes each package in turn.
Files="$1/private/tmp/LogicContent/*.pkg"
for f in $Files
do
echo "Installing $f package..."
/usr/sbin/installer -pkg "$f" -target "$1"
echo "Removing $f package..."
rm -fv "$f"
done
This has the advantage of reducing the file size overhead (from ~70GB to ~40GB), and the script is no longer dependent on a specific set of .pkg files (it will just install and rm anything with the .pkg extension in the target directory.
One could also substitute ```
Files="$1/private/tmp/LogicContent/*.pkg"
with ```
Files="$4/*.pkg"
```
to create a general purpose post-flight pkg installer, leaving the pkg directory available to be defined as a script option in the JSS.