English | 简体中文
Use
electron-updater
to realize the update detection, download and installation of the electric program.
npm i electron-updater
-
Add a
publish
field toelectron-builder.json5
for configuring the update address and which strategy to use as the update service.{ "publish": { "provider": "generic", "channel": "latest", "url": "https://foo.com/" } }
For more information, please refer to : electron-builder.json5...
-
- Checking if an update is available;
- Checking the version of the software on the server;
- Checking if an update is available;
- Downloading the new version of the software from the server (when an update is available);
- Installation method;
For more information, please refer to : update...
-
The main function is to provide a UI page for users to trigger the update logic mentioned in (2.) above. Users can click on the page to trigger different update functions in Electron.
For more information, please refer to : components/update...
Here it is recommended to trigger updates through user actions (in this project, Electron update function is triggered after the user clicks on the "Check for updates" button).
For more information on using electron-updater
for Electron updates, please refer to the documentation : auto-update