Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-update-dev] Problems with UninstallCommand

I am trying to use UninstallCommand to uninstall a feature that I had
previously installed with InstallCommand.

Here's the code I wrote:

UninstallCommand command = new UninstallCommand(featureFullName, null,
null, "false");
command.run();
command.applyChangesNow();

It seems that UninstallCommand does lots of things, but never really gets
around to uninstalling the three bundles that comprise my feature. I
noticed if I insert a breakpoint before the command.run(), and if I then
manually stop and uninstall the bundles at the osgi command line, that the
UninstallCommand then seems to work fine, removing the feature and plug-ins
from the various Eclipse caches and registries and also from the file
system.

I was confused specifically about the "toSite" parameter in the
UninstallCommand. Since I am running  on my target locally and using an
update site on my local file system, I was not at all sure what to put for
"toSite". It seemed odd to me to need a "to" site when the very notion of
uninstalling seems to demand a "from" and the to is sorta implied to be to
the trash. There really is no destination in my thinking. So I used null,
but this is purely a guess.

Am I missing something obvious?

I suspect that the answer is that I am *supposed* to do the stopping and
uninstalling myself. If this is the case, how do I get from the name and
version (Strings) of a feature to the actual bundles associated with that
feature as it is installed? It also seems to matter that I uninstall these
bundles in top-down order. Any clues on how I can determine that at
runtime?

Thanks for any and all insights.

Paul VanderLei
Embedded Java Enablement Team
1750 Ridgemoor SE
Grand Rapids, MI 49506
616.975.1985
pvlei@xxxxxxxxxx

"I don't see architecture coming from you." -Jerry Seinfeld




Back to the top