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
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: How could I terminate the installation?
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
‎Apr 05, 2006
10:30 PM
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.
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.
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 06, 2006
09:08 AM
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.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 06, 2006
10:15 PM
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.
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.
![](/skins/images/A5EADE085F77DE82FB3B14D6B307AE6A/responsive_peak/images/icon_anonymous_message.png)