Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2005
Visual Studio
Visual C++
Deployment
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:

Want more? Here are some additional resources on this topic:

Visual C++ 
Deployment (C++) 

Deployment is the process by which you distribute a finished application or component to be installed on other computers. Deployment is a multi-stage process that starts when an application is created on a developer's computer and ends when it is installed and ready to run on a user's computer.

Visual Studio provides two different technologies for deploying Windows applications: ClickOnce deployment or Windows Installer deployment.

  • ClickOnce can be used to deploy C++ applications that target the Common Language Runtime (mixed, pure, and verifiable assemblies). You can use Windows Installer to deploy a managed application also, but ClickOnce takes advantage of .NET Framework security features (such as manifest signing) and is therefore preferred over Windows Installer deployment. ClickOnce does not support deployment of native C++ applications. For more information, see ClickOnce Deployment for Visual C++ Applications.

  • Windows Installer technology can be used for deploying both native C++ applications and C++ applications that target the Common Language Runtime.

For a detailed comparison of ClickOnce and Windows Installer deployment, see Choosing a Deployment Strategy.

This section discusses how to ensure that a native Visual C++ application runs on any computer that provides a supported target platform, which files you need to include in your installation package, and what are the recommended ways to redistribute the Visual C++ components on which your application depends.

If you are familiar with the deployment process and are primarily interested in learning about changes made in Visual Studio 2005, you may start with Choosing a Deployment Method. For examples of deployment please see, Deployment Examples.

The following topics discuss deployment of Visual C++ applications in more detail.

In This Section

See Also

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Distributing your app      Ben Anderson MSFT   |   Edit   |  

The best deployment method in most cases is to use the included Merge Modules in your setup .msi to distribute the Visual C++ libraries.  This is the safest method and allows Windows Side-by-Side to manage security updates and versioning rules for the libraries.  It also has the advantage that you are not installing two separate entries into Add/Remove Programs as you would using vcredist*.exe.  A customer in that scenario could break your application by simply removing the vcredist entry from Add/Remove programs since it does not appear to be part of your app.  Additionally, it allows Windows SxS to manage the shared usage scenario - otherwise, when would you know whether to remove the libraries on uninstall?  You never know if another app was using vcredist to deploy and therefore if your uninstall tried to remove it you would be breaking the user's other app.  Windows SxS deploylment manages the reference counting for you - assuming you install using MSMs inside your MSI. 

 

To create an installer with VS is trivial:

1) Create a new Setup Project

2) Add files to be deployed

3) In many cases the VC libraries dependencies will be detected and the correct MSMs added.  If not, just right click the project and click Add->Merge Modules and select the MSMs for the libraries and architectures you are deploying on. 

4) Hit build.  Your setup will now install the VC libraries required for execution into WinSXS which will manage them for you. 

Warning - This only works with Windows Installer 3 and later      jorendorff   |   Edit   |  
The approach described by Ben Anderson above is indeed the recommended approach--but if you go that route, your MSI will not work on versions of Windows Installer before version 3.0! This means you will be unable to install on unpatched Windows 2000 and Windows 2003 Server systems. The error is: "There is a problem with this Windows Installer package. A DLL required for this install to complete could not be run. Contact your support personnel or package vendor." (In the msiexec log, you'll see "Error 1723. There is a problem with this Windows Installer package. A DLL required for this install to complete could not be run. Contact your support personnel or package vendor. Action SxsInstallCA, entry: CustomAction_SxsMsmInstall, library: C:\WINDOWS\Installer\MSIA.tmp".)

Workaround: Install Windows Installer 3 or later before installing your MSI. It's a pain, but in most cases this is the best of a bad set of options.
Try SP1 redist      Ben Anderson MSFT   |   Edit   |  
I believe the issues mentioned by jorendorff were addressed in the SP1 release of VS2005. If I'm wrong, someone please correct me.
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker