Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2007-11-08 09:53:04 -0500
committerThomas Watson2007-11-08 09:53:04 -0500
commit018217b7bca69027acee151b29dbb120d59d0e28 (patch)
tree58902ee0d0d5829a40dd345787e6be3276f801e1
parent858ad9c8d4d175959016cf1edd271adc9d047275 (diff)
downloadrt.equinox.framework-R3_2_maintenance.tar.gz
rt.equinox.framework-R3_2_maintenance.tar.xz
rt.equinox.framework-R3_2_maintenance.zip
Bug 209192 Eclipse fails to startup because the library swt-win32-3235.dll couldn't be loaded.R32x_v20071108R3_2_maintenance
-rw-r--r--bundles/org.eclipse.osgi/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/LocationManager.java27
2 files changed, 24 insertions, 5 deletions
diff --git a/bundles/org.eclipse.osgi/META-INF/MANIFEST.MF b/bundles/org.eclipse.osgi/META-INF/MANIFEST.MF
index 293c8a131..630680991 100644
--- a/bundles/org.eclipse.osgi/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.osgi/META-INF/MANIFEST.MF
@@ -54,7 +54,7 @@ Bundle-Activator: org.eclipse.osgi.framework.internal.core.SystemBundleActivator
Bundle-Description: %systemBundle
Bundle-Copyright: %copyright
Bundle-Vendor: %eclipse.org
-Bundle-Version: 3.2.2.qualifier
+Bundle-Version: 3.2.3.qualifier
Bundle-Localization: systembundle
Bundle-DocUrl: http://www.eclipse.org
Eclipse-ExtensibleAPI: true
diff --git a/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/LocationManager.java b/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/LocationManager.java
index 385a7861e..8b452734f 100644
--- a/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/LocationManager.java
+++ b/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/LocationManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -257,7 +257,9 @@ public class LocationManager {
File fileTest = null;
try {
- fileTest = File.createTempFile("writtableArea", null, installDir); //$NON-NLS-1$
+ // we use the .dll suffix to properly test on Vista virtual directories
+ // on Vista you are not allowed to write executable files on virtual directories like "Program Files"
+ fileTest = File.createTempFile("writtableArea", ".dll", installDir); //$NON-NLS-1$ //$NON-NLS-2$
} catch (IOException e) {
//If an exception occured while trying to create the file, it means that it is not writtable
return false;
@@ -278,6 +280,18 @@ public class LocationManager {
if (installURL == null)
return null;
File installDir = new File(installURL.getFile());
+ // compute an install dir hash to prevent configuration area collisions with other eclipse installs
+ int hashCode;
+ try {
+ hashCode = installDir.getCanonicalPath().hashCode();
+ } catch (IOException ioe) {
+ // fall back to absolute path
+ hashCode = installDir.getAbsolutePath().hashCode();
+ }
+ if (hashCode < 0)
+ hashCode = -(hashCode);
+ String installDirHash = String.valueOf(hashCode);
+
String appName = "." + ECLIPSE; //$NON-NLS-1$
File eclipseProduct = new File(installDir, PRODUCT_SITE_MARKER);
if (eclipseProduct.exists()) {
@@ -290,12 +304,17 @@ public class LocationManager {
String appVersion = props.getProperty(PRODUCT_SITE_VERSION);
if (appVersion == null || appVersion.trim().length() == 0)
appVersion = ""; //$NON-NLS-1$
- appName += File.separator + appId + "_" + appVersion; //$NON-NLS-1$
+ appName += File.separator + appId + "_" + appVersion + "_" + installDirHash; //$NON-NLS-1$ //$NON-NLS-2$
} catch (IOException e) {
// Do nothing if we get an exception. We will default to a standard location
// in the user's home dir.
+ // add the hash to help prevent collisions
+ appName += File.separator + installDirHash;
}
- }
+ } else {
+ // add the hash to help prevent collisions
+ appName += File.separator + installDirHash;
+ }
String userHome = FrameworkProperties.getProperty(PROP_USER_HOME);
return new File(userHome, appName + "/" + pathAppendage).getAbsolutePath(); //$NON-NLS-1$
}

Back to the top