Remove Install New Software from help menu (p2)

1.4k Views Asked by At

I have a question for a RCP project in Eclipse where is installed p2.

I have the help menu with "install new software" and "check for updates" options and I have to remove the "install new software" option from the product.

Can I do that? And if so, how?

I tried to look for an answer in the web but I didn't find anything.

Features that I have in the project are:

  1. org.eclipse.equinox.p2.rcp.feature
  2. org.eclipse.rcp
  3. org.test (my feature)
2

There are 2 best solutions below

0
On BEST ANSWER

It was simple. If you insert the help menu by code in ApplicationActionBarAdvisor, p2 fills the menu automatically. To create a custom help menu without p2 intromissions you must go in plugin.xml, in the extensions tab and add into the menu extension a menu 'Help' and also add to it the command 'org.eclipse.equinox.p2.ui.sdk.update'

0
On

You can use the Equinox Transforms extension (an Adapter Hook) to remove that entry. If you use the xslt-transformation to wipe out that entry you can use the following xsl-snippet:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:template match="menuContribution[@locationURI='menu:help?after=org.eclipse.equinox.p2.ui.sdk.update']">
 </xsl:template>
 <xsl:template match="node()|@*">
     <xsl:copy>
         <xsl:apply-templates select="node()|@*"/>
     </xsl:copy>
 </xsl:template>
</xsl:stylesheet>