PDA

View Full Version : Enabling MakeFiles Through .pro files of Qt



zgulser
14th May 2012, 09:59
Hi,

How can I make qmake read (embedded) manifest file?

I'm asking this because I needed to customize my manifest file(from VS2010) in order to be able to have some writing priviliges on disk(C:)

To do this, I tuned Linker-->Manifest File part accordingly but I'm using qmake built. So I couldn't find how to add my customized Manifest properties into my exe.


In VS2010, the manifest is default embedded. Adding to .pro file;


"CONFIG += embedded_manifest_exe"
To copy to clipboard, switch view to plain text mode
will be OK?

Added after 59 minutes:


What about;


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

as well?

zgulser
14th May 2012, 12:09
I'm using Qt 4.8 and VS2010 by the way.

Moreover, I did type the following entry into my pro file;


QMAKE_LFLAGS_WINDOWS += /MANIFESTUAC:NO\"level='asInvoker' uiAccess='false'\"

and I can build and create a setup but this time my setup doesn2t working and giving me "side-by-side configuration" error and application fails to start.

ChrisW67
14th May 2012, 23:47
You add a Windows manifest to an executable using:

the Windows resources, or
the Microsoft mt.exe tool to add the manifest afterward

Only the first option is portable to another compiler/tool set.



// pro file
RC_FILE = coolapp.rc

// rc file
#include <windows.h>
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "coolapp.exe.manifest"
... etc

// coolapp.exe.manifest example
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" processorArchitecture="X86"
name="com.example.coolapp" type="win32" />
<description>Cool App</description>
<dependency />
<!-- Identify the application security requirements. -->
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="asInvoker"
uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>