60001388 Using vdAnyCPUSxS.zip to create a ClickOnce installation

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


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


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.



For version 8.8001.1.0 and up you need to check at the end of this page. For version 7.7015 and up you need to check the diagram near the end of this article and also check the changes you need to make in the following procedure.


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


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. 
For version 7.7015 and UP!!
You need to create two different folders the x64 (as previous) and the x86 that will contain the files slapi.dll, xFiles.dll, vdfOpen.dll vdrawgl.dll and the folders Microsoft.VC90.CRT, Microsoft.VC90.MFC, Microsoft.VC100.CRT that are placed at the "root" of the vdAnyCPUSxS.zip.


UPDATE for version 8.8001.1.0 and up

Microsoft VC90 and VC100 files and folders are not needed or used any more from VDF version 8.8001 and up so don't add them as above. Instead the Microsoft's Visual C++ 2010 and 2017 Redistributables are necessary.

These Microsoft's Visual C++ 2010 and 2017 Redistributables are not provided by MS as side-by-side and you need to download them  from MSDN (links below) as standalone setups and install them to the system, if they are not already installed. For x86 (32bit) operating systems you need only to download and install the x86 version of these setups, and for x64 (64bit) systems is recommended to download and install both the x86 and the x64 version of these redistributables. The links are:

- Microsoft Visual C++ 2010 SP1 Redistributable Package (x86) from https://www.microsoft.com/en-us/download/details.aspx?id=8328
- Microsoft Visual C++ Redistributable for Visual Studio 2017 (x86) from https://aka.ms/vs/15/release/vc_redist.x86.exe

- Microsoft Visual C++ 2010 SP1 Redistributable Package (x64) from https://www.microsoft.com/en-us/download/details.aspx?id=13523
- Microsoft Visual C++ Redistributable for Visual Studio 2017 (x64) from https://aka.ms/vs/15/release/vc_redist.x64.exe

After installing these redistributables then you can run your ClickOnce installation. Note that during installation of these redistributables and your ClickOnce VDF installation you need to have all applications closed.

Note that .NET Framework 2.0 or 3.5 is also necessary.

Send comments on this topic.