Use Composer to call scripts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on
06-17-2016
06:57 AM
- last edited on
03-04-2025
06:46 AM
by
kh-richa_mig
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..
#!/bin/sh
cd /tmp/Threat-Prevention
./PkgInstallScript
cd /tmp/Firewall
./PkgInstallScript
Cd /tmp/Web-Control
./PkgInstallScript
exit 0 ## Success
exit 1 ## Failure

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 06-17-2016 07:20 AM
I often have Composer drop my installer into /tmp/myTempInstallerStuff, then run a post install script such as:
tmpinstallfolder=/private/tmp/myTempInstallerStuff/
/usr/sbin/installer -pkg ${tmpinstallfolder}Package.pkg -target /
/usr/sbin/installer -pkg ${tmpinstallfolder}Package2.pkg -target /
rm -rf /tmp/myTempInstallerStuff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 06-17-2016 07:24 AM
@jwojda rather than changing into the directory, call the script directly:
/tmp/Threat-Prevention/PkgInstallScript
/tmp/Firewall/PkgInstallScript
/tmp/Web-Control/PkgInstallScript
That should work.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 06-17-2016 07:40 AM
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.
