|
install4j API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.install4j.api.CustomAction
com.install4j.api.InstallAction
public abstract class InstallAction
All install actions must be derived from this class. You have to override the appropriate methods and provide a public constructor with no arguments.
Of the three perform* methods, only one is called for a particular installation.
The different environment of these three perform* methods is apparent in the different parameters. While performAction gets an InstallerWizardContext and a ProgressInterface, performUnattendedAction only gets a InstallerContext. Finally, performFirstRunAction is not passed any arguments. You'll have to code your action accordingly for any of the cases that you support.
If you don't produce any archive media files, you can ignore performFirstRunAction. By default, unattended installations are not enabled, so you can choose to ignore performUnattendedAction. If you only produce archive installers, you can ignore performAction, too.
If necessary, you can override the two rollback* methods which correspond to the perform* methods.
In the installer wizard, the user can cancel the installation. If your custom action takes a long time, you should override the cancel method to let your performAction method know that it should return as soon as possible. You can do that by setting a flag in cancel that is checked regulary by your performAction method.
| Constructor Summary | |
|---|---|
InstallAction()
|
|
| Method Summary | |
|---|---|
void |
cancel()
Override this method to react to the user canceling the installation. |
boolean |
performAction(InstallerWizardContext context,
ProgressInterface progressInterface)
Override this method to perform the custom action in the installation wizard. |
boolean |
performFirstRunAction()
Override this method to perform the custom action for archive media files. |
boolean |
performUnattendedAction(InstallerContext context)
Override this method to perform the custom action for unattended installations. |
void |
rollback(InstallerWizardContext context,
ProgressInterface progressInterface)
Override this method to perform a rollback of the performAction method. |
void |
rollbackUnattended(InstallerContext context)
Override this method to perform a rollback of the performUnattendedAction method. |
| Methods inherited from class com.install4j.api.CustomAction |
|---|
getPercentOfTotalInstallation |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public InstallAction()
| Method Detail |
|---|
public boolean performAction(InstallerWizardContext context,
ProgressInterface progressInterface)
throws UserCanceledException
Note: For unattended installations, the performUnattendedAction method is called instead.
context - the context of the installation.progressInterface - an interface to display progress and messages.
UserCanceledException - thrown e.g. by file installation methods. You can let
these exceptions pass through, they will be handled by the framework.public boolean performUnattendedAction(InstallerContext context)
context - the context of the installation.
public boolean performFirstRunAction()
public void rollback(InstallerWizardContext context,
ProgressInterface progressInterface)
context - the context of the installation.progressInterface - an interface to display progress and messages.public void rollbackUnattended(InstallerContext context)
context - the context of the installation.public void cancel()
|
install4j API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||