Issue
I have developed console mode installer for linux CentOS platform,i have used multiple console handler components.
How to close Installer at any point of time in console mode? i.e How to provide GUI cross/close button like functionality in console mode?
The default way to close shell script in linux is using ctrl+c how can we gracefully handle such scenario or can we provide any shortcut to close installer using java code or hotkeys?
Solution
Console mode is interrupted with CTRL-C. This will trigger a rollback.
If you have to react to the rollback with specific code, I would recommend adding a "Run script" action and use its "Optional Rollback Script" property.
Also, you can add an installer event listener in a "Run script" action like this:
context.addInstallerEventListener(new InstallerEventListener() {
public void installerEvent(InstallerEvent installerEvent) {
if (installerEvent.getType() == EventType.CANCELLING) {
// TODO
}
}
};
Answered By - Ingo Kegel Answer Checked By - David Marino (WPSolving Volunteer)