0

我想创建一个 pkg 文件以在用户目录 (/Users//Applications/) 中安装捆绑包。

我该怎么做?

我使用产品构建将文件传输到产品:

productbuild --component ./Bundle.app --product ./file.plist

file.plist 包含

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>home</key>
  <true/>
</dict>
</plist>

但它不起作用......

pkgbuild 是否可以使用or 来实现这种行为 productbuild

4

1 回答 1

0

我想出了怎么做。

  1. pkgbuild --root <path to app> --identifier <identifier> --scripts <path to scripts>--install-location Applications/Name.app Package.pkg

  2. productbuild --synthesize --package ./Package.pkg Distribution.xml

  3. 通过在以下位置添加标签来编辑文件 Distribution.xml installer-gui-script<domains enable_anywhere="false" enable_currentUserHome="true" enable_localSystem="false"/>

  4. productbuild --distribution ./Distribution.xml --package-path ./Package.pkg Product.pkg

于 2020-09-04T11:18:32.660 回答