Page 1 of 1

[Solved] How to debug/fix my .oxt installation: can't remove

Posted: Tue Feb 20, 2018 1:32 am
by xenon325
(cross-posting this from ask.libreoffice.org/q146900)

Here is an example extension I'm trying to make work: github:hello-libreoffice-extension

It partially works - menu item in "Tools | Add-Ons" is added and it works as expected (shows message box in UI).

However,
  • there is no license notice at installation
  • my extension's version (1.0) is not recognized - when trying to replace, LibreOffice says "version 0"
  • extension is installed for current user, not for everyone as I've scepcified in `description.xml`
  • after installation (with "Tools | Extensions Manager...") there is no description line under my Extension
And the worst part is that I can't remove (and update/replace) my extension. I know I can just delete files (as described in Cannot uninstall extension in Linux). But that's really too much asking from my user and sure we can do better. The error message is (reformatted it for readability, in original all tokens were delimeted by single space):

Code: Select all

(com.sun.star.lang.IllegalArgumentException) 
{ 
	{ 
		{ 
			Message = "Cannot detect media-type:file:///C:/Users/%D0%B0%D0%BD%D0%BC/AppData/Roaming/LibreOffice/4/user/uno_packages/cache/uno_packages/lu7922basxp.tmp_/hello-libreoffice-extension2.zip",
			Context = (com.sun.star.uno.XInterface) @27d4c9d02e0 
		} 
	}, 
	ArgumentPosition = (short) -1 
}
All in all, it looks like my `description.xml` is not recognized or is ignored or has failed at parsing stage.

How I've packaged/installed extension (both ways don't work):
  • Uncompressed `zip` the whole folder, then install with Extensions Manager
  • Uncompressed `zip` the whole folder, rename file to end with `.oxt`, close LibreOffice, install by double-clicking on the `.oxt` file
What's iteresting is that Hanya's MRI extension (which is awesome, by the way) works OK on my installation despite it's targeted on Apache Open Office 4 (there is LO-specific version, but it's serveral years older). I've compared all of mine and his (her?) config files (manifest.xml and description.xml) byte-to-byte, copied tag's name from his configs (to avoid subtle differences like latin `e` and cirillic `е`) but all to no avail.


I've re-read dev-guides (1, 2 and others) for like hundred times already, but clearly am missing something. Any tips would be greatly appreciated.


My LibreOffice Version 5.4.5.1 (x64), Build ID: 79c9829dd5d8054ec39a82dc51cd9eff340dbee8

Re: How to debug/fix my .oxt installation: can't remove and

Posted: Tue Feb 20, 2018 3:16 am
by JeJe

Re: How to debug/fix my .oxt installation: can't remove and

Posted: Tue Feb 20, 2018 7:05 pm
by hanya
If you have "zip" file extension, the office recognize the package as regacy package. In that case, description.xml file is not used.
You have to add "oxt" file extension to your package name.

Re: How to debug/fix my .oxt installation: can't remove and

Posted: Wed Feb 21, 2018 1:21 am
by xenon325
Have you tried Extension Compiler?
Nope, I've missed it somehow :/ There is a lot of info in that document, will read it up. Thanks!
You have to add "oxt" file extension to your package name.
That's what I've tried first, but in a wrong way :)

Jim K has nailed it on ask.lo.org - instead of zipping extension's folder content, I was zipping folder itself. As a result, on a top level "my-extension.oxt" archive contained single folder named "my-extension", which contained "META-INF" folder and "description.xml", so that they were not on the top level anymore and that's why they were not recognised by Extension Manager.

P.S. huge thank you for your work - whithout MRI it would take me forever to figure out internal structure of Writer documents.

Re: [Solved] How to debug/fix my .oxt installation: can't re

Posted: Fri Aug 31, 2018 6:53 pm
by Stella365
I am having the same problem and none of the solutions is working. Is there something else I can try?