Giter Site home page Giter Site logo

Silent updates about electron-updater HOT 4 CLOSED

develar avatar develar commented on July 28, 2024
Silent updates

from electron-updater.

Comments (4)

justinmchase avatar justinmchase commented on July 28, 2024

It actually does that already :)

There are 3 kinds of things to update: the app itself, its dependencies and plugins.

Plugins are silently updated if possible. Meaning, while your app is running, if a new version of a plugin becomes available then it will silently download it side-by-side your currently running version and on next launch it will just load that update instead. There is an 'udpateAvailable' event that fires so you can notify users through the UI.

If you develop the majority of your code in plugins then most of your updates will be silent.

The only time a non-silent update happens is if a "dependency" of the app itself is missing or if the app itself has an update. If your installer has no dependencies by default (except electron-updater of course) then it will force it into update mode on first launch which will get the latest version even for older downloads of the installer.

from electron-updater.

sindresorhus avatar sindresorhus commented on July 28, 2024

if the app itself has an update

Why can't this be silent? That's really what I'm looking for.

from electron-updater.

justinmchase avatar justinmchase commented on July 28, 2024

Ah, well even as I'm writing this I'm having thoughts on how I could make it work.

But the primary challenge is that a) you can't update electron.exe itself while its running. Similarly if you overwrite dependencies under node_modules then depending on what is already loaded or not you can end up with non-deterministic results for the currently running application. And since npm/node doesn't support side-by-side versions of modules you would need to side-by-side the entire application.

Typically (in windows at least) you have a top level link to the main .exe of the program you're trying to run so it's tricky to have side-by-side versions. Thus, when the app or dependencies need updates, what it does right now is to copy electron into a temp folder then run it from there and update the original app.

But there are things we can do to either solve it completely or at least make it faster such as:

a) download all the tarballs ahead of time then notify the user of an update. So the update process, while still not idea, would be much faster.

b) figure out a way to side-by-side the entire app. Which would probably result in a simple .exe that goes at the root that knows how to launch electron as a child process in a sub-folder.

myapp.exe
myapp.config
/v0.0.1/myapp.exe
/v0.0.2/mapp.exe

Where the root myapp.exe looks at myapp.config which has the current version to use and then fires up the more specific version as a child process. I think that could be doable. :)

from electron-updater.

sindresorhus avatar sindresorhus commented on July 28, 2024

Might also be worth to look into how Atom does it. Maybe any missing APIs that's needed to achieve this could be implemented in Electron.

from electron-updater.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.