Vector installPackages = installData.getInstallPackages();
private Vector installedPackages = new Vector();
public void run() {
LogManager.setCommandsHeaderLine("Installation");
Installer installer = InstallerFactory.getInstance();
String titleText = ResourceManager.getString("String_InstallationOngoing1");
panel.setTitle(titleText);
for (int i = 0; i < installPackages.size(); i++) {
PackageDescription packageData = (PackageDescription) installPackages.get(i);
int progress = java.lang.Math.round((100*(i+1))/installPackages.size());
panel.setProgressValue(progress);
panel.setProgressText(packageData.getPackageName());
installer.installPackage(packageData);
installedPackages.add(packageData);
if ( installData.isAbortedInstallation() ) {
break;
}
}
if ( installData.isAbortedInstallation() ) {
// undoing the installation
LogManager.setCommandsHeaderLine("Installation aborted!");
titleText = ResourceManager.getString("String_UninstallationOngoing1");
panel.setTitle(titleText);
panel.setStopButtonEnabled(false);
LogManager.setCommandsHeaderLine("Uninstallation");
for (int i = 0; i < installedPackages.size(); i++) {
PackageDescription packageData = (PackageDescription) installedPackages.get(i);
int progress = java.lang.Math.round(100/installedPackages.size()) * (i+1);
panel.setProgressValue(progress);
panel.setProgressText(packageData.getPackageName());
installer.uninstallPackage(packageData);
}
// removing already created helper files (admin files)
Vector removeFiles = installData.getRemoveFiles();
for (int i = 0; i < removeFiles.size(); i++) {
File removeFile = new File((String)removeFiles.get(i));
SystemManager.deleteFile(removeFile);
}
}
installer.postInstallationOngoing();
String next = getNext();
getSetupFrame().setCurrentPanel(next, false, true);
}
};