Date: prev next · Thread: first prev next last
2016 Archives by date, by thread · List index


Hey Lionel,


On Sat, Jun 18, 2016 at 5:44 PM, Lionel Elie Mamane <lionel@mamane.lu>
wrote:

Hi,

Does anybody have an idea how we can determine at runtime where the
LibreOffice installation root is?

The difficulty we are having with firebird is that is needs to find a
"security3.fdb" file. So we put it in instdir/share/ and we want
firebird to look there.

But now, when running from the instdir in the source dir, that will be
something like

 /home/username/sources/libreoffice/.../instdir/share

but after a "real" installation the exact same binary will be in
something like

 /opt/libreoffice5.3/share
 /usr/lib/libreoffice
 /usr/local/lib/libreoffice

So we need to determine at _runtime_ where LibreOffice is being run
from... I see that the "soffice" script has a "sd_prog" variable; if
we just export it, we could use that, something like the
concatenation of getenv("sd_prog") and "../share/".

Is it OK if we do that? Will it work on other platforms than Unixy
systems? Is there already another mechanism to achieve the same result
in LibreOffice that I don't know about?



There is already a way to do exactly thatand it is actually already used in
the old firebird code.

Have a look at connectivity/source/drivers/firebird/Driver.cxx:90

In general rtl::Bootstrap::expandMacros provides access to most of the
directories that are of interest to LibreOffice.

Regards,
Markus

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.