An
Installer object must be initially created to load the automation support that is required for COM to access the installer functions. This object provides wrappers to create the top-level objects and access their methods.
You can create the
Installer object from the ProgId "WindowsInstaller.Installer".
Methods
The Installer object defines the following methods.
| Method | Description |
AddSource | Adds a source to the list of valid network sources in the sourcelist. |
AdvertiseProduct | Advertises an installation package. |
AdvertiseScript | Advertises an installation package.
|
ApplyPatch | Invokes an installation and sets the PATCH property to the path of the patch package for each product listed by the patch package as eligible to receive the patch. |
ApplyMultiplePatches | Applies one or more patches to products eligible to receive the patch. Sets the PATCH property to the path of the patch packages provided. |
ClearSourceList | Removes all network sources from the sourcelist. |
CollectUserInfo | Invokes a user interface wizard sequence that collects and stores both user information and the product code. |
ConfigureFeature | Configures the installed state of a product feature. |
ConfigureProduct | Installs or uninstalls a product. |
CreateAdvertiseScript | Generates an advertise script. |
CreateRecord | Returns a new Record object with the requested number of fields. |
EnableLog | Enables logging of the selected message type for all subsequent installation sessions in the current process space. |
ExtractPatchXMLData | Extracts information from a patch as an XML string. |
FileHash | Takes the path to a file and returns a 128-bit hash of that file. |
FileSignatureInfo | Takes the path to a file and returns a SAFEARRAY of bytes that represents the hash or the encoded certificate. |
FileSize | Returns the size of the specified file. |
FileVersion | Returns the version string or language string of the specified path. |
ForceSourceListResolution | Forces the installer to search the source list for a valid product source the next time a source is required. |
InstallProduct | Opens an installer package and initializes an installation session. |
LastErrorRecord | Returns a Record object that contains error parameters for the most recent error from the function that produced the error record. |
OpenDatabase | Opens an existing database or creates a new one. |
OpenPackage | Opens an installer package for use with functions that access the product database and install engine. |
OpenProduct | Opens an installer package for an installed product using the product code. |
ProvideAssembly | Returns the installed path of an assembly. |
ProvideComponent | Returns the full component path and performs any necessary installation. |
ProvideQualifiedComponent | Returns the full component path and performs any necessary installation. |
RegistryValue | Reads information about a specified registry key of value. |
ReinstallFeature | Reinstalls features or corrects problems with installed features. |
ReinstallProduct | Reinstalls a product or corrects installation problems in an installed product. |
RemovePatches | Removes one or more patches to products eligible to receive the patch.
|
UseFeature | Increments the usage count for a particular feature and returns the installation state for that feature. |
Properties
The Installer object defines the following properties.
| Property | Description |
ComponentClients | Returns a StringList object enumerating the set of clients of a specified component. |
ComponentPath | Returns the full path to an installed component. |
ComponentQualifiers | Returns a StringList object enumerating the set of registered qualifiers for the specified component. |
Components | Returns a StringList object enumerating the set of installed components for all products. |
Environment | The string value for an environment variable of the current process. |
FeatureParent | Specifies the parent feature of a feature. |
Features | Returns a StringList object enumerating the set of published features for the specified product. |
FeatureState | Returns the installed state of a feature. |
FeatureUsageCount | Returns the number of times that the feature has been used. |
FeatureUsageDate | Returns the date that the specified feature was last used. |
FileAttributes | Returns a number that represents the combined file attributes for the designated path to a file or folder. |
Patches | Returns a StringList object that contains all the patches applied to the product. |
PatchesEx | Enumerates a collection of Patch objects. |
PatchFiles | Returns a StringList object that contains a list of files that can be updated by the provided list of patches. |
PatchInfo | Returns information about a patch. |
PatchTransforms | Returns the semicolon delimited list of transforms that are in the specified patch package and applied to the specified product. |
ProductElevated | Returns True if the product is managed or False if the product is not managed. |
ProductInfo | Returns the value of the specified attribute for an installed or published product. |
ProductInfoFromScript | Returns the value of the specified attribute that is stored in an advertise script. |
Products | Returns a StringList object enumerating the set of all products installed or advertised for the current user and machine.
|
ProductsEx | Enumerates a collection of Product objects. |
ProductState | Returns the install state information for a product. |
QualifierDescription | Returns a text string that describes the qualified component. |
RelatedProducts | Returns a StringList object enumerating the set of all products installed or advertised for the current user and machine with a specified UpgradeCode property in their property table. |
ShortcutTarget | Examines a shortcut and returns its product, feature name and component if available. |
SummaryInformation | Returns a SummaryInfo object that can be used to examine, update and add properties to the summary information stream of a package or transform. |
UILevel | Indicates the type of user interface to be used when opening and processing subsequent packages within the current process space. |
Version | Returns the string representation of the current version of Windows Installer. |
Requirements
| Version | Requires Windows Installer 4.0 on Windows Server 2008 or Windows Vista. Windows Installer on Windows Server 2003, Windows XP, and Windows 2000. |
| DLL | Requires Msi.dll. |
| IID | IID_IInstaller is defined as 000C1090-0000-0000-C000-000000000046. |
See Also
Using the
Automation Interface
Windows Installer Scripting Examples
Send comments about this topic to Microsoft
Build date: 6/5/2008