Choosing a Deployment Method
Unless your Visual C++ application is self-contained and can be deployed by using a copy command, we recommend that you use Windows Installer deployment. Windows Installer supports installation, repair, and uninstallation, and also supports atomic updating of application files, dependencies, and registry entries.
Because Visual C++ libraries are included in Visual Studio—in the %windir%\system32\ directory—when you develop a Visual C++ application that depends on them, it will run as expected. However, to deploy the application to computers that may not have Visual Studio, we recommend that you ensure that the libraries are installed on those computers together with the application.
In your deployments, you can redistribute any version of a Visual C++ library that's licensed for redistribution. Here are three ways to deploy them:
Central deployment by using redistributable packages, which installs Visual C++ libraries as shared DLLs in %windir%\system32\. Redistributable packages are available for the x86, x64, and ARM platforms (VCRedist_x86.exe, VCRedist_x64.exe, or VCRedist_arm.exe). Visual Studio includes these packages ((VCRedist_x86.exe, VCRedist_x64.exe, or VCRedist_arm.exe) in \Program Files (x86)\Microsoft Visual Studio version\VC\Redist\locale ID\. You can also download them from the Microsoft Download Center. (On the Download Center, search for the "Visual C++ Redistributable Package Visual Studio version and update" that matches your application. For example, if you used Visual Studio 2012 update 4 to build your application, then search for "Visual C++ Redistributable Package 2012 update 4".) For information about how to use a redistributable package, see Walkthrough: Deploying a Visual C++ Application By Using the Visual C++ Redistributable Package.
Central deployment by using merge modules, each of which installs a particular Visual C++ library as a shared DLL in %windir%\system32\ (requires administrator rights). Visual C++ redistributable merge modules are included in Visual Studio, in \Program Files (x86)\Common Files\Merge Modules\. For more information, see Redistributing Components By Using Merge Modules.
Local deployment, in which you obtain particular Visual C++ DLLs from your Visual Studio installation—typically in \Program Files (x86)\Microsoft Visual Studio version\VC\Redist\platform\library\—and install them on target computers in the same folder as the application executable. You can use this deployment method to enable installation by users who don't have administrator rights, or for applications can be run from a network share.
If a deployment uses redistributable merge modules and an installation is run by a user who does not have administrative rights, the Visual C++ DLLs are not installed and the application will not run. Also, for applications that allow installation on a per-user basis but also use merge modules, the libraries are installed in a shared location that impacts all users of the system. In scenarios like these, we recommend that you install the required DLLs in the directory of a particular user's application. When the operating system loads the application, it uses the search order described in LoadLibraryEx
Incorrect deployment of Visual C++ libraries may cause run-time errors during execution of an application that depends on them
We recommend that you avoid static linking when you redistribute Visual C++ libraries. Although static linking almost never significantly improves application performance, it almost always makes servicing more expensive. For example, consider an application that's statically linked to a library that's been updated with security enhancements—the application cannot benefit unless it is recompiled and redeployed. Instead, we recommend that you dynamically link your applications to the libraries they depend on so that the libraries can be updated wherever they're deployed.