RegDBDeleteItem

InstallShield 2016 » InstallScript Language Reference

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.

RegDBDeleteItem is a special registry-related function designed to work with certain predefined registry keys. The RegDBDeleteItem function deletes values under the per application paths key or the application uninstallation key, depending on the value of nItem. Calling RegDBDeleteItem with either the REGDB_APPPATH or the REGDB_APPPATH_DEFAULT option results in the deletion of the per application paths key.

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

RegDBDeleteItem( nItem );

Parameters

RegDBDeleteItem Parameters

Parameter

Description

nItem

Specifies the item to delete. Pass one of the following predefined constants in this parameter:

REGDB_APPPATH—The data of the Path value under the per-application paths key. This key is deleted by the installation as a result of calling CreateInstallationInfo. You must call CreateInstallationInfo to create this key before calling RegDBDeleteItem. (In an event-based script, CreateInstallationInfo is called in the default OnMoveData event handler code.)
REGDB_APPPATH_DEFAULT—The data of the DefaultPath value under the per-application paths key. This key is created by the installation as a result of calling CreateInstallationInfo. You must call CreateInstallationInfo to create this key before calling RegDBDeleteItem. (In an event-based script, CreateInstallationInfo is called in the default OnMoveData event handler code.)
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.
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.
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.
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. The UninstallString value is created when the MaintenanceStart or DeinstallStart functions are called.
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, szValue specifies the installed product’s version number expressed as a string, for example, "16777216".

Important • Do not use REGDB_WINCURRVER_REGOWNER or REGDB_WINCURRVER_REGORGANIZATION with this function. Windows sets these values, and they should not be deleted by an installation.

Return Values

RegDBDeleteItem Return Values

Return Value

Description

0

Indicates that the function successfully set the value.

< 0

Indicates that the function failed.

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.
RegDBDeleteItem does not write anything to the uninstall log file; thus, calling this function does not have any effect how the application is uninstalled.

See Also