Access to Properties in MSI Deferred-Execution Custom Actions.
Original Publication Date: 2001-Jun-16
Included in the Prior Art Database: 2003-Jun-20
A program is disclosed that enables MSI custom actions executing in deferred mode to have easy access to multiple properties. MSI (Microsoft* Installer) is an emerging method of installing software on Microsoft Windows systems. Installing using MSI is a Microsoft Windows* 2000 logo certification requirement for certain types of product, or soon will soon be. During an MSI installation, user-written code ("Custom Actions") can be invoked to perform tasks that MSI cannot handle. Custom actions (CA's), typically DLL functions, can be invoked in several distinct phases (modes) of execution. When in deferred execution mode, a (CA) has very limited acces to "properties". Properties, which are managed by MSI, contain system and application information to which a CA might need access to accomplish its task. Typically, a property would contain a path, information collected from the user, or any other textual information desired. A CA must issue an MsiGetProperty() call to get the value of a particular property. Normally a CA which runs in an MSI-controlled environment has access only to one property, whose name is the same as the CA. Any information that the CA needs must be pre-stored in that one property by an earlier action. Unfortunately, properties can contain up to only 256 bytes of data. This is insufficient for many tasks; for instance a single Windows path can be 256 bytes long, leaving no room for more information. This program provides a mechanism for deferred-execution custom actions to gain access to any desired property easily. Furthermore, the mechanism works also in modes other than deferred execution, allowing a developer to change a CA's mode with no coding changes. The program works by saving the values of any properties that CA's might need in a temporary file. A CA, instead of calling MsiGetProperty(), issues a GETPROPERTY macro. This macro determines the mode of execution (deferred or not) and either issues MsiGetProperty() or gets the required property value from the temporary file.