diff options
author | Vladimir Glazunov <vg@openoffice.org> | 2011-03-21 17:59:11 +0100 |
---|---|---|
committer | Vladimir Glazunov <vg@openoffice.org> | 2011-03-21 17:59:11 +0100 |
commit | 712a83ef918c355e7c5ecd23316d6e95013e4cb0 (patch) | |
tree | da72f4107359358eb27085bfd6e8e12cb5e753a3 /javainstaller2 | |
parent | eb58e26326300bb0d22b0e6d491f82b0c6b2c6d4 (diff) | |
parent | 76df3c1d4649e26dab420a03853fdcc16a7aee48 (diff) |
CWS-TOOLING: integrate CWS native361
Diffstat (limited to 'javainstaller2')
3 files changed, 40 insertions, 6 deletions
diff --git a/javainstaller2/src/JavaSetup/org/openoffice/setup/Controller/InstallationOngoingCtrl.java b/javainstaller2/src/JavaSetup/org/openoffice/setup/Controller/InstallationOngoingCtrl.java index b435b480eaea..f5ff37ad4d70 100755 --- a/javainstaller2/src/JavaSetup/org/openoffice/setup/Controller/InstallationOngoingCtrl.java +++ b/javainstaller2/src/JavaSetup/org/openoffice/setup/Controller/InstallationOngoingCtrl.java @@ -39,6 +39,7 @@ import org.openoffice.setup.Util.InfoDir; import org.openoffice.setup.Util.PackageCollector; import org.openoffice.setup.Util.SystemManager; import java.io.File; +import java.util.Collections; import java.util.Vector; public class InstallationOngoingCtrl extends PanelController { @@ -105,6 +106,7 @@ public class InstallationOngoingCtrl extends PanelController { private Vector installedPackages = new Vector(); public void run() { + boolean ignoreMajorUpgrade = false; LogManager.setCommandsHeaderLine("Installation"); Installer installer = InstallerFactory.getInstance(); String titleText = ResourceManager.getString("String_InstallationOngoing1"); @@ -131,32 +133,46 @@ public class InstallationOngoingCtrl extends PanelController { installer.installPackage(packageData); installedPackages.add(packageData); - if ( installData.isAbortedInstallation() ) { + if (( installData.isAbortedInstallation() ) || ( installData.isErrorInstallation() )) { + ignoreMajorUpgrade = true; break; } } - if ( installData.isMajorUpgrade() ) { + if (( installData.isMajorUpgrade() ) && ( ! ignoreMajorUpgrade )) { for (int i = 0; i < removePackages.size(); i++) { PackageDescription packageData = (PackageDescription) removePackages.get(i); installer.uninstallPackage(packageData); } } - if ( installData.isAbortedInstallation() ) { + if (( installData.isAbortedInstallation() ) || ( installData.isErrorInstallation() )) { // undoing the installation - LogManager.setCommandsHeaderLine("Installation aborted!"); - titleText = ResourceManager.getString("String_UninstallationOngoing1"); + if ( installData.isAbortedInstallation() ) { + LogManager.setCommandsHeaderLine("Installation aborted!"); + titleText = ResourceManager.getString("String_UninstallationOngoing1"); + } else { + LogManager.setCommandsHeaderLine("Error during installation!"); + titleText = ResourceManager.getString("String_UninstallationOngoing1"); + } panel.setTitle(titleText); panel.setStopButtonEnabled(false); LogManager.setCommandsHeaderLine("Uninstallation"); + // Inverting the package order for uninstallation + Collections.reverse(installedPackages); + 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()); + if ( i == 0 ) { + installData.setIsFirstPackage(true); + } else { + installData.setIsFirstPackage(false); + } installer.uninstallPackage(packageData); } @@ -185,7 +201,7 @@ public class InstallationOngoingCtrl extends PanelController { getSetupFrame().setButtonEnabled(true, getSetupFrame().BUTTON_CANCEL); InstallData installData = InstallData.getInstance(); - if ( ! installData.isAbortedInstallation() ) { + if (( ! installData.isAbortedInstallation() ) && ( ! installData.isErrorInstallation() )) { InfoDir.prepareUninstallation(); } diff --git a/javainstaller2/src/JavaSetup/org/openoffice/setup/InstallData.java b/javainstaller2/src/JavaSetup/org/openoffice/setup/InstallData.java index 358ebd489db4..71b1f702f2e8 100755 --- a/javainstaller2/src/JavaSetup/org/openoffice/setup/InstallData.java +++ b/javainstaller2/src/JavaSetup/org/openoffice/setup/InstallData.java @@ -78,6 +78,7 @@ public class InstallData static private boolean isDebianSystem = false; static private boolean useForceDebian = false; /* --force-debian */ static private boolean debianInvestigated = false; + static private boolean isFirstPackage = false; static private String installType; /* custom or typical installation */ static private String osType; /* Linux, SunOS, ... */ static private String installDir = null; @@ -668,6 +669,14 @@ public class InstallData isDebianSystem = value; } + public boolean isFirstPackage() { + return isFirstPackage; + } + + public void setIsFirstPackage(boolean value) { + isFirstPackage = value; + } + public boolean useForceDebian() { return useForceDebian; } diff --git a/javainstaller2/src/JavaSetup/org/openoffice/setup/Installer/LinuxInstaller.java b/javainstaller2/src/JavaSetup/org/openoffice/setup/Installer/LinuxInstaller.java index 4383904569c0..c13f32f68339 100755 --- a/javainstaller2/src/JavaSetup/org/openoffice/setup/Installer/LinuxInstaller.java +++ b/javainstaller2/src/JavaSetup/org/openoffice/setup/Installer/LinuxInstaller.java @@ -346,6 +346,7 @@ public class LinuxInstaller extends Installer { String forceDebianString = ""; String nodepsString = ""; + String noscriptsString = ""; if ( ! data.debianInvestigated() ) { helper.investigateDebian(data); @@ -360,6 +361,10 @@ public class LinuxInstaller extends Installer { } } + if (( data.isErrorInstallation() ) && ( data.isFirstPackage() )) { + noscriptsString = "--noscripts"; + } + // Defining a Vector that contains the full rpm command. Then the string array can be // created dynamically. Otherwise there would be too many different scenarios. @@ -375,6 +380,10 @@ public class LinuxInstaller extends Installer { rpmVector.add(nodepsString); } + if ( ! noscriptsString.equals("") ) { + rpmVector.add(noscriptsString); + } + rpmVector.add("-ev"); if ( useLocalDatabase ) { |