Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Oomph » Minimal API to install arbitrary product from udpate site
Minimal API to install arbitrary product from udpate site [message #1753525] Tue, 07 February 2017 12:55 Go to next message
Markus Duft is currently offline Markus DuftFriend
Messages: 35
Registered: March 2015
Member
Hey,

I have been playing a little with Oomph lately, and came up with a setup model that is capable to install (one of) our product(s) from an update site I provide. I created the model in the model editor and fed that to the normal installer. There are some rough edges, but basically it works Smile

We also have the case where we want to headlessly, and in an automated way, install RCP applications on a server. I would love to use Oomph for that. To be able to do it, I'd need some pointers please Smile

1) I need the minimal Model elements I need to create and how to create them. Let's assume I have an update site and "just" want to install a product from there - no other things to be done, except maybe .ini file adaptions. I saw that there is more than one way to create certain model elements (Installation, Workspace, ...), so I'm not sure where to start. Using Eclipse itself as an example would be OK for me Smile
2) Once I built the model in memory, I need to somehow perform the installation (without UI, without confirmations - let's for the sake of simplicity assume that everything has been confirmed up front). Is SetupTaskPerformer the right thing to use? Whats the most simple sequence you can imagine to make it install a product (eclipse)?

It would be really helpful to get at least some cues on how to proceed with a prototype.

Cheers,
Markus
Re: Minimal API to install arbitrary product from udpate site [message #1753596 is a reply to message #1753525] Wed, 08 February 2017 04:49 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
You basically need what you see in the index, and there generally needs to be an index. There are wizards to create all the things like an index, a product catalog, and a product. Those things are all needed. Yes, the SetupTaskPerformer is the engine, and as long as all variables that need values are resolved, it can be used to perform the tasks for creating an installation. There's this old Bugzilla that we never completed https://bugs.eclipse.org/bugs/show_bug.cgi?id=487626 and there is more recent work done on configurations https://wiki.eclipse.org/Eclipse_Oomph_Authoring#Automation_and_Specialization_with_Configurations which is intended to automate the selection process in the UI, but could also be used to help drive a headless install without so much command line processing because a configuration setup can be specified on the installer application command line.

Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Minimal API to install arbitrary product from udpate site [message #1753610 is a reply to message #1753596] Wed, 08 February 2017 08:11 Go to previous messageGo to next message
Markus Duft is currently offline Markus DuftFriend
Messages: 35
Registered: March 2015
Member
Thanks for the quick reply Smile I think I was not clear enough in my intention. I would like to "embed" oomph as library into my own application. Lets assume this application has the ability to calculate all the things required for an install (location, product, update sites required, etc.). Which model elements would I have to create through EMF APIs to have everything absolutely required to create an installation through SetupTaskPerformer programmatically? Is there kind of a minimal unit test for this or something similar that I could use as starting point? I explicitly DON'T want to create an index or any model XMIs up front. I would like to generate the models dynamically at runtime.
Re: Minimal API to install arbitrary product from udpate site [message #1753673 is a reply to message #1753610] Wed, 08 February 2017 17:25 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
As Ed said, you'll need all these models. But of course you cold generate them on the fly into the temp folder and point the performer to there.

On the (lower) p2 layer you could automate an installation as shown in http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/tree/plugins/org.eclipse.oomph.p2.tests/src/org/eclipse/oomph/p2/tests/AgentTests.java#n237 , but I guess that's not what you want.


Re: Minimal API to install arbitrary product from udpate site [message #1753701 is a reply to message #1753673] Thu, 09 February 2017 06:43 Go to previous messageGo to next message
Markus Duft is currently offline Markus DuftFriend
Messages: 35
Registered: March 2015
Member
OK, So the performer always needs a real file representation, is that right? I cannot simple create them in memory and hand it over, but I must serialize it somewhere so the performer can pick it up? Do you have a pointer to the code that actually picks up those files? I guess there are system properties that tell the performer where to look?

Thanks for all the help! Especially thanks for the AgentTest. I'm not yet entirely sure how much of the performer part actually will fit into what I'm trying to do (I do want to re-use the SetupTask concept, so I will need it I guess?). Still it's interesting to see how "simple" a very plain and simple P2 operation can be Very Happy
Re: Minimal API to install arbitrary product from udpate site [message #1753705 is a reply to message #1753701] Thu, 09 February 2017 07:32 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Markus Duft wrote on Thu, 09 February 2017 07:43
OK, So the performer always needs a real file representation, is that right? I cannot simple create them in memory and hand it over, but I must serialize it somewhere so the performer can pick it up?


Right.

Markus Duft wrote on Thu, 09 February 2017 07:43
Do you have a pointer to the code that actually picks up those files? I guess there are system properties that tell the performer where to look?


Please read https://wiki.eclipse.org/Eclipse_Oomph_Authoring#Hosting_your_own_index_.2F_catalogs carefully. You need to specify something like

-Doomph.redirection.setups=index:/->file:/C:/Users/Stepper/AppData/Local/Temp/setups_765873645876/

Your local index file must be named "org.eclipse.setup".


Re: Minimal API to install arbitrary product from udpate site [message #1753736 is a reply to message #1753705] Thu, 09 February 2017 13:33 Go to previous message
Markus Duft is currently offline Markus DuftFriend
Messages: 35
Registered: March 2015
Member
Alright, thanks for the hints Smile I will run off into that direction and let you know what's the outcome Smile
Previous Topic:Connection Issues during Installation Process
Next Topic:Network Connections Active Provider selection preference
Goto Forum:
  


Current Time: Thu Mar 28 18:12:18 GMT 2024

Powered by FUDForum. Page generated in 0.04362 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top