|
VCX library. Deployment |
News |
|
IntroductionTo deploy your application which uses VCX library you need to register the library on a target computer. Usually you accomplish this by running regsvr32.exe utility either automatically or manually: regsvr32.exe VCProX.ocx If you purchase the Enterprise license of the VCX library, you may use the silent registration approach. This means applying your VCX registration key behind the scene and not displaying the "Enter your registration key" dialog. To accomplish this you have either to... 1) copy the VCProX.lic file with the registration key to Windows\System32 directory before running the regsvr32.exe (/s - silent mode): regsvr32.exe VCProX.ocx /s(VCProX.lic is deleted after the registry key is applied) 2) ...or passing the registration key as a regsvr32.exe parameter (/i:your_license_key): regsvr32.exe "c:\myapplication\VCProX.ocx" "/i:123456789ABCDEF" /s VCX library saves the registration key into Windows Registry. The registration key is stored in the encoded format, which also prevents re-using it on another computer without proper installation. These tasks can be automated with your software installer. Some are mentioned below.ClickOnce (Visual Studio 2005)In Visual Studio 2005 you can use ClickOnce technology to publish your solution to the Internet or your local network. In this case you have to use the "isolated" VCX library reference. Select the AxVCProX reference in the Solution Explorer window, activate the Properties window and set the Isolated property to True:
You can also use a silent registration approach provided by the VCX Enterprise license. Create the VCProX.lic file, put your registration key there and add this file to your project. Select the VCProx.lic file in the Solution Explorer window, activate the Properties window and set the Build Action property to Content: (this feature is only available in the latest beta version now)
When installing your application on a target computer you may get the following error: "Unable to install or run the application. The application requires that assembly stdole Version 7.0.3300.0 be installed in the Glabal Assembly Cashe (GAC) first". In this case, please open your project properties, the Publish tab, click the Application files button and change the stdole.dll settings from Prerequisite to Include:
InnoSetupIf you use InnoSetup installer, you can use the following script to deploy the VCX library (deploy the VCProX.lic file containing your registration key if you use the silent registration approach supported by the Enterprise license): Download the script file
[Files]
; VCX library files: .ocx + registration key
Source: "VCProX.ocx"; DestDir: "{app}"; Flags: regserver;
Source: "VCProX.lic"; DestDir: "{sys}";
; Your application files
Source: "App.exe"; DestDir: "{app}";
If you use InnoSetup version 5.1.11 or higher, you may experience a problem registering the VCX library on Windows Vista. This happens because of the conflict between the VCX library protection and the ultimate security of regsvr32.exe utility on Windows Vista. In order to overcome this problem please do the following:
- do not automatically register VCProX.ocx;
[Files]
; VCX library files: .ocx + registration key
Source: "VCProX.ocx"; DestDir: "{app}";
Source: "VCProX.lic"; DestDir: "{sys}";
; renamed regsvr32.exe
Source: "regvcx.exe"; DestDir: "{tmp}";
; Your application files
Source: "App.exe"; DestDir: "{app}";
[Run]
; register the library
Filename: "{tmp}\regvcx.exe";
Parameters: """{app}\VCProX.ocx"" /s"
|