VS2010 Setup Project with C++ 2008 Redistributable

2019-08-29 07:58发布

Here is the situation:

  • I have a Visual Studio 2010 Setup project which installs a C# executable
  • The installation includes a C# dll that references a C++ dll
  • The C++ dll requires the C++ 2008 libraries

The problem is that it is very easy to make the setup project install the C++ 2010 libraries, but I am not having much luck trying to install 2008.

  • For 2010, it is as simple as selecting C++ 2010 in the Properties > Prerequisites section of the project. 2008 is not an option.
  • I have found much documentation about using merge modules to install C++ redistributables. However, in the C:\Program Files (x86)\Common Files\Merge Modules directory of my machine, I only have C++ 2010 merge modules. I have not been able to find the C++ 2008 merge modules available for download from any reputable source.
  • I can download the redistributable installer easily enough, but I do not know how to make the setup project use it.
  • I found this MSDN article on creating bootstrapper packages. Hopwever, the Bootstrapper Manifest Generator only seems to work for VS2008 and VS2005 (see comments).

I do not have the authority/ability to do any of the following, which I believe could resolve the issue:

  • Install VS2008 to get the correct merge modules
  • Use a different installer program, like InstallShield.
  • Re-compile the C++ dll to use the 2010 libraries.

If anyone has encountered and resolved this issue before, I welcome your help.

2条回答
做自己的国王
2楼-- · 2019-08-29 08:26

In order to add C++ 2008 redistributables as prerequisites in VS 2010, I found the following steps to be effective:

  1. Determine the product key for the redistributable. There is a good list here: http://blogs.msdn.com/b/astebner/archive/2009/01/29/9384143.aspx
  2. Add the installation executable and corresponding xml files to the bootstrapper directory (C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages), as explained here: http://insomniacgeek.com/clickonce-4-0-package-for-the-c-2008-sp1-redist-atl-security-update/
  3. Restart VS, and check the prerequisites list for the setup project. All should now be present.

Also, as an aside, I discovered that unless you take the steps outlined in this question: Visual C++ 2010 Runtime Libraries prerequisite keeps popping up on a VS 2010 created installer your C++ 2010 redistributables will always try to install, even if they are already present.

查看更多
叼着烟拽天下
3楼-- · 2019-08-29 08:38

The merge modules come along with VS2008 and a VS2008 license. Whoever created the C++ dll which depends on the 2008 runtimes probably has a license for VS2008. You can ask them to provide it to you - it's legal to do so.

查看更多
登录 后发表回答