Why the SelfReg Table Should Not be Used in the Installer Database

Why the SelfReg Table Should Not be Used in the Installer Database
WiseUser's picture

The SelfReg table contains information about modules that need to be self registered. The installer calls the DllRegisterServer function during installation of the module; it calls DllUnregisterServer during uninstallation of the module. The installer does not self register EXE files.

If you're thinking of using the SelfReg table in the Installer Database, here are a few reasons to rethink your strategy.

  1. Rollback of an installation with self-registered modules cannot be safely done using DllUnregisterServer because there is no way of telling if the self-registered keys are used by another feature or application.
  2. The ability to use advertisement is reduced if Class or extension server registration is performed within self-registration routines.
  3. The installer automatically handles HKCR keys in the registry tables for both per-user or per-machine installations. DllRegisterServer routines currently do not support the notion of a per-user HKCR key.
  4. If multiple users are using a self-registered application on the same computer, each user must install the application the first time they run it. Otherwise the installer cannot easily determine that the proper HKCU registry keys exist.
  5. The DllRegisterServer can be denied access to network resources such as type libraries if a component is both specified as run-from-source and is listed in the SelfReg table. This can cause the installation of the component to fail to during an administrative installation.
  6. Self-registering DLLs are more susceptible to coding errors because the new code required for DllRegisterServer is commonly different for each DLL. Instead use the registry tables in the database to take advantage of existing code provided by the installer.
  7. Self-registering DLLs can sometimes link to auxiliary DLLs that are not present or are the wrong version. In contrast, the installer can register the DLLs using the registry tables with no dependency on the current state of the system.
3.857145
Average: 3.9 (28 votes)

Tao of the Windows Installer

Sounds like Rule 19: Avoid Using the SelfReg Table

A common SetupCapture configuration is to uncheck the "Automatically add self-registration" option in the "Windows Application" template (Windows Installer Template) used during capture to an MSI.

This will also prevent any requirement of in which order (Registration Order) any added COM component to the SelfReg table should be placed.

Custom actions get added while setup capture

Harsh's picture

Some time while setup capture some custom actions get added which are resposnible for self registration. These Custom actions calling command such as MSIEXEC /x and MSIEXEC /Y.
Just in case if you find such custom actions then delete them from your package.Then revise your package for COM information is correctly implemented for those files/components for which these custom actions were initated.

Directions on SelfReg Entries