View Full Version : Exec actions, progress bars, JVM resolution, etc

03-30-2003, 09:22 PM

In our current project, we're developing "bundled" installer for our product. This "overall" installation program, invokes the installer for our product, and the installers of other products. The installer for our product is developed using ISMP 5.0 and the other installers are also developed using ISMP 5.0.

The first thing that came to mind was the multi-suite/single-suite installer aspect of ISMP. We were quick to try the approach; however, we found that all wizard panels (except the Install panel) of sub-installers are supressed. Thus, things like the license panel and other custom wizard actions of sub-installers are not executed by the suite installer. Saddened, we looked for other weaker approaches.

The first approach was to create an overall installer that invokes other sub-installers through exec wizard actions. So, we inserted exec wizard actions in the Installer tree and respect exec wizard actions to uninstall the sub-product within the Uninstaller tree. At first things seemed to be working; however, we ran into many problems:

1. JVM resolution: We're bundling a JVM with the overall installer. In the case where a JVM is not found on the user machine, the installer extracts the bundled JVM in a temporary location and runs the installer. The installer then invokes the sub-product installations. The JVM resolution bean for the sub-installers might resolve to the temporary JVM extracted by the overall installer. This was a problem since the temporary JVM (referenced by the sub-product installer) would be deleted upon completion of the overall installation.

To fix this problem, we always bundled a JVM with the overall installer and included no search instructions. That way, we were guaranteed that a JVM would always be installed at a specific location (like "_jvm"). In addition, we didn't create uninstaller launchers for the sub-products.

Ideally, we'd like to bundle a JVM with the installer and also bundle a JVM with the uninstaller. We do not want the bundled installer JVM to be "installed" anywhere. We want the uninstaller to always extract the bundled JVM to a temporary location and use it during uninstallation.

2. Exec Wizard Actions: We're using an ExecWizardAction to invoke our sub-product installers. Since in the end we want to provide a single "setup.exe" file to the user, we're bundling the executable. This works fine for the installation; however, it creates problems for the uninstaller.

When the uninstaller is created, the executable bundled for the installation is also bundled in the uninstall.jar archive. This is clearly wrong behavior and through our 30-day email support, we were able to determine that this is a BUG in ISMP 5.0. Don't know if a fix has been planned; but it would be nice to get a patch for this bug. Since one of our sub-product installers is around 90MB, it takes a while (around 2mins) for the uninstaller to be created.

To get around this problem, it was suggested to convert the ExecWizardActions to Product ExecActions. We tried this, but ran into other problems ... explained below.

3. Product ExecActions: Product ExecActions are not executed during a "re-installation" of a product. A way around this behavior is to insert a UninstallProductAction just before the ExecAction and to specify the appropriate bean id. I don't know if this is correct; however, this seems to work.

4. Progress Bar: Product ExecActions don't seem to accurately update the installation progress bar. We'd like a custom message to be displayed to the user while the ExecAction is running. In addition, we'd like the progress bar to be updated accurately while the ExecAction is running - meaning that the progress bar should increment by a specified amount when the ExecAction is complete.

We tried extending the ExecAction product action and overriding the getEstimatedTimeToInstall() method to return a value. This seems to change the behavior; however, it just makes the progress bar get stuck at a location other than the end (100%). But we could not figure out how to show a custom message to the user similar to how the file names are displayed as they are installed.

Overall, it's been a fun experience - learning and using ISMP. However, there have been times where I've felt very restricted even when writing custom code. The biggest suprise was the behavior of the suite installers. It was a suprise that we could not control which wizard panels are executed and displayed in the sub-installers.

We're trying to release our product sometime this week and I'd like to iron out some of the wrinkles that we currently have in the installer. Any help that ANYONE can provide will be greatly appreciated.