Is possible to make mt.exe embed manifest files correctly in Visual Studio 2008?

Posted by Sorin Sbarnea on Stack Overflow See other posts from Stack Overflow or by Sorin Sbarnea
Published on 2010-03-17T22:45:58Z Indexed on 2010/03/17 22:51 UTC
Read the original article Hit count: 414

I found that mt.exe fails to correctly create and embed manifest files into executables when run inside a VCPROJ.

For example the same executable load well on Windows 7 but failed to load on Windows XP. The manifest was embedded and correct.

After I spend lots of hours searching for possible reasons and solution I modified the project settings to generate the manifest outside the exe file. Now it works on both systems.

Here are the examples for debug builds.

With embed disabled:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel>
      </requestedPrivileges>
    </security>
  </trustInfo>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.VC90.DebugCRT" version="9.0.21022.8" processorArchitecture="x86"     publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
    </dependentAssembly>
  </dependency>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.VC90.DebugMFC" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
    </dependentAssembly>
  </dependency>
</assembly>

This is with embed enabled:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> 
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false" /> 
</requestedPrivileges>
</security>
</trustInfo>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.VC90.DebugCRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b" /> 
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.VC90.DebugMFC" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b" /> 
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="x86" publicKeyToken="6595b64144ccf1df" language="*" /> 
</dependentAssembly>
</dependency>
</assembly>

If you compare them the second one adds common controls (I don't know from where) and also it is a small difference with the syntax of requestedExecutionLevel tag.

© Stack Overflow or respective owner

Related posts about manifest

Related posts about winsxs