cancel
Showing results for 
Search instead for 
Did you mean: 
nikhilgupta
Flexera beginner

Re: How to disable the Cancel button

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/
0 Kudos
munsingh
Pilgrim

Re: How to disable the Cancel button

Well I have used the same code as provided in this thread and it works for me. I am using IA 2008 VP1.
0 Kudos

Need help to call CustomCodePanel to disable cancel button!

(1) I followed the discussion of this thread, came out with custom panel code as below:

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
0 Kudos
Yves_Kreis
Pilgrim

Re: How to disable the Cancel button

You need to include it as custom panel, not custom code!

Best Regards,
Yves
0 Kudos

Need help to call CustomCodePanel to disable cancel button!

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.

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();
}
}
}
0 Kudos
sukrit007
Pilgrim

Disabling X button

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);
}
}
}



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.
0 Kudos
ascans
Pilgrim

Still cannot disable Cancel button in IA2010

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
0 Kudos
pv7721
Flexera beginner

Re: How to disable the Cancel button

Maybe this was a regression in IA2010, could you give it a try in the latest version, IA 2011?
0 Kudos
moniv22
Pilgrim

Re: How to disable the Cancel button

Is your solution working for InstallAnywhere 2011 too or am I doing something wrong? Smiley Sad

Thank you
0 Kudos