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.

Tarma Installer'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 Tarma Installer project. Tarma Installer 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 Tarma Installer, this folder is represented by the <WinSysDir> variable. 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 Tarma Installer project, act as follows.

  1. Select the Project - Files page by clicking on its bullet in the Navigation area.
  2. On the Project - Files page, create the <WinSysDir> installation folder if it isn't already present in the Installation Folders Tree. The easiest method is as follows:

    1. Right-click on Installation Files to open the installation folders context menu;
    2. Choose Insert Special Folder to open its submenu;
    3. Choose System Folder from the submenu.
  3. Add the ActiveX control's DLL file as an installation file to the <WinSysDir> folder. If necessary, refer to the Installing Files topic for information about adding installation files to folders.
  4. Select the newly added ActiveX control file in the Installation Files List to display its settings in the Installation file settings pane, then check that the following options are set:

    If you followed the procedure above, Tarma Installer will have set these options for you and you don't have to change anything.

  5. If the ActiveX control requires installation of a separate license key (as is often the case for developer's versions of ActiveX controls), use the REG file option in the Installation file settings pane to specify the REGEDIT4 file that contains the license key information that must be stored in the registry. You do not have to install this file; Tarma Installer includes it automatically. Note - If the ActiveX control uses a separate license key file instead of registry settings (as is often the case for older controls), simply install that file along with the control proper.
  6. Repeat steps 3-5 as required for other ActiveX controls.

The net result is that the ActiveX controls will be installed and registered when your application is installed, and unregistered and removed when your application is uninstalled. All this is subject to the usual rules for file installation; in particular, Tarma Installer 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).

Note 1 - 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 Tarma Installer 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.

Note 2 - 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. Tarma Installer'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.