MSI Factory 2.3

Custom Actions

Custom Actions

Previous topic Next topic  

Custom Actions

Previous topic Next topic  

MSI Factory

This dialog lets you create custom actions that will be run during the installation. While Windows Installer has a lot of built in actions to operate on tables of settings (registry actions, INI file actions, install files, etc.) there may be times that you need to accomplish something in your installer that is not directly supported by Windows Installer. There are a few general things that you should know about custom actions which follow.

Microsoft recommends that you minimize your use of custom actions as part of your installation strategy. Custom actions can be problematic because they are outside of the direct control of Windows Installer. As such, unless you design them to do so, they may not support things like uninstall and rollback properly. According to Microsoft, many if not most problems that occur during a Windows Installer installation can be attributed to the use of custom actions.

Having said that, however, custom actions are a reality that must be used by many installations to achieve their installation goals. Many times they are used to do fairly benign tasks like setting a property, reading specific information from the user's system, or validating the value of a property (such as a serial number or password). The danger comes in because they can really do most anything to the user's system and can be seen as a security or stability risk. When you create a custom action you are effectively breaking the "rules" of the Windows Installer to accomplish your own tasks.

As you may have already discovered, custom actions can be fairly complex to author and schedule properly. Whenever possible, make use of the Windows Installer's built-in actions. For example, it is much better to use the built-in registry actions than to write a custom action that makes registry changes.

You can create the following kinds of custom actions by clicking the Add button:

Call DLL

Allows you to call a function from a DLL. Note that the DLL function must follow the MSI standards for custom actions. Corresponds to Windows Installer custom action types 1 and 17. See the Call DLL dialog for more details.

Run Executable

Allows you to run another program (executable). Corresponds to Windows Installer custom action types 2, 18 and 50. See the Run Executable dialog for more details.

Run VBScript

Allows you to run a VBScript. Corresponds to Windows Installer custom action types 6, 22 and 54. See the Run VBScript dialog for more details.

Run JScript

Allows you to run a JScript. Corresponds to Windows Installer custom action types 21, 37 and 53. See the Run JScript dialog for more details.

Run LuaScript

Allows you to run a LuaScript file. LuaScript is an interpreted scripting language created for MSI Factory that allows you to easily create very flexible and powerful scripts that can be run during installation. See the Run LuaScript dialog for more details.

Set Folder

Allows you to set a folder's value. Corresponds to Windows Installer custom action type 35. Can be based on the value of a property. See the Set Folder dialog for more details.

Set Property

Allows you to set a property's value. Corresponds to Windows Installer custom action type 51. Can be based on the value of other properties. See the Set Property dialog for more details.

Terminate Installation

Allows you to display a message and then terminate the installation. Corresponds to Windows Installer custom action type 19. See the Terminate Installation dialog for more details.

Once you have added a custom action to the list you can edit it using the Edit button or remove it using the Remove button.

More Information

MSDN Online: CustomAction Table

MSDN Online: Summary List of All Custom Action Types

WiX Help File: CustomAction Element


Learn More: Indigo Rose Software - MSI Factory - Buy Now - Contact Us