3 out of 11 rated this helpful - Rate this topic

ClickOnce Deployment for Visual C++ Applications 

Visual Studio provides two different technologies for deploying Windows applications: ClickOnce deployment or Windows Installer deployment. For a detailed comparison of ClickOnce and Windows Installer deployment, see Choosing Between ClickOnce and Windows Installer

ClickOnce Deployment in C++

The Visual C++ development environment does not directly support deployment of Visual C++ projects with ClickOnce, but tools are available to use it.

NoteNote

Visual Studio does support ClickOnce in the Visual C# and Visual Basic development environments. If your Visual C++ project is a dependency of a Visual C# project, you can publish the application (including its dependencies) using ClickOnce deployment from the Visual C# development environment.

To deploy a Visual C++ application using ClickOnce, you first have to build a ClickOnce Application Manifest and a ClickOnce Deployment Manifest using the Manifest Generation and Editing Tool (Mage.exe) or its graphical user interface version (for information, see Manifest Generation and Editing Tool, Graphical Client (MageUI.exe)).

You first use Mage.exe to build the application manifest; the resulting file will have the extension .manifest. You then use Mage.exe to build the deployment manifest; the resulting file will have the extension .application. You then sign the manifests.

The application manifest must specify the target processor (x86, x64, or Itanium). See Deploying 64-bit Applications for information on these options.

Also, the name of the application and deployment manifests must be different from the name of the C++ application. This avoids conflict between the application manifest created by Mage.exe and the external manifest that is part of the C++ application.

Your deployment will need to install any Visual C++ libraries on which your application depends. To determine the dependencies for a particular application, you can use depends.exe or the DUMPBIN utility with the /DEPENDENTS option. For more information on dependencies, see Understanding Dependencies of a Visual C++ Application. You might need to run VCRedist.exe; this utility installs Visual C++ libraries on the target computer.

You may also need to build a bootstrapper (prerequisites installer) for your application to deploy prerequisite components; for information on the bootstrapper, see Adding Custom Prerequisites.

For a more detailed description of the technology, see ClickOnce Deployment. For a detailed example of ClickOnce deployment, see Walkthrough: Deploying a ClickOnce Application Manually.

See Also

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
ClickOnce and MFC dlls

This is probably simple for you chaps.
I have a VC++ program which requires the MFC and CRT dlls to run.
I compile the program using cl/clr.
I generate signed application and deployment manifests using mage.
I am trying to deploy it using ClickOnce.
I have used ClickOnce successfully in a previous version of my program which didn't need the MFC components.
My ClickOnce install fails on a clean target with an error (eg) "Cannot copy mfc90.dll - file already exists"
I believe it's because it (a) reads the microsoft.vc90.mfc manifest, and then installs the dlls' referenced in this manifest; and then (b) tries to

copy the dll's again because they are seperately defined in the ClickOnce application manifest.
If I don't include the MFC dll's (eg mfc90.dll) in the distribution folder, then the install fails because it can't find the required components of

microsoft.vc90.mfc.
And if I do include the dll's it tries to copy them twice and fails!
All help appreciated...

ClickOnce Deployment for Unmanaged Code (C++, VB6, etc)
Here's an example of how to deploy C++ apps via ClickOnce from inside Visual Studio by piggy-backing on C#:


Enjoy,
Michael
Advertisement