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 ExpertInstall, this folder is available as Windows Volume\Windows\System32 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 Tarma ExpertInstall project, act as follows.

  1. Select the Files and Folders project page in the navigation panel on the left.
  2. On the Files and Folders project page, click on the Windows Volume\Windows\System32 folder.

  3. Add the ActiveX control's DLL file as an installation file to the Windows Volume\Windows\System32 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 to display its attributes in the File attributes pane, then check that the following options are set:

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

  5. 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
  6. 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.
    1. Go to the Registry Keys and Values project page.
    2. Right-click on the Registry tree node and select Import RegEdit File from the popup menu.
    3. 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.
  7. 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, 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.