Logo
EMCO MSI Package Builder Documentation MSI Package Builder Overview | Download | Purchase

Using Pre and Post Actions

The pre and post actions are the generic actions that can be performed together with the MSI package install and/or uninstall process. They can be used, for example, to prepare the system for the installations, to check prerequisites, to start the application on installation completion, etc. These actions are defined on a project level and are displayed in the Pre & Post Actions view when the Pre & Post Actions node of a project is selected in the Projects view.

Action

Action

The Action button from the New group on the Project Ribbon page and on the contextual Pre & Post Actions Ribbon page should be used to create a new action and add it to the selected project.

To create a new action, choose the New Action item from the Pre & Post Actions view pop-up menu. Alternatively, you can use the Action button from the New group on the Project Ribbon page and on the contextual Pre & Post Actions Ribbon page. In any case the New Action dialog will appear on the screen to let you configure the action to be created Pic 1.

Creating a new action

Pic 1. Creating a new action

Each action can be represented with a command (such as an executable or script file) or a simple action to open a file or an URL. The actual action to be executed should be provided to the Command field. You can input the action command manually and choose a file to be opened either from the project, or from the local file system. Use the Select File and Select Project File buttons build into the edit box to select required files. The parameters to be passed to the command are to be defined in the Parameters field. Both the Command and Parameters fields support the property definition placeholders, so you can use the standard MSI properties while configuring the actions. See the Property Definition Placeholders section of this document for the list of available placeholders.

Warning

The Windows Installer does not allow installing, configuring and uninstalling packages in parallel, though it is impossible to execute installation, repair or uninstallation of another MSI package within the pre and post actions execution scope.

As for the start type, you can choose between Before Install, After Uninstall, Before Uninstall and After Uninstall. Thus, you can, for example check some prerequisites and perform preparation steps before the package installation and perform a kind of clean-up after uninstalling the package. For each action, you can choose if to run it as administrator or as invoker, if the installer should wait for the action to complete and if it should analyze the completion result.

Info

The Administrator value from the Run As drop-down should be selected only for executing the actions that required administrative privileges to function. It is insecure to run all actions as administrator.

If the successful action completion is required for the installation to complete successfully, than you can check both the Wait until this action is completed and Interrupt the install/uninstall process if this action is completed with an error options. However, be aware of the fact, that if the action is implemented incorrectly, the whole installation will fail.

Move Up

Move Up

The Move Up button from the Order group on the contextual Pre & Post Actions Ribbon page should be used to move the selected actions up the execution order.

Move Down

Move Down

The Move Down button from the Order group on the contextual Pre & Post Actions Ribbon page should be used to move the selected actions down the execution order.

By default, the actions execution order is the same as the addition order, but you can reorder the actions using the Move Up and Move Down items from the pop-up menu or the Order group on the contextual Pre & Post Actions Ribbon page.

Edit

Edit

The Edit button from the Management group on the contextual Pre & Post Actions Ribbon page should be used to change the selected action configuration.

Delete

Delete

The Delete button from the Management group on the contextual Pre & Post Actions Ribbon page allows you to delete the selected actions from the selected project.

Copy To

Copy To

The Copy To button from the Management group on the contextual Pre & Post Actions Ribbon page should be used to copy the selected actions to another project.

Move To

Move To

The Move To button from the Management group on the contextual Pre & Post Actions Ribbon page allows you to move the selected actions to another project.

The pre and post actions can be changed, deleted and transferred between projects. To change the action, select it and either double-click, or choose the Edit item in pop-up menu or on the contextual Pre & Post Actions Ribbon page. While editing an action, you can define the same scope of properties as during its creation. To delete the action from the project, select it and choose the Delete item in the pop-up menu or on the contextual Pre & Post Actions Ribbon page. The well-known drag/drop and copy/paste techniques are fully supported for copying and moving pre and post actions between projects. You can also use the Copy To and Move To buttons from the Management group on the contextual Pre & Post Actions Ribbon page to transfer the selected actions to a different project. While using these buttons you are proposed to select a project from those available in a dialog and confirm your selection Pic 2.

Copying pre and post actions between projects

Pic 2. Copying pre and post actions between projects

Now you are introduced to the pre and post actions concept and the abilities the pre and post actions provide you with, thus you should be able to use this feature of MSI Package Builder to solve appropriate problems.