From 84a7310e5a78f8c9bf2e93e417a10e80eb52a222 Mon Sep 17 00:00:00 2001 From: Andrew Gvozdev Date: Mon, 8 Mar 2010 05:35:44 +0000 Subject: [PATCH] bug 213920: cygwin path resolver does not work for "locked" registry in windows --- .../gnu/cygwin/CygwinPathResolver.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/CygwinPathResolver.java b/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/CygwinPathResolver.java index db6ce860339..c866414fcf1 100644 --- a/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/CygwinPathResolver.java +++ b/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/CygwinPathResolver.java @@ -40,10 +40,10 @@ public class CygwinPathResolver implements IBuildPathResolver { private static final String PROPERTY_OS_NAME = "os.name"; //$NON-NLS-1$ private static final String PROPERTY_OS_VALUE = "windows";//$NON-NLS-1$ private static final String SP = " "; //$NON-NLS-1$ - // note that in Cygwin 1.7 the mount point storage has been moved out of the registry - private static final String REGISTRY_KEY_MOUNTS = "SOFTWARE\\Cygnus Solutions\\Cygwin\\mounts v2\\"; //$NON-NLS-1$ private static final String REGISTRY_KEY_SETUP = "SOFTWARE\\Cygwin\\setup"; //$NON-NLS-1$ private static final String REGISTRY_KEY_SETUP_WIN64 = "SOFTWARE\\Wow6432Node\\Cygwin\\setup"; //$NON-NLS-1$ + // note that in Cygwin 1.7 the mount point storage has been moved out of the registry + private static final String REGISTRY_KEY_MOUNTS = "SOFTWARE\\Cygnus Solutions\\Cygwin\\mounts v2\\"; //$NON-NLS-1$ private static final String PATH_NAME = "native"; //$NON-NLS-1$ private static final String SSLASH = "/"; //$NON-NLS-1$ private static final String BSLASH = "\\\\"; //$NON-NLS-1$ @@ -181,21 +181,21 @@ public class CygwinPathResolver implements IBuildPathResolver { } } - // 2. Try to find the root dir in SOFTWARE\Cygnus Solutions - if (rootValue == null) { - rootValue = readValueFromRegistry(REGISTRY_KEY_MOUNTS + ROOTPATTERN, PATH_NAME); - } - - // 3. Try to find the root dir in SOFTWARE\Cygwin\setup + // 2. Try to find the root dir in SOFTWARE\Cygwin\setup if(rootValue == null) { rootValue = readValueFromRegistry(REGISTRY_KEY_SETUP, "rootdir"); //$NON-NLS-1$ } - // 4. Try to find the root dir in SOFTWARE\Wow6432Node\Cygwin\setup + // 3. Try to find the root dir in SOFTWARE\Wow6432Node\Cygwin\setup if(rootValue == null) { rootValue = readValueFromRegistry(REGISTRY_KEY_SETUP_WIN64, "rootdir"); //$NON-NLS-1$ } + // 4. Try to find the root dir in SOFTWARE\Cygnus Solutions + if (rootValue == null) { + rootValue = readValueFromRegistry(REGISTRY_KEY_MOUNTS + ROOTPATTERN, PATH_NAME); + } + // 5. Try the default Cygwin install dir if(rootValue == null) { File file = new File(DEFAULT_ROOT);