简体   繁体   English

从命令行packagemaker指定安装位置

[英]Specifying install location from commandline packagemaker

Being new to packagemaker I assume I am just missing something. 作为包装工具的新手,我认为我只是缺少一些东西。 It does not seem all the options in the GUI are available from the command line. 似乎GUI中的所有选项都不能从命令行中获得。 I have read the man page but maybe I just don't get it. 我已经阅读了手册页,但也许我不明白。

Of most interest to me is how do I specify the install locations of the files? 我最感兴趣的是如何指定文件的安装位置?

From the commandline to I need to also use installer in combination with packagemaker to get the same results of the GUI packagemaker? 从命令行到我还需要使用安装程序和packagemaker来获得与GUI packagemaker相同的结果? If so are there any examples you can recommend? 如果有,你可以推荐一些例子吗?

Thanks Vincent 谢谢文森特

What I ended up doing to change the install directory from command line: 我最后做了什么来从命令行更改安装目录:

  • create the package 创建包
  • extract the new package with pkgutil 使用pkgutil提取新包
  • string search for install-location="/" in the pkg file's PackageInfo, replace with desired install location 字符串搜索pkg文件的PackageInfo中的install-location="/" ,替换为所需的安装位置
  • repackage with pkgutil 用pkgutil重新包装

That works. 这样可行。

If you are creating packages using commandline mode of packagemaker, you will have to create a dummy directory which contains all your files in proper location. 如果使用packagemaker的命令行模式创建包,则必须创建一个虚拟目录,其中包含位于正确位置的所有文件。 For example, if you have to install files A and B at /Library/Applications/ and /Library/Application Support/ respectively, then you create the structure as below. 例如,如果必须分别在/Library/Applications//Library/Application Support/安装文件AB ,则可以创建如下结构。

Create a temp directory, say SourceFiles . 创建一个临时目录,比如SourceFiles Add your files to this directory as follows- 将您的文件添加到此目录,如下所示 -

SourceFiles/Library/Applications/A
SourceFiles/Library/Application Support/B

Now use the flag --root in packagemaker commandline mode. 现在在packagemaker命令行模式下使用标志--root。

packagemaker --root SourceFiles/ OTHER_OPTIONS

The idea is that instead of passing location of individual files to the command, you create a similar structure in a temporary directory and just pass that directory as argument to --root flag. 我们的想法是,不是将单个文件的位置传递给命令,而是在临时目录中创建类似的结构,并将该目录作为参数传递给--root标志。

More for commandline mode of packagemaker: http://macinstallers.blogspot.in/ 更多关于packagemaker的命令行模式: http//macinstallers.blogspot.in/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM