官术网_书友最值得收藏!

Testing automatic updates

Testing the whole auto-update process takes a few steps since you need to install one version of the app, publish a new one, and then see what happens. Let's see those steps in practice:

  1. Go to the release page and download the installer package. For macOS, this is going to be in .dmg format:
  1. Install the app and run it to ensure it works as expected. Close the application for now; we are going to return to it shortly.
  2. Update the package.json file and set the version attribute to 1.1.0. Alternatively, you can run the following command to update the file:
      npm version minor 
  1. The output should be as follows:
      v1.1.0
  1. Run the publish command once again to create a new release draft:
      GH_TOKEN=<YOUR-TOKEN> npm run publish:github
  1. Now, you should have two releases on GitHub, including a new draft for version 1.1.0:
  1. Perform the same steps you performed earlier and publish the new release. Then, run the application you downloaded and installed earlier.
  2. In a few seconds, after startup, the automatic updater will raise a system notification, saying that a new version of the application has been downloaded and ready to install:
  1. Quit the application and run it once again. At this point, you should be using the latest version, that is, 1.1.0 (at the time of writing).
  1. You can use the standard Electron framework out of the box to check that your application version is the latest one:
  1. Note the vision value; it is now 1.1.0:

Well done and congratulations on setting up publishing and automatic updates for your application!

As an exercise, try to configure building and publishing for other platforms. Be sure to test the installation and upgrade process with Windows or Ubuntu Linux if you have real or virtual machines nearby.

In the next section, we are going to provide a proper title for our application.

主站蜘蛛池模板: 福建省| 龙游县| 宜黄县| 苍南县| 托克托县| 华坪县| 加查县| 灵山县| 金山区| 鄂温| 南丰县| 清镇市| 新民市| 三门峡市| 庄浪县| 迁安市| 高密市| 晴隆县| 岚皋县| 巴彦淖尔市| 乌兰浩特市| 林周县| 华阴市| 库车县| 鄯善县| 贵德县| 本溪| 深水埗区| 板桥市| 海口市| 湘潭市| 台山市| 永城市| 那曲县| 蕲春县| 泾源县| 常德市| 临颍县| 苏尼特右旗| 阿克苏市| 信阳市|