Skip to content

Location of app-update.yml #1254

@mikecao

Description

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

Activity

develar

develar commented on Feb 14, 2017

@develar
Member

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

mikecao commented on Feb 14, 2017

@mikecao
Author

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

develar commented on Feb 14, 2017

@develar
Member

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

develar

develar commented on Feb 14, 2017

@develar
Member

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

mikecao

mikecao commented on Feb 14, 2017

@mikecao
Author

@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 commented on Feb 14, 2017

@develar
Member

Too many complains. Reconsidered to be fixed.

mikecao

mikecao commented on Feb 14, 2017

@mikecao
Author

@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

mikecao commented on Feb 14, 2017

@mikecao
Author

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

develar commented on Apr 10, 2017

@develar
Member

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.

added a commit that references this issue on Apr 10, 2017
8c73f57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @develar@mikecao

      Issue actions

        Location of app-update.yml · Issue #1254 · electron-userland/electron-builder