RegDBDeleteKey

InstallShield 2020 » 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.

The RegDBDeleteKey function deletes a specific key and its associated value from the registry. All subkeys of the deleted key are also deleted, along with their associated values.

InstallShield assumes the key specified in szSubKey is a subkey of HKEY_CLASSES_ROOT. You can use RegDBSetDefaultRoot to specify another root key.

RegDBDeleteKey is a general registry-related function, designed to work with all registry keys, including those handled by the special registry-related functions. For more information on special registry-related functions, see Special Registry-Related Functions.

Note:This function supports the 64-bit parts of the registry by using the REGDB_OPTION_WOW64_64KEY option. For more information, see REGDB_OPTIONS.

Syntax

RegDBDeleteKey ( szSubKey );

Parameters

RegDBDeleteKey Parameters

Parameter

Description

szSubKey

Specifies the name of the key to delete. Separate different levels in the subkey with a double backslash (\\).

Return Values

RegDBDeleteKey Return Values

Return Value

Description

0

Indicates that the function successfully deleted the key.

< 0

Indicates that the function was unable to delete the key.

You can obtain the error message text associated with a large negative return value—for example, -2147024891 (0x80070005)—by calling FormatMessage.

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.
RegDBDeleteKey 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