INFO: Self-Registration Versus Windows Installer Registration

Windows Installer Registration

How It Works

When you allow the Windows Installer to register your application, the file’s registration data is stored in the Windows Installer COM tables. When using this method, the file’s DLLRegisterServer and DLLUnregisterServer functions are not called at run time, instead the Windows Installer takes the data specified in the COM tables and registers the file itself. For some advantages and disadvantages to letting Windows Installer register your file, read InstallShield Help Library topic Registering COM Servers.

The Windows Installer tables used to store the file’s registration data are as follows:

  • The TypeLib table provides information that the installer places in the registry for the registration of type libraries. Type library entries are not written at the time of advertisement. The installer writes the type library entries at the time the components associated with the library are installed.

  • The Class table is used to register Class IDs and other information for COM objects. This table contains COM server-related information that must be generated as a part of the product advertisement.
  • The ProgId table associates program IDs with class IDs.

For more information on the data registered for COM Servers, see Microsoft Help Library topic COM Registry Keys.

How to Implement

To use the Windows Installer to register your file, you can use any of the following methods. For more information, see InstallShield Help Library topic COM Registration Overview.

A.  Set the component’s Extract at build option to Yes by following these steps:

    1. Select the Components view.
    2. Select the component that contains the file with the COM Data.
    3. Set the component’s COM Extract at Build property to Yes.
    4. Expand the component node and select the Files view of the component.
    5. Right-click the file with the COM Data and select Set Key File.

B.  Right-click the file to Extract COM data by following these steps:

    1. Select the Components view.
    2. Select the component that contains the file with the COM Data.
    3. Expand the component node and select the Files view of the component.
    4. Right-click the file with the COM Data and select Extract COM Data for Key File.

c.  Add the data from the COM Registration view under Advances Settings by following these steps:

    1. Select the Components view.
    2. Select the component that contains the file with the COM Data.
    3. Expand the component node and select the Advanced Settings > COM Registration view.
    4. Manually add the appropriate COM data in this view.

Self-Registration

It is recommended that you use the Windows Installer registration method instead of the self-registration method. For a list of advantages to using Windows Installer Registration, see the Windows Installer Help Library topic SelfReg Table.

How It Works

Self-registering files have a DLLRegisterServer and a DLLUnRegisterServer function. Each function contains custom code that registers and unregisters the file. The developer of the file is responsible for writing the code to register and unregister the file in each of the functions. At run time, the DLLRegisterServer and DLLUnregisterServer are called for the files populated in this table. For more information on the self-registration process, see Microsoft Help Library topic Self-Registration.

If a file is selected to be self-registered in the InstallShield project, the SelfReg or IsSelfReg Table is populated. For more information on the advantages and disadvantages of each table, see InstallShield Help Library topic Self Registration Methods. By default, the InstallShield project uses the IsSelfReg Table. However, this option can be changed by using the following steps:

  1. Select Tools > Options.
  2. Select the Preferences tab.
  3. Under the Self-Registration section, select the SelfReg Table option from the drop-down box.

How To Implement

To mark a file as self-registering, follow these steps:

  1. Select the Files and Folders view and find the file you wish to self-register.
  2. Right-click the file and choose Properties.
  3. Select the Self-Register check box and click OK.

To specify the order in which files should be registered, follow these steps:

  1. Select the Direct Editor view.
  2. Select the IsSelfReg Table.
  3. Select the Order column and add a value. The entry with value 1 will be registered first, then 2, and so on.

Additional Information

Troubleshooting

If Using COM Extraction

  1. Verify that data can be extracted from the file using RegSpyUI.exe and verify that the data extracted is correct. RegSpyUI.exe can be found in the InstallShield Support folder <ProductPath>Support.
  2. If using Com Extract At Build, verify that you have marked the file that should have data extracted from it as a key file for the component.
  3. Verify that you are extracting data with a clean registry. See COM Registration Overview for other reasons for COM extraction failure

If Using Self-Registration

  1. If the file fails to register, try registering it with regsvr32.exe found in the system32 folder. At the command prompt, run regsvr32 <Path to File> and make sure this works.
  2. Verify that files are being registered in the correct order. This can be done by running regsvr32 on each file and verifying that each file is registered correctly. Once this is done, you can specify the correct order that the files should be registered in the IsSelfReg Table.
  3. Verify that all dependencies are on the machine and registered. For more information, see InstallShield Knowledge Base article Determining Your Application’s File Dependencies.
  4. Verify that files are ordered correctly in ISSelfReg Table.

For more information, see InstallShield Help Library topic Registering COM Servers.

 

Source: http://kb.flexerasoftware.com/selfservice/viewContent.do?externalID=Q111120

Leave a Reply

Your email address will not be published. Required fields are marked *