#$K+MsiServices Object
	Msi Objects	Database Tables
The MsiServices component provides common platform services, exposed as a set   of objects which expose, in a platform-independent manner, functionality such as file, directory, registry, and memory services. Common data handling is supported by the string and record objects, and by the property management. The database subsystem is also contained within the services component.
The MsiServices object must be the first to be instantiated, as the other objects are dependent upon its functionality. No errors are handled within this component; the information is packaged and returned to the outside caller. For C++ callers, the error information is returned as a record object; for OLE automation callers, it is returned in the error exception object.
Properties
LoggingEnabled

Methods
AttachClient
DetachClient
CreateCopier
CreatePatcher
CreateString
CreateRecord
SetPlatformProperties
GetShellFolderPath
GetUserProfilePath
CreateLog
WriteLog
CreateDatabase
CreateDatabaseFromStorage
CreateFilePath
CreatePath
CreateVolume
CreateVolumeFromLabel
EnumDriveType
ClearAllCaches
GetModuleUsage
GetLocalPath
CreateRegKey
RegisterFont
UnRegisterFont
WriteIniFile
ReadIniFile
GetLangNamesFromLangIDString
CreateStorage
GetUnhandledError
SupportLanguageId
GetAllocator
CreateShortcut
RemoveShortcut
ExtractFileName
ValidateFileName
CreateFileStream
CreateMemoryStream
RegisterTypeLibrary
UnregisterTypeLibrary
RipFileNameFromPath

#$+KAttachClient method
	MsiServices Object	Msi Objects	Database Tables
This method is undocumented.
Syntax
object.AttachClient
object
Required. The MsiServices object.
#$+KDetachClient method
	MsiServices Object	Msi Objects	Database Tables
This method is undocumented.
Syntax
object.DetachClient
object
Required. The MsiServices object.
#$+KLoggingEnabled Property
	MsiServices Object	Msi Objects	Database Tables
A boolean indicating whether logging is currently enabled.
Syntax
object.LoggingEnabled
object
Required. The MsiServices object.
#$+KCreateString Method
	MsiServices Object	Msi Objects	Database Tables
Returns an MsiString object containing an empty string. Note that MsiString objects are not used by the OLE Automation interface, except for testing.
Syntax
object.CreateString
object
Required. The MsiServices object.
#$+KCreateRecord Method
	MsiServices Object	Msi Objects	Database Tables
Returns a new MsiRecord object with the requested number of fields.
Syntax
object.CreateRecord(count)
object
Required. The MsiServices object.
count
Required. The number of fields, which may be 0. The upper limit is memory limited.
Remarks
Field 0, not one of the fields in count, is reserved for the format string, which is used by MsiRecord.FormatText.
#$+KSetPlatformProperties Method
	MsiServices Object	Msi Objects	Database Tables
Sets hardware and operating system properties. See Property Summary for complete listing. This method is normally called by the MsiEngine object at initialization.
Syntax
object.SetPlatformPropertiestable, allUsersProfile
object
Required. The MsiServices object.
table
Required. The MsiTable object containing the property definitions. The first column must be the primary key containing the property names. The second column must contain the string values of the properties. The table may be empty or may contain initial property definitions.
allUsersProfile
Required. Boolean. True to set profile folder properties to folders in the "All Users" profile, if it exists. False to set those properties to folders in the user's personal profile.
#$+KGetShellFolderPath Method
	MsiServices Object	Msi Objects	Database Tables
Returns the path to a shell folder.
Syntax
object.GetShellFolderPath(folderId, regValue)
object
Required. The MsiServices object.
folderId
Required. The CSIDL_* value corresponding to this shell folder. These values are defined in the Windows header shlobj.h.
regValue
Optional. The registry value under (HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE)\Software\Microsoft\Windows\CurrentVersion\Explorer\(Shell Folders or User Shell Folders) in which the folder is registered. This argument is required to locate a folder that does not physically exist.
#$+KGetUserProfilePath Method
	MsiServices Object	Msi Objects	Database Tables
Returns the path to the user's profile folder on Windows NT.  Returns an empty string on Windows 95.
Syntax
object.GetUserProfilePath
object
Required. The MsiServices object.
#$+KCreateLog Method
	MsiServices Object	Msi Objects	Database Tables
Opens a file for subsequent logging using the WriteLog method.
Syntax
object.CreateLog(path, append)
object
Required. The MsiServices object.
path
Required. The path specification for the logfile to be created.
append
Required. A boolean: True to append to existing information in the file, False to clear any existing data.
#$+KWriteLog Method
	MsiServices Object	Msi Objects	Database Tables
Writes a line of text to the log file.
Syntax
object.WriteLog(text)
object
Required. The MsiServices object.
text
Required. A string containing the text to write to the log file. A line separator will be written following the text.
#$+KCreateDatabase Method
	MsiServices Object	Msi Objects	Database Tables
Creates and returns an MsiDatabase object. Generates an error if the database object could not be succcessful connected to the database.
Syntax
object.CreateDatabase(name, openMode)
object
Required. The MsiServices object.
name
Optional. String containing the name of the database. If no name is supplied, a temporary database will be created which is not persisted.
openMode
Required. How to open the database file, one of the idoEnum values:
 idoReadOnly      - Read only
 idoTransact      - Transacted mode, can rollback
 idoDirect        - Direct write, not transacted
 idoCreate        - Create new storage file, transacted mode
 idoCreateDirect  - Create new storage file, direct mode
 idoScript        - Open an execution script for enumeration
Remarks
If the database is opened read-write, changes will be written to that database. If it is opened read-only, then SetOutputDatabase must be used to save updates.
#$+KCreateDatabaseFromStorage Method
	MsiServices Object	Msi Objects	Database Tables
Creates and returns an MsiDatabase object using an opened MsiStorage object to access the database streams. Generates an error if the database  object could not be succcessful generated from the storage object.
Syntax
object.CreateDatabaseFromStorage(storage, readOnly)
object
Required. The MsiServices object.
storage
Required. MsiStorage object which contains the database data. This must have been opened read-write if the database is to be opened read-write.
readOnly
Required. Boolean: True to open read-only, False to open read-write
Remarks
If the database is opened read-write, changes will be written to that database. If it is opened read-only, then SetOutputDatabase must be used to save updates.
#$+KCreateFilePath Method
	MsiServices Object	Msi Objects	Database Tables
This method provides for the creation of an MsiPath object, based on a full path to a file.
Syntax
object.CreateFilePath(path)
object
Required. The MsiServices object.
path
Required. A full pathname to a file, including a full volume specification.
Remarks
See the documentation for the MsiPath object for details regarding path and volume syntax.
#$+KRipFileNameFromPath Method
	MsiServices Object	Msi Objects	Database Tables
Given a full path to a file, this method returns the file name.
Syntax
object.RipFileNameFromPath(path)
object
Required. The MsiServices object.
path
Required. A full pathname to a file, including a full volume specification.
Remarks
See the documentation for the MsiPath object for details regarding path and volume syntax.
#$+KCreatePath Method
	MsiServices Object	Msi Objects	Database Tables
This method provides for the creation of an MsiPath object.
Syntax
object.CreatePath(path)
object
Required. The MsiServices object.
path
Required. A full pathname to a directory, including a full volume specification.
Remarks
See the documentation for the MsiPath object for details regarding path and volume syntax.
#$+KCreateVolume Method
	MsiServices Object	Msi Objects	Database Tables
This method provides for the creation of an MsiVolume object, which is used to represent a physical disk drive.
Syntax
object.CreateVolume(volPath,fSuppressLFN)
object
Required. The MsiServices object.
volPath
Required. A pathname that includes a valid volume reference.  See the documentation for the MsiPath object for details regarding path syntax.
Remarks
Note: Any path information beyond the volume specification, and any trailing directory separators, will be ignored by the CreateVolume method.  Thus, all the following calls  are functionally identical:

  services.CreateVolume("\\MyServer\MyShare")
 services.CreateVolume("\\MyServer\MyShare\")
 services.CreateVolume("\\MyServer\MyShare\Dir1\Dir2")
 services.CreateVolume("\\MyServer\MyShare\Dir1\Dir2\")
 
#$+KCreateVolumeFromLabel Method
	MsiServices Object	Msi Objects	Database Tables
This method searches for a mounted volume having a specified type and specified label. If the specified volume is found, an MsiVolume object will be created and returned.
Syntax
object.CreateVolumeFromLabel(label, driveType)
object
Required. The MsiServices object.
label
Required. A string specifying the label of the volume to be searched for.
driveType
Required. An enumeration value of type idtEnum, specifying the type of volume to be searched for.
Remarks
If there is no mounted volume of the specified type and label, error 1000 will be thrown, and no volume object will be returned.
#$+KCreateCopier Method
	MsiServices Object	Msi Objects	Database Tables
Creates an MsiFileCopy object, which can be used to copy files from a source directory (i.e. the full path associated with this MsiPath object) to a specified destination directory.  Once the MsiFileCopy object has been created, the CopyTo function can be used to perform the actual file copy.
Syntax
object.CreateCopier(copierType,storage)
object
Required. The MsiServices object.
copierType
An integer enumeration value specifying the type of copier object to be created. The following values are acceptable:
ictFileCopier = 0
A copy object suitable for copying uncompressed files.
ictFileCabinetCopier = 1
A copy object suitable for copying files compressed in a standard cabinet file.
ictStreamCabinetCopier = 2
A copy object suitable for copying files compressed in a cabinet stored as a stream within an MsiStorage object (see the storage parameter below).
ictResourceCabinetCopier = 3
Obsolete.  Currently still supported for compatibility.  Copies files from a cabinet stored as a resource within a Launcher.  However, note that from automation, there's no way to exploit this copier type, because we have no mechanism available through automation to provide the valid HINSTANCE of a module containing the cabinet resource.

storage
Optional.  If the copier type is ictStreamCabinetCopier, this parameter must be supplied as an MsiStorage object that contains a cabinet as a named stream.
#$+KCreatePatcher Method
	MsiServices Object	Msi Objects	Database Tables
Creates an MsiFilePatch object, which can be used to patch existing files.
Syntax
object.CreatePatcher
object
Required. The MsiServices object.
#$+KEnumDriveType Method
	MsiServices Object	Msi Objects	Database Tables
Returns an enumeration object containing a collection of MsiVolume objects representing all the mounted volumes of a specified type.
Syntax
object.EnumDriveType(driveType)
object
Required. The MsiServices object.
driveType
Required. The type of volume to be enumerated, one of idtEnum:
   idtAllDrives = 1    Enumerate drives of all types
   idtRemovable = 2    Drive contains non-floppy removable media
   idtFixed     = 3    Hard disk drive
   idtRemote    = 4    Network server share
   idtCDROM     = 5    CD_ROM drive
   idtRAMDisk   = 6    RAM disk
   idtFloppy    = 2    Floppy disk (currently not distinguished from idtRemovable). 

#$+KClearAllCaches Method
	MsiServices Object	Msi Objects	Database Tables
Clears all caches in the services object. Currently these caches are references to created volume objects in the internal volume cache and cached record objects (for performance).
Syntax
object.ClearAllCaches
object
Required. The MsiServices object.
Remarks
Each time an MsiVolume object is to be created (usually in conjunction with an associated MsiPath object), Darwin checks to see if an MsiVolume object already exists for the referenced volume.  If so, a reference to that object is returned by the CreateVolume method, obviating the need to create a new MsiVolume object from scratch.   Each time a record is released we add it to a record cache (assuming there is still room) in order to save time by not returning it to the memory pool. When a record of the same size is needed, we return a record from the cache if one is available. The ClearAllCaches method clears the volume cache and record cache, and is called by the Darwin Engine dll at setup termination.
#$+KGetModuleUsage Method
	MsiServices Object	Msi Objects	Database Tables
The GetModuleUsage function enumerates all the processes on the user system that have currently loaded a given executable module in their address space. The function returns an enumeration of MsiRecord objects, one for each such process. The record has 3 fields - The first field is a string which is the process name. The second field is an integer which is the process id. The third field is an integer which is the handle of the top level window of the process. The third field is null if there is no top level window for the process.
Syntax
object.GetModuleUsage(fileName)
object
Required. The MsiServices object.
fileName
Required. A string that is the file name of the executable module.
Remarks
 Note: The file name of the module must be the file name only and not the full path.
#$+KGetLocalPath Method
	MsiServices Object	Msi Objects	Database Tables
Windows:
Returns a string representing the full path of the installer's launch directory.

Mac:
Returns a string representing the full path of the MsiServices DLL directory.

Syntax
object.GetLocalPath(fileName)
object
Required. The MsiServices object.
fileName
Optional.  If supplied, this file name will be appended to the path returned by GetLocalPath.

Remarks
(Windows Only)
If the string supplied in the fileName parameter has the format of a fully qualified path (i.e. a colon in the 2nd character position, or two leading backslash characters), that string itself will  be returned. Otherwise, no error checking is performed on the supplied fileName parameter  before it is appended.
#$+KCreateRegKey Method
	MsiServices Object	Msi Objects	Database Tables
Creates a MsiRegKey object.
Syntax
object.CreateRegKey(value, subKey)
object
Required. The MsiServices object.
value
Required. A string which is one of the following predefined roots
 "HKEY_CLASSES_ROOT"
 "HKEY_CURRENT_USER"
 "HKEY_LOCAL_MACHINE"
 "HKEY_USERS"
subKey
Required. A string which is denotes the subkey below the predefined root value
Remarks
The actual registry key is not opened or created on the construction of the MsiRegKey object.
#$+KRegisterFont Method
	MsiServices Object	Msi Objects	Database Tables
Registers a font with the system.
Syntax
object.RegisterFont(fontTitle, fontFile, path)
object
Required. The MsiServices object.
fontTitle
Required. the font title string.
fontFile
Required. the font filename.
path
Optional. the MsiPath object where the font file exists. If this argument is omitted, the font file is assumed to exist in the default font folder.
Remarks

#$+KUnregisterFont Method
	MsiServices Object	Msi Objects	Database Tables
Unregisters a font with the system.
Syntax
object.UnregisterFont(fontTitle)
object
Required. The MsiServices object.
fontTitle
Required. the font title string.
Remarks

#$+KWriteIniFile Method
	MsiServices Object	Msi Objects	ReadIniFile Method
Writes/Deletes an entry in a .INI file. Generates an error if a system error occurs during file update.
Syntax
object.WriteIniFile(path, file, section, key, value, action)
object
Required. The MsiServices object.
path
Optional. The MsiPath object to the .INI file. If absent, the windows directory is assumed. If this directory does not exist, a run-time error will be generated.
file
Required. A string denoting the .INI file name.
section
Required. A string denoting the section in the .INI file.
key
Required. A string denoting the key in the .INI file.
value
A string denoting the value for the key in the .INI file. Ignored for iifIniRemoveLine action.
action
Required. The type of .INI update, one of the iifIniMode values:
 iifIniAddLine    =0 - Creates/Updates .INI entry
 iifIniCreateLine =1 - Creates .INI entry only if absent
 iifIniRemoveLine =2 - Deletes .INI entry
 iifIniAddTag     =3 - Creates/ Appends a new comma separated tag(value) to a .INI entry
 iifIniRemoveTag  =4 - Deletes a tag from a .INI entry
Remarks

#$+KReadIniFile Method
	MsiServices Object	Msi Objects	WriteIniFile Method
Reads an entry from a .INI file. Returns a string containing the value read from the .INI file. Generates an error  if a system error occurs during file read.
Syntax
object.ReadIniFile(path, file, section, key, field)
object
Required. The MsiServices object.
path
Optional. The Path object to the .INI file. If absent, the windows directory is assumed.
file
Required. a string denoting the .INI file name.
section
Required. a string denoting the section in the .INI file.
key
Required. a string denoting the key in the .INI file.
field
Optional. integer denoting field to be read from the .INI file. If absent or 0, will read the entire line.
Remarks

#$+KGetAllocator Method
	MsiServices Object	Msi Objects	Database Tables
Returns the system memory allocator as an MsiMalloc object. This method and the allocator are exposed solely for testing purposes.
Syntax
object.GetAllocator
object
Required. The MsiServices object.
Remarks
!!Additional notes!! 
#$+KGetLangNamesFromLangIDString Method
	MsiServices Object	Msi Objects	Database Tables
Given a string containing a comma-separated list of language identifiers, GetLangNamesFromLangIDString returns the full localized name of each specified language in a record object supplied by the caller.
Syntax
object.GetLangNamesFromLangIDString(langIDString, langRec, iFieldStart)
object
Required. The MsiServices object.
langIDString
Required. A string containing a comma-separated list of valid language identifiers.  For example: "1031, 1033, 1046"

langRec
Required. An existing MsiRecord object.

iFieldStart
Required. An integer specifying the first field within langRec to begin storing language names.  Starting with this field, GetLangNamesFromLangIDString will store the converted language names in consecutively ascending record fields. 
Return Value:
A count of the successfully converted language IDs.
Remarks
GetLangNamesFromLangIDString will continue processing language IDs until either the end of the string is reached, a syntax error (such as a non-numeric character) is detected, an unassigned language ID is found, or the available fields within the record are exhausted. In any case, the count returned as the function result will reflect the number of language IDs successfully converted before the terminating condition was reached.

Note: If the iFieldStart parameter is greater than the number of allocated fields in the caller's MsiRecord object, GetLangNamesFromLangIDString will return immediately with a count of zero as the function result.
#$+KCreateStorage Method
	MsiServices Object	Msi Objects	Database Tables
Creates and returns an MsiStorage object for a file, from which MsiStream objects can be created to read or write persistent data.            
Syntax
object.CreateStorage(path, openMode)
object
Required. The MsiServices object.
path
Required. The file path for the file on which the storage will be opened.
openMode
Required. The mode in which the storage will be created, one of ismEnum:
 ismReadOnly      opens storage in read-only mode, required for read-only file.
 ismDirect        opens storage in direct mode, non-transacted, cannot rollback.
 ismTransact      opens storage in transacted mode, updates can be rolled back.
 ismCreateDirect  creates new file, overwriting any existing, in direct mode.
 ismCreate        creates new file, overwriting any existing, in transacted mode.
Remarks
MsiStorage objects may be created internally from sources other than files, such as resources and memory buffers and substorages of other structured storage files.
#$+KGetUnhandledError Method
	MsiServices Object	Msi Objects	Database Tables
Returns an MsiRecord object containing the error information for an error that occured under conditions that could not be returned at the time.
Syntax
object.GetUnhandledError
object
Required. The MsiServices object.
Remarks
Errors can sometimes occur during background processing and during destruction of objects. If the MsiRecord object containg the error information cannot be returned, it is posted internally, to be accessed at some later time using this method. Only the first such error will be retained. Calling this method will clear the error and allow another to be posted. Much of the need for unhandled errors can be eliminated by finalizing objects before they are released. For example, committing a database or storage object will report any write errors at that time, rather than relying upon the implicit commit during destruction of the object.
#$+KSupportLanguageId Method
	MsiServices Object	Msi Objects	Database Tables
Checks system support for the supplied language Id and returns the information as a figure of merit.
Syntax
object.SupportLanguageId(languageId, systemDefault)
object
Required. The MsiServices object.
languageId
Required. The numeric Id representing the language, including the dialect (sub-language).
languageId
Required. Boolean: True to use SystemDefault language, False to use UserDefault language.
Return Codes, one of ismEnum
 isliNotSupported      = 0   system configuration doesn't support the language Id
 isliLanguageMismatch  = 1   base language differs from current user language Id
 isliDialectMismatch   = 2   base language matches, but dialect mismatched
 isliLanguageOnlyMatch = 3   base language matches, no dialect supplied
 isliExactMatch        = 4   exact match, both language and dialect
#$+KCreateShortcut Method
	MsiServices Object	Msi Objects	Database Tables
Creates a shortcut.
Syntax
object.CreateShortcut(shortcutPath, shortcutName, targetPath, targetName, shortcutInfo)
object
Required. The MsiServices object.
shortcutPath
Required. An MsiPath object indicating where the shortcut should be created.
shortcutName
Required. The name of the shortcut to be created.
targetPath
Required. An MsiPath object indicating where the target is.
targetName
Required. The name of the shortcut's target.
shortcutInfo
Optional. An MsiRecord containing additional information about the shortcut. The record contains the following fields:
 icsArguments        = 1  The command-line arguments for the shortcut.
 icsDescription      = 2  The description for the shortcut.
 icsHotKey           = 3  The hotkey for the shortcut. It has the virtual-key code for the key in the low-order byte, and the modifier flags in the high-order byte. 
 icsIconId           = 4  The icon index for the shortcut.
 icsIconFullPath     = 5  An MsiPath object denoting the external icon file for the shortcut.
 icsShowCmd          = 6  The show command for the application window. The values are exactly as defined for the ShowWindow Windows API fn. See the Shortcut Table help for more information.
 icsWorkingDirectory = 7  An MsiPath object denoting the working directory for the shortcut.
#$+KRemoveShortcut Method
	MsiServices Object	Msi Objects	Database Tables
Removes a shortcut.
Syntax
object.RemoveShortcut(shortcutPath, shortcutName, targetPath, targetName)
object
Required. The MsiServices object.
shortcutPath
Required. An MsiPath object indicating where the shortcut to be deleted is located.
shortcutName
Required. The name of the shortcut to be deleted.
targetPath
Optional. An MsiPath object indicating where the target is.
targetName
Optional. The name of the shortcut's target.
#$+KExtractFileName Method
	MsiServices Object	Msi Objects	Database Tables
Extract the appropriate name from a short|long pair of file names. The extracted name is validated for correct syntax. The name that is not extracted, if there is one, is not validated for syntax.
Syntax
object.ExtractFileName(pair, longname)
object
Required. The MsiServices object.
pair
Required. The pair of file names, seperated by a '|'. This string may also contain only one name if desired.
longname
Required. Boolean. True to extract the long name, false to extract the short name.
Remarks

#$+KValidateFileName Method
	MsiServices Object	Msi Objects	Database Tables
Validates a file name for correct syntax. Can validate either short or long file names.
Syntax
object.ValidateFileName(filename, longname)
object
Required. The MsiServices object.
pair
Required. String. The file name.
longname
Required. Boolean. True to validate for long name syntax, false to validate for short name syntax.
Remarks

#$+KCreateFileStream Method
	MsiServices Object	Msi Objects	Database Tables
Creates and returns an MsiStream object that accesses the supplied file.
Syntax
object.CreateFileStream(filePath, write)
object
Required. The MsiServices object.
filePath
Required string. The full path to the file.
write
Required boolean. True to create a writable stream, false to create a read-only stream.
Remarks
If a read-only stream is requested, the file must exist. If a writable stream is requested the file will be created if it does not exist, and will be truncated to 0 before the first write.
#$+KCreateMemoryStream Method
	MsiServices Object	Msi Objects	Database Tables
Creates and returns an MsiStream object that accesses an allocated block of memory.Memory streams are read-only. Attempts to write will cause the stream to be set to the error state.The memory is allocated to hold the contents of a supplied string.
Syntax
object.CreateMemoryStream(data)
object
Required. The MsiServices object.
data
Required string. A string which is copied (as Unicode) to the allocated memory stream buffer.
Remarks
The actual IMsiServices interface supports two functions, AllocateMemoryStream, and CreateStreamOnMemory. Because VBA does not easily deal with raw memory, this wrapper function accepts a string to determinine the size and contents of the allocated memory. The memory is released when the stream is destructed.
#$+KRegisterTypeLibrary Method
	MsiServices Object	Msi Objects	Database Tables
Registers a type library using the Windows RegisterTypeLib API function.
Syntax
object.RegisterTypeLibrary(libId, locale, path, helpPath)
object
Required. The MsiServices object.
libId
Required string. A string that represents the type library IID.
locale
Required integer. The locale.
path
Required string. The full file path of the type library.
helpPath
Optional string. The help file folder.
Remarks
The services object impersonates the user if running in the context of the Darwin service if the type library is located on a network path.
#$+KUnregisterTypeLibrary Method
	MsiServices Object	Msi Objects	Database Tables
Unregisters a type library using the Windows UnregisterTypeLib API function.
Syntax
object.UnregisterTypeLibrary(libId, locale, path)
object
Required. The MsiServices object.
libId
Required string. A string that represents the type library IID.
locale
Required integer. The locale.
path
Required string. The full file path of the type library.
Remarks
The services object impersonates the user if running in the context of the Darwin service if the type library is located on a network path.
#$+KMsiData Object
	Msi Objects	Database Tables
MsiData is a base object from which MsiString and other objects are derived. Its sole purpose is to permit the storage of objects in fields of MsiRecord and MsiTable objects. The only direct access to the data is via read-only properties. MsiData objects cannot be created directly. Rather, the ObjectData property of MsiCursor and MsiRecord return the stored objects as MsiData objects.
Properties
StringValue
IntegerValue

#$+KStringValue Property
	MsiData Object	Msi Objects	Database Tables
The string value for the MsiData object. This is the default property. Because the MsiData object is a common base class for other objects, this property returns a string representation of the underlying object. Read-only.
Syntax
object.StringValue
object
Required. The MsiData object.
Remarks
OLE automation transfers strings as Unicode on Windows platforms. The automation wrappers use the Win32 API to translate the strings to SBCS or DBCS strings for use with the non-Unicode version of Microsoft Installer.
#$+KIntegerValue Property
	MsiData Object	Msi Objects	Database Tables
The integer value for the MsiData object. Because the MsiData object is a common base class for other objects, this property returns an integer representation of the underlying object. If the object cannot be converted to an integer, the value iMsiNullInteger is returned. Read-only.
Syntax
object.IntegerValue
object
Required. The MsiData object.
Remarks
!!Additional notes!! 
#$K+MsiString Object
	Msi Objects	Database Tables
MsiString is a object providing abstracted, allocated string handling for the whole of the Microsoft Installer implementation. This has been designed to improve performance by reducing the need for string copying, to eliminate the use of error-prone text buffers, and to efficiently handle DBCS strings.
The MsiString object is derived from the common MsiData object that is used to support storage in records and in local database tables.
NOTE: Although the MsiString object is commonly used to pass strings by the C++ methods, is not exposed to OLE automation. Rather, it is translated to the OLE automation string type BSTR, which transfers strings as Unicode on Windows. However the MsiString object itself is exposed to OLE automation for testing purposes, as its integrity is crucial to the remainder of the system.
Properties
Value
IntegerValue
TextSize
CharacterCount
IsDBCS

Methods
Compare
Append
Add
Extract
Remove
UpperCase
LowerCase

#$+KValue Property
	MsiString Object	Msi Objects	Database Tables
The string value for the MsiString object. This is the default property.
Syntax
object.Value
object
Required. The MsiString object.
Remarks
OLE automation transfers strings as Unicode on Windows platforms. The automation wrappers use the Win32 API to translate the strings to SBCS or DBCS strings for use with the non-Unicode version of Microsoft Installer.
#$+KTextSize Property
	MsiString Object	Msi Objects	Database Tables
The length of the string in units of character size, not counting the null terminator. This is the storage requirement; the number of displayable characters may be less if the string contains DBCS lead bytes or Unicode uncomposed sequences. Read-only.
Syntax
object.TextSize
object
Required. The MsiString object.
#$+KIntegerValue Property
	MsiString Object	Msi Objects	Database Tables
The integer value of the string. If the string does not represent a valid signed 32-bit integer, the value iMsiNullInteger is returned.Read-only.
Syntax
object.IntegerValue
object
Required. The MsiString object.
#$+KCharacterCount Property
	MsiString Object	Msi Objects	Database Tables
The number of logical characters in the string. DBCS lead byte sequences and Unicode uncomposed sequences count as a single character. This execution of this property is considerably slower if the string contains lead bytes. Read-only.
Syntax
object.CharacterCount
object
Required. The MsiString object.
#$+KIsDBCS Property
	MsiString Object	Msi Objects	Database Tables
True if the string contains any double-byte characters. Will always return False if the operating system is not use a DBCS codepage. Read-only.
Syntax
object.IsDBCS
object
Required. The MsiString object.
#$+KCompare Method
	MsiString Object	Msi Objects	Database Tables
Compares the object with another string. A variety of compare options can be set with the mode argument.
Syntax
object.Compare(mode, text)
object
Required. The MsiString object.
mode
Required. The comparison mode, one of the enumeration iscEnum:
  iscExact    - supplied string matches exactly current string, case sensistive
  iscExactI   - supplied string matches exactly current string, case insensistive
  iscStart    - supplied string matches start of current string, case sensitive
  iscStartI   - supplied string matches start of current string, case insensitive
  iscEnd      - supplied string matches end of current string, case sensitive
  iscEndI     - supplied string matches end of current string, case insensitive
  iscWithin   - supplied string matches anywhere in current string, case sensisitve
  iscWithinI  - supplied string matches anywhere in current string, case insensitive

text
Required. The string to compare with the object.
Remarks
!!Additional notes!! 
#$+KAppend Method
	MsiString Object	Msi Objects	Database Tables
Appends a string or an MsiString object to the end of the current string object.
Syntax
object.Append(text)
object
Required. The MsiString object.
text
Required. The string to append. May be either a string or an MsiString object. If the argument is Null, no action takes place.
Remarks
!!Additional notes!! 
#$+KAdd Method
	MsiString Object	Msi Objects	Database Tables
Returns a new MsiString object by appending a string or an MsiString object to the end of the current string object.
Syntax
object.Add(text)
object
Required. The MsiString object.
text
Required. The string to append. May be either a string or an MsiString object. If the argument is Null, the current MsiString object is returned.
Remarks
!!Additional notes!! 
#$+KExtract Method
	MsiString Object	Msi Objects	Database Tables
Returns a new MsiString object by extracting a portion of the existing string, depending upon the mode specified by the mode argument.
Syntax
object.Extract(mode, limit)
object
Required. The MsiString object.
mode
Required. The extraction mode, one of the enumeration iseEnum:
  iseFirst      - the first iLimit characters of the current string
  iseLast       - the last iLimit characters of the current string
  iseUpto       - the string up to the character iLimit
  iseIncluding  - the string up to and including the character iLimit
  iseFrom       - the string starting with the final character iLimit
  iseAfter      - the string following the last character iLimit
limit
Required. An integer containing the number of characters to extract, or the particular character to use as the limit.
Remarks
!!Additional notes!! 
#$+KRemove Method
	MsiString Object	Msi Objects	Database Tables
Removes a portion of the existing string, depending upon the mode specified by the mode argument. Returns a boolean indicating whether any text was removed.
Syntax
object.Remove(mode, limit)
object
Required. The MsiString object.
mode
Required. The extraction mode, one of the enumeration iseEnum:
  iseFirst      - the first iLimit characters of the current string
  iseLast       - the last iLimit characters of the current string
  iseUpto       - the string up to the character iLimit
  iseIncluding  - the string up to and including the charcter iLimit
  iseFrom       - the string starting with the final character iLimit
  iseAfter      - the string following the last charcter iLimit
limit
Required. An integer containing the number of characters to extract, or the particular character to use as the limit.
Remarks
!!Additional notes!! 
#$+KUpperCase Method
	MsiString Object	Msi Objects	Database Tables
Converts all lower case characters in the string to upper case.
Syntax
object.UpperCase
object
Required. The MsiString object.
Remarks
The actual conversion is performed by the operating system, using the current system codepage or system script.
#$+KLowerCase Method
	MsiString Object	Msi Objects	Database Tables
Converts all upper case characters in the string to lower case.
Syntax
object.LowerCase
object
Required. The MsiString object.
Remarks
The actual conversion is performed by the operating system, using the current system codepage or system script.
#$K+MsiRecord Object
	Msi Objects	Database Tables
The MsiRecord object is a container for holding and transferring a variable number of values. Fields within the record are numerically indexed and can contain strings, integers, objects, and null values. Fields beyond the allocated record size are treated as having permanently null values. Field number 0 is not used for data, but is reserved for the format string for the record, processed by the FormatText method. Major uses of records are for error returns and database row fetches.
Properties
Data
StringData
IntegerData
ObjectData
FieldCount
IsInteger
IsNull
IsChanged
TextSize

Methods
FormatText
ClearData
ClearUpdate

#$+KData Property
	MsiRecord Object	Msi Objects	Database Tables
Read-write. Transfers data between a variant and a specified field within the record. On property set, integers, strings, Empty, and objects derived from MsiData are accepted. On property get, the returned variant will contain an long integer, string, MsiData object, or Empty.
Syntax
object.Data(field)
object
Required. The MsiRecord object.
field
Required. The field number of the value within the record, 1-based.
Remarks
The returned value of a non-existent field will be an Empty variant. An Empty variant value will set the record field to the Null state. Attempting to store a value in a non-existent field will cause an error.
#$+KStringData Property
	MsiRecord Object	Msi Objects	Database Tables
Read-write. Transfers string data in or out of a specified field within the record. If an integer or object has been stored, its string value will be returned.
Syntax
object.StringData(field)
object
Required. The MsiRecord object.
field
Required. The field number of the value within the record, 1-based.
Remarks
The returned value of a non-existent field will be an empty string. An Empty variant value will set the record field to the Null state. Attempting to store a value in a non-existent field will cause an error.
#$+KIntegerData Property
	MsiRecord Object	Msi Objects	Database Tables
Read-write. Transfers 32-bit integer data in or out of a specified field within the record. If a field value cannot be converted to an integer, iMsiNullInteger is returned.
Syntax
object.IntegerData(field)
object
Required. The MsiRecord object.
field
Required. The field number of the value within the record, 1-based.
Remarks
The returned value of a non-existent field will be iMsiNullInteger. Attempting to store a value in a non-existent field will cause an error.
#$+KObjectData Property
	MsiRecord Object	Msi Objects	Database Tables
Read-write. Transfers objects in or out of a specified field within the record. The objects must be of type derived from MsiData.
Syntax
object.ObjectData(field)
object
Required. The MsiRecord object.
field
Required. The field number of the value within the record, 1-based.
Remarks
The returned value of a non-existent field will be an object set to Nothing. An object set to Nothing will set the record field to the Null state. Attempting to store a value in a non-existent field will cause an error. To check if the object is of a particular type get its HasInterface property. To obtain an automation object for the particular type call its GetInterface method.
#$+KFieldCount Property
	MsiRecord Object	Msi Objects	Database Tables
Returns the number of fields in the record. Read-only. Read access to fields beyond this count returns null values. Write access will fail.
Syntax
object.FieldCount
object
Required. The MsiRecord object.
#$+KIsInteger Property
	MsiRecord Object	Msi Objects	Database Tables
Returns a boolean indicating whether the field data is stored as an integer. Read-only.
Syntax
object.IsInteger(field)
object
Required. The MsiRecord object.
field
Required. The field number of the value within the record, 1-based.
#$+KIsNull Property
	MsiRecord Object	Msi Objects	Database Tables
Read-only. Returns True if the indicated field is null, False if the field contains data.
Syntax
object.IsNull(field)
object
Required. The MsiRecord object.
field
Required. The field number of the value within the record, 1-based.
#$+KIsChanged Property
	MsiRecord Object	Msi Objects	Database Tables
Read-only. Returns True if the field data has been changed since the record was initially created or since the last call to ClearUpdate. Note that integer fields always return True, even if unchanged (the implementation has no space to maintain the original integer, not a problem for the internal clients).
Syntax
object.IsChanged(field)
object
Required. The MsiRecord object.
field
Required. The field number of the value within the record, 1-based.
#$+KTextSize Property
	MsiRecord Object	Msi Objects	Database Tables
Returns the size of the text if the field data were to be access as string data. Read-only.
Syntax
object.TextSize(field)
object
Required. The MsiRecord object.
field
Required. The field number of the value within the record, 1-based.
#$+KClearData Method
	MsiRecord Object	Msi Objects	Database Tables
Clears the data in all fields, setting them to Null. Any objects stored in the fields will be released.
Syntax
object.ClearData
object
Required. The MsiRecord object.
#$+KFormatText Method
	MsiRecord Object	Msi Objects	Database Tables
Returns an MsiString object produced from the format string in record field 0 by substituting the record parameters designated in the format string. If field 0 of the record is null or an integer, then it is treated as being the string {1: [1]}{2: [2]} etc. If a substring of the form [number] is encountered, it is replaced by the contents of the record field of the given number if it exists, otherwise replaced by a null string. If a part of the string is enclosed in { }, and contains no field numbers, it is left unchanged, including the curly braces. If a part of the string is enclosed in { }, and contains one or more field numbers, and any of the field values are null or missing, all the text in the braces, and the braces themselves are removed; else the subsititued text is displayed without the curly braces.
Syntax
object.FormatText
object
Required. The MsiRecord object.
#$+KClearUpdate Method
	MsiRecord Object	Msi Objects	Database Tables
Clears the update states in the record, such that the IsChanged property will return False for all fields.
Syntax
object.ClearUpdate
object
Required. The MsiRecord object.
#$K+MsiRegKey Object
	Msi Objects	Database Tables
The MsiRegKey object provides an interface to the system registry.
Properties
Value
Key
Exists
GetSelfRelativeSD
ValueExists

Methods
RemoveValue
RemoveSubKey
RemoveSubTree
Values
SubKeys
CreateChild

Remarks
Differences between the Windows 95 and Windows NT registry: 
1. Windows NT does not allow you to create a new key under HKEY_LOCAL_MACHINE or HKEY_USERS, whereas this is allowed under Windows 95.  Thus code that attempts to do this will succeed under Windows 95 but fail when run on NT.
#$+KValue Property
	MsiRegKey Object	Msi Objects	Database Tables
The default or a named value for the current key. Read-write.
Syntax 1
object.Value
Syntax 2
object.Value(valueName)
object
Required. The MsiRegKey object.
valueName
Optional. Name of value, omit to access default value.
Remarks
The Value Property is always read or written as a string. The system Registry however supports values that may be strings, integers or hexadecimals. If the string is preceded by a #x the value is interpreted (for read/ write) as a hexadecimal value. If Value is preceded by a # it is interpreted as an integer. Else Value is interpreted as a string. In case the string begins with 2 or more consequtive #'s Value is interpreted as a string, dropping the first #.
#$+KExists Property
	MsiRegKey Object	Msi Objects	Database Tables
Boolean indicating whether the current registry key exists or whether to create/ delete the current registry key. Read-write.
Syntax
object.Exists
object
Required. The MsiRegKey object.
Remarks
The property can be used to query the registry to determine if the key exists. It can also be used with an assignment to create/ delete the key.
#$+KValueExists Property
	MsiRegKey Object	Msi Objects	Database Tables
Boolean indicating whether the given value exists under the current registry key. Read-only.
Syntax
object.ValueExists(valueName)
object
Required. The MsiRegKey object.
valueName
Name of the value.
Remarks

#$+KKey Property
	MsiRegKey Object	Msi Objects	Database Tables
The string representation of the key. Read-only.
Syntax
object.Key
object
Required. The MsiRegKey object.
Remarks
A possible value of this property would be "HKEY_CLASSES_ROOT\Software\Microsoft".
#$+KRemoveValue Method
	MsiRegKey Object	Msi Objects	Database Tables
The method is used to remove the default or a named value of the  MsiRegKey object.
Syntax
object.RemoveValue(valueName,value)
object
Required. The MsiRegKey object.
valueName
Optional. Name of the value, default value used if omitted.
value
Optional. the value. The value is used only in case of REG_MULTI_SZ registry values. If the value indicates a registry MULTI_SZ value append or prepend operation (there is an extra null either at the beginning or at the end of the string list) then only the strings that appear in the passed in value are removed from the existing registry value. If the value is not specified or the existing registry value is not of type REG_MULTI_SZ, then the entire value is deleted.
Remarks
The function does not return failure if it does not find the value.
#$+KRemoveSubKey Method
	MsiRegKey Object	Msi Objects	Database Tables
The method is used to remove an empty subkey of the MsiRegKey object.
Syntax
object.RemoveSubKey(subKey)
object
Required. The MsiRegKey object.
subKey
Required. the string denoting the subkey.
Remarks
The function fails if the subkey is not empty ie. if it has values  and/or subkeys.
#$+KRemoveSubTree Method
	MsiRegKey Object	Msi Objects	Database Tables
The method is used to remove a subkey of the MsiRegKey object.
Syntax
object.RemoveSubTree(subKey)
object
Required. The MsiRegKey object.
subKey
Required. the string denoting the subkey.
Remarks
The function removes the subkey and any subkeys and values below, if present.
#$+KValues Method
	MsiRegKey Object	Msi Objects	Database Tables
The method returns an enumeration object of all the value names of the values of the current key.
Syntax
object.Values
object
Required. The MsiRegKey object.
Remarks

#$+KSubKeys Method
	MsiRegKey Object	Msi Objects	Database Tables
The method returns an enumeration object of all the subkey names of the current key.
Syntax
object.SubKeys
object
Required. The MsiRegKey object.
Remarks

#$+KCreateChild Method
	MsiRegKey Object	Msi Objects	Database Tables
The method creates a new MsiRegKey object which is a subkey of the current MsiRegKey object.
Syntax
object.CreateChild(subKey)
object
Required. The MsiRegKey object.
subKey
Required. the string denoting subkey under the MsiRegKey object.
Remarks
Please note that this function creates a reference to a new MsiRegKey object that represents the physical registry key. The actual registry key is not opened or created on the construction of the MsiRegKey object. One has to use the member methods of the MsiRegKey object to manipulate the physical key itself.
#$+KGetSelfRelativeSD Property
	MsiRegKey Object	Msi Objects	Database Tables
The property returns a stream object containing a self relative security descriptor for the registry key.
Syntax
object.GetSelfRelativeSD()
object
Required. The MsiRegKey object.
Remarks
Please note that modifying this stream does not manipulate the security descriptor itself. Also note that security descriptors may be equivalent in that they represent the same set of permissions, without being identical binaries.
#$K+MsiMalloc Object
	Msi Objects
Provides basic memory allocation services for all modules. This object is exposed only for testing purposes. The MsiMalloc object is obtained from the MsiServices method GetAllocator. In debug builds, memory blocks are monitored for corruption such as overwriting bounds and double deletion. Also in debug builds memory leaks are displayed in dialog boxes. Stack traces are shown of who allocated the memory. In order to see these on your machine make sure the following DLLs are on your path. In WinNT - imagehlp.dll, dbi.dll and mspdb40.dll On win95 - mspdb40.dll.
!! Talk about diagnostic capabilities here !!
Methods
Alloc
Free
SetDebugFlags
GetDebugFlags
CheckAllBlocks
FCheckBlock
GetSizeOfBlock

#$+KAlloc Method
	MsiMalloc Object	Msi Objects
Allocates a new memory block and returns its address as a Long.
Syntax
object.Alloc(byteCount)
object
Required. The MsiMalloc object.
byteCount
Required. Number of bytes to allocate in the block.
Remarks
!!Additional notes!! 
#$+KFree Method
	MsiMalloc Object	Msi Objects
Frees a previously allocated memory block. This block must have been allocated with this allocator object.
Syntax
object.Free(memoryBlock)
object
Required. The MsiMalloc object.
memoryBlock
Required. Memory block returned from Alloc.
Remarks
!!Additional notes!! 
#$+KSetDebugFlags Method
	MsiMalloc Object	Msi Objects
Sets the debug flags for the debug allocator. Possible flags are:
	0x1	Tells the debug allocator never to actually free a memory block, but to keep it in the "Free List" which allows you to more easily tell if the block is being doubly-freed.
	0x2	Logs each memory allocation with the size and address from where the allocation was called.
This is only available when using debug services.
Syntax
object.SetDebugFlags(flag)
object
Required. The MsiMalloc object.
flag
Required. Flags.
Remarks
!!Additional notes!! 
#$+KGetDebugFlags Method
	MsiMalloc Object	Msi Objects
Returns the debug flags for the debug allocator. Possible flags are:
	0x1	Tells the debug allocator never to actually free a memory block, but to keep it in the "Free List" which allows you to more easily tell if the block is being doubly-freed.
	0x2	Logs each memory allocation with the size and address from where the allocation was called.
This is only available when using debug services.
Syntax
object.GetDebugFlags
object
Required. The MsiMalloc object.
Remarks
!!Additional notes!! 
#$+KCheckAllBlocks Method
	MsiMalloc Object	Msi Objects
Checks all the allocated memory blocks for corruption and returns true if everything is ok. False otherwise. It will display asserts about memory blocks which are corrupt if asserts are enabled.
This is only available when using debug services.
Syntax
object.CheckAllBlocks
object
Required. The MsiMalloc object.
Remarks
!!Additional notes!! 
#$+KFCheckBlock Method
	MsiMalloc Object	Msi Objects
Checks the allocated memory block for corruption and returns true if everything is ok. False otherwise. It will display asserts about memory blocks which are corrupt if asserts are enabled.
This is only available when using debug services.
Syntax
object.FCheckBlock(memoryBlock)
object
Required. The MsiMalloc object.
memoryBlock
Required. Memory block allocated through memory allocator.
Remarks
!!Additional notes!! 
#$+KGetSizeOfBlock Method
	MsiMalloc Object	Msi Objects
Returns the size of the allocated memory block. Only works on blocks allocated by the memory allocator.
This is only available when using debug services.
Syntax
object.GetSizeOfBlock(memoryBlock)
object
Required. The MsiMalloc object.
memoryBlock
Required. Memory block allocated through memory allocator.
Remarks
!!Additional notes!! 
GetSizeOfBlock