find at runtime where LibreOffice is being executed from

Lionel Elie Mamane lionel at
Sat Jun 18 15:44:35 UTC 2016


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


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


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?

Thanks in advance,


More information about the LibreOffice mailing list