Running a script when OXT install process

Discussions about using 3rd party extension with OpenOffice.org

Running a script when OXT install process

Postby Mr.Dandy » Mon Aug 06, 2018 5:58 pm

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.3 - Windows 7
User avatar
Mr.Dandy
 
Posts: 285
Joined: Tue Dec 11, 2012 4:22 pm

Re: Running a script when OXT install process

Postby Zizi64 » Sun Aug 12, 2018 8:58 am

I don't see any events like OnInstall to do it.

Why you need it?
Tibor Kovacs, Hungary; LO4.4.7, LO5.4.7 on Win7x64Prof.
PortableApps, winPenPack: LO3.3.0-LO6.1.0 and AOO4.1.5
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
Zizi64
Volunteer
 
Posts: 6984
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Running a script when OXT install process

Postby Mr.Dandy » Mon Aug 13, 2018 2:33 pm

My extension runs an external program to be work.
This one must installed in a specific directory.
OpenOffice 4.1.3 - Windows 7
User avatar
Mr.Dandy
 
Posts: 285
Joined: Tue Dec 11, 2012 4:22 pm

Re: Running a script when OXT install process

Postby RoryOF » Mon Aug 13, 2018 2:43 pm

You may already know this, but there is extension configuration information here
https://wiki.openoffice.org/wiki/Documentation/DevGuide/Extensions/Extension_Manager
and in the links on its sidebar.
Apache OpenOffice 4.1.5 on Xubuntu 18.04 (mostly 64 bit version) and infrequently on Win2K/XP
14 October 2016 was Pooh's 90th birthday
User avatar
RoryOF
Moderator
 
Posts: 26925
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Running a script when OXT install process

Postby RoryOF » Mon Aug 13, 2018 3:17 pm

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   Expand viewCollapse view
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.5 on Xubuntu 18.04 (mostly 64 bit version) and infrequently on Win2K/XP
14 October 2016 was Pooh's 90th birthday
User avatar
RoryOF
Moderator
 
Posts: 26925
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Running a script when OXT install process

Postby Mr.Dandy » Mon Aug 13, 2018 3:28 pm

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.3 - Windows 7
User avatar
Mr.Dandy
 
Posts: 285
Joined: Tue Dec 11, 2012 4:22 pm

Re: Running a script when OXT install process

Postby RoryOF » Mon Aug 13, 2018 3:34 pm

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.5 on Xubuntu 18.04 (mostly 64 bit version) and infrequently on Win2K/XP
14 October 2016 was Pooh's 90th birthday
User avatar
RoryOF
Moderator
 
Posts: 26925
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Running a script when OXT install process

Postby Mr.Dandy » Mon Aug 13, 2018 3:43 pm

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.3 - Windows 7
User avatar
Mr.Dandy
 
Posts: 285
Joined: Tue Dec 11, 2012 4:22 pm

Re: Running a script when OXT install process

Postby RoryOF » Mon Aug 13, 2018 3:47 pm

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.5 on Xubuntu 18.04 (mostly 64 bit version) and infrequently on Win2K/XP
14 October 2016 was Pooh's 90th birthday
User avatar
RoryOF
Moderator
 
Posts: 26925
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Running a script when OXT install process

Postby Mr.Dandy » Fri Aug 17, 2018 3:03 pm

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.3 - Windows 7
User avatar
Mr.Dandy
 
Posts: 285
Joined: Tue Dec 11, 2012 4:22 pm


Return to Extensions

Who is online

Users browsing this forum: No registered users and 1 guest