我目前正在使用 Electron 构建一个 VueJS 应用程序。为此,我使用依赖项“电子构建器”。 “https://www.electron.build/”上有相对详细的文档,但有一个细节我丢失了,只是无法弄清楚 - 即使经过几个小时的谷歌搜索。
场景如下:
我想构建一个 NSIS Web 安装程序而不是普通的 NSIS 安装程序。我可以让“正常”安装程序工作。对于网络安装程序,我在“electron-builder.json5”中定义了以下配置:
/**
* @see https://www.electron.build/configuration/configuration
*/
{
"appId": "com.emhartglass.flexis",
"productName": "FlexFire",
"copyright": "Copyright © year ${author}",
"asar": true,
"icon": "build/bucher-logo-small-512x512.ico",
"directories": {
"output": "release/${version}"
},
"files": [
"dist-electron",
"dist"
],
"win": {
"target": [
{
"target": "nsis-web",
// ...
"arch": [
"x64"
]
}
],
"artifactName": "${productName}_${version}.${ext}",
},
"nsis": {
//
"oneClick": false,
//
"perMachine": false,
//
"allowToChangeInstallationDirectory": true,
//
"deleteAppDataOnUninstall": true,
//
"unicode": true,
//
"menuCategory": true,
//
"createDesktopShortcut": true,
//
"displayLanguageSelector": true,
//
"shortcutName": "FlexFire",
//
"installerIcon": "build/bucher-logo-small-512x512.ico",
//
"uninstallerIcon": "build/bucher-logo-small-512x512.ico",
//
"installerHeader": "build/bucher-header.bmp",
//
"installerHeaderIcon": "build/bucher-logo-small-512x512.ico",
//
"installerSidebar": "build/bucher-sidebar-installer.bmp",
//
"uninstallerSidebar": "build/bucher-sidebar-uninstaller.bmp",
//
"uninstallDisplayName": "${productName} ${version}",
//
"license": "build/license/license_en.txt",
// ...
"multiLanguageInstaller": true,
//
"packElevateHelper": true
}
}
现在我已经触发了构建过程,但它因以下错误而中止:
“无法计算应用程序包下载 URL failedTask=build stackTrace=错误:无法计算应用程序包下载 URL”。
如果我还不知道的话,我不知道在哪里定义这个链接以及我可能还需要什么。毕竟这里的文档几乎不存在。这里有人知道这件事吗?
非常感谢, 丹尼斯
到目前为止,我在另一个页面上找到了“appPackageUrl”标签,并将其放在括号后面的不同位置,但没有成功。
如果您在某个位置放置了错误的标签并触发了构建过程,则会出现一条错误消息,表明它不知道该标签以及哪些标签是可能的。即使给出了选项,我还没有找到一个可以让我变得更聪明的标签。
我好像漏掉了一些东西。
我看到您正在使用“nsis”键自定义安装程序,而 NSIS 电子构建器页面 告诉我们 “要自定义 Web 安装程序,请使用顶级 nsisWeb 密钥(而不是 nsis)。” 这应该是它找不到appPackageUrl的原因:尝试将“nsis”更改为“nsisWeb”