develar/electron-updater

The updater should never be caught in an update loop

Closed this issue · 2 comments

It's possible for the app to be in a bad state, such as a specific version of a dependency doesn't actually exist. For example if you are asking for dependency "example": "1.0.0" and that version doesn't exist, the app will check to see if its valid, fire the 'udpateRequired' event and then go to update. The updater will then ask for that dependency, fail to find it because it doesn't exist and then fail to update.

In this situation, its possible for the updater to attempt to restart the app, which will then attempt to update again and then loop endlessly.

This kind of update cycle should not happen, in this case it should show a critical error dialog. Inform the user to try again later, repair or reinstall the app and then exit fully. If the user re-runs the app it should go through the same cycle of attempting to update and then gracefully handling the error (if the error condition still exists).

Is this on the roadmap/is the project still maintained?

Also happens when you answer "No" for privilege escalation for update. I won't ask for it again after the next restart and will be stuck in an endless loop as a result.

Re: saying no to elevation. I've noticed that too. I am not sure how to solve for that tbh.

But regarding the bigger picture about the project roadmap and maintainance...

First off I want to say that I no longer work at Evolve Labs. I have been maintaining this project in my spare time because I know some people are using it and I didn't want to leave anyone hanging. And as far as I know Evolve does not intend to put any more work into it. So no, it's not fully maintained by a team as it should be.

But secondly, its probably a more important question to answer whether or not this project can accomplish its goals, which is to make cross platform auto-updating easy. Assuming all of the bugs and features on this list are solvable, does this project still accomplish this goal? I think the answer is actually that it doesn't actually doesn't. :(

It is fairly easy to add this module to your app, and the code in the main.js is definitely easy to write so thats nice but the configuration you need to go through to get it actually working is a totally different matter, especially once you encounter native modules, which is really pretty common. Also, the fact that you have to brand your electron binaries causes even more complexity... and maintaining your own npm server. It just ends up being pretty hard in reality. Negating the supposed benefits frankly.

I'm now thinking that the right way to actually solve this problem is to probably go through the various stores for the various operating systems. In those cases I believe you generate a .dmg / .msi / .apt (or whatever they use on linux) and deploy your app and updates through their store systems. It's a huge pain how they're all so different but there is enough complexity that I think its probably the only way to do it really safely to be honest.

The only other thing in this project that's interesting is the plugins and auto-updating of the plugins. Interestingly, that's a much easier task to solve for than the app itself and this does solve that problem fairly well I think. So basically what I'm saying is that I think if we removed support for updating the app itself and dependencies and instead just focused on making this an electron plugin updater, that would maybe be something I could more realistically support and would be a problem that isn't already solved by the various operating systems. You would then use the electron-builder project to generate installers for the various operating systems and deploy those through the stores to update your main app.

So I'm trying to figure out how to announce that here, probably make a roadmap and update the README.md to reflect this change in purpose. All changes would be in a major version so this version would continue to work as is... Does this make sense?

I would be interested in helping anyone who is interested in finding out a migration path to use the store updaters since, frankly, I'm not totally sure how to do it and want to learn.

I hope this helps.