BUG: Automating Windows Installer May Hang When Enumerating Products (269251)



The information in this article applies to:

  • Microsoft Windows Installer 1.0
  • Microsoft Windows Installer 1.1
  • Microsoft Windows Installer 1.2

This article was previously published under Q269251

SYMPTOMS

When you are enumerating all programs that are installed with the Windows Installer, the process may hang. This is true only if the enumeration is done through automation to the Windows Installer engine and not by calling the MsiEnumProducts API function directly.

CAUSE

This is a bug in the OLE automation layer of Windows Installer.

RESOLUTION

IMPORTANT: This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows Registry


One possible reason why the process may hang is that an invalid globally unique identifier (GUID) exists in the registry under the Products key for the Installer key. A GUID is represented in the registry as thirty-two hexadecimal characters. If one of the GUID keys is longer than thirty-two characters, the process may hang.

With the help of a registry-monitoring tool, such as the following, you can find which key in question is being read repetitively: The keys in question can be found under

HKEY_CURRENT_USER\Software\Microsoft\Installer\Products

-and-

HKEY_LOCAL_MACHINE\Software\Classes\Installer\Products

Before making any changes to the registry, Microsoft recommends that you export the keys that are going to be modified or deleted in case that the keys are deleted or modified in error. If you do find any GUID keys that are longer than thirty-two characters, remove the keys or change them to the correct length.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

The following Visual Basic code may cause the process to hang if any of the GUID keys are longer than thirty-two characters:
Dim Products as Object
Dim WI as Object
Set WI = CreateObject("WindowsInstaller.Installer")
Set Products  = WI.Products 'this line may hang
				

REFERENCES

For more information on the Windows Installer, you can download the Windows Installer SDK from the MSDN downloads page on the following Microsoft Web site:

Modification Type:MajorLast Reviewed:10/2/2003
Keywords:kbbug kbpending KB269251