Microsoft Office 2000/Visual Basic Programmer's
Guide |
|
Distributing COM Add-ins Created with Visual Basic 5.0
To create a setup program for an add-in created with Visual Basic 5.0, you have a couple of options:
-
You can create a custom setup program that copies the DLL to the user's computer, registers it by calling Regsvr32.exe, and writes the additional subkeys needed for a COM add-in to the Windows registry. For more information about creating a custom setup program, see Chapter 2, "Designing and Deploying Office Solutions."
-
You can run the Visual Basic 5.0 Setup Wizard on the add-in project. The Visual Basic 5.0 Setup Wizard will create a setup program that installs and registers the add-in DLL and any other necessary files. However, since the Visual Basic 5.0 add-in doesn't contain the add-in designer, you must take additional steps to add a subkey to the registry on the user's machine so that the COM add-in appears in the COM Add-ins dialog box.
There are two ways to write information to the registry when a setup program runs:
-
Use the Visual Basic 5.0 Setup Toolkit to modify the setup project, and call the functions that write the new subkey to the registry when the setup program runs.
-
Include a .reg file with the setup program that contains the necessary registry information, and modify the Setup.lst file created by the Visual Basic 5.0 Setup Wizard so that the information in the .reg file is transferred to the user's registry.
An in-depth discussion of these techniques is beyond the scope of this book. For more information, see the documentation included with Visual Basic 5.0.