August 10, 2010

Adding a VBScript Custom Action to Installshield Merge Module


This article explains about adding a VBScript Custom Action to the Merge Module created using InstallShield 2010 SP1 and using the same in another InstallShield Project (Say Basic MSI Project).

Create a VBScript Custom Action (stored in binary table) in traditional way as you do in your Basic MSI or InstallScript MSI project. But the options to specify the Install UI / Execute Sequence and Conditions are not directly available as Custom Action properties in merge module project

So the conditions can be added to a custom action in a merge module by inserting the custom action into the sequence and modifying the condition column of the ModuleInstallUISequence or ModuleInstallExecuteSequence table. The following knowledge base article explains how to Insert a Custom Action into a Merge Module:

If you want the custom action to run only when a specific patch is being applied then you would possible use the PATCH property and the specific property name for the patch as part of the condition.
This is documented in the following msdn article:

To run the custom action during the uninstallation of a patch, you can set the "Run during Uninstall of Patch" property to yes. This can be changed under the custom action view and is described in the following helpnet article: