Microsoft Windows Installer

Commands for accessing Microsoft Windows Installer


package require twapi_msi
cast_msi_object MSICOMOBJ MSITYPE


This module is experimental.

This module provides commands for accessing the Microsoft Windows Installer (MSI) component through its COM interfaces. The primary motivation for this module is that although the Installer provides a COM interface, it cannot be bound and types discovered at run time. This module provides the required type definitions for the various interfaces. These type definitions must be programmatically loaded into a MSI object instance by the application.

Creation and Destruction of MSI objects

MSI objects are created through TWAPI's COM interface commands. The Installer object is created through the command

set msiobj [comobj WindowsInstaller.Installer]

Once an MSI object is no longer needed, it must be deleted like any other COM object.

$msiobj -destroy

Note a final call to $MSIOBJ -destroy is required for all MSI objects, not just the top-level Installer object.

Once an MSI object is created, it must be cast to the appropriate type with the command cast_msi_object before calling any methods on the object.

twapi::load_msi_prototypes $msiobj Installer
cast_msi_object MSICOMOBJ MSITYPE
Loads the type information corresponding to the MSI type MSITYPE into the COM object command MSICOMOBJ. MSITYPE corresponds to one of the object types defined in the Windows Installer Reference: Database, FeatureInfo, Installer, Patch, Product, Record, RecordList, Session, StringList, SummaryInfo, UiPreview and View.

When an object of a MSI type is created, it should be passed to cast_msi_object along with the type before making any method calls on the objects.


Copyright © 2007-2009 Ashok P. Nadkarni

Tcl Windows API 4.0.61