This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallAnywhere
- :
- InstallAnywhere Forum
- :
- How to disable the Cancel button
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 07, 2007
03:46 AM
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
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
(38) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 07, 2007
05:28 AM
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+and+cancel+and+button
Moreover, if the user hits the Cancel button, there is no rollback mechanism (for the files already installed, only the TEMP folder is cleaned).
http://community.zerog.com/cgi-bin/ikonboard.cgi?s=4731965840afffff;act=ST;f=15;t=3656;hl=disable+and+cancel+and+button
Moreover, if the user hits the Cancel button, there is no rollback mechanism (for the files already installed, only the TEMP folder is cleaned).
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 07, 2007
06:03 AM
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
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
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 07, 2007
07:02 AM
Everything is possible... it's Java!
You can disable the Cancel button using Custom code.
Best Regards,
Yves
You can disable the Cancel button using Custom code.
Best Regards,
Yves
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 07, 2007
07:29 AM
OK. How? Can you please supply some example code?
Best regards
Henric
Best regards
Henric
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 07, 2007
07:44 AM
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
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
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
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 08, 2007
07:07 AM
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.;)
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.;)
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 08, 2007
11:57 AM
Try to put the Custom Code Panel as first step in the Install section...
Best Regards,
Yves
Best Regards,
Yves
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 09, 2007
02:04 AM
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
Best regards
Henric
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 09, 2007
02:10 AM
I will try to disable it today and let you know if I was successful...
Best Regards,
Yves
Best Regards,
Yves
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 16, 2007
04:16 AM
Hi henric
It is not possible to disable cancel button on the installing panel through the way suggested by Yves Kreis.
because the way Yves Kreis is saying to disable the cancel button will work only for that custom code panel
and installing panel is not shown as a panel in the installation project(as u have already seen) so u cant substitute it.
If u find any other way please let me know
It is not possible to disable cancel button on the installing panel through the way suggested by Yves Kreis.
because the way Yves Kreis is saying to disable the cancel button will work only for that custom code panel
and installing panel is not shown as a panel in the installation project(as u have already seen) so u cant substitute it.
If u find any other way please let me know
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 16, 2007
04:44 AM
I still need to solve a problem with my installer, as soon as I am done with it I will try to get the idea I announced working and will let you know about the results... Its Java, everything can be done!
Best Regards,
Yvse
Best Regards,
Yvse
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 27, 2007
02:50 AM
Good morning,
Unfortunately it took me longer to test this as I thought; I had to solve important problems first. But nevertheless this one is quite easy:
a) Use a CustomCodePanel in Pre-Install and store the GUIAccess object in a static variable.
b) Use a CustomCodeAction as first action during Install step and use the enableExitButton(false) method on the previously stored GUIAccess object.
Hope this helps.
Best Regards,
Yves
Unfortunately it took me longer to test this as I thought; I had to solve important problems first. But nevertheless this one is quite easy:
a) Use a CustomCodePanel in Pre-Install and store the GUIAccess object in a static variable.
b) Use a CustomCodeAction as first action during Install step and use the enableExitButton(false) method on the previously stored GUIAccess object.
Hope this helps.
Best Regards,
Yves
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 24, 2007
04:40 AM
Hi,
I was using IA7.5.
I did the following:
a) Use a CustomCodePanel in Pre-Install and store the GUIAccess object in a static variable.
b) Use a CustomCodeAction as first action during Install step and use the enableExitButton(false) method on the previously stored GUIAccess object.
It's 98% working because during the first 10-15 seconds of the Install step, where is shows:
"Installing.... Java Runtime Environment", the Cancel button is still enabled. But after that, the cancel/exit button is automatically disabled throughout the rest of the Install step.:o
Though in IA 2008 it's not working at all... 😞
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 29, 2007
02:18 AM
public class PanelDisableCancel extends CustomCodeAction{
@Override
public String getInstallStatusMessage() {
// TODO Auto-generated method stub
return null;
}
@Override
public String getUninstallStatusMessage() {
// TODO Auto-generated method stub
return null;
}
@Override
public void install(InstallerProxy ruleProxy) throws InstallException {
setInstallerProxy(ruleProxy);
GUIAccess gui = (GUIAccess)ruleProxy.getService(GUIAccess.class);
System.out.println("Haiiiiiiiiiiiiiii");
System.out.println(gui);
gui.getFrame().setTitle("new title");
try{
gui.setExitButtonEnabled(false);
}catch (Exception e) {
e.printStackTrace();
}
try{
gui.setNextButtonEnabled(false);
}catch (Exception e) {
e.printStackTrace();
}
try{
gui.setPreviousButtonEnabled(false);
}catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void uninstall(UninstallerProxy arg0) throws InstallException {
try {
String installDirStr = arg0.substitute("$USER_INSTALL_DIR$");
FileService fs = (FileService)arg0.getService(FileService.class);
File installDir = new File(installDirStr);
if (installDir.exists())
fs.deleteDirectory(installDirStr, false,
true);
} catch (Exception e) {
File f = new File("c:\\logUninstall5.txt");
FileOutputStream fis = null;
try{
fis = new FileOutputStream(f);
fis.write(e.getMessage().getBytes());
fis.flush();
fis.close();
}
catch (Exception e1) {
// TODO: handle exception
}
}
}
@Override
public String getInstallStatusMessage() {
// TODO Auto-generated method stub
return null;
}
@Override
public String getUninstallStatusMessage() {
// TODO Auto-generated method stub
return null;
}
@Override
public void install(InstallerProxy ruleProxy) throws InstallException {
setInstallerProxy(ruleProxy);
GUIAccess gui = (GUIAccess)ruleProxy.getService(GUIAccess.class);
System.out.println("Haiiiiiiiiiiiiiii");
System.out.println(gui);
gui.getFrame().setTitle("new title");
try{
gui.setExitButtonEnabled(false);
}catch (Exception e) {
e.printStackTrace();
}
try{
gui.setNextButtonEnabled(false);
}catch (Exception e) {
e.printStackTrace();
}
try{
gui.setPreviousButtonEnabled(false);
}catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void uninstall(UninstallerProxy arg0) throws InstallException {
try {
String installDirStr = arg0.substitute("$USER_INSTALL_DIR$");
FileService fs = (FileService)arg0.getService(FileService.class);
File installDir = new File(installDirStr);
if (installDir.exists())
fs.deleteDirectory(installDirStr, false,
true);
} catch (Exception e) {
File f = new File("c:\\logUninstall5.txt");
FileOutputStream fis = null;
try{
fis = new FileOutputStream(f);
fis.write(e.getMessage().getBytes());
fis.flush();
fis.close();
}
catch (Exception e1) {
// TODO: handle exception
}
}
}
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 03, 2008
02:58 AM
Hi Yves Kreis
Great work done
Thanks a lot it worked.
Great work done
Thanks a lot it worked.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 03, 2008
03:50 AM
You are welcome.
Best Regards,
Yves
Best Regards,
Yves
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 17, 2008
01:32 PM
Yves Kreis wrote:
Good morning,
Unfortunately it took me longer to test this as I thought; I had to solve important problems first. But nevertheless this one is quite easy:
a) Use a CustomCodePanel in Pre-Install and store the GUIAccess object in a static variable.
b) Use a CustomCodeAction as first action during Install step and use the enableExitButton(false) method on the previously stored GUIAccess object.
Hope this helps.
Best Regards,
Yves
Hello,
One thing that is confusing me on this method is how to store the GUIAccess object in a static variable at PRE-INSTALL time and access this variable at INSTALL time.
Would I create CLASS A that Extends customcodepanel and CLASS B that Extends customcodeaction?
I think the EVERY VARIABLE IS A STRING in IA methodology has confused me on as to how I'd share the GUIAccess object between two classes using IA...
Maybe it's the lack of sleep 😞 heh
Thanks,
CK
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 17, 2008
02:14 PM
public class a extends ... {
public static GUIAccess gui = ...
...
}
public class b extends ... {
...
a.gui.enableExitButton(false);
...
}
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 04, 2008
03:51 PM
Yves Kreis wrote:public class a extends ... {
public static GUIAccess gui = ...
...
}
public class b extends ... {
...
a.gui.enableExitButton(false);
...
}
My understanding of above:
public class a extends CustomCodePanel {
CustomCodePanelProxy panelProxy = null;
public static GUIAccess gui = null;
public disableCancelDuringInstallPanel() {
}
public boolean setupUI(CustomCodePanelProxy customCodePanelProxy) {
panelProxy = customCodePanelProxy;
GUIAccess gui = (GUIAccess)customCodePanelProxy.getService(GUIAccess.class);
return false;
}
@Override
public void panelIsDisplayed() {
}
@Override
public String getTitle() {
return "Installing...";
}
@Override
public boolean okToContinue() {
return true;
}
@Override
public boolean okToGoPrevious() {
return false;
}
}
public class b extends CustomCodeAction {
private a testPanel; <-- I feel here is my issue (how can I get class b to see the GUIAccess object from class a (inited at PRE-INSTALL) :confused:
public disableCancelDuringInstallAction () {
}
@Override
public void install(InstallerProxy ip) throws InstallException {
try {
testPanel.gui.setExitButtonEnabled(false);
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void uninstall(UninstallerProxy up) throws InstallException {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public String getInstallStatusMessage() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public String getUninstallStatusMessage() {
throw new UnsupportedOperationException("Not supported yet.");
}
}
}
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 05, 2008
11:55 AM
Try the following:
ckanywhere529 wrote:
public class b extends CustomCodeAction {
public disableCancelDuringInstallAction () {
}
@Override
public void install(InstallerProxy ip) throws InstallException {
try {
a.gui.setExitButtonEnabled(false);
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void uninstall(UninstallerProxy up) throws InstallException {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public String getInstallStatusMessage() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public String getUninstallStatusMessage() {
throw new UnsupportedOperationException("Not supported yet.");
}
}
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)