* detected and the user has chosen in the prior step to clean them up.
*
* @return the install step (not <code>null</code>)
*/
protected InstallStep cleanUnlinkedInstallsStep() {
final RunOperationsStep step = new RunOperationsStep(installer) {
public boolean canExecute() {
return options.getBoolean(OPTION_DELETE_UNUSED_INSTALLATIONS)
&& options.getBoolean(OPTION_CLEAN_CONFIG);
}
public boolean canRollback() {
return false;
}
public void aboutToStep() {
File installDir = new File(options.getString(InstallOptions.OPTION_INSTALL_DIR));
String primaryProductDirName = getPrimaryProduct().getInstallDirName();
File primaryProductDir = new File(installDir, primaryProductDirName);
add(new CleanUnlinkedInstallsOperation(installer));
add(new CleanRegistryOperation(options, primaryProductDir.getAbsolutePath()));
}
};
step.setTitle("Delete old installations");
step.setDescription("Deleting old installations... this may take a few minutes...");
installer.add(step);
return step;
}