Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 224615 - [update][reconciler] Allow the preinstalled feature to be removed
Summary: [update][reconciler] Allow the preinstalled feature to be removed
Status: CLOSED WORKSFORME
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Pascal Rapicault CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 241637 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-03-28 10:01 EDT by Samuel Wu CLA
Modified: 2010-03-12 14:37 EST (History)
6 users (show)

See Also:


Attachments
Error log (2.50 KB, text/plain)
2008-04-23 09:11 EDT, Samuel Wu CLA
no flags Details
Latest edition of the director app (16.27 KB, application/octet-stream)
2008-04-24 13:12 EDT, John Arthorne CLA
no flags Details
exception when running director (2.17 KB, text/plain)
2008-04-25 09:16 EDT, Samuel Wu CLA
no flags Details
Screen shot of extra feature that can be uninstalled (60.92 KB, image/png)
2008-06-18 13:39 EDT, John Arthorne CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Samuel Wu CLA 2008-03-28 10:01:14 EDT
Build ID: I20080305-1100

Steps To Reproduce:
1. Unzip a new feature into the directory where eclipse is installed
2. Start eclipse
3. The new feature is not listed as installed feature as in the Manage Configuration of the old eclipse. 


More information:
We need a way to uninstall the features which may not be installed by the Equinox.
Comment 1 Pascal Rapicault CLA 2008-03-28 10:33:54 EDT
This is an update manager bug.
Comment 2 Mike Wilson CLA 2008-04-03 14:34:28 EDT
If it's an update manager bug, why is it still in the p2 inbox?

Comment 3 Pascal Rapicault CLA 2008-04-03 20:19:58 EDT
Because I first misread the bug and the build id. You can see in the history that it went to UM and then back here.
Comment 4 Mike Wilson CLA 2008-04-07 08:51:07 EDT
Ah, apologies.

So the title, and the "More information" line seem to be asking for a general mechanism for removing features not installed by Equinox (whatever that means), but the steps to reproduce appear to be one particular scenario for *adding* a feature that isn't working. Do we know whether the reporter is looking for this particular scenario to work, or whether there is something about our normal "dropins" model that doesn't allow deletion, or...?


Comment 5 Pascal Rapicault CLA 2008-04-07 20:54:44 EDT
The current design for dropins is such that anything being installed through it will stay installed until manually removed from the dropins and that even if the user has explicitly uninstalled it from the UI (Note that this behavior could still be reviewed and be made more consistent with the rest of p2, in that we could go and delete things from disk).

Also the dropins is not a mechanism designed for composing products. Instead products should be built from one or several provisioning operations, thus giving the product author the choice of organizing what is made visible to the user and thus better controlling the availability of updates.

So in the end I don't think there is much to fix here.
Comment 6 Samuel Wu CLA 2008-04-08 08:44:35 EDT
Our product contains a couple of manuals which may out of date after the installation and need to be replaced with the new version. And some of the customers have concern on the extra space taken by the out of date plugins and want to remove them. We are using the Install Shield to do the first installation. I would think our request is a valid one. Or maybe you can suggest a solution?
Comment 7 Pascal Rapicault CLA 2008-04-08 09:17:58 EDT
I'm getting confused :)
Could you please describe exactly the steps you follow to end up in a situation where things are broken.
Comment 8 Samuel Wu CLA 2008-04-08 10:24:14 EDT
Here is a scenario of of using Install Shield.
1. Set up a directory and unzip all the features there, including eclipse, our main feature and the features which contains the manuals
2. Point Install Shield to the directory and let it package everything in the directory to create a installable driver
3. Run the installable driver on another machine which restore everything to a directory, including eclipse, our main feature and manual features.
This is very similar to what I described in the bug report since I don't want to create a installable driver. 
Does it help?
Comment 9 John Arthorne CLA 2008-04-08 17:31:11 EDT
If they have been installed by unzipping, then they can be uninstalled by deleting the plugins/features that were unzipped.  Was there any other way to do this in old update manager?
Comment 10 Samuel Wu CLA 2008-04-08 17:41:39 EDT
A feature zip file may contains a couple of plugins. It's easy to unzip it. But when it comes to remove it, it's very hard to pick up the right plugins of the right version. We can't suggest this to the end users.
Comment 11 Mike Wilson CLA 2008-04-22 09:46:14 EDT
Any progress?

Comment 12 John Arthorne CLA 2008-04-22 12:00:17 EDT
I'm reclassifying this as an enhancement, since uninstalling pre-installed features was not possible in Eclipse 3.3.

The good news is that this is now possible with p2. The issue is with how things are installed. The different ways to install/uninstall things are symmetric. If you installed by unzipping into eclipse/dropins, then the way to uninstall is to delete from eclipse/dropins.  If the software is installed programmatically with p2, either with the GUI or p2 command line tools, then it can be uninstalled in the same way.

So, you can achieve the result you are looking for today by doing the following:

1) Install or unzip Eclipse platform into an empty directory (say c:\eclipse).
2) Install your documentation plugins and features into a separate directory (say c:\docs).
3) Start up the platform in c:\eclipse.
4) Open Help > Software Updates
5) On the "Available Software" tab, select "Add Site".
6) Click "Local", and browse to c:\docs
7) Expand the newly added site, and install the desired extra documentation features

-> It is now possible for the end user to uninstall this added feature from within the GUI

Of course, these steps are likely not practical for a product. What you want to do is replace these steps with a build script that does the same thing automatically.  p2 provides command line tools and Ant scripts that can perform these steps without the GUI. These tools are not yet very well documented, but we can help you through the process if you are interested in this direction. See the initial documentation at http://wiki.eclipse.org/Equinox_p2_Getting_Started_for_Releng
Comment 13 John Arthorne CLA 2008-04-22 12:03:00 EDT
Clearing the target milestone because it's not clear what steps we need to take here.
Comment 14 Samuel Wu CLA 2008-04-22 15:02:02 EDT
Can you please provide more specific suggestion on how to set up the build script? The information on the page you provided is too brief.
I tried the Equinox p2 Metadata Generator with -config option and it threw exception. 
Comment 15 John Arthorne CLA 2008-04-22 17:48:56 EDT
Are you trying the ant script, or the command line generator application? Can you describe the failure you are getting?  The -config option is for generating metadata for a legacy application that is not p2-enabled. If you just have a folder containing plugins and features, you should use the -source argument instead.  

To restate my steps from comment #12 in build terms, your build would look something like this:

1) Unzip Eclipse platform into an empty directory (say c:\eclipse).
2) Unzip your documentation plugins and features into a separate directory
(say c:\docs).
3) Invoke p2 generator with source location c:\docs. This will generate p2 metadata for your extra plug-ins and features
4) Invoke p2 director application to install your extra plug-ins and features into the target at c:\docs
5) Zip up the resulting application at c:\eclipse.

There is currently work going on in bug 226401 to make the command line director application easier to use. Or, you can use the director ant task.

CCing our PDE build wizard Andrew who can help with more detailed questions about the p2 generator or director Ant tasks.
Comment 16 Samuel Wu CLA 2008-04-23 09:11:49 EDT
Created attachment 97214 [details]
Error log

1. Download eclipse-SDK-I20080421-1322-win32.zip and unzip it to folder d:\eclipse34
2. Download RSE feature and unzip it to directory d:\eclipse34\RSE30
3. Run the following command just to see if it works
D:\eclipse34\eclipse>eclipse -application org.eclipse.equinox.p2.metadata.genera
tor.EclipseGenerator -source d:\eclipse34\RSE30
4. Got exception 
Artifact repository location is not a valid URL: null.
The error log is attached as above
What the syntax to start the generator?
another question is how to start p2 director? what's the syntax
Comment 17 John Arthorne CLA 2008-04-23 10:32:23 EDT
Here is a command line. I tested with RSE core 3.0 M6 download:

C:\eclipse>eclipse -application org.eclipse.equinox.p2.metadata.generator.EclipseGenerator -source d:\eclipse34\RSE30\ -flavor tooling -mr file:/c:/eclipse34/RSE-out/ -ar file:/c:/eclipse34/RSE-out/ -publishArtifacts

The error was due to the artifact and metadata repository locations not being specified. I have entered bug 228406 to not throw an exception here and use a default location.
Comment 18 Samuel Wu CLA 2008-04-23 13:37:10 EDT
The new command ran well and I found two new files generated in RSE-out. Can you suggest on how to do the installation?
Comment 19 John Arthorne CLA 2008-04-24 13:11:34 EDT
The best way to do this from the command line is the p2 director application. Pascal has just written up some documentation on how to use it here:

http://wiki.eclipse.org/Equinox_p2_director_application

The doc includes an example of installing CDT into the SDK using the command line.

The other issue is that the director application is not yet part of the SDK. This is being integrated today (bug 225778).  I will attach the latest version of the director application to this bug as a convenience until a build is available that contains the director app.
Comment 20 John Arthorne CLA 2008-04-24 13:12:17 EDT
Created attachment 97491 [details]
Latest edition of the director app
Comment 21 Samuel Wu CLA 2008-04-25 09:16:58 EDT
Created attachment 97604 [details]
exception when running director

Since step-by-step instructions are not provided, I tried it based on my understanding and it doesn't work for me.
There are a couple of thing that are not clear.
1. Pascal describes three ways of using director, which one should I follow? I picked up the first one.
2. Pascal doesn't describe what's in the directory d:\tmp\cdt. I took it as an update site since it has a site.xml
3. how to install the directory? It looks like a plugin to me so I created directory and unzip the attached file there
4. Do I still need to run the generator? I cann't fit it in the picture.

Here is what I did.

1. Put RSE in the directory dropins and start eclipse
2. Build an update site to contain org.eclispe.rse feature
3. Shut down eclipse and remove RSE from dropings directory
4. Move update site to D:\eclipse34\RSE30-Update
5. Run the following command
eclipse.exe -application org.eclipse.equinox.p2.director.app.application -metadataRepository file:D:/eclipse34/RSE30-Update/site.xml -artifactRepository file:D:/eclipse34/RSE30-Update/site.xml -installIU org.eclipse.rse.feature.group
6. I got the exception (see the attachment)

7. I tried the follwoing command to use the result from the generator. It still didn't work.
D:\eclipse34\eclipse>eclipse.exe -application org.eclipse.equinox.p2.director.ap
p.application -metadataRepository file:D:/eclipse34/RSE-out/artifacts.xml -artif
actRepository file:D:/eclipse34/RSE-out/artifacts.xml -installIU org.eclipse.rse
.sdk.feature.group

Can you please provide some more details? Please bear in mind that I'm not a p2 expert. You have to explain it clearly to me.
Comment 22 John Arthorne CLA 2008-06-18 13:37:57 EDT
I just tested this with the 3.4 final build (I20080617-2000) and it worked for me. Here is exactly what I did:

1) Unzip eclipse SDK to c:\tmp  (so it creates c:\tmp\eclipse\ directory containing eclipse.exe). I used the 3.4 final build:

http://fullmoon.ottawa.ibm.com/downloads/drops/I20080617-2000/download.php?dropFile=eclipse-SDK-I20080617-2000-win32.zip

2) Unzip RSE core feature into c:\tmp\rse. To be precise I used:

http://www.eclipse.org/downloads/download.php?file=/dsdp/tm/downloads/drops/R-2.0.3-200802251530/RSE-runtime-core-2.0.3.zip

3) From c:\eclipse directory I ran the following:

C:\tmp\eclipse>eclipse -application org.eclipse.equinox.p2.director.app.application -metadataRepository file:c:/tmp/rse/eclipse -artifactRepository file:/c:/tmp/rse/eclipse -installIU org.eclipse.rse.core.feature.group -destination c:/tmp/eclipse -profile SDKProfile -vmargs -Declipse.p2.data.area=c:/tmp/eclipse/p2


-> Now the RSE feature is installed into c:\tmp\eclipse. If I startup that configuration I can see that RSE is installed, and the user can uninstall it from the Installed Software dialog.  The p2 metadata generation step is no longer needed because we will generate metadata on the fly while installing.
Comment 23 John Arthorne CLA 2008-06-18 13:39:33 EDT
Created attachment 105319 [details]
Screen shot of extra feature that can be uninstalled
Comment 24 John Arthorne CLA 2008-06-18 13:43:05 EDT
Please let us know if you have further problems or need further assistance.
Comment 25 Samuel Wu CLA 2008-06-19 12:53:52 EDT
Hi John,
How to get the 0617-2000 driver? From the following page, it's all red crosses.
http://ganymede-mirror2.eclipse.org/eclipse/downloads/drops/I20080617-2000/winPlatform.php#EclipseSDK
Tried to verify with the other drivers and it didn't seem to install RSE.
Comment 26 John Arthorne CLA 2008-06-19 13:53:54 EDT
The build is marked red because there were network problems and the test results weren't copied back from the test machines. This build is good and is likely the final 3.4 build. I will look into getting it marked green.
Comment 27 Pascal Rapicault CLA 2008-12-18 00:08:14 EST
*** Bug 241637 has been marked as a duplicate of this bug. ***