Self-Registering COM Servers

InstallShield 2020

Project:This information applies to the following project types:

Basic MSI
DIM
InstallScript MSI
Merge Module
MSI Database
MSM Database

If you have a COM server that is self-registering, you can call the COM server’s self-registration functions at installation time to register the COM server on the target machine.

InstallShield supports different methods for indicating that a COM-related file (.ocx, .dll, .exe, .tlb, or .olb) is self-registering:

You can specify that a particular file is self-registering. For more information, see File Properties Dialog Box.
You can specify that a dynamic link is self-registering. For more information, see Dynamic File Link Settings Dialog Box.

Tip:If the self-registering file is part of a 64-bit component, 64-bit self-registration occurs on the target machine. For more information, see Targeting 64-Bit Operating Systems.

When you mark a COM server .dll or .ocx file as self-registering, the file’s own registration function (DllRegisterServer) is called during installation to register it with the target system, and its unregistration function (DllUnregisterServer) is called during uninstallation to unregister the file.

Registering a file with DllRegisterServer has several limitations:

COM information registered with DllRegisterServer cannot be advertised.
Because DllRegisterServer is .dll code, its effects cannot reliably be rolled back during a failed installation.
DllRegisterServer cannot distinguish between per-user and per-machine COM information.
Self-registration may require COM servers to be registered in a particular order. InstallShield self-registration (ISSelfReg) enables you to overcome this limitation.
DllRegisterServer generally does not register a file with a relative path, as needed by systems that support side-by-side sharing.

In addition, if you use any type of self-registration in a patch, the patch will not be uninstallable.

When you mark one or more files as self-registering, InstallShield adds data to a table of your .msi database, and adds some custom actions related to self-registration to your installation Execute sequence. For details, see Self-Registration Methods and InstallShield Self-Registration (ISSelfReg).

Per-machine self-registration information is stored in the registry key HKLM\SOFTWARE\Classes\CLSID, and per-user self-registration information is stored in HKCU\SOFTWARE\Classes\CLSID; a merged view of the data is available under HKCR\CLSID.

See Also