diff options
5 files changed, 97 insertions, 28 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 ) { diff --git a/setup_native/source/packinfo/shellscripts_extensions.txt b/setup_native/source/packinfo/shellscripts_extensions.txt index 0be870990b71..3ab47f925802 100755 --- a/setup_native/source/packinfo/shellscripts_extensions.txt +++ b/setup_native/source/packinfo/shellscripts_extensions.txt @@ -76,6 +76,12 @@ END if [ -x "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" ]; then "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" sync + if [ "$$?" != "0" ]; then + echo "ERROR: Registration of extensions failed!" + exit 1 + else + echo "SUCCESS: unopkg returns successful!" + fi find "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/share/prereg/bundled" -type f -exec chmod 644 {} \; fi @@ -87,6 +93,12 @@ END if [ -x "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" ]; then "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" sync + if [ "$$?" != "0" ]; then + echo "ERROR: Registration of extensions failed!" + exit 1 + else + echo "SUCCESS: unopkg returns successful!" + fi find "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/share/prereg/bundled" -type f -exec chmod 644 {} \; fi @@ -99,6 +111,12 @@ END if [ -x "PRODUCTDIRECTORYNAME/program/unopkg" ]; then "PRODUCTDIRECTORYNAME/program/unopkg" sync + if [ "$$?" != "0" ]; then + echo "ERROR: Registration of extensions failed!" + exit 1 + else + echo "SUCCESS: unopkg returns successful!" + fi find "PRODUCTDIRECTORYNAME/share/prereg/bundled" -type f -exec chmod 644 {} \; fi @@ -111,6 +129,12 @@ END if [ -x "PRODUCTDIRECTORYNAME/program/unopkg" ] then "PRODUCTDIRECTORYNAME/program/unopkg" sync + if [ "$$?" != "0" ]; then + echo "ERROR: Registration of extensions failed!" + exit 1 + else + echo "SUCCESS: unopkg returns successful!" + fi find "PRODUCTDIRECTORYNAME/share/prereg/bundled" -type f -exec chmod 644 {} \; fi diff --git a/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx b/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx index 9a748e9f2008..4a44b360fdba 100644 --- a/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx +++ b/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx @@ -317,14 +317,13 @@ static BOOL RemoveCompleteDirectory( std::_tstring sPath ) extern "C" UINT __stdcall RegisterExtensions(MSIHANDLE handle) { - std::_tstring sInstDir = GetMsiProperty( handle, TEXT("INSTALLLOCATION") ); + // std::_tstring sInstDir = GetMsiProperty( handle, TEXT("INSTALLLOCATION") ); + std::_tstring sInstDir = GetMsiProperty( handle, TEXT("CustomActionData") ); std::_tstring sUnoPkgFile = sInstDir + TEXT("program\\unopkg.exe"); std::_tstring mystr; WIN32_FIND_DATA aFindFileData; - - mystr = "unopkg file: " + sUnoPkgFile; - //MessageBox(NULL, mystr.c_str(), "Command", MB_OK); + bool registrationError = false; // Find unopkg.exe HANDLE hFindUnopkg = FindFirstFile( sUnoPkgFile.c_str(), &aFindFileData ); @@ -333,32 +332,44 @@ extern "C" UINT __stdcall RegisterExtensions(MSIHANDLE handle) { // unopkg.exe exists in program directory std::_tstring sCommand = sUnoPkgFile + " sync"; - mystr = "Command: " + sCommand; - //MessageBox(NULL, mystr.c_str(), "Command", MB_OK); DWORD exitCode = 0; bool fSuccess = ExecuteCommand( sCommand.c_str(), & exitCode); -// if ( fSuccess ) -// { -// mystr = "Executed successfully!"; -// MessageBox(NULL, mystr.c_str(), "Command", MB_OK); -// } -// else -// { -// mystr = "An error occured during execution!"; -// MessageBox(NULL, mystr.c_str(), "Command", MB_OK); -// } +// if ( fSuccess ) +// { +// mystr = "Executed successfully!"; +// MessageBox(NULL, mystr.c_str(), "Command", MB_OK); +// } +// else +// { +// mystr = "An error occured during execution!"; +// MessageBox(NULL, mystr.c_str(), "Command", MB_OK); +// } + + if ( ! fSuccess ) + { + mystr = "ERROR: An error occured during registration of extensions!"; + MessageBox(NULL, mystr.c_str(), "ERROR", MB_OK); + registrationError = true; + } FindClose( hFindUnopkg ); } -// else -// { -// mystr = "Error: Did not find " + sUnoPkgFile; -// MessageBox(NULL, mystr.c_str(), "Command", MB_OK); -// } + // else + // { + // mystr = "Error: Did not find " + sUnoPkgFile; + // MessageBox(NULL, mystr.c_str(), "Command", MB_OK); + // } - return ERROR_SUCCESS; + if ( registrationError ) + { + return 1; + } + else + { + return ERROR_SUCCESS; + } } |