Installing and Registering ActiveX Controls
ActiveX controls are in-process COM servers that are packaged as dynamic link libraries (DLLs) with an .ocx file name extension. To make their services available to applications, they must be registered with Windows. By convention, each ActiveX control's DLL file contains a special entry point DllRegisterServer that performs this registration upon request. A second entry point, called DllUnregisterServer, is used to roll back the registration when the ActiveX control is removed from the system.
InstallMate's Setup program knows how to register and unregister ActiveX controls. All necessary functionality is built into Setup.exe; no external helper programs such as regsvr32.exe are required. All that you need to do is add the ActiveX control's DLL file to your InstallMate project. InstallMate automatically recognizes ActiveX controls and will mark them for registration as required.
ActiveX controls are typically installed as shared files in the Windows System folder. Within InstallMate, this folder is available as Windows\System (32-bit) on the Files and folders project page. Unless you know what you are doing and have a very good reason to do otherwise, we recommend that you follow this convention.
How to add an ActiveX control to your project
To add an ActiveX control to your InstallMate project, act as follows.
- Select the Files and folders project page in the navigation panel on the left.
On the Files and folders project page, click on the Windows\System (32-bit) folder.
- Add the ActiveX control's DLL file as an installation file to the Windows\System (32-bit) folder. If necessary, refer to the Installing Files topic for information about adding installation files to folders.
Select the newly added ActiveX control file to display its attributes in the File attributes pane, then check that the following options are set:
- Install action - Install if newer
- Remove action - Remove if installed
- Registration - Use DllRegisterServer
- Shared file - checked
If you followed the procedure above, InstallMate will have set these options for you and you don't have to change anything.
- If the ActiveX control uses a separate license key file, simply install that file along with the ActiveX DLL file. Be sure to assign both files to the same component, so they will be installed and removed together
- If the ActiveX control uses license key information in the registry and you have the required .reg file with the registry information, do the following.
- Go to the Registry project page.
- Right-click on the Registry tree node and select Import RegEdit File from the popup menu.
- Browse to the required .reg file for the ActiveX control and select it. In the Bulk Import dialog box that appears, select Assign to existing component and select the same component as the ActiveX DLL file.
- Repeat steps 3-6 as required for other ActiveX controls.
The net result is that the ActiveX controls will be installed and registered when their component or your product as a whole is installed, and unregistered and removed when their component or your product as a whole is uninstalled. All this is subject to the usual rules for file installation; in particular, InstallMate will correctly handle updates of existing copies of an ActiveX control (based on a version check) and will only remove and unregister the control if no other applications use it. This remains true even if the SharedDlls reference count of an ActiveX control is unreliable (as is often the case with third-party controls).
Notes
- ActiveX controls are a special kind of in-process COM servers. (What makes them ActiveX controls is not so much the fact that they are in-process COM servers, but rather the COM interfaces that they implement.) As far as installation is concerned, they are just like any in-process COM server and InstallMate therefore treats them the same, except for their Object Caches (see next note). Refer to Installing and Registering COM Servers and Type Libraries for a general discussion of COM server installation.
- Recent versions of Windows create Object Cache files for ActiveX controls. These files have the same name as the ActiveX control's DLL file, but an .oca file name extension instead of .ocx. InstallMate's Setup program automatically removes these cache files when the ActiveX control is installed (to force Windows to re-create the cache) and when the ActiveX control is removed from the system. You should not install these .oca files yourself.