cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
321tseug
Level 3

How could I terminate the installation?

1.preinstall
 1.1 a wizard dialog to gather some information that user inputed.

2.install
 2.1 custom product action to do installation
  ...
  do some installation depend on what user had inputed
  ...
  if (something wrong) {
   ProductAction.this.getServices().displayUserMessage("Error","Something Wrong!",WizardServicesUI.ERROR);
   back to 1.1 dialog //???
  }

I can't find any way or code to terminate the installation and back to wizard dialog.

could someone tell me how to solve the problem?
thanks for any help.
Labels (1)
0 Kudos
(2) Replies
RobertDickau
Flexera Alumni

To exit the installation from a product action, you can throw an uncaught ProductException; please see, for example, Macrovision KB article Q106190 at http://support.installshield.com.
0 Kudos
321tseug
Level 3

Thanks for your Tip.
I made the program like this:

1.preinstall
 1.1 a wizard dialog to gather some information that user inputed.

2.install
 2.1 custom product action to do installation

[PHP]
...
do some installation depend on what user had inputed
...
if (something wrong) {
ProductAction.this.getServices().displayUserMessage("Error","Something Wrong!",WizardServicesUI.ERROR);
// set a variable
try {
ISVariable oResult = getServices().getISDatabase().getVariable("product_action_error");
if ( oResult != null ) {
oResult.setValue(1);
}
}catch ( Exception e ) {
logEvent(this,Log.DBG,e);
}
....
throw new ProductExcpetion( ...);
}[/PHP]

3.postinstall
 3.1 a custom dialog will display depend on the condition ( $V( product_action_error) != 0 )
  and I added a entered listener to the dialog:
[PHP]
public void enteredXXXDialog(com.installshield.event.ui.ISDialogContext arg0)
{
final SwingWizardUI wizardUI = (SwingWizardUI)arg0.getWizardUI();
SwingUtilities.invokeLater( new Runnable() {
public void run() {
System.out.println("entered");
wizardUI.doPrevious();
}
});
}[/PHP]


and it runs well for me although the program flow is troublesome. :confused: :confused:
when some error occurs during the installation,
it shows a error dialog and it automatically turns back to the preinstall wizard dialog.
0 Kudos