Dela via


Redistributing Visual C++ Files

When you deploy an application, you must also deploy the files that are required to support it. If any of these files are provided by Microsoft, check whether you are permitted to redistribute them. To review the Microsoft Software License Terms, see License.htm in the directory where Visual Studio is installed, or on the Visual Studio installation media. To view the "REDIST list" that is referenced in the "Distributable Code" section of the Microsoft Software License Terms for certain editions of Visual Studio, see Distributable Code for Microsoft Visual Studio 2013 and Microsoft Visual Studio 2013 SDK on the Microsoft website. For more information about redistributable files, see Determining Which DLLs to Redistribute and Deployment Examples.

To deploy redistributable Visual C++ files, you can use the Visual C++ Redistributable Packages (VCRedist_x86.exe, VCRedist_x64.exe, or VCRedist_arm.exe) that are included in Visual Studio or use redistributable merge modules, or you can directly install redistributable Visual C++ DLLs in the application local folder, which is the folder that contains the executable application file.

The Visual C++ Redistributable Packages install and register all Visual C++ libraries. If you use one, you must set it to run on the target system as a prerequisite to the installation of your application. We recommend that you use these packages for your deployments because they enable automatic updating of the Visual C++ libraries. For an example about how to use these packages, see Walkthrough: Deploying a Visual C++ Application By Using the Visual C++ Redistributable Package.

If you use a merge module that contains a Visual C++ DLL, you must include it in the Windows Installer package (or similar installation package) that you are using to deploy the application. For more information, see Redistributing Components By Using Merge Modules. For an example, see Walkthrough: Deploying a Visual C++ Application By Using a Setup Project, which also shows how to use InstallShield Limited Edition to create an installation package.

Potential Run-Time Errors

If a Visual C++ library DLL is not reachable and Windows cannot load it for your application, this message may be displayed: This application has failed to start because MSVCR<version number>.dll was not found. Re-installing the application may fix this problem.

To resolve this kind of error, make sure that your application builds correctly and that Visual C++ libraries are correctly deployed on the target system. For more information, see Understanding the Dependencies of a Visual C++ Application.

Title

Description

Redistributing Components By Using Merge Modules

Describes how to use Visual C++ redistributable merge modules to install the Visual C++ runtime libraries as shared DLLs in the %windir%\system32\ folder.

Redistributing Visual C++ ActiveX Controls

Describes how to redistribute an application that uses ActiveX Controls.

Redistributing Database Support Files

Discusses how to redistribute support files for Data Access Objects (DAO) and the database technologies in the Microsoft Data Access SDK.

Redistributing the MFC Library

Describes how to redistribute an application that uses MFC.

Redistributing ATL and OLE DB Templates

Describes how to redistribute an application that uses ATL and OLE DB templates.

Deployment Examples

Links to examples that demonstrate how to deploy Visual C++ applications.

Deploying Native Desktop Applications (Visual C++)

Introduces Visual C++ deployment concepts and technologies.