[CMake] InstallRequiredSystemLibraries with MSVC9 SP1

cyril_wobow cyril at wobow.com
Sun Dec 7 06:12:27 EST 2008


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.

HTH finding a fix...
Kind regards,
Cyril



More information about the CMake mailing list