How do I include Visual C++ 2010 redistribuable in

2019-04-29 01:25发布

问题:

When my application runs, it requires that Microsoft Visual C++ 2010 Redistributable Package (x86) is installed. How do I include it in my app setup?

I use the setup wizard of Visual Studio 2010 to create it.

回答1:

I would include the VC++ 2010 merge module into the setup project. Information on redistribution via merge module can be found in this MSDN article. General resitribution is available from the parent article.



回答2:

Prerequisites Dialog Box

This dialog box specifies which prerequisite components are installed, how they are installed, and which order the packages are installed.

To access this dialog box, select a project node in Solution Explorer, and then, on the Project menu, click Properties. When the Project Designer appears, click the Publish tab. On the Publish page, click Prerequisites. For Setup projects, on the Project menu, click Properties. When the Property Pages dialog box appears, click Prerequisites.

it's all explained here, follow the suggested steps then add VC++ 2010 runtime as prerequisite. Done!



回答3:

Take a look at the following articles. They explain how to include requisite resources in a setup project.

  • http://msdn.microsoft.com/en-us/library/ms235317%28v=vs.90%29.aspx
  • http://msdn.microsoft.com/en-us/library/k3bxs9z6.aspx


回答4:

If you're using a deployment project, I would recommend using Merge Modules.

Redistributing By Using Merge Modules

Visual Studio installs several merge modules for each Visual C++ component that may be redistributed with your application. They may be found in the Program Files\Common Files\Merge Modules folder. Each of these merge modules may be used to deploy Visual C++ DLLs to the target system.

Adding merge modules to your project is fairly straight forward.

To add a merge module to a deployment project

  1. Select the deployment project in Solution Explorer.
  2. On the Project menu, point to Add, and then click Merge Module.
  3. In the resulting Add Modules dialog box, browse to the location of the merge module that you want to add.