Ask Your Question
0

Find Install directory of LibreOffice on Linux

asked 2016-08-29 06:22:50 +0100

mark_t gravatar image

Is there any way to find the path of the install directory of LibreOffice where the soffice.bin is located?

It might be possible to use GetCommandLineW on windows, but this is dependent on a windows dll.

Private Declare Function GetCommandLine Lib "kernel32" Alias "GetCommandLineW" () As Long

Is there some equivalent for linux?

Trying to find the path to the running executable to allow timed calls to macros via Shell command, without hardcoding the path in the macro as this is sometimes different on different installations.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2016-08-29 07:21:09 +0100

karolus gravatar image

updated 2016-08-29 07:26:08 +0100

Hallo

http://api.libreoffice.org/docs/idl/r...

 pathsubstitution = createUnoService("com.sun.star.util.PathSubstitution")
 installpath = pathsubstitution.substituteVariables('$(inst)',1)


 →→ 'file:///usr/lib/libreoffice/program/..'

but for LO distributed by the main-Linux-Distros this gives not the path to parentdirectory of executable soffice, in that case you should run from Commandline:

>> which soffice
/usr/bin/soffice

if so, you need not to find the path to soffice first, simply use soffice in your Shell-Command

edit flag offensive delete link more

Comments

Thanks, I'll try both and post back here.

mark_t gravatar imagemark_t ( 2016-08-29 14:47:40 +0100 )edit

The first method you suggested works the way I was looking for thanks. I'm using $(prog). This allows my macro to find the executable for whichever version of office is running the macro, including if openoffice and libreoffice are both installed.

mark_t gravatar imagemark_t ( 2016-08-29 17:29:17 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2016-08-29 06:22:50 +0100

Seen: 8,515 times

Last updated: Aug 29 '16