简体   繁体   中英

VS2010 Setup Project with C++ 2008 Redistributables?

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.

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM