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
- :
- Re: 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
‎Feb 05, 2008
12:03 PM
Yves Kreis wrote:
Try the following:
Thanks for the quick reply Yves. I got it running.
I was being a moron and expecting GUIAccess gui to
be initialized in a (using a same named LOCAL variable named gui lol)
One thing I noticed is the X box is still active, but the CANCEL button is inactive.
Any clue if this is something editable (from the looks of it, it doesn't look like part of the open IA api.)
Also, the panel (Pre-installation summary) now reads "Next" instead of "Install" because of the custom panel used to do this.
If the last panel returns false on setupUI, you'd think IA would catch this and display "install" on the second to last panel....
A workaround is to put the disableCancelButtonPanel before Pre-installation summary.
~Chris.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 06, 2008
03:34 AM
Dear ckanywhere529,
The X box cannot be disabled as far as I know. If you find something I would be pleased to know! However it should not work...
You can try to put the CustomCodePanel earlier in the pre-install tasks. This might solve the Next <-> Install problem. You can also try to return true.
Best Regards,
Yves
The X box cannot be disabled as far as I know. If you find something I would be pleased to know! However it should not work...
You can try to put the CustomCodePanel earlier in the pre-install tasks. This might solve the Next <-> Install problem. You can also try to return true.
Best Regards,
Yves
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 19, 2008
05:29 AM
Hi all,
i followed Yves advice but it doesn't work 😞 😞 😞
I have these classes:
and
I put MyPanel just before Pre-Installation Summary and DisableCancelDuringInstallAction as first action in Install section... can you help me?
Thanks
i followed Yves advice but it doesn't work 😞 😞 😞
I have these classes:
public class MyPanel extends CustomCodePanel {
CustomCodePanelProxy panelProxy = null;
public static GUIAccess gui = null;
public A() {
}
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;
}
}
and
public class DisableCancelDuringInstallAction extends CustomCodeAction {
/**
*
*/
public DisableCancelDuringInstallAction() {
// TODO Auto-generated constructor stub
}
/* (non-Javadoc)
* @see com.zerog.ia.api.pub.CustomCodeAction#getInstallStatusMessage()
*/
@Override
public String getInstallStatusMessage() {
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see com.zerog.ia.api.pub.CustomCodeAction#getUninstallStatusMessage()
*/
@Override
public String getUninstallStatusMessage() {
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see com.zerog.ia.api.pub.CustomCodeAction#install(com.zerog.ia.api.pub.InstallerProxy)
*/
@Override
public void install(InstallerProxy arg0) throws InstallException {
try {
MyPanel.gui.setExitButtonEnabled(false);
} catch (Exception e) {
e.printStackTrace();
}
}
/* (non-Javadoc)
* @see com.zerog.ia.api.pub.CustomCodeAction#uninstall(com.zerog.ia.api.pub.UninstallerProxy)
*/
@Override
public void uninstall(UninstallerProxy arg0) throws InstallException {
// TODO Auto-generated method stub
}
}
I put MyPanel just before Pre-Installation Summary and DisableCancelDuringInstallAction as first action in Install section... can you help me?
Thanks
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 19, 2008
07:45 AM
In class A, method setupUI you create a second variable gui, i.e. you don't assign the result to the static one!
Best Regards,
Yves
Best Regards,
Yves
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 19, 2008
07:51 AM
Sorry,
I have no class A, constructor public A() {} is public MyPanel() {}.
It doesn't work yet.
I have no class A, constructor public A() {} is public MyPanel() {}.
It doesn't work yet.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 19, 2008
07:58 AM
Class MyPanel then instead of class A.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 19, 2008
08:10 AM
Yves Kreis wrote:
Class MyPanel then instead of class A.
I think I'm going crazy... could you post me some piece of code???
Thanks a lot
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 19, 2008
08:18 AM
(...)
public boolean setupUI(CustomCodePanelProxy customCodePanelProxy) {
gui = (GUIAccess)customCodePanelProxy.getService(GUIAccess.class);
}
(...)
Best Regards,
Yves
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 19, 2008
08:35 AM
Thank you Yves,
finally I understood what the problem was. Now it works.
Best Regards
finally I understood what the problem was. Now it works.
Best Regards
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 13, 2009
06:25 AM
I am using IA 2008 VP1 and have not been successful in disabling cancel button. gui object is set in CustomPanel code but when CustomCodeAction executes, gui becomes null. I tried using static int which retains its value from panel code to customcode action.
Is there something changed in IA 2008/
Is there something changed in IA 2008/
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 28, 2009
08:05 AM
Well I have used the same code as provided in this thread and it works for me. I am using IA 2008 VP1.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 26, 2009
02:29 PM
(1) I followed the discussion of this thread, came out with custom panel code as below:
Compiled it to SetCustomPanel.class as part of our IS_Installer.jar file.
I'm not sure how to call this custom panel other than through Execute Custom Code Action. Is this a correct assumption?
When I added this panel as custom code action before the Pre-Install Summary panel, I then kept getting error stating this class is UNAVAILABLE.
[PHP]com.ibm.filenet.is.install.SetCustomPanel
Status: ERROR
Additional Notes: ERROR - class com.ibm.filenet.is.install.SetCustomPanel unavailable.[/PHP]
What did I miss? Appreciate input to confirm.
(2) Also, for the 2nd part, the Custom Code to disable the Cancel button, to be called in the Install Task. The suggestion is to call as the first thing in the Install task. We have many visual trees in the Install Task like one for the USER_MAGIC_FOLER_x, one for User Install Folder, one for DO NOT INSTALL, etc. Should I add this custom code under the User Install Folder or it really doesn't matter?
PS - I'm actually using IA 2009 SP1. Sorry for the confusion since I want to continue using this thread instead of starting a new thread.
Regards, Gloria
public class SetCustomPanel extends CustomCodePanel
{
CustomCodePanelProxy panelProxy = null;
public static GUIAccess gui = null;
public boolean setupUI(CustomCodePanelProxy customCodePanelProxy)
{
gui = (GUIAccess)customCodePanelProxy.getService(GUIAccess.class);
return false;
}
}
Compiled it to SetCustomPanel.class as part of our IS_Installer.jar file.
I'm not sure how to call this custom panel other than through Execute Custom Code Action. Is this a correct assumption?
When I added this panel as custom code action before the Pre-Install Summary panel, I then kept getting error stating this class is UNAVAILABLE.
[PHP]com.ibm.filenet.is.install.SetCustomPanel
Status: ERROR
Additional Notes: ERROR - class com.ibm.filenet.is.install.SetCustomPanel unavailable.[/PHP]
What did I miss? Appreciate input to confirm.
(2) Also, for the 2nd part, the Custom Code to disable the Cancel button, to be called in the Install Task. The suggestion is to call as the first thing in the Install task. We have many visual trees in the Install Task like one for the USER_MAGIC_FOLER_x, one for User Install Folder, one for DO NOT INSTALL, etc. Should I add this custom code under the User Install Folder or it really doesn't matter?
PS - I'm actually using IA 2009 SP1. Sorry for the confusion since I want to continue using this thread instead of starting a new thread.
Regards, Gloria
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 26, 2009
06:58 PM
You need to include it as custom panel, not custom code!
Best Regards,
Yves
Best Regards,
Yves
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 29, 2009
01:48 PM
Thanks Yves.
I finally figured out on how to do the Custom Panel through Plugin.
Now I'm pretty sure both my custom panel in the preinstall and custom code in the install are called without errors. What my test shows that the 'Cancel' button is still showing as Enabled when the panel displays "Installing ... Java Runtime Environment'. Once this is done, the 'Cancel' button is finally Disabled when installer starts copying files.
Is this the best behavior I can get? Or is there any way to also disable the 'Cancel' button for installing the JRE?
Below is the excerpt of the code. Any comment is greatly appreciated.
I finally figured out on how to do the Custom Panel through Plugin.
Now I'm pretty sure both my custom panel in the preinstall and custom code in the install are called without errors. What my test shows that the 'Cancel' button is still showing as Enabled when the panel displays "Installing ... Java Runtime Environment'. Once this is done, the 'Cancel' button is finally Disabled when installer starts copying files.
Is this the best behavior I can get? Or is there any way to also disable the 'Cancel' button for installing the JRE?
Below is the excerpt of the code. Any comment is greatly appreciated.
This custom code panel is called right before the Pre-install Summary Panel.
public class SetCustomPanel extends CustomCodePanel
{
CustomCodePanelProxy panelProxy = null;
public static GUIAccess gui = null;
public boolean setupUI(CustomCodePanelProxy customCodePanelProxy)
{
gui = (GUIAccess)customCodePanelProxy.getService(GUIAccess.class);
return false;
}
}
This Custom code is executed as the 1st step under the $USER_INSTALL_DIR$ Visual Tree.
public class DisableCancelAtInstall extends CustomCodeAction
{
public void install( InstallerProxy ip ) throws InstallException
{
try {
SetCustomPanel.gui.setExitButtonEnabled(false);
} catch (Exception e) {
e.printStackTrace();
}
}
}
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 16, 2009
07:47 PM
You may also disable X button , by de-registering the window listener. Assuming that you have guiAccess object,
Frame frame = guiAccess.getFrame();
Container parentContainer = frame;
if(parentContainer instanceof JFrame) {
JFrame jframe = (JFrame) parentContainer;
WindowListener [] listeners =jframe.getWindowListeners();
for(WindowListener listener: listeners) {
if(!listener.getClass().getName().startsWith("java")) {
jframe.removeWindowListener(listener);
}
}
}
Frame frame = guiAccess.getFrame();
Container parentContainer = frame;
if(parentContainer instanceof JFrame) {
JFrame jframe = (JFrame) parentContainer;
WindowListener [] listeners =jframe.getWindowListeners();
for(WindowListener listener: listeners) {
if(!listener.getClass().getName().startsWith("java")) {
jframe.removeWindowListener(listener);
}
}
}
ckanywhere529 wrote:
Thanks for the quick reply Yves. I got it running.
I was being a moron and expecting GUIAccess gui to
be initialized in a (using a same named LOCAL variable named gui lol)
One thing I noticed is the X box is still active, but the CANCEL button is inactive.
Any clue if this is something editable (from the looks of it, it doesn't look like part of the open IA api.)
Also, the panel (Pre-installation summary) now reads "Next" instead of "Install" because of the custom panel used to do this.
If the last panel returns false on setupUI, you'd think IA would catch this and display "install" on the second to last panel....
A workaround is to put the disableCancelButtonPanel before Pre-installation summary.
~Chris.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 20, 2011
04:47 PM
Hi,
I have implemented the solution suggested in this thread. I have confirmed the code is executed in my installer but the "Cancel" button still not being disabled (I think I saw a brief moment the Cancel button being gray out but enabled afterward). The only thing is that I am using IA2010, would it make a different. Please let me know if anyone run into same problem with IA2010 or have a solution for it.
Thanks
I have implemented the solution suggested in this thread. I have confirmed the code is executed in my installer but the "Cancel" button still not being disabled (I think I saw a brief moment the Cancel button being gray out but enabled afterward). The only thing is that I am using IA2010, would it make a different. Please let me know if anyone run into same problem with IA2010 or have a solution for it.
Thanks
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 21, 2011
06:07 AM
Maybe this was a regression in IA2010, could you give it a try in the latest version, IA 2011?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 11, 2013
06:44 AM
Is your solution working for InstallAnywhere 2011 too or am I doing something wrong? 😞
Thank you
Thank you