Defining update sites in the config.ini file

I am creating a product based on Eclipse 3.6.2 for our project. The idea is to create an Eclipse installation that has all the plugins we need, and the whole setup is customized as needed for the project.

As part of this, I want to make sure our update sites are turned on, but how can I do this?

If I choose to export settings, updates are not included. I can export update sites from the preferences page and get an XML file with them, but how do I include it in the config.ini file? Or is there some other way?

The goal is that when a user launches a custom Eclipse product, our update sites will be in the list of sites. Ideally, the only ones on the list.

+7
source share
2 answers

You can add a p2.inf file that indicates specific update sites when everything is installed:

 instructions.configure=\ addRepository(type:0,location:http${#58}//www.eclipse.org/equinox/p2/testing/updateSite);\ addRepository(type:1,location:http${#58}//www.eclipse.org/equinox/p2/testing/updateSite); 

This will add www.eclipse.org/equinox/p2/testing/updateSite .

This file ( p2.inf ) must be in the same directory as your MANIFEST.MF file. You can read about it here .

+7
source

Since there is a chance that I will have to do it again, and I don’t remember how to do it next time, I will write the following steps:

I created a p2.inf file with instructions;

 instructions.configure=\ org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(type:0,location:http${#58}//<my_url_here>,name:<my_name_here>,enabled:true);\ org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(type:1,location:http${#58}//<my_url_here>,name:<my_name_here>,enabled:true);\ org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(type:0,location:http${#58}//<my_url_here>,name:<my_name_here>,enabled:true);\ org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(type:1,location:http${#58}//<my_url_here>,name:<my_name_here>,enabled:true);` 

According to the Eclipse inf wiki, the file can be placed in the same directory as my feature.xml , so what I did is

I had a product consisting of this function, so I exported the product using the Eclipse Product Export Wizard. I have definitely built a repository.

After the assembly was completed, the content.jar file was in the repository. Inside content.jar was a content.xml file. Having studied it, I was able to find:

 <touchpointData size='1'> <instructions size='1'> <instruction key='configure'> org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(<all my update sites>); </instruction> </instructions> </touchpointData> 

So, this confirmed that the export did see my p2.inf file and did something with it.

To install from the repository, I used the Eclipse Director script:

 cmd /c "C:\Program\Eclipse\director\director -consoleLog -bundlepool c:/program/eclipse/eclipse3.6_custom -profileProperties "org.eclipse.update.install.features=true" -i MyProduct.Product -r "file:/C:\eclipse\exported\repository" -dc:/program/eclipse/eclipse3.6_custom -p helios"` 

The script installed the product from the repository to the destination.

+1
source

All Articles