How should I implement an auto-updater?

后端 未结 16 1143
名媛妹妹
名媛妹妹 2020-12-04 06:11

Many programs include an auto-updater, where the program occasionally looks online for updates, and then downloads and applies any updates that are found. Program bugs are f

16条回答
  •  执念已碎
    2020-12-04 06:33

    I'm going to assume answer for Windows.

    This way seems to work well.

    In the installer do:
    1. Create a manual-start service that runs as LocalSystem that when started does the update then stops.
    2. Change the service permissions so all users can start the service (if all users should be able to update w/o admin rights).
    3. Change the main program to check for updates when started using a simple mechanism. If it detects an update, prompt if the user wants to apply it.
    4. If user accepts the update, start the service.

    If the architecture allows for it, create a way to monitor the update as it is running.

提交回复
热议问题