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)

Most upvoted comments

Maybe this will help someone for solving this issue. For me it worked creating the dev-app-update.yml manually in the top level of my electron app. I am using the two package.json way.

My directory structure then looks like this

.
├── app
│   ├── main
│   │   ├── main.js
│   │   └── update.js
│   ├── package.json
│   ├── renderer
│   │   ├── ...
│   │       └── main.jsx
│   └── yarn.lock
├── dev-app-update.yml
├── package.json
├── publish.sh
└── yarn.lock

And in dev-app-update.yml I inserted the following for using GitHub:

owner: yourGHName
repo: yourGHRepoName
provider: 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.yml is still expecting to be at ...Contents/Resources/default_app.asar location which is invalid. for me workaround for now:

if (isDev) {
    autoUpdater.updateConfigPath = path.join(__dirname, 'app-update.yml');
}

Creating a file dev-app-update.yml in root directory with following content fixed the problem for me of my generic server setup:

provider: generic
url: http://127.0.0.1:8080/releases
channel: latest

@zeevl I believe the generated file is ./dist/win-unpacked/resources/app-update.yml for Windows, or ./dist/mac/MyApp.app/Contents/Resources/app-update.yml for macOS. You can copy it to app/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

if (process.env.NODE_ENV === 'development')
  // Skip autoupdate check
else
  autoUpdater.checkForUpdates()

dev-app-update.yml is 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

ENOENT, dev-app-update.yml not found in [path]\node_modules\electron\dist\resources\default_app.asar

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

owner: yourGitHubName
repo: yourRepositoryName
provider: github

At least this is what is working for me

@develar I’m not sure where to manually add this file either…

default_app.asar is in a binary format so I can’t amend anything inside of it

If you want to use updater in a dev mode, you need to add this file manually.

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: generic url: http://127.0.0.1:8080/releases

Hope this saves somebody a day.

In development env, DO NOT USE checkForUpdatesAndNotify() - You MUST USE checkForUpdates()

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 null from 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.yml file?