Bug 209192 Eclipse fails to startup because the library swt-win32-3235.dll couldn't be loaded.
diff --git a/bundles/org.eclipse.osgi/META-INF/MANIFEST.MF b/bundles/org.eclipse.osgi/META-INF/MANIFEST.MF index 293c8a1..6306809 100644 --- a/bundles/org.eclipse.osgi/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.osgi/META-INF/MANIFEST.MF
@@ -54,7 +54,7 @@ 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 385a786..8b45273 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 @@ 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 @@ 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 @@ 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$ }