Skip to content

Location of app-update.yml #1254

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

Closed
mikecao opened this issue Feb 13, 2017 · 9 comments · May be fixed by qcif/data-curator#563
Closed

Location of app-update.yml #1254

mikecao opened this issue Feb 13, 2017 · 9 comments · May be fixed by qcif/data-curator#563

Comments

@mikecao
Copy link

mikecao commented Feb 13, 2017

  • Version:
    electron-builder 13.5.0
    electron-updater 1.6.1
  • Target:
    Win x64
    MacOS

It looks like appUpdater checks for app-update.yml inside the electron dist/resources folder. Without it you'll get an error like:

Error: Error: ENOENT: no such file or directory, open 
'C:\Users\mike\AppData\Roaming\npm\node_modules\electron\dist\resources\app-update.yml'

This is problematic because if you install electron globally and use it to run applications using electron path/to/app, you will need to change the file depending on which app you're running. Even if electron is installed locally you have to place the file in there to do any testing.

I would suggest first looking in the app folder that is running, and then falling back to the electron folder if not found. Or make it configurable so we can set the location.

@develar
Copy link
Member

develar commented Feb 14, 2017

auto-update supported only for installed applications. In the dev mode you should not use it. Please use https://github.com/sindresorhus/electron-is-dev to check.

Anyway — PR will be accepted.

@mikecao
Copy link
Author

mikecao commented Feb 14, 2017

Ok, I was able to get it to work by adding this to my code:

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

The reason I need to run it in dev is because my application allows the user to trigger the update check manually, so I need to make sure that everything is working. Thanks for the great work on this project.

@develar
Copy link
Member

develar commented Feb 14, 2017

@mikecao How does it work on macOS where code sign is required?

@develar
Copy link
Member

develar commented Feb 14, 2017

Ah, I see that your error about windows (where code sign will be required later ;) if exe is signed).

@mikecao
Copy link
Author

mikecao commented Feb 14, 2017

@develar I haven't tested macOS yet but plan to soon. I'll let you know if I run into any issues.

It is fine if the install part doesn't work because I can always build an installer and test that. But during dev I need to make sure I can at least trigger the update check and perform the download. So far it's working on Windows. When I exit my dev application, it installs the application update externally, so dev doesn't actually get the update, but that's ok.

@develar develar reopened this Feb 14, 2017
@develar
Copy link
Member

develar commented Feb 14, 2017

Too many complains. Reconsidered to be fixed.

@develar develar added feature and removed wontfix labels Feb 14, 2017
@mikecao
Copy link
Author

mikecao commented Feb 14, 2017

@develar You're right, code signing does cause a problem. I tested macOS and got the error, Could not get code signature for running application. I assume the same thing will happen when Windows signing is required.

I think my workaround is good enough for now since it allows me to at least test the update request. This probably doesn't need a fix. But It might be helpful to update the wiki to tell people they need to manually copy the app-update.yml after building if they want to test in dev. Or load it themselves using updateConfigPath.

@mikecao
Copy link
Author

mikecao commented Feb 14, 2017

Maybe something like this will work?

autoUpdater.setConfig({
  provider: 'generic',
  url: 'https://website.com/download',
  channel: 'latest'
});

Production can still use the app-update.yml file while in dev you will have to configure it manually.

@develar
Copy link
Member

develar commented Apr 10, 2017

In the next version file dev-app-update.yml will be searched in the app path in a dev mode. Prefix dev- is used to make it clear, that file only for a dev mode.

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

Successfully merging a pull request may close this issue.

2 participants