cancel
Showing results for 
Search instead for 
Did you mean: 
henric
Pilgrim

How to disable the Cancel button

Is there a way to disable the Cancel button in InstallAnywhere?

I would like to do that since the user shouldn't be able to cancel the installation once the user has pressed Install and the installation has started.

Best regards
Henric
Labels (1)
0 Kudos
38 Replies
pv7721
Flexera beginner

Re: How to disable the Cancel button

Unfortunately, this is still not possible, even after 3 years since this feature request has been requested for the first time:

http://community.zerog.com/cgi-bin/ikonboard.cgi?s=4731965840afffff;act=ST;f=15;t=3656;hl=disable+an...

Moreover, if the user hits the Cancel button, there is no rollback mechanism (for the files already installed, only the TEMP folder is cleaned).
0 Kudos
henric
Pilgrim

Re: How to disable the Cancel button

Thanks for the rapid response.

I agree that it's a pity that this hasn't been implemented yet. Disabling Cancel button or rollback funtionality would have been good to have in this case.

Best regards
Henric
0 Kudos
Yves_Kreis
Pilgrim

Re: How to disable the Cancel button

Everything is possible... it's Java!
You can disable the Cancel button using Custom code.

Best Regards,
Yves
0 Kudos
henric
Pilgrim

Re: How to disable the Cancel button

OK. How? Can you please supply some example code?

Best regards
Henric
0 Kudos
Highlighted
Yves_Kreis
Pilgrim

Re: How to disable the Cancel button

I don't have example code for this, but I can provide you the idea how to do it:
a) Write an extension to CustomCodePanel and register your own listener to the next button
Container guiContainer = ((GUIAccess) ccpp.getService(GUIAccess.class)).getFrame();
if (guiContainer instanceof JFrame) {
guiContainer = (Container) ((JFrame) guiContainer).getContentPane().getComponent(0);
JButton guiJButton = (JButton) ((Container) guiContainer.getComponent(3)).getComponent(2);
guiJButton.addActionListener(new NextListener(guiContainer));
}

b) In the listener, wait for the button text to be "Install" and afterwards disable the Cancel button.

I hope this helps.

Best Regards,
Yves
0 Kudos
henric
Pilgrim

Re: How to disable the Cancel button

Thanks for your help.
I wrote some test code based on your idea but it seems like this doesn't work. I got the code to execute every time the next button was pressed. When the text was Install I disabled the Cancel button. But it seems like InstallAnywhere enables the button once the installation starts again.

I also tried to put the Custom code Panel as the last step in Pre-installation. Then I didn't need to add the listener to any button. Even in this case the Cancel button seem to get enabled. :confused:

I have given up for now. Instead I hope that this will be fixed sometime in the future. In that case we may be able to our next release instead.;)
0 Kudos
Yves_Kreis
Pilgrim

Re: How to disable the Cancel button

Try to put the Custom Code Panel as first step in the Install section...

Best Regards,
Yves
0 Kudos
henric
Pilgrim

Re: How to disable the Cancel button

I tried to put a Custom Code Action in the install section but this didn't work. I am not sure how I put a custom code panel in the install section?

Best regards
Henric
0 Kudos
Yves_Kreis
Pilgrim

Re: How to disable the Cancel button

I will try to disable it today and let you know if I was successful...

Best Regards,
Yves
0 Kudos