跳到内容

app builder lib.Interface.NsisOptions

Electron-Builder / app-builder-lib / NsisOptions

继承自

被...扩展

属性

allowElevation?

readonly optional allowElevation: boolean

仅限辅助安装程序。 允许请求提升权限。如果为 false,用户将需要以提升的权限重启安装程序。

默认值

true

allowToChangeInstallationDirectory?

readonly optional allowToChangeInstallationDirectory: boolean

仅限辅助安装程序。 是否允许用户更改安装目录。

默认值

false

artifactName?

readonly optional artifactName: null | string

产物文件名模板。默认为 ${productName} Setup ${version}.${ext}

覆盖

TargetSpecificOptions.artifactName


buildUniversalInstaller?

readonly optional buildUniversalInstaller: boolean

禁用构建目标配置中指定的 arch 架构的通用安装程序。不支持 nsis-web

默认值

true

createDesktopShortcut?

readonly optional createDesktopShortcut: boolean | "always"

是否创建桌面快捷方式。如果需要在重新安装时也重新创建(即使已被用户删除),请设置为 always

默认值

true

继承自

CommonWindowsInstallerConfiguration.createDesktopShortcut


createStartMenuShortcut?

readonly optional createStartMenuShortcut: boolean

是否创建开始菜单快捷方式。

默认值

true

继承自

CommonWindowsInstallerConfiguration.createStartMenuShortcut


customNsisBinary?

readonly optional customNsisBinary: null | CustomNsisBinary

允许您提供自己的 makensis,例如支持通过 LogSet 和 LogText 进行调试日志记录的版本。(日志记录还需要 debugLogging = true 选项)

继承自

CommonNsisOptions.customNsisBinary


deleteAppDataOnUninstall?

readonly optional deleteAppDataOnUninstall: boolean

仅限一键安装程序。 是否在卸载时删除应用数据。

默认值

false

displayLanguageSelector?

readonly optional displayLanguageSelector: boolean

是否显示语言选择对话框。不推荐使用(默认情况下将使用操作系统语言检测)。

默认值

false

guid?

readonly optional guid: null | string

请参阅 GUID 与应用名称对比

继承自

CommonNsisOptions.guid


include?

readonly optional include: null | string

NSIS 包含脚本的路径,用于自定义安装程序。默认为 build/installer.nsh。请参阅 自定义 NSIS 脚本


installerHeader?

readonly optional installerHeader: null | string

仅限辅助安装程序。 MUI_HEADERIMAGE,相对于构建资源或项目目录。

默认值

build/installerHeader.bmp

installerHeaderIcon?

readonly optional installerHeaderIcon: null | string

仅限一键安装程序。 头部图标(进度条上方)的路径,相对于构建资源或项目目录。默认为 build/installerHeaderIcon.ico 或应用图标。


installerIcon?

readonly optional installerIcon: null | string

安装程序图标的路径,相对于构建资源或项目目录。默认为 build/installerIcon.ico 或应用图标。


installerLanguages?

readonly optional installerLanguages: null | string | string[]

安装程序语言(例如 en_US, de_DE)。仅当您了解自己在做什么以及为了什么时才更改。


installerSidebar?

readonly optional installerSidebar: null | string

仅限辅助安装程序。 MUI_WELCOMEFINISHPAGE_BITMAP,相对于构建资源或项目目录。默认为 build/installerSidebar.bmp${NSISDIR}\\Contrib\\Graphics\\Wizard\\nsis3-metro.bmp。图像尺寸 164 × 314 像素。


language?

readonly optional language: null | string

LCID Dec,默认为 1033 (英语 - 美国)。


license?

readonly optional license: null | string

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

支持多种语言的许可证文件 - 使用语言后缀(例如 _de, _ru)。例如,在构建资源中创建文件 license_de.txtlicense_en.txt。如果操作系统语言是德语,将显示 license_de.txt。请参阅 语言代码到名称 的映射。

将根据用户操作系统语言选择合适的许可证文件。


readonly optional menuCategory: string | boolean

是否为开始菜单快捷方式和程序文件目录创建子菜单。如果为 true,将使用公司名称。或字符串值。

默认值

false

继承自

CommonWindowsInstallerConfiguration.menuCategory


multiLanguageInstaller?

readonly optional multiLanguageInstaller: boolean

是否创建多语言安装程序。默认为 unicode 选项值。


oneClick?

readonly optional oneClick: boolean

是否创建一键安装程序或辅助安装程序。

默认值

true

覆盖

CommonWindowsInstallerConfiguration.oneClick


packElevateHelper?

readonly optional packElevateHelper: boolean

是否打包提升权限可执行文件(如果使用每机器安装程序或将来可能使用,则 electron-updater 需要此文件)。如果 perMachine 设置为 true,则忽略此选项。

默认值

true

perMachine?

readonly optional perMachine: boolean

是否为辅助安装程序显示安装模式安装页面(选择每机器或每用户)。或者安装是否始终针对所有用户(每机器)。

如果 oneClicktrue(默认值):是否按所有用户(每机器)安装。

如果 oneClickfalseperMachinetrue:不显示安装模式安装页面,始终按每机器安装。

如果 oneClickfalseperMachinefalse(默认值):显示安装模式安装页面。

默认值

false

覆盖

CommonWindowsInstallerConfiguration.perMachine


preCompressedFileExtensions?

readonly optional preCompressedFileExtensions: null | string | string[]

将不压缩的文件的文件扩展名。仅适用于 extraResourcesextraFiles 文件。

默认值

[".avi", ".mov", ".m4v", ".mp4", ".m4p", ".qt", ".mkv", ".webm", ".vmdk"]

publish?

optional publish: Publish

继承自

TargetSpecificOptions.publish


removeDefaultUninstallWelcomePage?

readonly optional removeDefaultUninstallWelcomePage: boolean

仅限辅助安装程序。 移除默认的卸载欢迎页面。

默认值

false

runAfterFinish?

readonly optional runAfterFinish: boolean

是否在安装完成后运行已安装的应用程序。对于辅助安装程序,将移除相应的复选框。

默认值

true

继承自

CommonWindowsInstallerConfiguration.runAfterFinish


script?

readonly optional script: null | string

NSIS 脚本的路径,用于自定义安装程序。默认为 build/installer.nsi。请参阅 自定义 NSIS 脚本


selectPerMachineByDefault?

readonly optional selectPerMachineByDefault: boolean

是否在安装模式安装页面上将每机器或每用户安装设置为默认选择。

默认值

false

shortcutName?

readonly optional shortcutName: null | string

将用于所有快捷方式的名称。默认为应用程序名称。

继承自

CommonWindowsInstallerConfiguration.shortcutName


unicode?

readonly optional unicode: boolean

是否创建 Unicode 安装程序

默认值

true

继承自

CommonNsisOptions.unicode


uninstallDisplayName?

readonly optional uninstallDisplayName: string

控制面板中的卸载程序显示名称。

默认值

${productName} ${version}

uninstallerIcon?

readonly optional uninstallerIcon: null | string

卸载程序图标的路径,相对于构建资源或项目目录。默认为 build/uninstallerIcon.ico 或应用图标。


uninstallerSidebar?

readonly optional uninstallerSidebar: null | string

仅限辅助安装程序。 MUI_UNWELCOMEFINISHPAGE_BITMAP,相对于构建资源或项目目录。默认为 installerSidebar 选项或 build/uninstallerSidebar.bmpbuild/installerSidebar.bmp${NSISDIR}\\Contrib\\Graphics\\Wizard\\nsis3-metro.bmp


warningsAsErrors?

readonly optional warningsAsErrors: boolean

如果 warningsAsErrorstrue(默认值):NSIS 将把警告视为错误。如果 warningsAsErrorsfalse:NSIS 将允许警告。

默认值

true

继承自

CommonNsisOptions.warningsAsErrors