Installer Object

Windows Installer

Installer Object

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 Access type Description

ClientsEx

Read-only

Returns a RecordList object that lists products that use a specified installed component.

Windows Installer 4.5 and earlier:  Not supported.

ComponentClients

Read-only

Returns a StringList object enumerating the set of clients of a specified component.

ComponentPath

Read-only

Returns the full path to an installed component.

ComponentPathEx

Read-only

Returns a RecordList object that gives the full path of a specified installed component.

Windows Installer 4.5 and earlier:  Not supported.

ComponentQualifiers

Read-only

Returns a StringList object enumerating the set of registered qualifiers for the specified component.

Components

Read-only

Returns a StringList object enumerating the set of installed components for all products.

ComponentsEx

Read-only

Returns a RecordList object that lists installed components.

Windows Installer 4.5 and earlier:  Not supported.

Environment

Read-only

The string value for an environment variable of the current process.

FeatureParent

Read-only

Specifies the parent feature of a feature.

Features

Read-only

Returns a StringList object enumerating the set of published features for the specified product.

FeatureState

Read-only

Returns the installed state of a feature.

FeatureUsageCount

Read-only

Returns the number of times that the feature has been used.

FeatureUsageDate

Read-only

Returns the date that the specified feature was last used.

FileAttributes

Read-only

Returns a number that represents the combined file attributes for the designated path to a file or folder.

Patches

Read-only

Returns a StringList object that contains all the patches applied to the product.

PatchesEx

Read-only

Enumerates a collection of Patch objects.

PatchFiles

Read-only

Returns a StringList object that contains a list of files that can be updated by the provided list of patches.

PatchInfo

Read-only

Returns information about a patch.

PatchTransforms

Read-only

Returns the semicolon delimited list of transforms that are in the specified patch package and applied to the specified product.

ProductElevated

Read-only

Returns True if the product is managed or False if the product is not managed.

ProductInfo

Read-only

Returns the value of the specified attribute for an installed or published product.

ProductInfoFromScript

Read-only

Returns the value of the specified attribute that is stored in an advertise script.

Products

Read-only

Returns a StringList object enumerating the set of all products installed or advertised for the current user and machine.

ProductsEx

Read-only

Enumerates a collection of Product objects.

ProductState

Read-only

Returns the install state information for a product.

QualifierDescription

Read-only

Returns a text string that describes the qualified component.

RelatedProducts

Read-only

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

Read-only

Examines a shortcut and returns its product, feature name and component if available.

SummaryInformation

Read-only

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

Read-only

Indicates the type of user interface to be used when opening and processing subsequent packages within the current process space.

Version

Read-only

Returns the string representation of the current version of Windows Installer.

 

Requirements

VersionWindows Installer 5.0 on Windows Server 2008 R2 or Windows 7. Windows Installer 4.0 or Windows Installer 4.5 on Windows Server 2008 or Windows Vista. Windows Installer on Windows Server 2003, Windows XP, and Windows 2000
DLLMsi.dll
IIDIID_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: 8/13/2009

© 2009 Microsoft Corporation. All rights reserved.