Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev-app-update.yml not found #1505

Closed
zeevl opened this issue Apr 26, 2017 · 34 comments
Closed

dev-app-update.yml not found #1505

zeevl opened this issue Apr 26, 2017 · 34 comments

Comments

@zeevl
Copy link

zeevl commented Apr 26, 2017

  • Version: 17.1.1
  • electron-updater version: 1.14.2
  • Target: MacOS

This is in relation to the recently-fixed #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?

@develar
Copy link
Member

develar commented Apr 27, 2017

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

@develar develar closed this as completed Apr 27, 2017
@develar develar reopened this Apr 27, 2017
@develar
Copy link
Member

develar commented Apr 27, 2017

Please specify electron version.

@zeevl
Copy link
Author

zeevl commented Apr 27, 2017

electron version 1.6.6

Is there a template of what this file should contain? Not even sure where to find the generated app-update.yml..

@alexcroox
Copy link

alexcroox commented May 10, 2017

@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

@sebn
Copy link

sebn commented May 11, 2017

@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.

@alexcroox
Copy link

alexcroox commented May 11, 2017

@sebn Is this where you mean?

ss

As this doesn't seem to work.

I could add it manually to ./dist/mac/MyApp.app/Contents/Resources/app-update.yml but that directory ./dist/mac/ gets emptied and re-generated with every build so this would only work for 1 release cycle and I'd have to repeat the action every time?

@sebn
Copy link

sebn commented May 12, 2017

@alexcroox Maybe you're confusing development and production setup?

@alexcroox
Copy link

Yer I'm still confused unfortunately. I'm running webpack-dev-server --hot --colors --config webpack.renderer.config.js --port ${config.port} --content-base app/dist

The error I'm getting is Error: ENOENT, dev-app-update.yml not found in /Users/alex/Projects/xxxx/node_modules/electron/dist/Electron.app/Contents/Resources/default_app.asar.

I'm still not sure where to manually copy dev-app-update.yml. I've added it to:

  1. /Users/alex/Projects/xxxx/node_modules/electron/dist/Electron.app/Contents/Resources
  2. /Users/alex/Projects/xxxx/dist/mac/xxxxx.app/Contents/Resources

Still the same error

@develar
Copy link
Member

develar commented May 15, 2017

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.

@alexcroox
Copy link

alexcroox commented May 15, 2017

The work around for development for me is now

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

@develar
Copy link
Member

develar commented May 15, 2017

https://github.com/sindresorhus/electron-is-dev recommended.

@develar develar closed this as completed Jun 1, 2017
@TimNZ
Copy link

TimNZ commented Jul 5, 2017

@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.

@TimNZ
Copy link

TimNZ commented Jul 5, 2017

This referenced issue is breaking even production builds because I have 'electron' in my dev path which causes electron-is-dev to return true when it shouldn't.

sindresorhus/electron-is-dev#4

@develar
Copy link
Member

develar commented Jul 5, 2017

You should not use electron updater in the dev mode.

@alexcroox
Copy link

alexcroox commented Jul 5, 2017

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...

@TimNZ
Copy link

TimNZ commented Jul 5, 2017

I can understand it not being supported in dev mode, the update system must rely on an install having files in certain places.

@develar
Copy link
Member

develar commented Jul 5, 2017

@alexcroox Please note — not "must", but "should". Want to test — no problem. Just create dev-app-update.yml with your own configuration to test :)

@develar
Copy link
Member

develar commented Jul 5, 2017

@TimNZ On macOS your update will be successful only if app is signed, but place doesn't matter (so you can run it not only from /Applicaitons, but from dist folder also). So, no way to test update fully, but you can test "update system UX" using dev-app-update.yml.

@develar
Copy link
Member

develar commented Jul 5, 2017

To make clear — we are not going to improve this aspect without properly formulated issue request. (Hint: JetBrains IDEs allows you to debug packed applications, even in the asar, in the same way as you debug your dev build). dev-app-update.yml is not created for you, it is your responsibility to create it according to your needs. If you think that it will be cool if electron-builder will have special command to generate such file or even somehow grab configuration on the fly from your electron-builder configuration — please file issue (and if you are commercial company — you can even donate to make sure that feature will be implemented in a short term).

@develar
Copy link
Member

develar commented Jul 5, 2017

@alexcroox If your issue is that dev file is not located correctly (The error I'm getting is Error: ENOENT, dev-app-update.yml not found in /Users/alex/Projects/xxxx/node_modules/electron/dist/Electron.app/Contents/Resources/default_app.asar.), I will check it now.

@alexcroox
Copy link

@develar yer I added it to those 2 locations above but was still getting the error not found. Ran out of places to find that I might be able to place it

@alexanderwe
Copy link

alexanderwe commented Jul 27, 2017

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.

@GorvGoyl
Copy link

GorvGoyl commented Nov 2, 2017

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');
}

@debuggerpk
Copy link

quick question, what is the format of the dev-app-update.yml file?

@alexanderwe
Copy link

alexanderwe commented Jan 19, 2018

@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

@zhanyouwei
Copy link

@alexanderwe Hi
I did as you said. But, Get the following tips.

[11:11:37.156] [info] Checking for update
[11:11:37.156] [info] Checking for update...
[11:11:37.297] [info] Generated new staging user ID: xxx-xxx-xxxx
[11:11:37.348] [info] Update for version 1.6.2 is not available (latest version: 1.0.2, downgrade is disallowed.
[11:11:37.349] [info] Update not available.

@alexanderwe
Copy link

@zhanyouwei
Did you made a release for the new version on your GitHub repo ?

@hatpick
Copy link

hatpick commented Apr 25, 2018

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.

@jetlej
Copy link

jetlej commented Nov 27, 2018

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.

@Nantris
Copy link

Nantris commented Apr 28, 2019

Anyone manage to get this working with Amazon S3? I've burned half a day on this seemingly simple task.

I get null as my result every time without fail in development.

I can't even understand where the autoUpdater is supposed to be checking for the yml file and whether it's doing that and failing to find it, if the configuration is wrong, etc. This is a complete black box besides digging through the source code yourself to understand what's going on.

I understand it's recommended to test this in a packaged app, but that's not really feasible in every situation. I've tried setting the updateConfigPath and a every other tip I've found online and in this thread, and always null, every single time, with no errors or warnings regarding dev-app-update.yaml

All I'm trying to do with this right now is to get info about the latest update to show in the GUI =(

@Nantris
Copy link

Nantris commented Apr 29, 2019

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 - #3753

@nihalmpatel
Copy link

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

@aziks
Copy link

aziks commented Aug 8, 2019

@nihalmpatel it worked like a charm!! thanks!!

@classmateoula
Copy link

classmateoula commented Nov 5, 2020

在根目录中创建具有以下内容的文件dev-app-update.yml可以解决我的通用服务器设置问题:
provider: generic
url: http://127.0.0.1:8080/releases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests