I have a pkg that I need to install, however, it must be installed from a specific location:
/Library/Application\\ Support/TheApp/installer.pkg (not the real name)
If I run sudo installer -pkg /Library/Application\\ Support/TheApp/installer.pkg -target / the script ends and I get a return code, 125, 160, whatever, not just 0 or 1. I need to get the same result from from log of the installer.
So I have a DMG that delivers the pkg to the proper location.
I then have a script that runs last:
sudo installer -pkg /Library/Application\\ Support/TheApp/installer.pkg -target /
pkgexitcode=$?
echo $pkgexitcode > /Users/Shared/AppExitCode.log
echo $pkgexitcode
exit $pkgexitcode
It will only return 0 in JAMF, and the log file also returns 0, though I know it is not (based off other log files that are generated)