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

Using Custom Actions

The custom actions are the 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 Custom Actions view when the Custom Actions node of a project is selected in the Projects view.

There are two kinds of custom actions, namely pre & post actions and system actions. The pre & post actions are generic commands to be performed, and the system actions are predefined commands.

Custom Actions

Custom Actions

The Custom Actions drop-down button from the New group on the Project Ribbon page allows creating a new action of a specific type and add it to the selected project.

Pre & Post

Pre & Post Action

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

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

Creating a new pre & post action

Pic 1. Creating a new pre & post action

Each pre & post 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 custom 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 the execution context, if to run it as administrator or as invoker in case of current user account context, 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 Custom Actions Ribbon page should be used to move the selected pre & post actions up the execution order.

Move Down

Move Down

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

By default, the pre & post 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 Custom Actions Ribbon page.

SAM Licenses Installation

SAM Licenses Installation

The SAM Licenses Installation button from the New group on the Custom Actions contextual Ribbon page should be used to create a new action for installing Software Assets Management (SAM) licenses to the Software Licensing Service (SLS) and add it to the selected project.

To create a new action for installing Software Assets Management (SAM) licenses, choose the New SAM Licenses Installation item in the Custom Actions view pop-up menu from the System Actions part. Alternatively, you can use the SAM Licenses Installation option within the Custom Action button from the New group on the Project Ribbon page and the SAM Licenses Installation button on the Custom Actions contextual Ribbon page. In each case, the New SAM Licenses Installation dialog will appear on the screen to let you configure the action to be created Pic 2.

Creating a new SAM Licenses Installation action

Pic 2. Creating a new SAM Licenses Installation action

For each SAM licenses installation action, you can define a name and a set of licenses to be installed to the Software Licensing Service (SLS) during the installation of the generated MSI package.

Pin Application Action

Pin Application Action

The Pin Application Action button from the New group on the Custom Actions contextual Ribbon page allows you to create a new action to pin any application to or unpin it from the Start Menu and/or the Task Bar.

If you would like to pin any application to or unpin it from the Start Menu and/or the Task Bar, you can use the Pin Application action. To create such an action, choose the New Pin Application Action in the Custom Actions view pop-up menu from the System Actions part. Alternatively, you can use the Pin Application Action option within the Custom Action button from the New group on the Project Ribbon page and the Pin Application Action button on the Custom Actions contextual Ribbon page. The New Pin Application Action dialog will appear on the screen in any case Pic 3.

Creating a new Pin Application action

Pic 3. Creating a new Pin Application action

For each action, you should define its name, the application to operate, whether the application should be pinned or unpinned, and if the operation should be performed for the Start Menu, the Task Bar or both.

Edit

Edit

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

Delete

Delete

The Delete button from the Management group on the contextual Custom 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 Custom 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 Custom Actions Ribbon page allows you to move the selected actions to another project.

The custom 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 Custom Actions contextual 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 Custom Actions contextual Ribbon page. The well-known drag/drop and copy/paste techniques are fully supported for copying and moving custom actions between projects. You can also use the Copy To and Move To buttons from the Management group on the contextual Custom Actions contextual 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 4.

Copying custom actions between projects

Pic 4. Copying custom actions between projects

Now you are introduced to the custom actions concept and the abilities the custon actions provide you with, thus you should be able to use this feature of MSI Package Builder to resolve appropriate tasks.