Skip to content

Latest commit

 

History

History
49 lines (32 loc) · 1.94 KB

File metadata and controls

49 lines (32 loc) · 1.94 KB

electron-updater

English | 简体中文

Use electron-updater to realize the update detection, download and installation of the electric program.

npm i electron-updater

Main logic

  1. Configuration of the update the service address and update information script:

    Add a publish field to electron-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...

  2. 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...

  3. 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