【问题标题】:How to set background image in MacOS Mojave pkg installer using productbuild?如何使用 productbuild 在 MacOS Mojave pkg 安装程序中设置背景图像?
【发布时间】:2019-07-03 23:23:45
【问题描述】:

我正在使用productbuild 为 MacOS Mojave 创建一个 .pkg 安装程序。我读过schema reference for the Distribution.xml file。我成功地使用它来包含自定义欢迎。因此,当我运行时,我知道我的资源路径被正确使用:

productbuild --resources ./res --sign "$PKG_SIGN_ID" --distribution Distribution.xml foo.pkg

但我似乎无法创建自定义背景图像。我尝试了各种 jpg 和 png 图片。

我已阅读 this question and answer 并尝试在资源目录中使用和不使用 en.lproj 子目录。

我的Distribution.xml 最终看起来像这样:

<?xml version="1.0" encoding="utf-8"?>
<installer-gui-script minSpecVersion="1">
<background file="background.jpg" mime-type="image/jpeg" scaling="tofit"/>
<welcome file="welcome.html"/>
<title>My App</title>
    <pkg-ref id="com.foo.myapp"/>
    <options customize="never" require-scripts="false"/>
    <choices-outline>
        <line choice="default">
            <line choice="com.foo.myapp"/>
        </line>
    </choices-outline>
    <choice id="default"/>
    <choice id="com.foo.myapp" visible="false">
        <pkg-ref id="com.foo.myapp"/>
    </choice>
    <pkg-ref id="com.foo.myapp" version="1.0" onConclusion="none">foo.pkg</pkg-ref>
</installer-gui-script>

Mojave 不能再这样做了吗?

【问题讨论】:

    标签: macos macos-mojave productbuild


    【解决方案1】:

    我发现了问题。我的问题是我在“黑暗模式”下运行。

    如果你想为暗模式设置安装程序的背景图片,你需要使用标签background-darkAqua,否则它永远不会显示:

    <background-darkAqua file="background.png" mime-type="image/png" scaling="tofit"/>
    

    【讨论】:

    • 我使用了这个,但我的安装程序部分,如介绍、摘要等都是黑色的,由于这张图片,不清楚。
    • 对我来说没问题。将您的 Distribution.xml 发送给我或分享链接
    猜你喜欢
    • 2013-07-08
    • 1970-01-01
    • 2012-12-07
    • 1970-01-01
    • 2022-07-11
    • 2019-03-14
    • 2019-03-27
    • 1970-01-01
    • 2020-09-28
    相关资源
    最近更新 更多