summaryrefslogtreecommitdiff
path: root/javainstaller2
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2008-08-01 10:19:35 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2008-08-01 10:19:35 +0000
commita69125c5c88dd5d03356d1bcf2ee7df61e6d899a (patch)
tree3d9d0c022746341a63d4393e3dab9c9ce8bc9e3e /javainstaller2
parenta4cb617a93c07bb1d65d2536786f357a9e6d5e35 (diff)
INTEGRATION: CWS native177 (1.5.16); FILE MERGED
2008/07/25 13:15:59 is 1.5.16.1: #158264# including softdist dependency
Diffstat (limited to 'javainstaller2')
-rwxr-xr-xjavainstaller2/src/JavaSetup/org/openoffice/setup/Util/InfoDir.java48
1 files changed, 33 insertions, 15 deletions
diff --git a/javainstaller2/src/JavaSetup/org/openoffice/setup/Util/InfoDir.java b/javainstaller2/src/JavaSetup/org/openoffice/setup/Util/InfoDir.java
index 4342175925ee..cc1cc6a641db 100755
--- a/javainstaller2/src/JavaSetup/org/openoffice/setup/Util/InfoDir.java
+++ b/javainstaller2/src/JavaSetup/org/openoffice/setup/Util/InfoDir.java
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: InfoDir.java,v $
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
* This file is part of OpenOffice.org.
*
@@ -31,6 +31,7 @@
package org.openoffice.setup.Util;
import org.openoffice.setup.InstallData;
+import org.openoffice.setup.ResourceManager;
import java.io.File;
import java.util.Vector;
@@ -243,21 +244,38 @@ public class InfoDir {
static public void prepareUninstallation() {
// additional tasks for uninstallation
- String setupPath = copySourceFile("setup");
- SystemManager.setUnixPrivileges(setupPath, "775");
+ // Directory destDir has to exist!
InstallData data = InstallData.getInstance();
- File jarFile = data.getJarFilePath();
- copySourceFile(jarFile.getName());
-
- File uninstallDir = createUninstallDir();
- copyInstallDirectoryWithExtension(uninstallDir, "xpd", "xpd");
- copyInstallDirectoryWithExtension(uninstallDir, "html", "html");
- copyInstallDirectoryWithExtension(uninstallDir, "images", "gif");
- copyInstallDirectoryDoubleSubdir(uninstallDir, "html", "images");
- copyGetUidSoFile(uninstallDir);
- copyJreFile(uninstallDir);
- moveAdminFiles(uninstallDir);
- createInfoFile(uninstallDir);
+ File destDir = new File(data.getInstallDefaultDir(), data.getProductDir());
+ boolean directoryExists = true;
+
+ if ( ! destDir.exists() ) {
+ try {
+ directoryExists = SystemManager.create_directory(destDir.getPath());
+ }
+ catch (SecurityException ex) {
+ String message = ResourceManager.getString("String_ChooseDirectory_No_Write_Access") + ": " + destDir.getPath();
+ String title = ResourceManager.getString("String_Error");
+ Informer.showErrorMessage(message, title);
+ }
+ }
+
+ if ( directoryExists ) {
+ String setupPath = copySourceFile("setup");
+ SystemManager.setUnixPrivileges(setupPath, "775");
+ File jarFile = data.getJarFilePath();
+ copySourceFile(jarFile.getName());
+
+ File uninstallDir = createUninstallDir();
+ copyInstallDirectoryWithExtension(uninstallDir, "xpd", "xpd");
+ copyInstallDirectoryWithExtension(uninstallDir, "html", "html");
+ copyInstallDirectoryWithExtension(uninstallDir, "images", "gif");
+ copyInstallDirectoryDoubleSubdir(uninstallDir, "html", "images");
+ copyGetUidSoFile(uninstallDir);
+ copyJreFile(uninstallDir);
+ moveAdminFiles(uninstallDir);
+ createInfoFile(uninstallDir);
+ }
}
static public void removeUninstallationFiles() {