[CMake] InstallRequiredSystemLibraries with MSVC9 SP1

cyril_wobow cyril at wobow.com
Sun Dec 7 15:10:01 EST 2008


Bill Hoffman a écrit :
> 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


Thanks Bill for your quick answer. I had read your posts but I just 
looked too crooked to me :). Your fix works, but -correct me if I am 
wrong- it consists in having the redist pretend its dlls are the old 
ones altough they are not? Just to make sure...

 PS: one other solution would consist in overring the exe-embedded 
manifest with an external myexe.exe.manifest file that would refer to 
the SP1 version of the CRT dlls.

Thanks again!


More information about the CMake mailing list