Editing a Custom Action

<< Click to Display Table of Contents >>

RayPack > 7.3 u6 > User Guide > PackDesigner > MSI / MST / RPP Based Projects > Advanced Mode > Custom Actions 

Editing a Custom Action

In order to edit a custom action from the CUSTOM ACTIONS view within the Advanced mode, its current settings have to be loaded into the details pane on the right. To do so, users select the custom action from the list view on the left-hand side.

 

icn_CustomActionStatusSwitchTileIf the tile based details view is active, users may edit some of the custom action settings directly by clicking on the tile that displays the current setting. For all tiles that display a set of state indicating rectangles at the bottom, e. g. execution mode and behavior as shown on the left, the different options may be set by simply clicking the tile until the desired value is displayed.

 

To access the full set of custom action properties for manipulation, users have to click on the black title tile. The CUSTOM ACTION PROPERTIES dialog will be displayed.

 

If the table based details view is active, users have to use the button Edit this custom action to display the CUSTOM ACTION PROPERTIES dialog.

 

The CUSTOM ACTION PROPERTIES Dialog

The custom action properties dialog allows packagers to manipulate the full scope of settings related to the custom action object. The dialog is divided into tabs:
 

General - changing settings for name, run mode and activity related behavior

PROCESSING AND EXECUTION - changing settings for execution mode, patch options and execution related behavior

 

The dialog shows a set of buttons at the lower right corner, allowing users to:

Save changes and close the dialog by clicking on the OK button

APPLY changes whilst the dialog is kept open

CLOSE the dialog without trying to save the changes

 

Tab: GENERAL

Name

The name of the custom action may not be left empty, has to be unique throughout the packaging project, and should not contain special characters. Please make sure to use a name value that allows you to quickly identify the custom action intention and purpose. Keep in mind that abbreviations may be hard to remember later, and that other packagers that might have to edit your packaging project in the future may not know them.

 

Run Mode

Immediate - Custom actions that set properties, feature states, component states, or target directories, or that schedule system operations by inserting rows into sequence tables, can in many cases use immediate execution safely.

Deferred - Custom actions that change the system directly, or call another system service, must be deferred to the time when the installation script is executed.

Rollback - The rollback procedure runs as a clean-up whenever an installation fails to be executed. Custom actions that are marked to run during rollback will not be executed during the primary installation.

Commit - The commit procedure runs to finalize successful installations. A commit custom action is the complement to a rollback custom action and can be used with rollback custom actions to reverse custom actions that make changes directly to the system.

 

The run mode may not be changed for custom actions of type set folder, set property, and error message.

 

User Context

Run as system - When custom actions are defined to run as system user, the properties of some user related properties and paths are affected, such as the user related AppData directories and current user registry targets.

Run as current user - This standard setting impersonates the custom action to the user that actually installs the package.

Terminal server aware - Required only in terminal server based target environments.

 

The user context may not be changed for custom actions of type set folder, set property, and error message.

 

The additional controls shown depend on the actual custom action type, and therefore vary:

 

Type: Executable

Type

The following four basic types are available for executable custom actions:

 

Executable from a binary source
Requires an executable resource object within the Binary table.
Please refer to the help section about Resources to get details on how to manage binary resources via the Visual Designer interface.
 

Executable deployed within this package
Requires an executable file object within the File table.
Please refer to the help section about Files and Folders to get details on how to manage files via the Visual Designer interface.
 

Executable pointed by a property
Requires a property containing a path that points to a specific file, which may either be stored within the current packaging project or on the target machine.
Please refer to the help section about Properties to get details on how to manage properties via the Visual Designer interface.
 

Executable on destination
Allows to define a path to an executable file.

 

Stream, File, Property, or Directory

The type selected above controls, which setting actually has to be defined. Changing the custom action type immediately switches the controls to enable stream file or property selection, etc..

 

Command or Arguments

Once again, the type selected above decides whether arguments or a specific command is required.

 

Type: DLL

Type

The type selection controls whether the DLL will be provided as resource stream or deployed file. Switching the type automatically changes the control for the source definition.

 

Stream or File

Select the binary resource or file deployed along with the package. Please make sure to provide a valid dll reference.

 

DLL Entry Point

The DLL has to be called through the entry point, passing the handle to the current install session as argument. The specified entry point must match that exported from the DLL.

 

Type: VBS or JS Script

Type

The four available script types are

Binary stream resource

Inline script source code

Property value

File deployed within the package

 

Base for the actual script content

According to the selected type, users are requested to select or define the actual script content or reference.

Using the Edit the script link calls an additional SCRIPT tab, only available when script based custom actions are edited. This tab offers the existing source code as changeable script code, and contains an additional input control for the definition of the initiating function.

 

Type: Set Property and Set Folder

Property or Folder name

Select the property or folder that has to be manipulated.

 

New value

Define the new value for the property or folder that has to be set at custom action run-time

Type: Error Message

The message actually displayed as error information may be changed. Please keep in mind that the message text cannot be empty.

 

Tab: PROCESSING AND EXECUTION

The collection of actually available controls depends on the type and configuration settings for the custom action. The tab may contain any combination of the following property controls:

 

The following optional behavior settings may be activated:

 

Execution Mode

Always execute

Execute only if running on client after UI sequence

Execute only once

Execute only once per process

 

Run During Patch Uninstall

This option is available for Installer versions later than 4.0. It may be used to exclusively execute custom actions on patch uninstall procedures. To read details about the scenario for patch uninstall custom actions, refer to MSDN.

 

Run as 64-bit Script

On 64-bit operating systems, Windows Installer may call custom actions that have been compiled for 32-bit or 64-bit systems. A 64-bit custom action based on Scripts must be explicitly marked as a 64-bit

 

Check Exit Code Upon Finishing

If this option is activated, the custom action will be considered as finished successfully if the return code 0 is given. All other return values express erroneous custom action execution. Deactivate this option to ignore the return code and always proceed with the procedure the custom action is a part of.

 

Run this Action Asynchronously (in the Background)

This option may be set for executable and DLL based custom actions. If it is set, the execution of the parent sequence is continued whilst the custom action logic is still executed.