cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Not applicable

Custom event does not work in uninstall sequence

In uninstall sequence, i added a custom event to detect silent mode, but it is not invoked when i run uninstall. Please kindly help. Appreciate your help.

i am using the following code from the "help"

TASK

To determine the interface being used:

1. First, you need to get an instance of the UI using the following code:

WizardUI ui = getWizard().getUI();


2. Next, use the Java instanceof operator to check if the UI is an instance of the AWTWizardUI, SwingWizardUI, or ConsoleWizardUI class. If it is not an instance of any of these classes, then the installation is running in silent mode.

if (ui instanceof AWTWizardUI){


System.out.println("running in AWT mode");


}


else if (ui instanceof SwingWizardUI){


System.out.println("running in Swing mode");


}


else if (ui instanceof ConsoleWizardUI) {


System.out.println("running in Console mode");


}


else {


System.out.println("running in Silent mode");


}


3. To compile this code, you need to import classes/packages into your JAVA file so that the compiler will find the classes that are being used. At a minimum, you need to include the following classes and packages:

import com.installshield.wizard.*;


import com.installshield.wizard.awt*;


import com.installshield.wizard.console*;


import com.installshield.wizard.swing.*;
Labels (1)
0 Kudos
(9) Replies
RobertDickau
Flexera Alumni

I'm a bit rusty with ISMP, but perhaps try this:
WizardUI ui = event.getUserInterface( ); 

if (ui instanceof SwingWizardUI)
// setup is running in Swing mode
else if (ui instanceof ConsoleWizardUI)
// setup is running in console mode
else
// setup is running in silent mode
0 Kudos
Not applicable

i will try
0 Kudos
Not applicable

if i put in WizardUI ui = event.getUserInterface();
it will fail the compile saying that "cannot find symbol" on event.

i guess it is because i am having the custom event calling this method and i was using WizardActionContext? The reason of this guess is i can see in help it says
WizardUI ui = getWizard().getUI();
0 Kudos
RobertDickau
Flexera Alumni

What is your custom event signature?
0 Kudos
Not applicable

i think no custom event can work in my current uninstall sequence. any idea why?

signature? onExecuting? (i added wizard action then custom event. then in "Event", select the context then select onExecuting...
0 Kudos
Not applicable

i guess i see what you mean by signature.

for some reason, by default, the name generated upon clicking onExecuting is a name with long string appended.
now i can see it in event browser, and i cannot delete it
0 Kudos
RobertDickau
Flexera Alumni

Putting aside detecting the UI mode for the moment, is your event called at all during uninstallation? (If you use JOptionPane.showMessageDialog with a message there, does something show up?)
0 Kudos
Not applicable

tried, i added JOptionPane.showMessageDialog, No, it does not show.
0 Kudos
Not applicable

is it jvm? or launcher?
0 Kudos