Use Composer to call scripts

Valued Contributor II

I'm trying to bundle 3 installs into 1 pkg using composer. It needs to call an install script for each install. I added all 3 to a post flight script, but it doesn't seem to run them..


cd /tmp/Threat-Prevention

cd /tmp/Firewall

Cd /tmp/Web-Control

exit 0      ## Success
exit 1      ## Failure

Valued Contributor II

I often have Composer drop my installer into /tmp/myTempInstallerStuff, then run a post install script such as:


/usr/sbin/installer -pkg ${tmpinstallfolder}Package.pkg -target /
/usr/sbin/installer -pkg ${tmpinstallfolder}Package2.pkg -target /

rm -rf /tmp/myTempInstallerStuff

Honored Contributor II
Honored Contributor II

@jwojda rather than changing into the directory, call the script directly:


That should work.

Contributor III

This probably isn't the issue because you would have seen a warning message, but just in case make sure you are using a postinstall and not a postflight script for a flat package...and of course build it as a .pkg not a DMG. If you are installing to a drive that you aren't booted to (Casper Imaging) you may have issues with those paths.