User Guide

463
OLE Automation Function Reference
AddFileEx
This is identical to AddFile, with the exception of the last parameter, which is a pointer to
a VARIANT, because VBScript can not handle out BSTR parameters. See AddFile on
page 462 for details.
VBScript Example (lines are numbered for clarity):
1. dim key, component
2. key = installer.AddFileEx("c:\winnt\system32\notepad.exe", "Program
3. Files\myapp\notepad.exe", 0, "Complete", 0, component)
Function
Prototype
BSTR AddFile(BSTR szSourcePath, BSTR szDestination, short iAttributes, BSTR
szFeatureComponent, short iType, BSTR FAR* pszComponentKey)
Parameters szSourcePath: source path of file to add
szDestination: destination path for file (including file name)
short iAttributes: Bitmask for the file; ORed values of:
1 for Read-only
2 for Hidden
4 for System
512 for vital file
1024 for file contains a checksum
8192 for file is uncompressed outside of the .MSI
szFeatureComponent: feature or component name to which to add key
iType: add the file to:
0 for feature
1 for component
szComponentKey: [out parameter] component key to which file was added
Return Value Key to row of new file row or empty string if unsuccessful
Function
Prototype
BSTR AddFileEx(BSTR szSourcePath, BSTR szDestination, short iAttributes, BSTR
szFeatureComponent, short iType, VARIANT* pvComponent)
Parameters szSourcePath: source path of file to add
szDestination: destination path for file (including file name)
short iAttributes: Bitmask for the File; ORed values of:
1 for Read-only
2 for Hidden
4 for System
512 for vital file
1024 for file contains a checksum
8192 for file is uncompressed outside of the .MSI
szFeatureComponent: feature or component name to which to add key
iType: add the file to:
0 for feature
1 for component
PvComponent: pointer to variant of type BSTR to hold component that file is added to. For
VBScript that can’t handle BSTR *
Return Value Key to row of new file row or empty string if unsuccessful