I am a Qt Developer with no knowledge on Windows specific development what so ever. Qt is great to allow developers like myself (more from the *nix world) to develop on Windows platforms as well with the same codebase.
All is well with InstallBuilder when it comes to bundling and customizing my installer but the main feature I was looking for is the possibility to autoupdate my application.
On the Install Builder documentation there is a chapter about that specific subject and a suggestion on how to automate the update checking process using the autoupdate executable generated from a XML on unattended mode.
For that to work, you need to spawn the process from your application to avoid having the user to interact with that application by himself. The idea is great, but I am having quite a few problems accomplishing that in Windows.
The Qt way to spawn a new process is using QProcess. The problem I am encountering is that QProcess does not solve problems with Windows Vista/7 UAC "feature". Whenever the underlying implementation calls CreateProcess, UAC denies it and we are left with no autoupdate.
Back to the Install Builder documentation, we see something around these lines:
But that does not look like a code that can be used. Can you guys provide us with a real example on how to:
I am able to accomplish those on Mac and Linux, but Windows documentation is a mess and QProcess does not look like the way out.
Thank you very much for the help.
Regards, João Mesquita
asked 30 Jan '12, 21:01
The issue is related to UAC feature and is not specific to Qt, but is how Windows Vista and newer versions are designed.
By default the autoupdate binary is set to run as elevated and this is why you cannot run it as on Windows, non-elevated processes cannot run elevated processes for security reasons.
What you can do is set autoupdate binary to run as normal binary and have the installer elevated. You can set the autoupdate not to be elevated by doing:
And then building the autoupdate binary by doing:
This way the autoupdate binary can be run mechanisms such as QProcess.
However, this will also require that the binary be started as elevated. In this case, autoupdate binary needs to invoke it using "cmd /c start" syntax. It will run the binary using the system shell and prompt the user for elevation (and/or elevated username/password).
This can be done in
answered 31 Jan '12, 05:05