You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by js...@apache.org on 2013/06/27 15:23:06 UTC

svn commit: r1497346 - /openoffice/trunk/main/odk/source/com/sun/star/lib/loader/InstallationFinder.java

Author: jsc
Date: Thu Jun 27 13:23:06 2013
New Revision: 1497346

URL: http://svn.apache.org/r1497346
Log:
#122478# adapt search in registry

Modified:
    openoffice/trunk/main/odk/source/com/sun/star/lib/loader/InstallationFinder.java

Modified: openoffice/trunk/main/odk/source/com/sun/star/lib/loader/InstallationFinder.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/odk/source/com/sun/star/lib/loader/InstallationFinder.java?rev=1497346&r1=1497345&r2=1497346&view=diff
==============================================================================
--- openoffice/trunk/main/odk/source/com/sun/star/lib/loader/InstallationFinder.java (original)
+++ openoffice/trunk/main/odk/source/com/sun/star/lib/loader/InstallationFinder.java Thu Jun 27 13:23:06 2013
@@ -189,6 +189,7 @@ final class InstallationFinder {
     private static String getPathFromWindowsRegistry() {
 
         final String SUBKEYNAME = "Software\\OpenOffice\\UNO\\InstallPath";
+        final String SUBKEYNAME64 = "Software\\Wow6432Node\\OpenOffice\\UNO\\InstallPath";
 
         String path = null;
         
@@ -199,14 +200,28 @@ final class InstallationFinder {
         } catch ( WinRegKeyException e ) {
             try {
                 // read the key's default value from HKEY_LOCAL_MACHINE
-                WinRegKey key = new WinRegKey( "HKEY_LOCAL_MACHINE",
-                                               SUBKEYNAME );
+                WinRegKey key = new WinRegKey( "HKEY_LOCAL_USER",
+                                               SUBKEYNAME64 );
                 path = key.getStringValue( "" ); // default                
-            } catch ( WinRegKeyException we ) {
-                System.err.println( "com.sun.star.lib.loader." +
-                    "InstallationFinder::getPathFromWindowsRegistry: " +
-                    "reading key from Windows Registry failed: " + we );
-            }         
+            } catch ( WinRegKeyException e64 ) {
+                try {
+                    // read the key's default value from HKEY_LOCAL_MACHINE
+                    WinRegKey key = new WinRegKey( "HKEY_LOCAL_MACHINE",
+                                                   SUBKEYNAME );
+                    path = key.getStringValue( "" ); // default                
+                } catch ( WinRegKeyException we ) {
+                    try {
+                        // read the key's default value from HKEY_LOCAL_MACHINE
+                        WinRegKey key = new WinRegKey( "HKEY_LOCAL_MACHINE",
+                                                       SUBKEYNAME64 );
+                        path = key.getStringValue( "" ); // default                
+                    } catch ( WinRegKeyException we64 ) {
+                        System.err.println( "com.sun.star.lib.loader." +
+                                            "InstallationFinder::getPathFromWindowsRegistry: " +
+                                            "reading key from Windows Registry failed: " + we64 );
+                    } 
+                } 
+            }
         }
         
         return path;