PRB: Windows Installer Properties Do Not Persist Across Installations (251389)



The information in this article applies to:

  • Microsoft Windows Installer 1.0
  • Microsoft Windows Installer 1.1

This article was previously published under Q251389
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

SYMPTOMS

It may be necessary to save information obtained from the initial installation of a program to use later in maintenance mode or uninstallation of the program. If you add or change a property during an installation, the new value and new property will not be added to the Property table of the cached .msi package. The cached .msi package is used in both maintenance mode and uninstallation.

This article describes how to write a registry key that contains the value of the property that you want to retain. It also describes the necessary entries to retrieve the data from the registry key for use during maintenance mode and uninstallation.

MORE INFORMATION

WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.


For this example, assume that the public property RETAININFO will be created and set during the initial installation of your product and it will be necessary to use this property during the uninstallation of the product.

In the Windows Installer package, add a registry entry named InstallInfo located at HKLM\SOFTWARE\<Your Company Name> with a value of [RETAININFO]. Example values for the Registry Table:

RegistryRootKeyNameValueComponent_
MyRegistryKey2SOFTWARE\<Your Company Name>InstallInfo[RETAININFO]MyComponent

When the registry key is written, the entry will be replaced with the value of the RETAININFO property. The registry key must be included in a component that will be installed and uninstalled during a typical installation.

To use the property during uninstallation, use the AppSearch action to search for the registry entry and create a property named MYREGVAL with the value of that registry entry:
  1. Specify the registry entry to be searched for in the RegLocator Table. The following are example values for the RegLocator Table:

    Signature_RootKeyNameType
    AppValue2SOFTWARE\<Your Company Name>InstallInfomsidbLocatorTypeRawValue
  2. Populate the AppSearch Table so that the AppSearch action returns the value of AppValue. After the Installer executes the AppSearch action, the value of MYREGVAL is the value of AppValue. The following are example values for the AppSearch Table:
    PropertySignature
    MYREGVALAppValue

REFERENCES

For more information on the AppSearch action, see the topics "AppSearch Table" and "RegLocator Table" in the Windows Installer Help file. Also see the topic "Registry Table" for information on entries in the Registry Table.

Modification Type:MajorLast Reviewed:10/20/2003
Keywords:kbFAQ kbMSIFAQ kbprb KB251389