diff options
author | Jörg Barfurth <jb@openoffice.org> | 2001-11-06 14:44:11 +0000 |
---|---|---|
committer | Jörg Barfurth <jb@openoffice.org> | 2001-11-06 14:44:11 +0000 |
commit | 215e084545d4f60a69a18ae2da733b580e6fcad8 (patch) | |
tree | d91196bcbf9c0f1734a2a910761697dbb917dbdf /unotools | |
parent | 7d236e4de6ee60790830bb00b8689059f1ab8e39 (diff) |
#94360# Locate bootstrap.ini next to executable
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/config/bootstrap.cxx | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/unotools/source/config/bootstrap.cxx b/unotools/source/config/bootstrap.cxx index b53f99033a90..8286b0d11a17 100644 --- a/unotools/source/config/bootstrap.cxx +++ b/unotools/source/config/bootstrap.cxx @@ -2,9 +2,9 @@ * * $RCSfile: bootstrap.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: jb $ $Date: 2001-11-02 12:15:30 $ + * last change: $Author: jb $ $Date: 2001-11-06 15:44:11 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -176,6 +176,8 @@ namespace utl bool initUserInstallationData(rtl::Bootstrap& _rData); }; // --------------------------------------------------------------------------------------- + static OUString getExecutableDirectory(); +// --------------------------------------------------------------------------------------- Bootstrap::Impl const& Bootstrap::data() { static Impl* s_pData = NULL; @@ -185,7 +187,7 @@ namespace utl using namespace osl; MutexGuard aGuard( Mutex::getGlobalMutex() ); - static Impl s_theData(OUString(RTL_CONSTASCII_USTRINGPARAM(BOOTSTRAP_DATA_NAME))); + static Impl s_theData(getExecutableDirectory() + OUString(RTL_CONSTASCII_USTRINGPARAM("/"BOOTSTRAP_DATA_NAME))); s_pData = &s_theData; } @@ -494,6 +496,19 @@ OUString getExecutableBaseName() } // --------------------------------------------------------------------------------------- +static +OUString getExecutableDirectory() +{ + OUString sFileName; + OSL_VERIFY(osl_Process_E_None == osl_getExecutableFile(&sFileName.pData)); + + sal_Int32 nDirEnd = sFileName.lastIndexOf(cURLSeparator); + + OSL_ENSURE(nDirEnd >= 0, "Cannot locate executable directory"); + + return sFileName.copy(0,nDirEnd); +} + // ---------------------------------------------------------------------------------- static |