From an article regarding Mr. @ Bart:
Application manifest
First we need to prepare the application manifest file. This is below for an application that does not require administrator rights:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <assemblyIdentity version="2.0.2.0" processorArchitecture="X86" type="win32"/> <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> <security> <requestedPrivileges> <requestedExecutionLevel level="asInvoker" uiAccess="false"/> </requestedPrivileges> </security> </trustInfo> </assembly>
Secondly, we need the MT.exe
tool from the Microsoft Windows SDK to embed this XML in our executable file. To do this, use the following command:
mt.exe βmanifest MyApp.exe.manifest -outputresource:MyApp.exe;1
Automatic manifest injection
Manually executing the mt command after each compilation is a tedious task. How about persuading qmake to do this for us? After studying the documents, it looks as follows:
win32 { WINSDK_DIR = C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A WIN_PWD = $$replace(PWD, /, \\) OUT_PWD_WIN = $$replace(OUT_PWD, /, \\) QMAKE_POST_LINK = "$$WINSDK_DIR/bin/x64/mt.exe -manifest $$quote($$WIN_PWD\\$$basename(TARGET).manifest) -outputresource:$$quote($$OUT_PWD_WIN\\${DESTDIR_TARGET};1)" }
The above code will automatically execute the mt.exe program from WINSDK_DIR and attach the manifest file, which is located in the project root directory and named after the project goal (i.e. MyApp.manifest). For all of this to add a manifest, now go and provide version information.
Another post: http://blog.strixcode.com/2010/08/embedding-application-manifest-and.html
source share