Automatically checking for a new version of my application

前端 未结 12 1212
天命终不由人
天命终不由人 2021-01-30 18:12

Trying to honor a feature request from our customers, I\'d like that my application, when Internet is available, check on our website if a new version is available.

The

12条回答
  •  粉色の甜心
    2021-01-30 18:32

    Pilif answer was good, and I have lots of experience with this too, but I'd like to add something more:

    Remember that if you start yourapp.exe, then the "updater" will try to overwrite yourapp.exe with the newest version. Depending upon your operating system and programming environment (you've mentioned C++/QT, I have no experience with those), you will not be able to overwrite yourapp.exe because it will be in use.

    What I have done is create a launcher. I have a MyAppLauncher.exe that uses a config file (xml, very simple) to launch the "real exe". Should a new version exist, the Launcher can update the "real exe" because it's not in use, and then relaunch the new version.

    Just keep that in mind and you'll be safe.

提交回复
热议问题