Running a script when OXT install process

Discussions about using 3rd party extension with OpenOffice.org
Post Reply
User avatar
Mr.Dandy
Posts: 427
Joined: Tue Dec 11, 2012 4:22 pm

Running a script when OXT install process

Post by Mr.Dandy »

Hello,

I try to build an OXT which copy some files into a specific folder.
I don't see any events like OnInstall to do it.
OpenOffice 4.1.12 - Windows 10
User avatar
Zizi64
Volunteer
Posts: 11352
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Running a script when OXT install process

Post by Zizi64 »

I don't see any events like OnInstall to do it.
Why you need it?
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Mr.Dandy
Posts: 427
Joined: Tue Dec 11, 2012 4:22 pm

Re: Running a script when OXT install process

Post by Mr.Dandy »

My extension runs an external program to be work.
This one must installed in a specific directory.
OpenOffice 4.1.12 - Windows 10
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Running a script when OXT install process

Post by RoryOF »

You may already know this, but there is extension configuration information here
https://wiki.openoffice.org/wiki/Docume ... on_Manager
and in the links on its sidebar.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Running a script when OXT install process

Post by RoryOF »

Do the files have to be transferred on installation of the extension, or would it be sufficient that they were available when the extension is run?

In that case, start the macro Main with a call to a subroutine to transfer the files. Surround that subroutine call with a conditional, which indicates that the subroutine has been called already on this execution of OO. To do a similar task I use

Code: Select all

Global Run as Boolean

Sub Main

	IF not(Run) Then
	Code to do whatever I need to do
	Run = True	' Set flag to indicate that this macro has been run in this editing session
	End If

other code for main

End Sub 'Main

Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
Mr.Dandy
Posts: 427
Joined: Tue Dec 11, 2012 4:22 pm

Re: Running a script when OXT install process

Post by Mr.Dandy »

OK I was think that a mechanism existed to make this process automatically.
I was wrong, never mind.
I take your idea to push my files through a macro but if I uninstall my OXT, these don't removed.
OpenOffice 4.1.12 - Windows 10
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Running a script when OXT install process

Post by RoryOF »

There may be an installation subroutine to do this or the possibility of entering code to do so in an installation routine, but I have never needed to do this and haven't looked. Have you checked Pitonyak?
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
Mr.Dandy
Posts: 427
Joined: Tue Dec 11, 2012 4:22 pm

Re: Running a script when OXT install process

Post by Mr.Dandy »

RoryOF wrote:Have you checked Pitonyak?
Not again but there are a lot of documents and not enough time to looking for. :ouch:
OpenOffice 4.1.12 - Windows 10
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Running a script when OXT install process

Post by RoryOF »

In Extension Layers
the section "Code execution during installation" mentions the possibility of running code during an extension. It appears that such code may be platform dependent.

My suggestion is that you should look for some existing extension that requires an external file(s) and modify its installation section.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
Mr.Dandy
Posts: 427
Joined: Tue Dec 11, 2012 4:22 pm

Re: Running a script when OXT install process

Post by Mr.Dandy »

RoryOF wrote: look for some existing extension that requires an external file(s) and modify its installation section.
Right
If someone has this kind of extension, let me know.
OpenOffice 4.1.12 - Windows 10
User avatar
Mr.Dandy
Posts: 427
Joined: Tue Dec 11, 2012 4:22 pm

Re: Running a script when OXT install process

Post by Mr.Dandy »

I bump the thread.
I don't find any OXT with this feature :(
OpenOffice 4.1.12 - Windows 10
JeJe
Volunteer
Posts: 2763
Joined: Wed Mar 09, 2016 2:40 pm

Re: Running a script when OXT install process

Post by JeJe »

On Windows you can create a simple bat file that moves files to where you want and starts the oxt installation. Or you can create a setup routine to do the same with any number of tools available. Not tried it but,

https://installforge.net/
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
User avatar
Mr.Dandy
Posts: 427
Joined: Tue Dec 11, 2012 4:22 pm

Re: Running a script when OXT install process

Post by Mr.Dandy »

An OXT can be OS independant. A batch is Windows only.
As said above, I try to use inner mechanism for my extension (install and uninstall event).
OpenOffice 4.1.12 - Windows 10
Post Reply