PDA

View Full Version : Qt application auto-updater?



liamstask
14th April 2007, 20:19
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!

marcel
14th April 2007, 20:24
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

niko
15th April 2007, 11:05
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

wysota
15th April 2007, 12:14
Firefox only makes an update if it has write permissions to the binary.

Methedrine
15th April 2007, 12:43
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.

wysota
15th April 2007, 12:46
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.

marcel
15th April 2007, 13:32
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

brraghava
2nd November 2009, 05:48
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

squidge
2nd November 2009, 08:32
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.

javed_alam786
24th August 2011, 10:59
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



qStartIntall = new QProcess();
qStartIntall->start("C:\\Data\\DownloadedApp.SIS");

but i get error "QProcess::FailedToStart"

Please help.