RegDBGetItem
Project:For InstallScript MSI and Basic MSI projects, it is recommended that you use the Registry view in InstallShield instead of creating registry keys and values through InstallScript code. Handling all of your registry changes in this way allows for a clean uninstallation through the Windows Installer service.
The RegDBGetItem function retrieves values under the per-application paths key or the application uninstallation key, depending on the value of nItem. RegDBGetItem is a special registry-related function, designed to work with certain predefined registry keys.
Note:The InstallScript engine currently does not support writing or reading Add or Remove Programs information for a product in the 64-bit part of the registry. Therefore, using the REGDB_OPTION_WOW64_64KEY option with the REGDB_OPTIONS system variable is not supported for this registry function. Enabling the REGDB_OPTION_WOW64_64KEY option has no effect on where registry entries are created by this function.
Syntax
RegDBGetItem ( nItem, svValue );
Parameters
RegDBGetItem Parameters
|
|
nItem
|
Specifies which item to retrieve. Pass one of the following predefined constants in this parameter:
|
•
|
REGDB_APPPATH—The data of the Path value under the per application paths key. |
|
•
|
REGDB_APPPATH_DEFAULT—The data of the DefaultPath value under the per application paths key. |
|
•
|
REGDB_UNINSTALL_COMMENTS—The data of the Comments value under the uninstallation key. |
|
•
|
REGDB_UNINSTALL_CONTACT—The data of the Contact value under the uninstallation key. |
|
•
|
REGDB_UNINSTALL_DISPLAY_VERSION—The data of the DisplayVersion value under the uninstallation key. |
|
•
|
REGDB_UNINSTALL_DISPLAYICON—The data of the DisplayIcon value under the uninstallation key. |
|
•
|
REGDB_UNINSTALL_HELPLINK—The data of the HelpLink value under the uninstallation key. |
|
•
|
REGDB_UNINSTALL_HELPTELEPHONE—The data of the HelpTelephone value under the uninstallation key. |
|
•
|
REGDB_UNINSTALL_INSTALLDATE—The data of the InstallDate value under the uninstallation key. |
|
•
|
REGDB_UNINSTALL_INSTALLLOC—The data of the InstallLocation value under the uninstallation key. |
|
•
|
REGDB_UNINSTALL_INSTALLSOURCE—The data of the InstallSource value under the uninstallation key. |
|
•
|
REGDB_UNINSTALL_LANGUAGE—The data of the Language value under the uninstallation key. |
|
•
|
REGDB_UNINSTALL_LOGFILE—The data of the LogFile value under the uninstallation key. |
|
•
|
REGDB_UNINSTALL_MAINT_OPTION—The data of the LogMode value under the uninstallation key. |
|
nItem (cont.)
|
|
•
|
REGDB_UNINSTALL_MAJOR_VERSION—The data of the VersionMajor value under the uninstallation key, if it is present. If it is not present, the function checks the data of the MajorVersion value under the uninstallation key. |
|
•
|
REGDB_UNINSTALL_MAJOR_VERSION_OLD—The data of the MajorVersion value under the uninstallation key. |
|
•
|
REGDB_UNINSTALL_MINOR_VERSION—The data of the VersionMinor value under the uninstallation key, if it is present. If it is not present, the function checks the data of the MinorVersion value under the uninstallation key. |
|
•
|
REGDB_UNINSTALL_MINOR_VERSION_OLD—The data of the MinorVersion value under the uninstallation key. |
|
•
|
REGDB_UNINSTALL_MODIFYPATH—The data of the ModifyPath value under the uninstallation key. |
|
•
|
REGDB_UNINSTALL_NAME—The data of the DisplayName value under the uninstallation key. When this constant is used, szValue specifies the application name shown in the list of uninstallable applications in the Control Panel. |
|
•
|
REGDB_UNINSTALL_NOMODIFY—The data of the NoModify value under the uninstallation key. |
|
•
|
REGDB_UNINSTALL_NOREMOVE—The data of the NoRemove value under the uninstallation key. |
|
•
|
REGDB_UNINSTALL_NOREPAIR—The data of the NoRepair value under the uninstallation key. |
|
•
|
REGDB_UNINSTALL_PRODUCTGUID—The data of the ProductGuid value under the uninstallation key. |
|
•
|
REGDB_UNINSTALL_PRODUCTID—The data of the ProductId value under the uninstallation key. |
|
•
|
REGDB_UNINSTALL_PUBLISHER—The data of the Publisher value under the uninstallation key. |
|
•
|
REGDB_UNINSTALL_README—The data of the Readme value under the uninstallation key. |
|
•
|
REGDB_UNINSTALL_REGCOMPANY—The data of the RegCompany value under the uninstallation key. |
|
•
|
REGDB_UNINSTALL_REGOWNER—The data of the RegOwner value under the uninstallation key. |
|
nItem (cont.)
|
|
•
|
REGDB_UNINSTALL_STRING—The data of the UninstallString value under the uninstallation key. |
|
•
|
REGDB_UNINSTALL_SYSTEMCOMPONENT—The data of the SystemComponent value under the uninstallation key. |
|
•
|
REGDB_UNINSTALL_URLINFOABOUT—The data of the URLInfoAbout value under the uninstallation key. |
|
•
|
REGDB_UNINSTALL_URLUPDATEINFO—The data of the URLUpdateInfo value under the uninstallation key. |
|
•
|
REGDB_UNINSTALL_VERSION—The data of the Version value under the uninstallation key. When this constant is used, svValue returns the installed product’s version number expressed as a string, for example, "16777216". |
|
•
|
REGDB_WINCURRVER_REGORGANIZATION—The data of the RegisteredOrganization value under the current version key. |
|
•
|
REGDB_WINCURRVER_REGOWNER—The data of the RegisteredOwner value under the current version key. |
|
svValue
|
Returns the value of the item.
|
Return Values
RegDBGetItem Return Values
|
|
0
|
Indicates that the function successfully retrieved the value of the item.
|
< 0
|
Indicates that the function was unable to retrieve the value of the item.
|
Additional Information
By default, any text that is surrounded by angle brackets—for example, "<my registry entry text>"—in this function’s string arguments is interpreted as a text substitution and is processed accordingly. To disable text substitution processing for the string arguments of registry functions, call Disable with the REGISTRYFUNCTIONS_USETEXTSUBS argument.
Project:In an InstallScript installation, calling RegDBSetItem with REGDB_APPPATH or REGDB_APPPATH_DEFAULT before calling CreateInstallationInfo has no net effect. This is because CreateInstallationInfo overwrites registry information that is created by RegDBSetItem, thus nullifying the call. Calling RegDBSetItem with any other constant before calling MaintenanceStart has no net effect. This is because MaintenanceStart overwrites the registry data created by RegDBSetItem, thus nullifying the call. (In an event-based script, CreateInstallationInfo and MaintenanceStart are called in the default OnMoveData event handler code.)
In an InstallScript MSI installation, the uninstallation information is created during file transfer by the Windows Installer. Therefore, if you call RegDBSetItem in an InstallScript MSI installation, you should call it only after file transfer.