Recently, when I tried to install a pkg file, just by double clicking, it gave an error. In such situations commandline installer tool comes handy. Here is how you can use it.
(Usually the target location is the root folder. However you can also point it to some other location depending on your requirements)
Here is an example.
