gpt4 book ai didi

electron - 如何与目标可移植 Electron 生成器一起使用?

转载 作者:行者123 更新时间:2023-12-03 12:24:27 24 4
gpt4 key购买 nike

我正在尝试使用electron-builder而不是安装程序来生成exe文件,因此我正在尝试将目标设置为可移植

{
"name": "hello-world",
"version": "1.0.0",
"description": "a hello world",
"main": "index.js",
"scripts": {
"start": "electron .",
"dist": "build"
},
"author": "KR",
"license": "ISC",
"devDependencies": {
"electron": "^4.1.4",
"electron-builder": "^20.39.0"
},
"build":{
"appId": "com.whatever.helloworld",
"win":{
"target": ["portable"],
"icon" : "build/icon.ico"
}


}
}
但是,当我尝试 npm run dist时,我得到了
Configuring yargs through package.json is deprecated and will be removed in the next major release, please use the JS API instead.
Configuring yargs through package.json is deprecated and will be removed in the next major release, please use the JS API instead.
• electron-builder version=20.39.0
• loaded configuration file=package.json ("build" field)
• writing effective config file=dist\builder-effective-config.yaml
• no native production dependencies
• packaging platform=win32 arch=x64 electron=4.1.4 appOutDir=dist\win-unpacked
• default Electron icon is used reason=application icon is not set
• building target=portable file=dist\hello-world 1.0.0.exe archs=x64
程序永远卡住了。当我打破它(ctrl-c)时,它说
 Error: Exit code: 255. Command failed: D:\electrontest\hello-world\node_modules\7zip-bin\win\x64\7za.exe a -bd -mx=9 -mtc=off -mtm=off -mta=off D:\electrontest\hello-world\dist\hello-world-1.0.0-x64.nsis.7z .
因此,我猜程序停留在7za压缩中。
我进行了搜索,没有使用nsis的便携式便携式 Electron 生成器的示例。 (我还有一个问题,但首先我想了解基础知识)。

最佳答案

使用1的 Electron 生成器
然后在package.json中在脚本中使用:

"dist": "electron-builder --win=portable",

关于electron - 如何与目标可移植 Electron 生成器一起使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55792014/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com