Results 1 to 5 of 5

Thread: automatic update example

  1. #1
    Join Date
    Apr 2014
    Posts
    53
    Thanks
    9

    Default automatic update example

    Hi,
    I have a client/server application. The server daemon is written in ansi C (gcc) and the Client app is written with QT 5.2
    What I want to do, is the client to be auto-updatable. Lets say, current client version is 1.1.1 , when the next version comes up, say 1.1.2 , the client would check if there is any new version available for update, download the code and automatically update the application code.

    Is there any example on how to do this ?
    Or another question would be, how do I replace current class code with the new version of it ?

    Will appreciate very much any help on this topic.

    Regards
    Nulik

  2. #2
    Join Date
    Dec 2009
    Location
    New Orleans, Louisiana
    Posts
    791
    Thanks
    13
    Thanked 153 Times in 150 Posts
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Re: automatic update example

    You didn't mention what platform(s) your app runs on. If it's Mac OSX, then Sparkle is the definitive standard for apps to add auto-update functionality. There have been ports for Windows I believe, but not sure how widely adopted those are.

    Rolling your own has been done been done many times of course and Qt offers the QNetwork* stuff that can simplify reading a file from a server to determine the latest available version of your application. The harder part to get right is the ability to install a new version of your app, terminate the running version, and start the newly installed version all without incident.

    For your particular case, you'll want to make sure that you could auto-update the daemon to ensure it's compatible with the new client version, or else you will wind up with broken client/server interaction.

    The way Sparkle works is that if downloads an XML file (RSS actually) that contains information about new version(s) of your program that are available. It then downloads the update and extracts it to a temporary version. There's a companion auto-update program that is then started which shuts down your running app and moves old version to the Trash and your newly unpacked temp version into the proper location, then launches your app again.

    Hope that helps.

  3. The following user says thank you to jefftee for this useful post:

    d_stranz (25th February 2015)

  4. #3
    Join Date
    Apr 2014
    Posts
    53
    Thanks
    9

    Default Re: automatic update example

    Thanks for you reply!
    Yeah, I forgot to mention that the client side application is cross platform, for Windows, Linux, Mac OS and so on. Sparkle looks nice, but I guess I will have to write this functionality myself. So, the thing I need to do, is a copy of Sparkle , but cross platform, this way will avoid issues of replacing code at runtime, I would just terminate current program , launch "MySparkle", it would update the application libaries and relanuch it. Seems not so complicated.
    Thanks again for the idea.
    Regards

  5. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: automatic update example

    Google for WinSparkle. Written for Windoze, but comes with source code and may be cross-platform buildable.

  6. #5
    Join Date
    Jan 2014
    Posts
    76
    Thanks
    17
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: automatic update example

    Maybe Qt Installer Framework? http://doc.qt.io/qtinstallerframework/ifw-overview.html
    I read that it can be used for updating app but I'm not sure.

Similar Threads

  1. QGraphicsItem::update(); vs scene()->update();
    By Lord_Navro in forum Newbie
    Replies: 1
    Last Post: 25th April 2013, 06:23
  2. QFileSystemModel - Incremental update/pre-emptive update
    By johnnyturbo3 in forum Qt Programming
    Replies: 0
    Last Post: 2nd September 2011, 13:56
  3. Replies: 5
    Last Post: 5th November 2010, 17:26
  4. Replies: 2
    Last Post: 29th September 2010, 17:44
  5. Automatic Splitter
    By Katuakina in forum Qt Tools
    Replies: 1
    Last Post: 5th October 2007, 09:29

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.