- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我用 Electron 制作了一个应用程序,并试图用 Electron Builder 打包它。
Link to repository
{
"name": "attendant",
"productName": "Attendant",
"version": "0.1.0",
"description": "A simple app to streamline web development by allowing you index.html to open on a live server in the default browser",
"main": "main.js",
"scripts": {
"start": "electron .",
"pack": "electron-builder --dir",
"dist": "electron-builder"
},
"devDependencies": {
"electron": "^8.0.1",
"electron-builder": "^22.3.2"
},
"build": {
"appId": "com.attendant",
"win": {
"icon": "./build/icon.png",
"title": "Attendant",
"msi": true
}
}
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
package.json
:
{
"name": "attendant",
"productName": "Attendant",
"version": "0.1.0",
"description": "A simple app to streamline web development by allowing you index.html to open on a live server in the default browser",
"main": "main.js",
"scripts": {
"start": "electron .",
"pack": "electron-builder --dir",
"dist": "electron-builder build"
},
"devDependencies": {
"electron": "^8.0.1",
"electron-builder": "^22.3.2"
},
"build": {
"appId": "com.attendant",
"directories": {
"buildResources": "build"
},
"win": {
"icon": "build/icon.png",
"title": "Attendant",
"msi": true
}
}
}
yarn dist
yarn run v1.22.0
warning package.json: No license field
$ electron-builder build
• electron-builder version=22.3.2 os=10.0.18363
• loaded configuration file=package.json ("build" field)
• author is missed in the package.json appPackageFile=C:\Users\alexr\Documents\GitHub\attendant-app\app\package.json
⨯ Invalid configuration object. electron-builder 22.3.2 has been initialised using a configuration object that
does not match the API schema.
- configuration.win should be one of these:
object { additionalCertificateFile?, appId?, artifactName?, asar?, asarUnpack?, certificateFile?, certificatePassword?, certificateSha1?, certificateSubjectName?, compression?, cscKeyPassword?, cscLink?, detectUpdateChannel?, electronUpdaterCompatibility?, extraFiles?, extraResources?, fileAssociations?, files?, forceCodeSigning?, generateUpdatesFilesForAllChannels?, icon?, legalTrademarks?, protocols?, publish?, publisherName?, releaseInfo?, requestedExecutionLevel?, rfc3161TimeStampServer?, sign?, signAndEditExecutable?, signDlls?, signingHashAlgorithms?, target?, timeStampServer?, verifyUpdateCodeSignature? } | null
-> Options related to how build Windows targets.
Details:
* configuration.win has an unknown property 'title'. These properties are valid:
object { additionalCertificateFile?, appId?, artifactName?, asar?, asarUnpack?, certificateFile?, certificatePassword?, certificateSha1?, certificateSubjectName?, compression?, cscKeyPassword?, cscLink?, detectUpdateChannel?, electronUpdaterCompatibility?, extraFiles?, extraResources?, fileAssociations?, files?, forceCodeSigning?,
generateUpdatesFilesForAllChannels?, icon?, legalTrademarks?, protocols?, publish?, publisherName?, releaseInfo?, requestedExecutionLevel?, rfc3161TimeStampServer?, sign?, signAndEditExecutable?, signDlls?, signingHashAlgorithms?, target?, timeStampServer?, verifyUpdateCodeSignature? }
* configuration.win has an unknown property 'msi'. These properties are valid:
object { additionalCertificateFile?, appId?, artifactName?, asar?, asarUnpack?, certificateFile?, certificatePassword?, certificateSha1?, certificateSubjectName?, compression?, cscKeyPassword?, cscLink?, detectUpdateChannel?, electronUpdaterCompatibility?, extraFiles?, extraResources?, fileAssociations?, files?, forceCodeSigning?,
generateUpdatesFilesForAllChannels?, icon?, legalTrademarks?, protocols?, publish?, publisherName?, releaseInfo?, requestedExecutionLevel?, rfc3161TimeStampServer?, sign?, signAndEditExecutable?, signDlls?, signingHashAlgorithms?, target?, timeStampServer?, verifyUpdateCodeSignature? }
How to fix:
1. Open https://www.electron.build/configuration/win
2. Search the option name on the page (or type in into Search to find across the docs).
* Not found? The option was deprecated or not exists (check spelling).
* Found? Check that the option in the appropriate place. e.g. "title" only in the "dmg", not in the root.
stackTrace=
ValidationError: Invalid configuration object. electron-builder 22.3.2 has been initialised using a configuration object that does not match the API schema.
- configuration.win should be one of these:
object { additionalCertificateFile?, appId?, artifactName?, asar?, asarUnpack?, certificateFile?, certificatePassword?, certificateSha1?, certificateSubjectName?, compression?, cscKeyPassword?, cscLink?, detectUpdateChannel?, electronUpdaterCompatibility?, extraFiles?, extraResources?, fileAssociations?, files?, forceCodeSigning?, generateUpdatesFilesForAllChannels?, icon?, legalTrademarks?, protocols?, publish?, publisherName?, releaseInfo?, requestedExecutionLevel?, rfc3161TimeStampServer?, sign?, signAndEditExecutable?, signDlls?, signingHashAlgorithms?, target?, timeStampServer?, verifyUpdateCodeSignature? } | null
-> Options related to how build Windows targets.
Details:
* configuration.win has an unknown property 'title'. These properties are valid:
object { additionalCertificateFile?, appId?, artifactName?, asar?, asarUnpack?, certificateFile?, certificatePassword?, certificateSha1?, certificateSubjectName?, compression?, cscKeyPassword?, cscLink?, detectUpdateChannel?, electronUpdaterCompatibility?, extraFiles?, extraResources?, fileAssociations?, files?, forceCodeSigning?, generateUpdatesFilesForAllChannels?, icon?, legalTrademarks?, protocols?, publish?, publisherName?, releaseInfo?, requestedExecutionLevel?, rfc3161TimeStampServer?, sign?, signAndEditExecutable?, signDlls?, signingHashAlgorithms?, target?, timeStampServer?, verifyUpdateCodeSignature? }
* configuration.win has an unknown property 'msi'. These properties are valid:
object { additionalCertificateFile?, appId?, artifactName?, asar?, asarUnpack?, certificateFile?, certificatePassword?, certificateSha1?, certificateSubjectName?, compression?, cscKeyPassword?, cscLink?, detectUpdateChannel?, electronUpdaterCompatibility?, extraFiles?, extraResources?, fileAssociations?, files?, forceCodeSigning?, generateUpdatesFilesForAllChannels?, icon?, legalTrademarks?, protocols?, publish?, publisherName?, releaseInfo?, requestedExecutionLevel?, rfc3161TimeStampServer?, sign?, signAndEditExecutable?, signDlls?, signingHashAlgorithms?, target?, timeStampServer?, verifyUpdateCodeSignature? }
How to fix:
1. Open https://www.electron.build/configuration/win
2. Search the option name on the page (or type in into Search to find across the docs).
* Not found? The option was deprecated
or not exists (check spelling).
* Found? Check that the option in the appropriate place. e.g. "title" only in the "dmg", not in the root.
at validate (C:\Users\alexr\Documents\GitHub\attendant-app\app\node_modules\@develar\schema-utils\dist\validate.js:50:11)
at validateConfig (C:\Users\alexr\Documents\GitHub\attendant-app\app\node_modules\app-builder-lib\src\util\config.ts:229:3)
at Packager._build (C:\Users\alexr\Documents\GitHub\attendant-app\app\node_modules\app-builder-lib\src\packager.ts:342:5)
at Packager.build (C:\Users\alexr\Documents\GitHub\attendant-app\app\node_modules\app-builder-lib\src\packager.ts:337:12)
at executeFinally (C:\Users\alexr\Documents\GitHub\attendant-app\app\node_modules\app-builder-lib\node_modules\builder-util\src\promise.ts:12:14)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Edit number 2
yarn run v1.22.0
warning package.json: No license field
$ electron-builder build
• electron-builder version=22.3.2 os=10.0.18363
• loaded configuration file=package.json ("build" field)
• author is missed in the package.json appPackageFile=C:\Users\alexr\Documents\GitHub\attendant-app\app\package.json
• writing effective config file=dist\builder-effective-config.yaml
• packaging platform=win32 arch=x64 electron=8.0.1 appOutDir=dist\win-unpacked
• asar usage is disabled — this is strongly not recommended solution=enable asar and use asarUnpack to unpack
files that must be externally available
⨯ cannot execute cause=exit status 1
errorOut=Fatal error: Unable to commit changes
command='C:\Users\alexr\AppData\Local\electron-builder\Cache\winCodeSign\winCodeSign-2.5.0\rcedit-x64.exe' 'C:\Users\alexr\Documents\GitHub\attendant-app\app\dist\win-unpacked\Attendant.exe' --set-version-string FileDescription Attendant --set-version-string ProductName Attendant --set-version-string LegalCopyright 'Copyright © 2020 Attendant' --set-file-version 1.1.0 --set-product-version 1.1.0.0 --set-version-string InternalName Attendant --set-version-string OriginalFilename '' --set-icon 'C:\Users\alexr\Documents\GitHub\attendant-app\app\dist\.icon-ico\icon.ico'
workingDir=
⨯ C:\Users\alexr\Documents\GitHub\attendant-app\app\node_modules\app-builder-bin\win\x64\app-builder.exe exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE stackTrace=
Error: C:\Users\alexr\Documents\GitHub\attendant-app\app\node_modules\app-builder-bin\win\x64\app-builder.exe exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
at ChildProcess.<anonymous> (C:\Users\alexr\Documents\GitHub\attendant-app\app\node_modules\app-builder-lib\node_modules\builder-util\src\util.ts:239:14)
at Object.onceWrapper (events.js:313:26)
at ChildProcess.emit (events.js:223:5)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
From previous event:
at processImmediate (internal/timers.js:439:21)
From previous event:
at WinPackager.signApp (C:\Users\alexr\Documents\GitHub\attendant-app\app\node_modules\app-builder-lib\src\winPackager.ts:357:27)
at WinPackager.doPack (C:\Users\alexr\Documents\GitHub\attendant-app\app\node_modules\app-builder-lib\src\platformPackager.ts:243:16)
at WinPackager.pack (C:\Users\alexr\Documents\GitHub\attendant-app\app\node_modules\app-builder-lib\src\platformPackager.ts:114:5)
at Packager.doBuild (C:\Users\alexr\Documents\GitHub\attendant-app\app\node_modules\app-builder-lib\src\packager.ts:444:9)
at executeFinally (C:\Users\alexr\Documents\GitHub\attendant-app\app\node_modules\app-builder-lib\node_modules\builder-util\src\promise.ts:12:14)
at Packager._build (C:\Users\alexr\Documents\GitHub\attendant-app\app\node_modules\app-builder-lib\src\packager.ts:373:31)
at Packager.build (C:\Users\alexr\Documents\GitHub\attendant-app\app\node_modules\app-builder-lib\src\packager.ts:337:12)
at executeFinally (C:\Users\alexr\Documents\GitHub\attendant-app\app\node_modules\app-builder-lib\node_modules\builder-util\src\promise.ts:12:14)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
最佳答案
"build":{
"productName":"yourProductName",
"appId":"org.yourProductName",
"dmg":{
"contents":[
{
"x":130,
"y":220
},
{
"x":410,
"y":220,
"type":"link",
"path":"/Applications"
}
]
},
"win":{
"target":[
"nsis",
"msi"
]
},
"linux":{
"target":[
"deb",
"rpm",
"snap",
"AppImage"
],
"category":"Development"
},
"directories":{
"buildResources":"resources",
"output":"release"
},
"files: ["resources/**/*"], // including buildResources folder in order to use this in the code
},"
我附上了之前为我的项目配置的示例 Electron 构建器配置。
"directories": {
"buildResources": "resources",
"output": "release"
}
buildResources
应该包括图标之类的资源文件。如果您不打算设置此
buildResources
手动则默认为
build
.
output
指示打包应用程序在打包后的位置,对于您的问题是可选的。无论如何,我已将项目设置为在“发布”文件夹中生成发布工件。
关于electron - 无法使用 Electron Builder 向 Electron 应用程序添加图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60273475/
首先,我创建了一个标签,并使用electron-packager构建了我的应用程序: node_modules/.bin/electron-packager . MyApp --platform=wi
我正在寻找一种基于 Electron 加载页面中提供的信息来更新MAC应用程序的徽章值的方法。 我在启动时使用main.js文件中的以下代码加载页面。 function createWindow ()
我正在使用 Electron 构建一个应用程序,并使用 Electron Builder 进行打包。当运行 Electron 时,我想通过这个command line argument: --enab
我遇到一种情况,当用户安装我的 Electron 应用程序时,我实际上需要安装2个应用程序:我的应用程序+一个单独的Windows MSI,它将作为我的应用程序工件的一部分包含在内。 我是Electr
使用 Electron 生成器构建 Electron 应用程序后,我无法从dist文件夹中打开该应用程序。我确实更改了所有链接以使用path.join(__ dirname,“relative_pat
我使用Linux,并正在制作要在Windows,Mac和Linux上分发的Electron App。我想要的是我的应用程序可以自我更新-但这需要代码签名。 这是否意味着我需要同时购买Windows和M
我在 Electron 应用主程序中使用foreverjs,如下所示: const forever = require("forever-monitor"); let child = forever.
在我在 Windows 10 上运行的 electron-forge 应用程序中,没有呈现 ejs 模板,尽管没有可见错误。 我可以使用创建的应用程序重现该问题 electron-forge init
我有一个 Electron 应用程序,该应用程序可以完美运行到开发环境中,并且日志引擎可以写入文件(使用winston.js)。 该项目的结构是这样的: 当我运行 Electron 构建器来打包我的应
Electron 应用程序是使用 electron-forge webpack 模板初始化的,一切都适用于 macOS。 使用 运行开发版本时 Electron 锻造开始该应用程序在 Windows
我正在尝试将我的 Electron 应用发布到GitHub版本,但无法正常工作。 这就是我所拥有的:package.json .... "scripts": { "start": "elect
我现在使用electron-builder并设法达到事件监听器的设置和触发点,但是我认为我没有完全正确设置它,因为当我使用electron .打开应用程序时,出现以下错误: Checking for
我想要的不是排除未使用的文件,而是将使用过的文件包排除到.exe文件中 我提供了一个像 config.json 这样的文件供用户编辑一些自定义配置,然后应用程序可以读取该文件来做一些事情。所以我不希望
我想了解 Signal Desktop 或 Visual Studio Code 等 Electron 桌面应用程序正在使用哪个版本的 Electron。有没有简单的方法——比如在开发控制台中输入命令
我有一个Electron我想在其中引入并行发布 channel 的应用程序:stable、next(用于早期采用者)和dev(用于测试最新版本)。 这些都会有一个分支,新功能首先出现在 dev 中,然
我是 Electron 新手,我想在主窗口中运行非 Electron 可执行文件。可以这样做吗? 这是我的代码: mainWindow = new BrowserWindow({width: 860,
我开始使用 GitHub 按需培训学习 Electron。当我执行以下命令时。系统抛出错误。 electron % electron-forge init electron-app ⚠ Could n
在我的 Electron 应用程序中,我使用“electron-json-storage”模块在本地存储一些设置数据。 但是,为了访问这些数据,我必须先找到本地路径。 为此,我正在使用 app.get
最近开始接触 Electron 。任何人都可以帮助我选择数据库。似乎没有直接的选择。 建议中型项目的数据库。 最佳答案 在 Electron 应用程序中,您可以使用您选择的数据库: https://g
我是Electron的新手,无法找到应用程序菜单的工作示例。 尝试将Quick Start应用程序与Electron文档的Class: Menu页面中的示例结合使用时,似乎什么都没发生-更改label
我是一名优秀的程序员,十分优秀!