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.
To add an ActiveX control to your Tarma Installer project, act as follows.
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:
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.
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.