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>
// 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>
To copy to clipboard, switch view to plain text mode
Bookmarks