OSX pkgbuild:在安装到备用卷时将软件包的plist放在启动盘中

时间:2015-12-21 16:16:38

标签: macos installer pkgbuild

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

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

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

This is created on the external drive

无论内容包安装在哪个驱动器上,我怎样才能将这些文件放到启动盘上?

这是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>

0 个答案:

没有答案