Results 1 to 10 of 10

Thread: Qt application auto-updater?

  1. #1
    Join Date
    Apr 2007
    Posts
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Qt application auto-updater?

    Hi - I'm wondering if there's a recommended strategy for adding an auto-updater to a Qt app. This would be something that would check online for an updated version, download the update and install it.

    Would this be a separate app sitting next to the main Qt app that acts on it? Is there a good way to keep it all in one codebase/application?

    Thanks for any suggestions/recommendations!

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt application auto-updater?

    The recommended solution is a second application that will check and apply the updates. You don't want your main app to apply the updates because maybe you update the main executable (which is running) or a library your app is using.

    If you use a second app, start it from the main app, check for updates, if any download them, close the main app, apply the updates( overwriting any necessary files) and if you want, start the application back.

    Regards

  3. #3
    Join Date
    Jan 2006
    Posts
    105
    Thanks
    21
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt application auto-updater?

    permissions could cause problems.

    only under windows when the user is administrator you can overwrite the executable.

    i have no idea how for example firefox solves this. (probably run the updater as root/Administrator?)


    niko

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt application auto-updater?

    Firefox only makes an update if it has write permissions to the binary.

  5. #5
    Join Date
    May 2006
    Location
    Germany
    Posts
    108
    Thanks
    2
    Thanked 14 Times in 12 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt application auto-updater?

    Quote Originally Posted by wysota View Post
    Firefox only makes an update if it has write permissions to the binary.
    That's not entirely true. It downloads the update and asks to install it, and ultimately the update installation will fail due to a lack of permissions. Experienced with Firefox 2.0.0.2 at university.
    "If you lie to the compiler, it will get its revenge." - Henry Spencer

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt application auto-updater?

    I have "update" options disabled if I don't have permissions to the destination directory. Maybe it only affects the possibility to change settings and not the actual update.

  7. #7
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt application auto-updater?

    If you originally install your app as admin, then you'll have to make the update as admin.
    If you install it as a regular user, then set write permissions for the current user for your files. Then it is possible for the same user to update the app.

    On Vista you can elevate you app's rights to a more privileged user ( by asking the current user a user name and pwd ). You'll just have to add a few extra entries in the app manifest and some lines of code.

    Regards

  8. #8
    Join Date
    Oct 2009
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt application auto-updater?

    Hi,
    I am working on application which will try to do some install or updates on Windows 2008 server (SBS - small business server).
    Since ever the Microsoft introduced UAC (user account control) security, a user created with Administrator rights (other than Administrator default account) windows treats the user as Standard user and it gives the user Administrator rights only when Admin applications are run and allowed access.
    Because of the above security, I have to elevate the user permissions to Administrator manually and then call any executable (.exe ) in my application.
    Since I am using QProcess to run any applications (.exe) I went through the QProcess documentation, but I never found any function or option to elevate QProcess to Administrator permissions.

    Please let me know if anyone know or have an idea how to elevate QProcess permissions.

    Thanks,
    Raghava

  9. #9
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt application auto-updater?

    I've never attempted to auto update the application. The program checks for a newer version if allowed by it's configuration, and then will poup a dialog box saying "A new version (Vx.x) is available. You are currently running version Vy.y. Would you like to download it?". If the user clicks "Yes" then it directs them to the website. Its then upto the user to backup there files, gain any necessary rights, and run the updater. Saves lots of potential problems.

  10. #10
    Join Date
    Jan 2011
    Posts
    32
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt application auto-updater?

    i am doing the exactly what squidge is saying. My separate app checks and downloads the SIS file (new updated version of the app) and asks the user to install it but how do i execute this SIS file automatically on the handset (Nokia E52).

    I have tried

    Qt Code:
    1. qStartIntall = new QProcess();
    2. qStartIntall->start("C:\\Data\\DownloadedApp.SIS");
    To copy to clipboard, switch view to plain text mode 

    but i get error "QProcess::FailedToStart"

    Please help.

Similar Threads

  1. dll + application
    By fpujol in forum Qt Programming
    Replies: 11
    Last Post: 15th April 2007, 18:37
  2. Application deployment problem
    By shapirlex in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 13th April 2007, 00:11
  3. Replies: 3
    Last Post: 8th December 2006, 18:51
  4. Gnome makes application crash
    By regix in forum Qt Programming
    Replies: 35
    Last Post: 18th August 2006, 19:44
  5. Replies: 3
    Last Post: 31st March 2006, 18:38

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.