electron-builder: dev-app-update.yml not found
- Version: 17.1.1
- electron-updater version: 1.14.2
- Target: MacOS
This is in relation to the recently-fixed https://github.com/electron-userland/electron-builder/issues/1254
Now, running autoUpdater using electron path/to/app results in
autoUpdater { Error: ENOENT, dev-app-update.yml not found in /.../node_modules/electron/dist/Electron.app/Contents/Resources/default_app.asar
Is there something I should be doing to generate this file?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 22
- Comments: 34 (9 by maintainers)
Maybe this will help someone for solving this issue. For me it worked creating the
dev-app-update.ymlmanually in the top level of my electron app. I am using the two package.json way.My directory structure then looks like this
And in
dev-app-update.ymlI inserted the following for using GitHub:And then normally start your main entry file with
electron main.js.That makes it incredibly hard to develop an updating system/UI if you have to build every time you change a line of code relating to the update system UX in order to test the result…
You should not use electron updater in the dev mode.
Hi, is the path issue fixed? for me
dev-app-update.ymlis still expecting to be at...Contents/Resources/default_app.asarlocation which is invalid. for me workaround for now:Creating a file dev-app-update.yml in root directory with following content fixed the problem for me of my generic server setup:
@zeevl I believe the generated file is
./dist/win-unpacked/resources/app-update.ymlfor Windows, or./dist/mac/MyApp.app/Contents/Resources/app-update.ymlfor macOS. You can copy it toapp/dev-app-update.yml.@develar Mate…
The issue is you have a hard-wired check for dev-app-update.yml, already using the electron-is-dev module. It is in AppUpdater.js:loadUpdateConfig()
It is using electron app.getAppPath() when dev mode is detected, which is generally going to point to default_app.asar when running ‘electron’ for dev.
This makes no sense as it can’t be implemented as we can’t place a file there.
So why have the code?
You are awesome for making electron-builder/electron-updater, but I find a lot of your dev decisions very baffling and frustrating when encountered, unlike any other popular open source package I’ve used.
Perhaps you should consider asking a couple of people to join a committee who bring a different perspective? Happy to help, I have 20+ years of SD experience, a lot of architecture.
The work around for development for me is now
dev-app-update.ymlis only and only for testing during development and unpacked. And it is advanced feature. Consider to test using packed app.I get this on windows
Update:
autoUpdater.updateConfigPath = path.join(_path to app-update.yml_);solved my issue.
@ysfjwd In case you want to use GitHub as your “Update Server” the following format should work
At least this is what is working for me
@develar I’m not sure where to manually add this file either…
default_app.asaris in a binary format so I can’t amend anything inside of itIf you want to use updater in a dev mode, you need to add this file manually.
https://github.com/sindresorhus/electron-is-dev recommended.
When I run this locally with the fix above, it compares the latest release of my app to the version of electron rather than the app itself.
在根目录中创建具有以下内容的文件dev-app-update.yml可以解决我的通用服务器设置问题:
provider: genericurl: http://127.0.0.1:8080/releasesHope this saves somebody a day.
In
developmentenv, DO NOT USEcheckForUpdatesAndNotify()- You MUST USEcheckForUpdates()This little oversight cost me big time. I expected it would still check for updates, but it doesn’t seem to from what I can tell.
I assume this is because this isn’t really a supported feature, there’s no provided partial functionality for that function in development, seems to be the case. The promise always resolves with
nullfrom what I can tell.All credit to @yeongjet - https://github.com/electron-userland/electron-builder/issues/3753
quick question, what is the format of the
dev-app-update.ymlfile?