Qt C++ desktop -Automatically checking for a new version of my application



  • Any Idea -Qt C++ desktop -Automatically checking for a new version of my application
    Want to add this feature to first release .windows and mac


  • Moderators

    you can store a xml file on your webserver and request it in your application and parse it for the version number. Then compare the version number with your local version number.



  • thanks for response,i agree with your point but the ting is that if is i have new files (.cpp,.h,images etc) to update in Clint machine then what mechanism is to followed.any example


  • Moderators

    there are many ways to accomplish this.
    One would be to download your files to a temporary directory and use a external update process to overwrite the files. Best would be a application which is not Qt based (or a statically built Qt application), since it may be that you also need to update the Qt binaries currently loaded.

    See this (cross platform solution): https://github.com/mendeley/Update-Installer


  • Lifetime Qt Champion

    KDAB also proposes a framework for automatic updates.
    Sparkle is another solution



  • Omaha - for Windows, Sparkle - for Mac, Qt Installer Framework - for both.



  • [quote author="raven-worx" date="1370602718"]you can store a xml file on your webserver and request it in your application and parse it for the version number. Then compare the version number with your local version number.[/quote]

    That's pretty much what I do. Also the XML file should contain the download URL, so the update can be downloaded automatically too - maybe with some session key to protect your downloads against "deep" links.

    But: I would HIGHLY recommend you sign both, the update information that is fetched from the web-server as well as the actual update (installer) with a digital signature. Your update tool may then contain the corresponding public key to verify the authenticity of these files. This protects against spoofing attacks, as well as man-in-the-middle and also against somebody taking over your domain. I have implemented this with GnuPG for my programs.

    Furthermore, I would HIGHLY recommend to make your application pick a random update mirror from a built-in list of multiple update mirrors (servers), when checking for new updates. If you only used a single update server and one day that server breaks away, you would leave thousands of users unable to update. And there will be nothing you can do to fix this. I know what I am talking about. Won't make that mistake again.

    Last but not least, on the Windows platform, NSIS with Inetc plug-in can be a great help to realize all this.



  • bq.
    Can you please explain me more about the Auto update and how its work and the xml structure at local and remote side.

    That's totally up to your choice.

    As long as your application and your server agree on the same format, everything is fine.

    Could look like this:
    @<UpdateInfo>
    <LatestBuildNo>42</LatestBuildNo>
    <DownloadUrl>
    <mirror>http://www.myserver.com/Setup.exe</mirror>
    <mirror>http://www.myotherserver.com/Setup.exe</mirror>
    </DownloadUrl>
    </UpdateInfo>@

    But choose the format carefully, as you cannot change it, as soon as the application is deployed to the user ;-)



  • We're using "AutoAppdate":http://www.AutoAppdate.com for our Windows release. It doesn't require any code because it is runs in a stand-alone process.



  • [quote author="Johnkagen" date="1389864740"]We're using "AutoAppdate":http://www.AutoAppdate.com for our Windows release. It doesn't require any code because it is runs in a stand-alone process. [/quote]

    I really hate those solutions. They make my system slow by starting up a service just to check if a single application is up to date. It seems to be used most by applications who's authors think that this is a very importing application, while in fact it is only a tool you use once in awhile and could do without. Sometimes, they even think it is appropriate to put an icon in my system tray just for the updater...

    This is one of those things that were solved ages ago on Linux (just use a distribution to manage your software) and only recently made it to mac and windows with their stores that publish the updates for all applications that have been installed from it.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.