RegDBSetDefaultRoot
InstallShield 2024 » InstallScript Language Reference
Project:
The RegDBSetDefaultRoot function sets the root key that is used by the general registry-related functions. Most InstallScript registry functions work on the HKEY_CLASSES_ROOT as the default registry hive. Using this function, you can specify another key, such as HKEY_LOCAL_MACHINE, HKEY_CURRENT_USER, or HKEY_USERS, as the root key.
You cannot use RegDBSetDefaultRoot to change the root key of keys created or handled using the special registry-related functions. For more information, 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
RegDBSetDefaultRoot ( nRootKey );
Parameters
Parameter |
Description |
|||||||||||||||||||||
nRootKey |
Specify one of the following constants for the root key:
If you pass HKEY_USER_SELECTABLE as the argument, a subsequent registry function call uses HKEY_LOCAL_MACHINE as the root key if the ALLUSERS system variable is non-zero when the function is called, or uses HKEY_CURRENT_USER as the root key if ALLUSERS is FALSE when the function is called. Note:Windows does not allow the creation of a key directly under HKEY_LOCAL_MACHINE or HKEY_USERS. |
Return Values
Return Value |
Description |
0 |
Indicates that the function successfully set the key. |
< 0 |
Indicates that the function was unable to set the key. |
See Also