PDA

View Full Version : Any Qt way of elevating a process's UAC privilege on windows 7?



mswarna
29th January 2014, 12:38
Our application is based on Qt4.8.4 on windows 7 64-bit. We would like to go for windows app certification.
One of the requirements for certification is that the application should start with standard user privileges and then application can elevate itself to admin level whenever required.
Using manifest file and windows API's we can achieve that.

Is there any Qt way of handling such scenarios on windows 7?

In windows terms, say, the application starts up with "asInvoker" privilege and then elevate it to "requireAdministrator" privilege whenever required and then go lower again when done.

Thanks in Advance.

mswarna
29th January 2014, 12:49
Our application is based on Qt4.8.4 on windows 7 64-bit. We would like to go for windows app certification.
One of the requirements for certification is that the application should start with standard user privileges and then application can elevate itself to admin level whenever required.
Using manifest file and windows API's we can achieve that.

Is there any Qt way of handling such scenarios on windows 7?

In windows terms, say, the application starts up with "asInvoker" privilege and then elevate it to "requireAdministrator" privilege whenever required and then go lower again when done.

Thanks in Advance.

anda_skoa
29th January 2014, 13:53
If you already have code that does that using windows API, then just keep using that.

The windows API is C/C++, right?

Cheers,
_

Lesiok
29th January 2014, 15:42
You cannot change the security token assigned to a process as soon as it is created. So You must do it by manifest.

mswarna
30th January 2014, 06:47
True, windows API is c++. But just wanted to know and try out if we can resolve certification related lua issues in some safe and platform independent way.
Also wanted to know if there are any design concepts in Qt related to UAC that we have missed or are unaware of.

anda_skoa
30th January 2014, 09:03
UAC is a Windows specific concept, so there is no need for any cross platform API.
You could look into the Qt Window Extras addon, but I doubt that it contains something as low level as this.

Cheers,
_