diff --git a/desktop/source/deployment/misc/dp_misc.cxx b/desktop/source/deployment/misc/dp_misc.cxx index 889f761ad850..f1c6fce79f90 100644 --- a/desktop/source/deployment/misc/dp_misc.cxx +++ b/desktop/source/deployment/misc/dp_misc.cxx @@ -4,9 +4,9 @@ * * $RCSfile: dp_misc.cxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: hr $ $Date: 2006-01-26 17:49:07 $ + * last change: $Author: obo $ $Date: 2006-09-13 11:51:22 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -39,6 +39,7 @@ #include "rtl/digest.h" #include "rtl/random.h" #include "rtl/bootstrap.hxx" +#include "unotools/bootstrap.hxx" #include "osl/file.hxx" #include "osl/pipe.hxx" #include "osl/security.hxx" @@ -99,32 +100,14 @@ struct OfficePipeId : public rtl::StaticWithInit { const OUString OfficePipeId::operator () () { - OUString userPath = OUSTR("${$SYSBINDIR/" SAL_CONFIGFILE("bootstrap") - ":UserInstallation}"); - ::rtl::Bootstrap::expandMacros( userPath ); - OSL_ASSERT( userPath.getLength() > 0 ); - - // normalize path: - osl::FileStatus status( FileStatusMask_FileURL ); - osl::DirectoryItem dirItem; - if (osl::DirectoryItem::get( userPath, dirItem ) - == osl::DirectoryItem::E_None && - dirItem.getFileStatus( status ) - == osl::DirectoryItem::E_None && - status.isValid( FileStatusMask_FileURL )) + OUString userPath; + ::utl::Bootstrap::PathStatus aLocateResult = + ::utl::Bootstrap::locateUserInstallation( userPath ); + if (!(aLocateResult == ::utl::Bootstrap::PATH_EXISTS || + aLocateResult == ::utl::Bootstrap::PATH_VALID)) { - // path exists: - if (osl::FileBase::getAbsoluteFileURL( - OUString(), status.getFileURL(), userPath ) - != ::osl::FileBase::E_None) - { - // but cannot be made absolute: - throw RuntimeException( - OUSTR("Cannot make absolute URL: ") + status.getFileURL(), - Reference() ); - } + throw Exception(OUSTR("Extension Manager: Could not obtain path for UserInstallation."), 0); } - // else invalid path, seems that user installation hasn't been written yet rtlDigest digest = rtl_digest_create( rtl_Digest_AlgorithmMD5 ); if (digest <= 0) {