Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass arguments to package installer from mac terminal

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?

like image 816
santhosh Avatar asked Feb 04 '15 15:02

santhosh


People also ask

How do I package a Mac OS installer?

Select the Packages payload and click Configure. Click Add for the macOS installer package file. Choose “Cache” from the Action pop-up menu. Specify a distribution point for computers to download the package from.

How do I create a package file on Mac?

Save as a package file: Click anywhere in the document window to make it active, then choose File > Advanced > Change File Type > Package (from the File menu at the top of your screen).


1 Answers

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.

like image 146
Vikram Singh Avatar answered Sep 23 '22 08:09

Vikram Singh