<div dir="ltr"><div>Hey Lionel,<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jun 18, 2016 at 5:44 PM, Lionel Elie Mamane <span dir="ltr"><<a href="mailto:lionel@mamane.lu" target="_blank">lionel@mamane.lu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
Does anybody have an idea how we can determine at runtime where the<br>
LibreOffice installation root is?<br>
<br>
The difficulty we are having with firebird is that is needs to find a<br>
"security3.fdb" file. So we put it in instdir/share/ and we want<br>
firebird to look there.<br>
<br>
But now, when running from the instdir in the source dir, that will be<br>
something like<br>
<br>
 /home/username/sources/libreoffice/.../instdir/share<br>
<br>
but after a "real" installation the exact same binary will be in<br>
something like<br>
<br>
 /opt/libreoffice5.3/share<br>
 /usr/lib/libreoffice<br>
 /usr/local/lib/libreoffice<br>
<br>
So we need to determine at _runtime_ where LibreOffice is being run<br>
from... I see that the "soffice" script has a "sd_prog" variable; if<br>
we just export it, we could use that, something like the<br>
concatenation of getenv("sd_prog") and "../share/".<br>
<br>
Is it OK if we do that? Will it work on other platforms than Unixy<br>
systems? Is there already another mechanism to achieve the same result<br>
in LibreOffice that I don't know about?<br>
<br></blockquote></div><br><br></div><div class="gmail_extra">There is already a way to do exactly thatand it is actually already used in the old firebird code.<br><br></div><div class="gmail_extra">Have a look at connectivity/source/drivers/firebird/Driver.cxx:90<br><br></div><div class="gmail_extra">In general rtl::Bootstrap::expandMacros provides access to most of the directories that are of interest to LibreOffice.<br><br></div><div class="gmail_extra">Regards,<br></div><div class="gmail_extra">Markus<br></div><div class="gmail_extra"><br><br></div></div>