RegDBGetKeyValueEx

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 RegDBGetKeyValueEx function retrieves the value of a particular value name under a specified key in the registry. By default, InstallShield assumes this key is a subkey of HKEY_CLASSES_ROOT. You can use RegDBSetDefaultRoot to specify another root key.

RegDBGetKeyValueEx is a general registry-related function, designed to work with all registry keys, including those handled by the 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

RegDBGetKeyValueEx ( szKey, szName, nvType, svValue, nvSize );

Parameters

RegDBGetKeyValueEx Parameters

Parameter

Description

szKey

Specifies the name of the key whose value is to be retrieved. Separate different levels in the subkey with a double backslash (\\).

szName

Specifies the value name under szKey of the value to retrieve. To retrieve the default value of the key, pass a null string ("").

nvType

Returns one of the following predefined constants, which identifies the type of data returned in svValue:

REGDB_STRING—String variable, no newline characters allowed.
REGDB_STRING_EXPAND—String variable holding an expandable environment variable expression such as "%MYPATH%".
REGDB_STRING_MULTI—String variable, newline characters allowed.
REGDB_NUMBER—Number expressed as a string and passed in a string variable.
REGDB_BINARY—Binary data stored in a string.

Note:When data type REGDB_STRING_MULTI is retrieved, use StrGetTokens with null string ("") to parse the multiple null terminated strings into a list of strings. That is, if svValue has the resulting multiple strings after a call to RegDBGetKeyValueEx, StrGetTokens( listID, svValue, "") can be used to parse the strings and put them in a string list (listID).

svValue

Returns the value that was specified by szKey and svName. Note that a number value is returned as a string.

nvSize

Returns the size—in bytes—of the value returned in svValue.

Return Values

RegDBGetKeyValueEx Return Values

Return Value

Description

0

Indicates that the function successfully retrieved the value.

< 0

Indicates that the function was unable to retrieve the value.

See Also