Use specific version of vcredist?

2019-08-15 04:41发布

Is it possible in Visual Studio 2008 SP1 to target a C++ COM project to vcredist 2008 instead of vcredist 2008 SP1?

Our customers have the vcredist 2008 installed and we don't want to force them to install vcredist 2008 SP1. (thousands of computers!)

2条回答
\"骚年 ilove
2楼-- · 2019-08-15 05:16

VS2008 actually, by default, continues to target the VS9 RTM redist. What is happening in dependency checker is, when VS9 SP1 is installed, a policy file is also installed that redirects attempts to load the RTM redistributables to the SP1 redistributables.

In order to get VS9 SP1 to actually require the SP1 runtimes you need to add the following macro to your project settings or precompiled header:

#define _BIND_TO_CURRENT_CRT_VERSION 1
查看更多
ゆ 、 Hurt°
3楼-- · 2019-08-15 05:42
  1. You can try to remove the embed manifest (look under the project settings Manifest Tool) and provide your own manifest for the application that targets the pre sp1 CRuntime versions.
  2. You can also deploy the C-Runtime yourself, in the redist folder under x86/x64 you will find the folder of the C-Runtime (Microsoft.VC90.CRT) just copy those folders in the same folder as your exe.
  3. Use the static C-Runtime option, so that the C-Runtime will be used as static lib, its useful if you don't have a lot of dll/exe.
查看更多
登录 后发表回答