commit 78748a44d4c75da489517fd6ce09397530b37fdb Author: 草鞋没号 <308487730@qq.com> Date: Wed Mar 15 09:16:10 2023 +0800 chore: cleanup commit dd5ff0674d83de9e5d97d661c10924bdc795a412 Author: Jimmy <jimmyrss1102@gmail.com> Date: Tue Mar 14 21:12:33 2023 +0800 docs : add `electron-auto-update` docs
electron-updater
English | 简体中文
Use
electron-updaterto realize the update detection, download and installation of the electric program.
npm i electron-updater
Main logic
-
Configuration of the update the service address and update information script:
Add a
publishfield toelectron-builder.json5for 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...
-
The update logic of Electron:
- 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...
-
Updating UI pages in Electron:
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