Create a component pkg from a DMG
pkgbuild --component /Volumes/ApplicationName/* .app --install-location \
/Applications ApplicationName-Version.pkg
Install pkg from command line
installer -pkg pkgName.pkg -target / -verbose
Flatten A Component Package Within A Bundle
pkgutil --flatten component.pkg
Remove Receipt of Installations
pkgutil --forget com.identifier.name
Export Choice Changes Plist from a Package
installer -showChoiceChangesXML -pkg /path/to/pkg > choiceChangesOutput.plist
Apply Choice Changes During Package Install
installer -applyChoiceChangesXML /path/to/plist -pkg /path/to/pkg -target " /"
Generate a Distribution XML File
productbuild --synthesize --package first.pkg --package second.pkg
Arg
Meaning
$1
Full path to the installation package
$2
Full path to the installation destination
$3
Mountpoint of the destination volume
$4
Root directory for the current System folder
Environment Variable se by the installer process
Env Variable
Meaning
$PACKAGE_PATH
Same as the $1 argument
$SCRIPT_NAME
The name of the script file
$COMMAND_LINE_INSTALL
Set when installing with installer
List Installed Packages from Filter
pkgutil --pkgs=com.googlecode*
List Specific Package Information
pkgutil --info com.googlecode.munki.core
List Files A Package Installed
pkgutil --files com.googlecode.munki.core
List Files A Package Installed Based on *.app
pkgutil --file-info /Applications/Numbers.app
pkgutil --expand pkgName.pkg /to/path/for/inspection
Payload Files Are Typically XAR archives
Read the contents of a Bom (Bill of Material) file
List Valid Identities on the Current System
security find-identity -p basic -v
Sign An Already Built Package
productsign --sign " Identity" unsigned.pkg signed.pkg