跳到内容

app builder lib.Interface.PkgOptions

Electron-Builder / app-builder-lib / PkgOptions

macOS 产品归档选项。

继承自

属性

allowAnywhere?

readonly optional allowAnywhere: null | boolean

是否可以安装在任何卷的根目录,包括非系统卷。否则,它不能安装在卷的根目录。

对应 enable_anywhere

默认值

true

allowCurrentUserHome?

readonly optional allowCurrentUserHome: null | boolean

是否可以安装到当前用户的主目录中。主目录安装以当前用户(而非 root 用户)身份完成,并且无法写入主目录之外的位置。如果产品无法安装在用户的主目录中,并且无法在用户的主目录中完全正常运行。

对应 enable_currentUserHome

默认值

true

allowRootDirectory?

readonly optional allowRootDirectory: null | boolean

是否可以安装到根目录。通常应为 true,除非产品只能安装到用户的主目录。

对应 enable_localSystem

默认值

true

artifactName?

readonly optional artifactName: null | string

artifact 文件名模板

继承自

TargetSpecificOptions.artifactName


background?

readonly optional background: null | PkgBackgroundOptions

安装程序背景图片的选项。


conclusion?

readonly optional conclusion: null | string

结论文件的路径。这可以用于自定义安装程序最终“摘要”页面上的文本。


extraPkgsDir?

readonly optional extraPkgsDir: null | string

macOS 产品归档的额外组件包目录(相对于构建资源目录)。自动扫描目录以查找任何 .pkg 文件,并相应地添加到 productbuild 命令中,作为 --package-path--package


hasStrictIdentifier?

readonly optional hasStrictIdentifier: null | boolean

是否需要在安装路径上使用相同的捆绑包标识符?

默认值

true

identity?

readonly optional identity: null | string

用于签名时使用的证书名称。 考虑使用环境变量 CSC_LINK 或 CSC_NAME 而不是指定此选项。


installLocation?

readonly optional installLocation: null | string

安装位置。 请勿使用它 来创建每用户包。 大多数情况下,你永远不需要更改此选项。 如果选择本地系统域,/Applications 将按预期安装到 /Applications 中,如果选择主目录安装,则安装到 $HOME/Applications 中。

默认值

/Applications

isRelocatable?

readonly optional isRelocatable: null | boolean

如果用户移动了捆绑包,是否覆盖安装旧版本?

默认值

true

isVersionChecked?

readonly optional isVersionChecked: null | boolean

如果磁盘上有更新的版本,是否不安装捆绑包?

默认值

true

license?

readonly optional license: null | string

EULA 许可证文件的路径。 默认为 license.txteula.txt (或大写变体)。 除了 txt,还支持 rtfhtml (不要忘记为链接使用 target="_blank")。


mustClose?

readonly optional mustClose: null | string[]

标识在安装软件包之前必须关闭的应用程序。

对应 must-close


overwriteAction?

readonly optional overwriteAction: null | "upgrade" | "update"

指定当安装包中的版本时,应如何处理磁盘上已存在的捆绑包版本。

如果指定 upgrade,则包中的捆绑包将原子地替换磁盘上的任何版本; 这具有删除新版本捆绑包中不再存在的旧路径的效果。

如果指定 update,则包中的捆绑包将覆盖磁盘上的版本,并且包中未包含的任何文件将保持不变; 当你交付仅更新包时,这很合适。

update 的另一个效果是,如果磁盘上尚不存在版本,则根本不会安装软件包捆绑包; 这允许软件包为用户可能已删除的应用程序交付更新。

默认值

upgrade

publish?

optional publish: Publish

继承自

TargetSpecificOptions.publish


scripts?

readonly optional scripts: null | string

脚本目录,相对于 build (构建资源目录)。 脚本可以使用任何语言,只要文件标记为可执行文件,并且具有指示解释器路径的适当 shebang。 脚本需要是可执行的 (chmod +x file)。

默认值

build/pkg-scripts

参见

安装程序包中的脚本.


welcome?

readonly optional welcome: null | string

欢迎文件的路径。 这可以用于自定义安装程序“简介”页面上的文本。