public void cancel() {
    if (currentProgress != null) {
      currentProgress.setCanceled(true);
    }

    if (overallProgress != null) {
      overallProgress.setCanceled(true);
    }

    super.cancel();
  }
  public void execute() {
    LogManager.logEntry("getting all installation data");
    final Registry registry = Registry.getInstance();
    final List<Product> products = registry.getProductsToInstall();
    final int percentageChunk = Progress.COMPLETE / products.size();
    final int percentageLeak = Progress.COMPLETE % products.size();

    overallProgress = new CompositeProgress();
    overallProgress.setPercentage(percentageLeak);
    overallProgress.synchronizeDetails(true);

    getWizardUi().setProgress(overallProgress);
    for (int i = 0; i < products.size(); i++) {
      // get the handle of the current item
      final Product product = products.get(i);

      // initiate the progress for the current element
      currentProgress = new Progress();

      overallProgress.addChild(currentProgress, percentageChunk);
      try {
        String prop =
            product.getRegistryType() == RegistryType.REMOTE
                ? PROGRESS_TITLE_REMOTE_PROPERTY
                : PROGRESS_TITLE_LOCAL_PROPERTY;
        String overallProgressTitle =
            StringUtils.format(getProperty(prop), product.getDisplayName());
        overallProgress.setTitle(overallProgressTitle);

        product.downloadData(currentProgress);

        // check for cancel status
        if (isCanceled()) return;

        // sleep a little so that the user can perceive that something
        // is happening
        SystemUtils.sleep(200);
      } catch (DownloadException e) {
        // wrap the download exception with a more user-friendly one
        InstallationException error =
            new InstallationException(
                StringUtils.format(
                    getProperty(DOWNLOAD_FAILED_EXCEPTION_PROPERTY), product.getDisplayName()),
                e);

        // adjust the product's status and save this error - it will
        // be reused later at the PostInstallSummary
        product.setStatus(Status.NOT_INSTALLED);
        product.setInstallationError(error);

        // since the installation data for the current product failed to
        // be downloaded, we should cancel the installation of the products
        // that may require this one
        for (Product dependent : registry.getProducts()) {
          if ((dependent.getStatus() == Status.TO_BE_INSTALLED)
              && registry.satisfiesRequirement(product, dependent)) {
            String exString =
                StringUtils.format(
                    getProperty(DEPENDENT_FAILED_EXCEPTION_PROPERTY),
                    dependent.getDisplayName(),
                    product.getDisplayName());

            final InstallationException dependentError = new InstallationException(exString, error);

            dependent.setStatus(Status.NOT_INSTALLED);
            dependent.setInstallationError(dependentError);

            products.remove(dependent);
          }
        }

        // finally notify the user of what has happened
        LogManager.log(ErrorLevel.ERROR, error);
      }
    }
    LogManager.logExit("... finished getting of the installation data");
  }