如何从Mac终端将参数传递给软件包安装程序 [英] How to pass arguments to package installer from mac terminal

查看:144
本文介绍了如何从Mac终端将参数传递给软件包安装程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从Mac终端以静默方式安装pkg文件.因此,我使用以下命令进行静默安装.

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 /

它完美安装了我的应用程序.但是我想将参数从此命令行脚本传递给在软件包制造商中创建的软件包安装程序.这样我就可以在软件包安装程序中的post/pre安装脚本中使用此参数值.

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?

推荐答案

由于"installer"命令不支持任何此类参数,因此该命令无法执行此操作.但是,您可以尝试使用配置文件,该文件可以从安装前/安装后脚本中读取并执行所需的操作.

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.

这篇关于如何从Mac终端将参数传递给软件包安装程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆