-->

How to pass arguments to package installer from ma

2019-06-20 15:22发布

问题:

I want to do my installation of pkg file as silent install from mac terminal. So i used the below command to do silent install.

sudo installer -store -pkg "/User/MyName/Desktop/helloWorld.pkg" -target /

It perfectly installed my application. But i want to pass arguments from this command line script to package installer that was created in package maker. So that i can able to use this argument value in post/pre installation script inside the package installer.

Is there any possibility to pass my value as argument in the above command?

回答1:

This is not possible from the command since the "installer" command does not support any such arguments. However, you may try using a configuration file which you can read from pre/postinstall script and do the required actions.