29#define WIN32_LEAN_AND_MEAN
42static wchar_t* getPathFromRegistryKey( HKEY hroot,
const wchar_t* subKeyName )
50 if ( RegOpenKeyExW( hroot, subKeyName, 0, KEY_READ, &hkey ) != ERROR_SUCCESS )
56 if ( RegQueryValueExW( hkey, NULL, NULL, &type, NULL, &size) != ERROR_SUCCESS )
63 data = (
wchar_t*) malloc( size +
sizeof(
wchar_t) );
66 if ( RegQueryValueExW( hkey, NULL, NULL, &type, (LPBYTE) data, &size ) != ERROR_SUCCESS )
76 data[
size /
sizeof(wchar_t)] = 0;
92 const wchar_t* UNOPATHVARNAME = L
"UNO_PATH";
95 wchar_t*
env = _wgetenv(UNOPATHVARNAME);
102 const wchar_t* SUBKEYNAME = L
"Software\\LibreOffice\\UNO\\InstallPath";
105 wchar_t* path = getPathFromRegistryKey( HKEY_CURRENT_USER, SUBKEYNAME );
110 path = getPathFromRegistryKey( HKEY_LOCAL_MACHINE, SUBKEYNAME );
131 const char* UNOPATHVARNAME =
"UNO_PATH";
134 char*
env = getenv(UNOPATHVARNAME);
138 const char* PATHVARNAME =
"PATH";
139 const char* APPENDIX =
"/libreoffice";
146 char buffer[PATH_MAX];
155 env = getenv( PATHVARNAME );
169 char* resolved =
NULL;
170 char* file = (
char*) malloc( strlen( dir ) + strlen( APPENDIX ) + 1 );
178 strcat( file, APPENDIX );
181 resolved = realpath( file, buffer );
182 if ( resolved !=
NULL )
189 pos = sep - resolved;
190 path = (
char*) malloc(
pos + 1 );
191 strncpy( path, resolved,
pos );
char * cppuhelper_detail_findSofficePath(void)
static char * platformSpecific(void)
const css::uno::Reference< css::xml::crypto::XSecurityEnvironment > & env