Choose a deployment method (original) (raw)

We recommend that you use Windows Installer for deployment. Windows Installer supports installation, repair, and uninstallation, and also supports atomic updating of application files, dependencies, and registry entries. Unless your Visual C++ application is self-contained and can be deployed by using a copy command, use Windows Installer.

Because Visual C++ libraries are installed in the %windir%\system32\ directory by the Visual Studio installer, when you develop a Visual C++ application that depends on them, it will run as expected. However, most computers don't have Visual Studio installed. To deploy the application to these computers, we recommend that you ensure that the libraries are installed together with your application.

Redistributable Visual C++ libraries

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:

If a deployment uses Redistributable merge modules, the user who installs the app must have administrative rights. Otherwise, the Visual C++ DLLs aren't installed and the application might not run. Application installers that allow installation on a per-user basis install the libraries in a shared location that impacts all users of the system. You can use local deployment to install the required Visual C++ DLLs in the directory of a particular user's application. This approach won't affect other users or require administrator rights. Because it can create serviceability issues, we don't recommend local deployment of Visual C++ Redistributable DLLs.

Incorrect deployment of Visual C++ libraries may cause run-time errors during execution of an application that depends on them. When the operating system loads the application, it uses the search order described in LoadLibraryEx.

Dynamic linking is better than static linking

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 a statically linked application with a library that's been updated with security enhancements. The application can't benefit unless it's recompiled and redeployed. Instead, we recommend that you dynamically link your applications to the libraries they depend on. Then the libraries can be updated wherever they're deployed.

See also

Deploying desktop applications
ClickOnce security and deployment
Deployment examples