Administrator rights for apps built with MinGW
-
Hi everyone
For a long time I've been using the following code in my pro file to give Admin rights to my apps using MSVC2010
@
CONFIG += embed_manifest_exe
QMAKE_LFLAGS_WINDOWS += $$quote( /MANIFESTUAC:"level='requireAdministrator' uiAccess='false'" )
@But it seems it is not working with MinGW. Any ideas???
-
See the second answer to "this question":http://stackoverflow.com/questions/5744008/is-it-possible-to-run-as-administrator-only-through-code.
-
You mean the solution is ShellExecute or CreateProcess. In other words, another app calling my app using runas?!
Thanks, this may work but it does not seem to be the solution in my case.
I need my app to become admin privileged. -
OK, then there is a trick to do that, but it will work only on Vista+. You need to change the name of your exe so that it contains "setup" somewhere in the file name. That usually (always?) triggers the UAC.
-
Or, of course, create a small "launcher" app, that will use runas to launch your real application.
-
[quote author="sierdzio" date="1403250206"]OK, then there is a trick to do that, but it will work only on Vista+. You need to change the name of your exe so that it contains "setup" somewhere in the file name. That usually (always?) triggers the UAC.[/quote]
[quote author="sierdzio" date="1403250251"]Or, of course, create a small "launcher" app, that will use runas to launch your real application.[/quote]
Yeah right. These are all solutions. (I wasn't aware of the one you mentioned about Vista+) and thanks again.
But let me ask my question this way:
How can I embed app manifest into my Qt app while using MinGW compiler? -
I know you want that, but you yourself claim it does not work ;-) So I'm tryign to provide an alternative.
According to "this":http://www.transmissionzero.co.uk/computing/win32-apps-with-mingw/ article, manifests should work.
-
:D Thanks for the alternatives.
[quote author="sierdzio" date="1403250989"]
According to "this":http://www.transmissionzero.co.uk/computing/win32-apps-with-mingw/ article, manifests should work.[/quote]Need to check this. Looks like a solution! Not an alternative ;) I'll share the results.