User Guide
473
OLE Automation Function Reference
SetComponentGuid
Sets the ComponentId column of a component. Components for files should be the same
across all products and all versions of a product. Example: You could have this function
follow an AddFile call, passing the component returned in AddFile to SetComponentGuid.
GUIDs are of the form:
{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} where x is a hex digit.
VBScript Example (lines are numbered for clarity):
1. installer.AddFileEx "c:\myapp\myexe.exe", "myapp\myexe.exe", 0, "Complete", 0,
compkey
2. installer.SetComponentGuid compkey, "{1926E179-96B8-11D3-B445-00600810A1CE}"
SetComponentKeyPath
Sets the key path to the resource key given in the parameter list. If szKeyPath is a
registry key, the attributes of the component get ORed with 4 (registry key path bit).
KeyPath is typically the return value from AddFile() or AddRegistryValue().
SetFileSelfRegister
Adds or deletes a SelfReg row associated with a particular file given its key.
Function Prototype BOOL Save(BSTR szPathName)
Parameters szPathName: absolute path to the destination to which
the file is saved
Return Value Nonzero if successful
Function Prototype BOOL SetComponentGuid(BSTR szComponent, BSTR
szGuid)
Parameters szComponent: Component to modify
szGuid: GUID string
Return Value Nonzero if successful
Function Prototype BOOL SetComponentKeyPath(BSTR szComponent, BSTR
szKeyPath)
Parameters szComponent: name of component for which to set key
path
szKeyPath: key to file or registry key to which to set key
path
Return Value Nonzero if successful