Package com.install4j.api.actions
Interface InstallAction
- All Superinterfaces:
Action
,Bean
,Serializable
- All Known Implementing Classes:
AbstractInstallAction
,AbstractInstallOrUninstallAction
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 TypeMethodDescriptionboolean
install
(InstallerContext context) 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
rollback
(InstallerContext context) This method is called by the framework to perform a rollback of theinstall
method.
-
Method Details
-
install
This method is called by the framework to perform the action during installation. You can use theProgressInterface
available fromcontext.getProgressInterface()
in order to display messages to the user or ask simple questions. For long-running actions, make sure to checkcontext.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 returnsfalse
, 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
This method is called by the framework to perform a rollback of theinstall
method. This method is only called if theinstall
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.
-