Microsoft KB Archive/251389

{|
 * width="100%"|

PRB: Windows Installer Properties Do Not Persist Across Installations

 * }

Q251389

-

The information in this article applies to:


 * Microsoft Windows Installer, versions 1.0, 1.1

-

IMPORTANT: This article contains information about editing the registry. Before you edit the registry, make sure you understand how to restore it if a problem occurs. For information about how to do this, view the "Restoring the Registry" Help topic in Regedit.exe or the "Restoring a Registry Key" Help topic in Regedt32.exe.

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: Using Registry Editor incorrectly can cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk.

For information about how to edit the registry, view the "Changing Keys and Values" Help topic in Registry Editor (Regedit.exe) or the "Add and Delete Information in the Registry" and "Edit Registry Data" Help topics in Regedt32.exe. Note that you should back up the registry before you edit it. If you are running Windows NT or Windows 2000, you should also update your Emergency Repair Disk (ERD).

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\ with a value of [RETAININFO]. Example values for the Registry Table:

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:

 Specify the registry entry to be searched for in the RegLocator Table. The following are example values for the RegLocator Table:

 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: