2

我们正在使用 pkgbuild 为音频插件创建安装程序。它由几个包(VST、AU、内容、预设等)组成。

由于内容很大,我们希望允许用户将内容包安装到外部驱动器。我在 distribution.xml 中使用了适当的设置(customLocationAllowAlternateVolumes="Yes")。但是,当内容安装到这样的外部驱动器时,安装程​​序还会在该驱动器上的 /Library/Receipts 文件夹(它创建)中的外部驱动器上放置一个 .plist 和一个 .bom 文件(参见屏幕截图)。

此文件夹结构是在外部驱动器上创建的:

这是在外部驱动器上创建的

无论内容包安装在哪个驱动器上,如何实现这些文件都放在启动盘上?

这是 pkgbuild 脚本:

#!/bin/bash

# Name of the package.
NAME="<OurProductName> Content"

IDENTIFIER="com.<OurCompanyName>.content.pkg.<OurProductName>"

# Package version number. The correct number will be set in the build process.
VERSION="1.0.1"

INSTALL_LOCATION="/Library/Application Support/<OurCompanyName>/<OurProductName>"
ROOT_LOCATION="content/"

# Remove any unwanted .DS_Store files.
find "$ROOT_LOCATION" -name '*.DS_Store' -type f -delete
chmod -R +r "$ROOT_LOCATION"

# Build package.
/usr/bin/pkgbuild \
    --root "$ROOT_LOCATION" \
    --install-location "$INSTALL_LOCATION" \
    --identifier "$IDENTIFIER" \
    --version "$VERSION" \
    --scripts Scripts \
    "$NAME.pkg"

这是分发文件中的相关片段:

<pkg-ref id="com.<OurCompanyName>.content.pkg.<OurProductName>" version="1.0.1" auth="Admin" onConclusion="None">Some%20Product%20Name%20Content.pkg</pkg-ref>
<choice id="Content" title="<OurProductName> Content" start_visible="true" start_selected="true" start_enabled="true" customLocation="/Library/Application Support/<OurCompanyName>/<OurProductName>" customLocationAllowAlternateVolumes="Yes" description='You can change the file location for the plugin content file. Click on the folder name in "Location" to select a different one.'>
    <pkg-ref id="com.<OurCompanyName>.content.pkg.<OurProductName>"/>
</choice>
4

0 回答 0