INTEGRATION: CWS jl45_SRC680 (1.11.142); FILE MERGED

2006/09/07 12:35:02 jl 1.11.142.1: #i69354 package manager pipe name did not match the pipe name used by office
This commit is contained in:
Oliver Bolte 2006-09-13 10:51:22 +00:00
parent 13d03ef67b
commit f3597ab55c

View file

@ -4,9 +4,9 @@
* *
* $RCSfile: dp_misc.cxx,v $ * $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 Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
@ -39,6 +39,7 @@
#include "rtl/digest.h" #include "rtl/digest.h"
#include "rtl/random.h" #include "rtl/random.h"
#include "rtl/bootstrap.hxx" #include "rtl/bootstrap.hxx"
#include "unotools/bootstrap.hxx"
#include "osl/file.hxx" #include "osl/file.hxx"
#include "osl/pipe.hxx" #include "osl/pipe.hxx"
#include "osl/security.hxx" #include "osl/security.hxx"
@ -99,32 +100,14 @@ struct OfficePipeId : public rtl::StaticWithInit<const OUString, OfficePipeId> {
const OUString OfficePipeId::operator () () const OUString OfficePipeId::operator () ()
{ {
OUString userPath = OUSTR("${$SYSBINDIR/" SAL_CONFIGFILE("bootstrap") OUString userPath;
":UserInstallation}"); ::utl::Bootstrap::PathStatus aLocateResult =
::rtl::Bootstrap::expandMacros( userPath ); ::utl::Bootstrap::locateUserInstallation( userPath );
OSL_ASSERT( userPath.getLength() > 0 ); if (!(aLocateResult == ::utl::Bootstrap::PATH_EXISTS ||
aLocateResult == ::utl::Bootstrap::PATH_VALID))
// 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 ))
{ {
// path exists: throw Exception(OUSTR("Extension Manager: Could not obtain path for UserInstallation."), 0);
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<XInterface>() );
} }
}
// else invalid path, seems that user installation hasn't been written yet
rtlDigest digest = rtl_digest_create( rtl_Digest_AlgorithmMD5 ); rtlDigest digest = rtl_digest_create( rtl_Digest_AlgorithmMD5 );
if (digest <= 0) { if (digest <= 0) {