Installing shared extensions on macOS

I want to provision a LibreOffice installation on macOS with an extension for all users. Under Linux I can use

sudo unopkg --shared add org.example.Extension

If I try that on macOS I get this instead:

~ % sudo unopkg add --shared /tmp/de.wikimedia.Defaults.oxt
ERROR: Exception occurred: You need write permissions to install a shared extension!

ERROR: unopkg failed.

LibreOffice has been installed using Homebrew, unopkg has been symlinked:

~ % which unopkg   
/opt/homebrew/bin/unopkg
~ % realpath $(which unopkg)
/Applications/LibreOffice.app/Contents/MacOS/unopkg

I couldn’t find any equivalents on macOS to /usr/lib64/libreoffice/share/extensions/ on Linux to check for permission problems. I suspect macOS’s System Integration Protection is at fault here but I guess someone might have a solution, though.

Change permissions for files, folders, or disks on Mac - Apple Support (OM)

I know how to change permissions on macOS, thank you. I need to know the location of the shared extensions folder on macOS.

Profiling apps using Instruments | Apple Developer Documentation

Found it, I guess.

/Applications/LibreOffice.app/Contents/Resources/extensions

But the permissions seem to be correct:

root@mac ~ # mkdir /Applications/LibreOffice.app/Contents/Resources/extensions/test
root@mac ~ # ll /Applications/LibreOffice.app/Contents/Resources/extensions/test
total 0
root@mac ~ # ll /Applications/LibreOffice.app/Contents/Resources/extensions/    
total 0
drwxr-xr-x@  40 user  staff  1280 Dec 11 09:20 dict-en
drwxr-xr-x@  60 user  staff  1920 Dec 11 09:20 dict-es
drwxr-xr-x@  16 user  staff   512 Dec 11 09:20 dict-fr
drwxr-xr-x@ 133 user  staff  4256 Dec 11 09:20 nlpsolver
drwxr-xr-x    2 root  staff    64 Jan 28 00:00 test
root@mac ~ # rmdir /Applications/LibreOffice.app/Contents/Resources/extensions/test
root@mac ~ # install -o user -g staff -m 755 -d /Applications/LibreOffice.app/Contents/Resources/extensions/test
root@mac ~ # ll /Applications/LibreOffice.app/Contents/Resources/extensions/                                 
total 0
drwxr-xr-x@  40 user  staff  1280 Dec 11 09:20 dict-en
drwxr-xr-x@  60 user  staff  1920 Dec 11 09:20 dict-es
drwxr-xr-x@  16 user  staff   512 Dec 11 09:20 dict-fr
drwxr-xr-x@ 133 user  staff  4256 Dec 11 09:20 nlpsolver
drwxr-xr-x    2 user  staff    64 Jan 28 00:00 test
root@mac ~ # rmdir /Applications/LibreOffice.app/Contents/Resources/extensions/test  

more gory stuff ;
154154 – LO can't install an extension for all users under macOS

1 Like

Thanks. Good to know it’s a bug and not me being too incompetent :smiley: