This topic is relevant for the following:
Product(s): ArcGIS Desktop: All
Version(s): 9.0, 9.1, 9.2
Language(s): VB6
Experience level(s): Insert comma-separated list of experience levels
here
This topic describes how you can package your VB6 components and deploy them to other users.
Exactly what must be packaged depends on the type of development but you should also consider including the following:
It is important not to package any of the files within the ArcGIS installation. If you did this and the user uninstalled your software, there would be a danger that some of the files ArcGIS requires to function correctly might be removed.
The only requirement for installation on the target machine is that it must have ArcGIS Desktop installed.
There are two popular methods for packaging and deploying COM DLLs.
It is possible to simply give the user a copy of the DLL with instructions on how to register the DLL on the system. Normally, this involves the use of the Windows Utility RegSvr32.EXE. To register a DLL, the user must type a command line similar to that below.
RegSvr32 MyServer.DLL
To unregister a server, the command is run with the /U switch.
RegSvr32 /U MyServer.DLL
A dialog box appears when the operation completes. When running regsvr32 on several files, it is advisable to run it in silent mode with the /S switchthis disables the dialog box.
Depending on how the DLL was developed, registering the DLL may not be the only task. The coclasses contained with the DLL may have to be added to the appropriate component categories. Other alternatives include the facility in the applications for commands; the Category Manager utility application; and the ComponentCategoryManager coclass, which is part of the framework subsystem or the creation of a registry script.
Included in the /ArcGIS/DeveloperKit/Tools directory is a small registry script called reg_in_menu.reg. The registry script adds options to the Windows Explorer context menu when DLL, EXE, OLB, and OCX files are selected. The five options provide support for registering and unregistering the files. The context menu is shown in the figure below.
After the server is registered on the system, registry scripts provide a good mechanism for adding supplemental information about the server to the registry, including the component category information. These registry scripts can either be written by hand or generated from the Compile and Register Visual Basic add-in. A sample script is shown below. The lines beginning "[HKEY" must all be on one line in the file.
REGEDIT4
; This Registry Script enters CoClasses Into their appropriate Component Category ; Use this script during installation of the components
; Coclass: prjDisplay.ZoomIn ; CLSID: {FC7EC05F-6B1B-4A59-B8A2-37CE33738728} ; Component Category: ESRI Mx Commands [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{FC7EC05F-6B1B-4A59-B8A2-37CE33738728}\Implemented Categories\{B56A7C42-83D4-11D2-A2E9-080009B6F22B}]
; Coclass: prjDisplay.ZoomOut ; CLSID: {2C120434-0248-43DB-AD8E-BD4523A93DF8} ; Component Category: ESRI Mx Commands [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{2C120434-0248-43DB-AD8E-BD4523A93DF8}\Implemented Categories\{B56A7C42-83D4-11D2-A2E9-080009B6F22B}
Most setup packages work well with registry scripts. For example, the Visual Basic Package and Deployment wizard provides a straightforward way of creating setup programs. To create a setup program for your server, follow these steps:
This is just one method of packaging COM developments. Whatever method you use, the setup procedure must be as simple as possible and involve as few decisions as possible to avoid user frustration.