[CMake] InstallRequiredSystemLibraries with MSVC9 SP1

Bill Hoffman bill.hoffman at kitware.com
Sun Dec 7 10:02:51 EST 2008


cyril_wobow wrote:
> Hi everyone,
> 
> I encountered an annoying problem when installing/packaging a project 
> using the InstallRequiredSystemLibraries script under MSVC9 SP1.
> 
> The following files are properly bundled next to my executable (in the 
> "./bin" install directory), which is great :
> - Microsoft.VC90.CRT.manifest
> - msvcm90.dll
> - msvcp90.dll
> - msvcr90.dll
> 
> However, on a clean system with no redist installed, I get the obnoxious 
> message "bla bla try reinstalling the application bla bla" when 
> attempting to run the executable. The latter has no other external 
> dependency.
> 
> The problem is that the manifest that is embedded in the exe states a 
> dependency to MSVC CRT version 9.0.21022.8 (aka RTM), whereas the 
> Microsoft.VC90.CRT.manifest and the three dlls that stand next to my exe 
> are version 9.0.30729.1 (aka SP1).
> 
> Other observations/remarks :
> - just installing the SP1 redist works well thanks to a policy in 
> winsxs/policies that redirects RTM CRT dependencies to SP1 CRT 
> dependencies.
> - changing the version in Microsoft.VC90.CRT.manifest to RTM works well.
> - hacking the exe to have its embedded manifest depend on SP1 CRT works 
> well.
> - adding the following preprocessor definitions to my project : 
> _BIND_TO_CURRENT_MFC_VERSION=1 and _BIND_TO_CURRENT_CRT_VERSION=1, as I 
> read about in forums, results in the embedded manifest depending on both 
> RTM and SP1 CRTs, which doesn't help.
> - there must be the same problem with MFC and ATL libs.
> 

Let me guess VS 9 service pack 1.  It is broken!  Not CMake's fault. 
See this post:

http://www.cmake.org/pipermail/cmake/2008-September/023822.html

The fix that I use is hacking the Microsoft.VC90.CRT.manifest file in 
the visual studio install.

-Bill


More information about the CMake mailing list