我正在为 OS X 整理一个安装程序包,但我不知道如何禁用询问用户要安装到哪个卷的屏幕。我希望它安装到 /
没有提示。
这是我构建包的方式:
pkgbuild --root build/staging/ --identifier xxxx --scripts InstallerOSX/resources/ --scripts InstallerOSX/scripts/ ${OBJROOT}/AgentPayload.pkg
productbuild --distribution InstallerOSX/distribution.dist --package-path ${OBJROOT} --resources InstallerOSX/resources/ ${BUILT_PRODUCTS_DIR}/AgentInstaller.pkg
这是我的 distribution file :
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<installer-gui-script minSpecVersion="1">
<title>xxxx</title>
<background file="background.png" mime-type="image/png" scaling="tofit"/>
<pkg-ref id="xxxx"/>
<options customize="never" require-scripts="false"/>
<choices-outline>
<line choice="xxxx"/>
</choices-outline>
<choice id="xxxx" title="title" description="desc">
<pkg-ref id="xxxx"/>
</choice>
<domains enable_anywhere="false" enable_currentUserHome="false" enable_localSystem="true"/>
<pkg-ref id="xxxx" version="0" onConclusion="none">AgentPayload.pkg</pkg-ref>
</installer-gui-script>
<domains>
元素似乎无法解决问题...
最佳答案
我最终将以下内容添加到分发定义中:
<options rootVolumeOnly="true"/>
rootVolumeOnly
已弃用,但目前可以使用,而 domains
似乎不行。
关于macos - 如何禁止在我的 OS X 安装程序包中选择备用卷?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14074866/