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.
The RegDBConnectRegistry function creates a connection to a remote registry. After you have opened the connection, you can create, delete, or retrieve registry keys, value names, and value pairs on a remote registry much as you would on a local registry. This functionality is also supported on 64-bit systems with some limitations.
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.
RegDBConnectRegistry allows you to edit only one registry root key each time the remote registry is opened, and you can edit only keys and values under either HKEY_LOCAL_MACHINE or HKEY_USERS. When you call RegDBConnectRegistry, you must specify which root key you want to be able to edit. If you want to edit the other root key or one its subkeys, you must close and re-open the connection.
Caution • Because you set the root key by calling RegDBConnectRegistry, you cannot call RegDBSetDefaultRoot after you have established a connection to a remote registry. When you call RegDBDisConnectRegistry, all calls to registry-related functions affect the local registry, and you can then call RegDBSetDefaultRoot to change the root key.
Note • If you are trying to open a registry on a remote Windows system, you must have administrator privileges. This function is intended for use by system administrators for network installations.
Syntax
RegDBConnectRegistry ( szRemoteSystem, nKeyType, nReserved );
Parameters
Parameter |
Description |
szRemoteSystem |
Specifies the name of the system with which to connect, such as “RemoteSys”. If you pass a null string ("") in this parameter, the function creates a connection to the local registry. |
nKeyType |
Specifies one of the following constants: HKEY_LOCAL_MACHINE or HKEY_USERS. |
nReserved |
Pass zero in this parameter. No other value is allowed. |
Return Values
Return Value |
Description |
0 |
Indicates this function successfully established a connection to the system registry. |
REGDB_ERR_CONNECTIONEXISTS (-6) |
A connection to a remote registry already exists. It must be closed using RegDBDisConnectRegistry before you can call RegDBConnectRegistry again. |
REGDB_ERR_CORRUPTEDREGISTRY (-4) |
Indicates that the remote registry is corrupted and cannot be accessed. |
REGDB_ERR_INITIALIZATION (-2) |
Indicates that the registry services could not be initialized. Make sure Remote Administration is enabled and that you have appropriate privileges to be able to write to the registry. |
REGDB_ERR_INVALIDHANDLE (-5) |
The key name provided for the remote registry is not allowed. |
REGDB_ERR_INVALIDNAME (-3) |
Indicates that the system in szRemoteSystem could not be found. Check the name and try again. |
-1 |
Other error. |
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.
See Also
Working with Registry Functions
InstallShield 2016 Help LibraryMay 2017 |
Copyright Information | Flexera Software |