1 Attachment(s)
Re: QProcess and Vista UAC
Vista won't launch the UAC elevation dlg automatically. You'll have to tell it in the application manifest.
Check the attached file. I downloaded it from Microsoft some time ago( Vista fever ).
1 Attachment(s)
Re: QProcess and Vista UAC
Also check this out. It's not mine, I got it from codeproject. I never used it but it may be of some help to you.
Here's the link too: http://www.codeproject.com/useritems/VistaElevator.asp
Re: QProcess and Vista UAC
Thanks for your answer. I have been through the voluminous MS documentation on the subject and I have embedded the correct manifest requesting admin privileges.
However, the second link you posted was really useful! I didn't know about the "runas" parameter to ShellExecuteEx. So now I guess the question is whether it's possible to get that behaviour through QProcess or whether I have to drop down to a platform-specific ShellExecuteEx at this point?
Re: QProcess and Vista UAC
Quote:
However, the second link you posted was really useful! I didn't know about the "runas" parameter to ShellExecuteEx. So now I guess the question is whether it's possible to get that behaviour through QProcess or whether I have to drop down to a platform-specific ShellExecuteEx at this point?
You'll have to use ShellExecuteEx. QProcess is more generic and it does not provide the details of ShellExecuteEx. At least in 4.2.2 - 4.2.3 it doesn't.
Maybe in 4.3. I didn't get the chance to take a look at 4.3 yet.
Is your app meant to run on Mac or Linux also? Because if it is, you'll have to use QProcess for Linux/Mac and the Win API on Windows.
regards
Re: QProcess and Vista UAC
Actually, I just tried it and it seems I don't even have to use "runas" with ShellExecute. "open" is enough, presumably because I've already embedded a manifest requesting elevation. That makes me wonder why launching it through QProcess doesn't display the elevation dialog too...
Re: QProcess and Vista UAC
because QProcess uses CreateProcessW.