Installer - Configuring Actions

     


  For more information on actions and related concepts, please see the corresponding help topic.
  Actions are attached to screens. The drop-down lists above the list of actions allow you to select
  • the installation mode for which screens and actions should be displayed. Screens and actions are configured separately for the installer and the uninstaller.
  • the screen whose attached actions should be displayed. If you add a new action it will be added to the screen selected in this drop-down list. If you open the drop-down popup, the number of attached actions is displayed in bold to the right of each screen.

    In addition to the configured screens, there's an imaginary "Startup" screen that allows you to perform actions before the installer or uninstaller is displayed. If any of these actions fails and has a "Quit on failure" failure strategy, the installer or uninstaller will not be shown.

Most often actions are added to the "Install files" or "Uninstall files" screens which are displayed be default. The advantage of those screens is that they have a progress and status bar that is utilized by actions. If a screen does not expose a progress interface, the status and progress messages of attached actions are lost. This is all right for near-instantaneous actions such as setting an environment variable, but for time-consuming operations the user should be informed about progress, even if it is only an indeterminate progress bar. As an alternative to the "Install files" or "Uninstall files" screens, you can use "Display progress" screens to create additional installation phases.

Some actions have an "affinity" to a particular screen and will suggest to add themselves to that screen, such as the actions in the "Final options" category which would like to go to the "Finish" screen. However, this is only a suggestion to guide you for the most common use case.

Some actions have an associated screen that allows the user to modify the behavior of the action. For example, the "Install a service" action has a corresponding "Services" screen that allows the user to decide whether the service should be installed and started on bootup. If such a relationship exists, a corresponding notification is displayed after adding an action.

To quickly jump to the current screen in the screens configuration, you can use the  [Go To Screen] tool bar button.

  On the left side you see the list of currently configured actions. The  [Add] button shows a popup window where you can select whether to add
  • a standard action, i.e. a action from the list of default actions that is made available by install4j or a action that is contributed by an installed extension. A registry dialog will be shown where you can select the desired action.
  • a action that is contained in your custom code. New types of actions can be developed with the install4j API. In your custom code configuration you can specify code locations that are scanned for suitable classes. A class selector will be shown where you can select the desired class.

If you select a single action in the list of actions, you can edit its properties on the right side, if you select multiple actions, you can copy them to the clipboard or delete them with a single action. If your selection is a single contiguous interval, you can move the entire block up or down in the list.

  After you add a action, the list of actions shows it with its type display name. This is often enough, however, if you have multiple instances of the same action alongside, a custom name makes it easier to distinguish these instances. You can assign a custom name to each action with the  [rename] button. The type name is still displayed in brackets after the custom name. To revert to the default, just enter an empty custom name in the rename dialog.
  install4j offers an inter-process clipboard for actions. You can  [cut] or  [copy] actions to the clipboard and  [paste] them in a different instance of install4j. Note that references to launchers or references to files in the distribution tree might not be valid after pasting in this case. Pasted actions are appended to the end of the list unless sequence restrictions with respect to the the already present actions force a different order.
  Common properties of actions are:
  • Condition expression
    This expression is evaluated just before the action is executed. If the expression or script returns false, the action will be skipped.
  • Rollback barrier
    If the action should be a rollback barrier. When a rollback barrier is completed, none of the preceding actions will be rolled back. You can use this property to prevent an incomplete rollback of complex changes or to protect actions from rollback when the user hits "Cancel" in the post-install phase.
  • Can be executed multiple times
    If the action can be executed multiple times. If unselected, the action will only be executed once and do nothing for subsequent invocations of the containing screen. The default settings for screens ensure that a screen with actions is only shown once. However, if the "Back button" property of a screen is changed of if you skip screens programatically, a screen with actions might be shown multiple times.
  • Failure strategy
    If an action fails (i.e. returns 'false'), the installer or uninstaller can continue, quit, or ask the user what to do. If you select something other than 'Continue on failure', you should enter an error message in the "Error message" property unless the action displays the error itself.
  • Error message
    If the action fails, this error message is displayed to the user, otherwise the action fails silently.