如何添加“便携式”到电子构建器.exe文件名?
这是我的软件包。JSON构建数据:
"build": {
"appId": "name.desktop",
"productName": "name",
"beforePack": "electron/beforePack.js",
"extraResources": [
{
"from": "bin/${os}",
"to": "bin",
"filter": [
"**/*"
]
}
],
"files": [
"build/**/*",
"electron/**/*",
"package.json"
],
"extends": null,
"mac": {
"target": "dmg",
"type": "distribution"
},
"win": {
"target": [
"portable",
"nsis"
]
},
"linux": {
"target": "AppImage"
}
}
我希望将“ Portable”添加到Windows Portable文件名中,以便.exe为“名称1.0.0 Portable.exe”,而不是“名称1.0.0.0.exe”
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可以通过使用
package.json
文件中的每个相关级别明确定义生成的文件名,通过使用“ artifactname”
属性。这在常见配置 - 电子构建器页:
这间接地指文件宏 文件模式的部分 - 电子构建器页面。
在您的具体情况下,您必须将以下
“ artifactname”
属性添加到package.json.json
在Windows版本级别:IE::
It is possible to explicitely define the generated file names at each relevant level in the
package.json
file by making use of an"artifactName"
property.This is documented in the Overridable per Platform Options section of the Common Configuration - electron-builder page:
which indirectly refers to the File Macros section of the File Patterns - electron-builder page.
In your specific case, you'll have to add the following
"artifactName"
property to yourpackage.json
file at the Windows version level:i.e.: