I've used the steps below with other customers to install all sorts of packages. If you use AnyConnect, Umbrella, etc, you're probably familiar with them You can place all of the files you wish into a DMG. Alternatively, a ZIP will work just as well Open Terminal Using mkdir Create a Directory. I’ve used InstallerPackage as the Example In Terminal Type cd InstallerPackage
mkdir Scripts
mkdir Content
cd Scripts
touch postinstall Copy the DMG you need into the Content Folder Using a text editor, edit the postinstall file and paste in your script (an example script is at the end of this post) that will move files in /tmp to where ever you need to chmod a+x postinstall
cd .. Build the package sudo pkgbuild --identifier com.meraki.sophosinstaller --root Content --script Scripts --install-location /tmp com.meraki.sophosinstaller.pkg
pkgbuild: Inferring bundle components from contents of Content
pkgbuild: Adding top-level postinstall script
pkgbuild: Wrote package to com.meraki.sophosinstaller.pkg Double Note: ensure that there is a space between /tmp and com.meraki.sophosinstaller.pkg An example postinstall: #!/bin/bash
dmgPath="/tmp/YourDMGName.dmg"
mountPath="/Volumes/YourDMGMounted"
currentuser="$(id -un)"
usersAppDir="$(sudo -u $currentuser echo $HOME)"
/usr/bin/hdiutil attach "$dmgPath" -nobrowse -quiet
if [[ -e "$mountPath" ]]
then
cp -r "$mountPath"/"YourApp.app" /Applications/"YourAppName.app"
fi
umount "$mountPath"
rm -rf "$dmgPath"
# insert the commands that you need to
# provision your application
exit 0 This may take a few attempts to get right. So, I'd install the installer manually first before deploying via SM Also note: The name of the bundle ID that you use in SM when creating the custom app HAS to match the bundle ID of Sophos, else SM has no way to know that it's been installed correctly.
... View more