Applications that are provided in an .pkg or .mpkg application bundle format can be installed silently in the background even while a user is currently logged into the system without him noticing. (.mpkg bundles are more customizable compared to their pkg. counterpart)
To Run the package installer in silent mode without showing the GUI-user-dialog the installer needs to be run from command line:
[bash]sudo -S installer -verbose -pkg your_installer_file.pkg -target /[/bash]
Target indicates the destination volume the package is going to be installed. The installer will run without showing the installer in the ui. You will have to enter your systems – administrator password in case the installer needs root permissions to copy various configuration files.
It’s possible (but not recommended) to fully automate the process with the command line by echoing the password
[bash]echo password | sudo -S installer -verbose -pkg your_installer_file.pkg -target /[/bash]
Attention: Your password will be stored in the bash_history in cleartext, therefore I DON’T recommend it.