PDA

View Full Version : win32, how to modify the manifest with qmake?



andres
18th March 2010, 12:55
Hi Qtlers..

I'm trying to build an app on win32 using visual studio express 2008 and qt 4.6.2 that needs to have the "Run as Administrator" bit set in the executable. This will require change of the manifest file... instead of <requestedExecutionLevel level="asInvoker" uiAccess="false" /> you have to put <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />.

I can change this from within Visual Studio Express by going to Project Properties under Configuration Properties -> Linker -> Manifest File and then selecting "requireAdministrator" in "UAC Execution Level", but is there a way to do this automagically with qmake?

I've searched through the source code to find both asInvoker and requireAdministrator so I dont think it's a trivial switch..

Thanks,

Andres

wysota
18th March 2010, 17:02
There is no direct support for that in QMake.

andres
22nd March 2010, 14:11
no direct support, true, but the following appears to work:

QMAKE_LFLAGS += /MANIFESTUAC:\"level=\'requireAdministrator\' uiAccess=\'false\'\"

cheers.
Andres

andres
31st May 2012, 10:59
further to that message.. in Qt 4.8.2 (not sure about other Qt 4.8 versions) you have to do:

win32 {
CONFIG += embed_manifest_exe
QMAKE_LFLAGS_WINDOWS += /MANIFESTUAC:level=\'requireAdministrator\'
}

reason is that in msvc_objectmodel.cpp the options are parsed curiously.. so the double quotes in my previous post make qmake generate create wrong options.

PeterLLLLLL
13th July 2012, 08:09
I don not understand.....What is your meaning...