将参数或环境传递给 Mac 安装程序脚本
我尝试使用 packagemaker 编写安装程序,该程序在安装过程中运行 shell 脚本。 我想在静默模式安装期间将一些参数传递给 shell 脚本。类似于
$installer -pkg MyInstaller.pkg -my_argument1 -my_argument2
我能想到的两个选项是,
- 设置环境变量并从脚本中读取这些变量。但这似乎不起作用。
- 将此数据写入某个文件并在安装过程中从中读取。但这是一种非常丑陋的方法,而且对于我的安装人员的用户来说并不方便。
有没有更好的方法来使用命令行参数或环境来做到这一点?
I tried to write installer with packagemaker which runs a shell script during installation.
I want to pass some arguments to the shell script during silent mode installation. Something similar to
$installer -pkg MyInstaller.pkg -my_argument1 -my_argument2
The two options I can think of are,
- Set the environment variables and read those from script. But this does not seem to work.
- Write this data to some file and read from it during installation. But it's very ugly way to do this and it is not convenient for my installer's user.
Is there a better way to do it with command line arguments or environments?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论