There are two ways this script can be run: When the user opens the pkg
file and goes through the normal GUI setup, or when an admin (or savvy user) runs sudo installer -pkg /path/to/Installer.pkg -target /
. For the second one, I want to know when the script was run in this mode so I can make more admin-friendly decisions like not opening another GUI. How do I know when my pkg
is installed via the command line?
I'm hoping for some environment variable or something similar.