What it is
A NodeJs module for Electron, that handles app.asar updates. Reconstruction of
How it works (Read this first)
- EAU (Electron Asar Updater) was built upon Electron Application Updater to handle the process of updating the app.asar file inside an Electron app ; it simply replaces the app.asar file (at /resources/) with the new one called "update.asar"!
- The check for "updates" must by triggered by the application. EAU doesn't make any kind of periodic checks on its own.
- EAU talks to an API (let's call it so) to tell it if there is a new update.
- The API receives a request from EAU with the client's current version of the application (must be specified inside the application package.json file).
- The API then responds with the new update, ... or simply false to abort.
- If there's an update available the API should respond with the source for this update update.asar file.
- EAU then downloads the .asar file, deletes the old app.asar and renames the update.asar to app.asar.
But why ? (use cases)
- If you think these are too complicated to implement: https://www.npmjs.com/package/electron-updater http://electron.atom.io/docs/v0.33.0/api/auto-updater/
- If you don't think it's reasonable to update the hole .app or .exe file (up to 100MB) when you're only changing one file (usually 40MB).
- If you want to see
- If you want to
checkthe version on the
server sideor on the
- If you want to use
zipto compress files, make your ASAR file smaller.
$ npm install --save electron-asar-hot-updater
Now, inside the main.js file, call it like this:
const app dialog = ;const EAU = ;app
The update server
The server can return the version details, for example
const express =var bodyParser = ;const app =app;app;var desktop_app_version = '1.0.0';var desktop_app_URL = '' // or ../update.zipapp;appconsole
Or you can return version information for client to check
If you use a zip file, the plug-in will unzip the file after downloading it, which will make your update file smaller, but you must make sure that
update.asar is at the root of the zip package:
── update.zip └── update.asar
😃 if you have any comments or wish to contribute to this project, you are welcome to submit Issues or PR.
MIT - yansenlei