Freigeben über


Redistributing Visual C++ Libraries

While deploying an application developed on VS 2005, we will have to make sure that the target machine has the Visual C++ libraries that are required to run this application. If we suspect that the target machine might not have the VC++ libraries already, all we need to do is redistribute the VC++ files along with the application.

 

I had earlier discussed a typical scenario where we would have to redistribute the VC++ libraries. Here is the link.

Here are the various deployment options for redistributing the VC++ libraries.

Options:

  1. Use Visual C++ Redistributable Package (VCRedist*.exe)
  2. Use the MSM merge modules
  3. App local deployment (Private Assembly install under the application directory)

1. Use Visual C++ Redistributable Package (VCRedist*.exe)

The Visual C++ Redistributable Package (VCRedist_x86.exe, VCRedist_x64.exe, VCRedist_ia64.exe) is a standalone exe that installs all the VC++ libraries to the WinSXS directory. It is present in the following path after you have installed VS 2005 in your machine: %PROGDIR%\Microsoft Visual Studio 8\SDK\v2.0\Bootstrapper\Packages\vcredist_x86\vcredist_x86.exe

The VC++ 2005 Redistributable Package is released to the web and can be downloaded from the Microsoft site. Refer the "Links for reference" section below for the links.

 

2.    Use the MSM merge modules

Merge Modules can be used to install the VC++ libraries to the WinSxS directory. The various merge modules can be located at %PROGDIR%\Common Files\Merge Modules

These MSMs can be merged into the application setup project.

Here is a quick look at the various merge modules present:

ATL

X86 - Microsoft_VC80_ATL_x86.msm, policy_8_0_Microsoft_VC80_ATL_x86.msm

IA64 - Microsoft_VC80_ATL_x86_ia64.msm, policy_8_0_Microsoft_VC80_ATL_x86_ia64.msm

X64 - Microsoft_VC80_ATL_x86_x64.msm,policy_8_0_Microsoft_VC80_ATL_x86_x64.msm

CRT

X86 - Microsoft_VC80_CRT_x86.msm, policy_8_0_Microsoft_VC80_CRT_x86.msm

IA64 - Microsoft_VC80_CRT_x86_ia64.msm, policy_8_0_Microsoft_VC80_CRT_x86_ia64.msm

X64 - Microsoft_VC80_CRT_x86_x64.msm, policy_8_0_Microsoft_VC80_CRT_x86_x64.msm

MFC

X86 - Microsoft_VC80_MFC_x86.msm, policy_8_0_Microsoft_VC80_MFC_x86.msm

IA64 - Microsoft_VC80_MFC_x86_ia64.msm, policy_8_0_Microsoft_VC80_MFC_x86_ia64.msm

X64 - Microsoft_VC80_MFC_x86_x64.msm, policy_8_0_Microsoft_VC80_MFC_x86_x64.msm

OpenMP

X86 - Microsoft_VC80_OpenMP_x86.msm, policy_8_0_Microsoft_VC80_OpenMP_x86.msm

IA64 - Microsoft_VC80_OpenMP_x86_ia64.msm, policy_8_0_Microsoft_VC80_OpenMP_x86_ia64.msm

X64 - Microsoft_VC80_OpenMP_x86_x64.msm, policy_8_0_Microsoft_VC80_OpenMP_x86_x64.msm

MFCLOC

X86 - Microsoft_VC80_MFCLOC_x86.msm, policy_8_0_Microsoft_VC80_MFCLOC_x86.msm

IA64 - Microsoft_VC80_MFCLOC_x86_ia64.msm, policy_8_0_Microsoft_VC80_MFCLOC_x86_ia64.msm

X64 - Microsoft_VC80_MFCLOC_x86_x64.msm, policy_8_0_Microsoft_VC80_MFCLOC_x86_x64.msm

Here is a good link on how to deploy using a setup and deployment project.

 

Note that Debug DLLs cannot be redistributed. They are shipped with VS for debugging purposes. Refer this link for details on redistributing using Merge Modules. 

3. App local deployment (Private Assembly install under the application directory)

The VC++ libraries can also be installed under the application directory. The required files are placed at %PROGDIR%\Microsoft Visual Studio 8\VC\Redist

The required libraries can be copied to the application directory. (we would need to copy the sub-directories)

Here is a good link for more details on app local deployment

 

 

Comparison:

A quick comparison of the three options:

VCRedist.exe

Merge Modules (*.MSM)

App Local Deployment

Setup

Application does not require setup project.

Application should have its own setup project.

XCopy deployment.

Required Libraries

We will have to install all the VC++ libraries irrespective of whether they are used by the application.

Deploy only the assemblies that the application depends on.

Deploy only the assemblies that the application depends on.

Administrative privileges

Requires

Requires

Does not require

Others

Package has to be installed once on the machine and all applications can make use of the libraries present in WinSxS.

MSMs have to be installed once on the machine and all applications can make use of the libraries present in WinSxS.

Duplication of the VC++ libraries in the case of multiple applications that is present in different directories.

Edit: Added new links for downloading Microsoft Visual C++ 2005 SP1 Redistributable Packages in the 'Links for reference' section.

 

 

Links for reference:

Comments