60001388 Using vdAnyCPUSxS.zip to create a ClickOnce installation

Article 60001388
Type HowTo
Product Engine
Version 6
Date Added 5/5/2011
Fixed (5/5/2011)
Submitted by Massimo Endrighi

Summary

How can I create a ClickOnce installation using the 6020 version ?

Solution

This How-To will explain to you how to create a project with VS2005/2008/2010 as Any CPU build that will also contain all the necessary files for redistributing this project as a ClickOnce installation. Note that this how-to applies to 6020 and above versions. The idea behind this is simple; create the project and add to the build folder all the necessary files for the VDF. This is done using all the files inside the vdAnyCPUSxS.zip that is distributed with every VDF version.

 

STEPS to create a Click Once installation
 
1) Create a new windows forms project in a folder like c:\samples\MyApp1 and in the empty form add the vdFramed control

 
Download form our website the vdAnyCPUSxS.zip that is the same version and build date as the VDF components installed in your system. Extract the contents of this zip file in the same folde as your solution, like :
 
After inserting the vdFramed control in the form in the Project's References a lot of VDF libraries are added automatically. Just remove them all and leave just the .NET dlls, like :
 
Right-click on the "References" and click "add.." and then use Browse and select all VDF dlls from the vdAnyCPUSxS.zip that were extracted earlier :
 
Set all of them to Copy Local True and Specific Version False
 
Now it is time to add the other dlls and files that VDF needs, so right-click in the project and click "Add" and "Existing Item ..." 
 
Choose vdfopen.dll and xFiles.dll and then "Add as Link". These 2 dlls are in the folder where the vdAnyCPUSxS.zip is extracted : 
 
Create inside the Project some folders and named them x64, Microsoft.VC90.CRT (this folder contains the x86 CRT dlls), Microsoft.VC90.MFC  (this folder contains the x86 MFC dlls) and images. Inside the x64 create 2 more folders named  Microsoft.VC90.CRT  (this folder contains the x64 CRT dlls) and Microsoft.VC90.MFC  (this folder contains the x64 MFC dlls). These folders are the same as the folders inside vdAnyCPUSxS.zip. Do not add the *.manifest files that are inside the MFC/CRT folders.

 
Add also the vdfopen64.dll and xFiles64.dll in the x64 folder with "Add as Link" and make sure that the Build Action is set Content and Copy to Output Directory is set Copy Always

 
Like:

 
Add the images also, like :

 
And at last the commands.txt, Menu.txt, vdres.txt and if you have translated the resources use your own versions (translated) here and also the vdFormsRes.dll. Here you need to add also the OpenDesign's Alliance Teigha libraries (dlls) if you are member of OpenDesign Alliance. If you are member of OpenDesign Alliance and you do not know which dlls are needed then contact us.
 
Then set the project to "release" and Build->clean, Build->Rebuild it. In the "Release" folder you will find your exe and ALL the VDF files of the vdAnyCPUSxS.zip. You just need to copy this folder to any machine and if .NET 2.0/3.5/4.0 is installed your project will run fine. This is the Side-by-Side "installation of this sample application and VDF libs.
 
   
Further STEPS to create a ClickOnce installation
 
Right-click on the project and click on "Publish..." 
 
Select the location where this setup will be created and click Next to set further preferences. At the end click Finish. You can find more information on Microsoft's ClickOnce technology in MSDN like : http://msdn.microsoft.com/en-us/library/31kztyey(v=vs.80).aspx
 
Now the output folder will contain some files and folders like below. In any machine that has .NET 2.0/3.5/4.0 you can click on MyApp1.application in order to install and run this application. 

 

Send comments on this topic.