Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 239227

Summary: Feature branding is not displayed in About Dialog
Product: [Eclipse Project] Platform Reporter: Kai Toedter <kai.toedter>
Component: Update (deprecated - use Eclipse>Equinox>p2)Assignee: John Arthorne <john.arthorne>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: aniefer, d.nachev, daniel.kruegler, dj.houghton, jeffmcaffer, pascal, rscott, tjwatson
Version: 3.4   
Target Milestone: 3.5 M6   
Hardware: PC   
OS: Windows Vista   
Whiteboard:
Bug Depends on:    
Bug Blocks: 241545    
Attachments:
Description Flags
Sample projects that can recreate the problem
none
Patch to make update.configurator register bundle group provider via DS none

Description Kai Toedter CLA 2008-07-02 07:59:38 EDT
Build ID: I20080617-2000

Steps To Reproduce:
1. Create an RCP app with feature branding and About dialog
2. Export the app using the export wizard (and create p2 repositories)
3. Check the About dialog in the exported version, you see the feature branding icon.
4. Install the app (using p2 director) from the repository created during export
5. Check the About dialog in the installed version, the feature branding icon is gone :(


More information:
Rich Scott found out that that has something to do with the generated config.ini, see his comment at http://toedter.com/blog/?p=27
Comment 1 Rich Scott CLA 2008-07-02 10:48:35 EDT
Created attachment 106316 [details]
Sample projects that can recreate the problem

THe attached zip contains 2 project that demonstrate the problem. The first tis the basic mail plugin with branding information. The second is a feature that depends on the mail plugin and also contains a product. The mail application is setup as the branding plug-in.

I had set this up in preparation for adding a bug, but found that Kai had already posted this one.
Comment 2 Rich Scott CLA 2008-07-02 10:52:07 EDT
I Also found that the same problem happens if I use p2installer to crate the installed copy instead of director.
Comment 3 Pascal Rapicault CLA 2008-07-21 10:47:20 EDT
This is probably because the update.configurator bundle is not started and update.configurator is still the entity registering the entities that gets registered to fill the UI.
Comment 4 Kai Toedter CLA 2008-07-21 10:51:43 EDT
@Pascal
But then there is a mismatch between the original export and the repository created (both done by the product export wizard in a single step), since the feature branding is showing up correctly in the original export.
Comment 5 Pascal Rapicault CLA 2008-07-21 18:31:14 EDT
This is "normal". The runnable application that is exported as part of the build is not a p2-enabled product (it does not have a p2 folder at the root) and therefore it does not exactly behave as the p2 enabled one. I think there is a bug about that in the PDE build bucket. 
To be correct, the runnable application resulting from the PDE Build export should result from a p2 director call.
Comment 6 Kai Toedter CLA 2009-01-07 10:23:43 EST
I found a solution (hack) for 3.4.1 to get the feature brandings back. See my blog entry at http://www.toedter.com/blog/?p=39
Comment 7 Pascal Rapicault CLA 2009-01-27 10:34:43 EST
This may be related to bug #261331	
Comment 8 DJ Houghton CLA 2009-02-03 15:02:41 EST
In the product that is exported, the update.configurator bundle is marked as started in the bundles.info file in the configuration.

In the repository that is exported, the update.configurator bundle is not marked as started so when we use the director to install the product in a new location, it is not marked as started in the resulting bundles.info in the configuration.

This is the difference between starting the exported product and starting a product that has been provisioned by the exported repository.

The features (and branding) listed in the About dialog are contributed to by IBundleGroupProviders. The activator for the update.configurator bundle is one of those providers. If the bundle doesn't get started then the bundle group provider is not registered and the branding information is not seen in the About.

In Eclipse 3.4, the update.configurator bundle was NOT marked as started but by coincidence it was touched by another bundle early on and since it is marked as lazy start, it started and was able to provide a list of bundle groups when prompted. In Eclipse 3.5 (and perhaps 3.4.x?) the code which touched the update.configurator was removed and therefore the bundle doesn't get started automatically and it relies on the information in the bundles.info file.

A couple of things to note:
- Andrew noted that in Generator#generateBundleConfigIUs we check to see if we are dealing with the update.configurator bundle. If so, then we explicitly don't mark it as started. (this explains the difference in behaviour since the product export doesn't use the generator but the repo export does)
- John mentioned that this is the sort of thing that we could use DS for. (it is being released into the SDK this week) We could declare that the update.configurator bundle provides a bundle group provider service and it wouldn't have to rely on always being started in order to see the results.

Comment 9 DJ Houghton CLA 2009-02-03 15:15:20 EST
*** Bug 261331 has been marked as a duplicate of this bug. ***
Comment 10 John Arthorne CLA 2009-02-23 14:50:42 EST
Created attachment 126496 [details]
Patch to make update.configurator register bundle group provider via DS

This patch creates a DS component that registers the IBundleGroupProvider service even before the bundle has started. Through testing I confirmed that the update.configurator bundle only becomes active when a client obtains the IBundleGroupProvider service.
Comment 11 John Arthorne CLA 2009-03-03 23:10:32 EST
Fix released to HEAD.
Comment 12 John Arthorne CLA 2009-03-12 13:12:15 EDT
For future reference, in case this code pattern is copied elsewhere: I was missing the check to only register the service if not already registered by DS. See patch in bug 268150.