View Full Version : Determine if a multi-suite installer product install failed

08-02-2004, 01:50 PM
I have 2 products installers. Within each product installer, I have a ProductFailCondition that I have attached to a custom cleanup bean that, when the installation fails, it executes and does some cleanup. This works great when these installers are run separately.

Now I have created a dynamic suite project that will be used to execute both installers. However, if either product installer fails now, my custom "cleanup" bean for the failing product does not get run because the ProductFailCondition bean does not get a valid message being returned from the ProductService. (I put a suite reference bean to the custom cleanup bean in the suite)

The code from the ProductFailCondition:

ProductService ps = (ProductService)getWizardBean().getServices().getService(ProductService.NAME);

summaryProperties = ps.getProductSummary(ProductService.DEFAULT_PRODUCT_SOURCE,
summaryType, ProductService.TEXT);

System.out.println("Message string is " + summaryProperties.getProperty(ProductService.SUMMARY_MSG));

And this now returns:

Message string is Summary not available.This may be a result of an invalid summary type request -- e.g. requesting an install summary when an uninstall has occurred.

So my question: How can I have the individual products that are part of the suite installer know when they have failed, so they can perform some post-failed-install actions?

08-03-2004, 09:09 AM
I might suggest a different approach, although it is a bit of a hack. For each sub product, add a new component at the root of the product tree. Make this the last component in the product tree. Under this component add an ascii file update bean, and have this bean create a new file. This file will act as a flag to indicate that the product was installed successfully. If the file does not exist, then you know that hte install action failed, and a rollback occured. If this file does exist, then you know that the product was installed sucessfully.

You can then call your cleanup bean, based upon the existance of this flag for each product in your suite.