Interface InstallAction

All Superinterfaces:
Action, Bean, Serializable
All Known Implementing Classes:
AbstractInstallAction, AbstractInstallOrUninstallAction

public interface InstallAction extends Action
All install actions must implement this interface. You have to override all methods and provide a public constructor with no arguments. It is recommended that you choose one of the derived abstract classes as a super class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    This method is called by the framework to perform the action during installation.
    boolean
    This method is called by the framework to determine if the action supports a rollback.
    void
    This method is called by the framework to perform a rollback of the install method.

    Methods inherited from interface com.install4j.api.actions.Action

    init
  • Method Details

    • install

      boolean install(InstallerContext context) throws UserCanceledException
      This method is called by the framework to perform the action during installation. You can use the ProgressInterface available from context.getProgressInterface() in order to display messages to the user or ask simple questions. For long-running actions, make sure to check context.isCancelling() frequently to comply with a cancel request from the user.
      Parameters:
      context - the context of the installation.
      Returns:
      should return true if successful. If it returns false, the error message and the failure strategy for the action configured in the install4j GUI will be used by the installer.
      Throws:
      UserCanceledException - thrown for example by file installation methods. You can let these exceptions pass through, they will be handled by the framework.
    • rollback

      void rollback(InstallerContext context)
      This method is called by the framework to perform a rollback of the install method. This method is only called if the install method has already been called and the installation is canceled by the user or if the installation fails. If this action is executed before a rollback barrier that has already been passed successfully, the rollback will not be performed for this action. The "Installation screen" is the only default rollback barrier in install4j.
      Parameters:
      context - the context of the installation.
    • isRollbackSupported

      boolean isRollbackSupported()
      This method is called by the framework to determine if the action supports a rollback.
      Returns:
      true if a rollback is supported.