[CMake] InstallRequiredSystemLibraries.cmake and Redistribution of the shared C runtime component in Visual C++

James Bigler jamesbigler at gmail.com
Thu Aug 6 14:05:57 EDT 2009


On Thu, Aug 6, 2009 at 11:55 AM, Bill Hoffman <bill.hoffman at kitware.com>wrote:

> James Bigler wrote:
>
>> I've just been bitten hard by this issue (many hours of frustration while
>> attempting to run a demo application that should have "Just Worked" (TM) ).
>>
>> According to this page:
>>
>> http://support.microsoft.com/kb/326922
>>
>>
>> "You should install these versions of the CRT on target computers by
>> running the Vcredist_x86.exe application that is included with Visual
>> Studio."  This is for the VS 2005 and 2008 versions of the C run-time
>> libraries except for Windows 2000 in which case you need to install them in
>> the system32 directory.
>>
>> I was dropping Msvcr80.dll and friends as per
>> InstallRequiredSystemLibraries next to the binaries with ineffectual
>> results.  It was really strange, because programs like Dependency Walker
>> seemed to find them just fine.  It was only after running vcredist_x86.exe
>> that I was able to run my programs properly.
>>
>> I though I should tell everyone that this method of distributing
>> Msvcr80.dll and Msvcr90.dll next to your binaries is not supposed to work.
>>  You must install them into the Windows Side by Side location (WinSxS) using
>> the CRT.msm merge module or the vcredist_x86.exe that comes with Visual
>> Studio.
>>
>> Now to try and get CPack to tell NSIS run the vcredist_x86.exe program
>> during installation.
>>
>> Note, that many people might get lucky and have already installed a
>> product that installed the right vcredist_x86.exe before installing your
>> software.
>>
>>
> No this works fine.... However you may be running into this issue:
>
> "
> Visual Studio 9 SP 1 has a bug that will cause trouble with cpack.
>
>
> You can read about it here:
>
>
> https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=361682
>
>
> Basically, when you compile an executable or dll with VS9 SP1 it embeds
> manifest information into the the exe or dll that does not match the
> version information in the manifest files that SP 1 provides for
> redistribution.
> "
>
> We use the InstallRequiredSystemLibraries all the time without requiring
> vcredist_x86.exe to be run.
>
> -Bill


Well, I was using VS 2005 64 bit with SP 1.  I wonder if there is a similar
bug or if there is something else going wrong such as what Marcus Hanwall
described.

James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090806/826bed81/attachment.htm>


More information about the CMake mailing list