User Guide

465
OLE Automation Function Reference
AddRegistryValueEx
Adds a registry key to a component or feature. This function is identical to the
AddRegistryValue function, except that the last parameter is a pointer to a VARIANT
type for VBScript compatibility. The VARIANT type is BSTR.
AddShortcut
Adds a shortcut to a particular component or feature. The shortcut type specifies
whether it is advertised, not advertised (file in the installation), or a command line
shortcut and can change the meaning of the other parameters.
Function
Prototype
BSTR AddRegistryValueEx(short sKeyRoot, BSTR szKey, BSTR szValueName,BSTR szData,
short sDataType, short sOperation,BSTR szFeatureComponent,short iType,VARIANT
*pvComponentKey)
Parameters SKeyRoot: specifies to which registry root to add key
-1 for HKEY_CURRENT_USER if per-user install, otherwise, HKEY_LOCAL_MACHINE
0 for HKEY_CLASSES_ROOT
1 for HKEY_CURRENT_USER
2 for HKEY_LOCAL_MACHINE
3 for HKEY_USERS
szKey: path of key
szValueName: registry value name
szData: new value of registry entry
sDataType:
0 for string
1 for expandable string
2 for integer
3 for binary
sOperation: if szData is empty, the following values are valid:
1 for key is created if absent
2 for key and subkeys are to be deleted on uninstall
3 for key is created if absent on install and deleted with subkeys on uninstall
szFeatureComponent: feature or component name to which to add key
iType:
0 for feature
1 for component
pvComponentKey: pointer to VARIANT of type BSTR to hold the key to the component to
which the registry value is added
Return Value Key to row of new registry key or empty string if failed