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:29:31 UTC

svn commit: r1497351 - in /openoffice/trunk/main: cli_ure/source/native/native_bootstrap.cxx cppuhelper/source/findsofficepath.c

Author: jsc
Date: Thu Jun 27 13:29:31 2013
New Revision: 1497351

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

Modified:
    openoffice/trunk/main/cli_ure/source/native/native_bootstrap.cxx
    openoffice/trunk/main/cppuhelper/source/findsofficepath.c

Modified: openoffice/trunk/main/cli_ure/source/native/native_bootstrap.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/cli_ure/source/native/native_bootstrap.cxx?rev=1497351&r1=1497350&r2=1497351&view=diff
==============================================================================
--- openoffice/trunk/main/cli_ure/source/native/native_bootstrap.cxx (original)
+++ openoffice/trunk/main/cli_ure/source/native/native_bootstrap.cxx Thu Jun 27 13:29:31 2013
@@ -55,6 +55,7 @@ namespace cli_ure {
 // INSTALL_PATH value needs to correspond to the Windows registry subkey
 // in main\scp2\source\ooo\registryitem_ooo.scp
 #define INSTALL_PATH L"Software\\OpenOffice\\UNO\\InstallPath"
+#define INSTALL_PATH_64 L"Software\\Wow6432Node\\OpenOffice\\UNO\\InstallPath"
 #define BASIS_LINK L"\\basis-link"
 #define URE_LINK L"\\ure-link"
 #define URE_BIN L"\\bin"
@@ -156,9 +157,19 @@ WCHAR * getInstallPath()
         szInstallPath = getPathFromRegistryKey( HKEY_CURRENT_USER, INSTALL_PATH );
         if ( szInstallPath == NULL )
         {
+            /* read the key's default value from HKEY_LOCAL_USER */
+            szInstallPath = getPathFromRegistryKey( HKEY_LOCAL_MACHINE, INSTALL_PATH_64 );
+        }
+        else if ( szInstallPath == NULL )
+        {
             /* read the key's default value from HKEY_LOCAL_MACHINE */
             szInstallPath = getPathFromRegistryKey( HKEY_LOCAL_MACHINE, INSTALL_PATH );
         }
+        else if ( szInstallPath == NULL )
+        {
+            /* read the key's default value from HKEY_LOCAL_MACHINE */
+            szInstallPath = getPathFromRegistryKey( HKEY_LOCAL_MACHINE, INSTALL_PATH_64 );
+        }
     }
     return szInstallPath;
 }
@@ -269,7 +280,8 @@ HMODULE loadFromPath(LPCWSTR sLibName)
 	if (sLibName == NULL)
 		return NULL;
 
-	WCHAR * szUreBinPath =  getUnoPath();
+//	WCHAR * szUreBinPath =  getUnoPath();
+	WCHAR * szUreBinPath =  getInstallPath();
 	if (!szUreBinPath)
 		return NULL;
 

Modified: openoffice/trunk/main/cppuhelper/source/findsofficepath.c
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/cppuhelper/source/findsofficepath.c?rev=1497351&r1=1497350&r2=1497351&view=diff
==============================================================================
--- openoffice/trunk/main/cppuhelper/source/findsofficepath.c (original)
+++ openoffice/trunk/main/cppuhelper/source/findsofficepath.c Thu Jun 27 13:29:31 2013
@@ -87,6 +87,7 @@ static char* getPathFromRegistryKey( HKE
 static char* platformSpecific()
 {
     const char* SUBKEYNAME = "Software\\OpenOffice\\UNO\\InstallPath";
+    const char* SUBKEYNAME64 = "Software\\Wow6432Node\\OpenOffice\\UNO\\InstallPath";
 
     char* path = NULL;
     
@@ -95,9 +96,19 @@ static char* platformSpecific()
 
     if ( path == NULL )
     {
+        /* read the key's default value from HKEY_LOCAL_USER 64 */
+        path = getPathFromRegistryKey( HKEY_LOCAL_MACHINE, SUBKEYNAME64 );
+    }
+    else if ( path == NULL )
+    {
         /* read the key's default value from HKEY_LOCAL_MACHINE */
         path = getPathFromRegistryKey( HKEY_LOCAL_MACHINE, SUBKEYNAME );
     }
+    else if ( path == NULL )
+    {
+        /* read the key's default value from HKEY_LOCAL_MACHINE 64*/
+        path = getPathFromRegistryKey( HKEY_LOCAL_MACHINE, SUBKEYNAME64 );
+    }
 
     return path;
 }