I'm trying to develop a customized PKG that would be used to install a piece of software both in-person and via Jamf Pro (two birds, one stone and all that). I would like to do things a little differently depending on whether or not Jamf Pro has launched the installer. Is there a way anyone can think of to identify whether or not Jamf Pro launched the PKG?
Identifying that a PKG was run by Jamf Pro?
Best answer by mm2270
I'm not sure using either pkgutil or looking in the computer record for receipts is what the OP is after. Looking at his post, I'm reading it as trying to know at the time the package is being installed, whether its being installed by a Jamf policy or if someone is manually installing the pkg, like in a preinstall script perhaps, and changing the behavior of what takes place in that script, maybe. @straffin will probably have to clarify that to be sure, but that was how I took his post.
If I'm right, checking package receipts isn't going to help, because those only get dropped after the package install has finished, not during installation.
Checking the jamf.log could work. I've used something similar in my scripts, but for a different end goal.
Another possibility is checking the running process list with ps and looking to see where installer/Installer is running from. If being called by a policy, it would show up as /usr/sbin/installer along with the path to the package in /Library/Application Support/JAMF/Downloads/. If being run from Installer.app, /System/Library/CoreServices/Installer.app/Contents/MacOS/Installer will show up in the results.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
