Now, we're using the Eclipse OSGI mechanism to do installs and updates. It's much simpler to understand (the bundles are in clearly marked directories) and the API to make updates is much simpler.
TO INSTALL:
BundleContext.install('http://myserver/bundles/mybundle-1.0.0.jar')
TO UNINSTALL
bundle.uninstall()
The final program structure I came up with has a launcher which also comes with an installer. This runs with the OSGI bundle and some SWT libraries to show progress in a UI. It is basically something like this..
// create the framework
ServiceLoader
FrameworkFactory ff = loader.iterator().next();
Map
config.put("osgi.configuration.area", configDirectory);
config.put("osgi.user.area", workspaceDirectory);
config.put("osgi.instance.area", workspaceDirectory);
fwk = ff.newFramework(config);
// start it
fwk.start();
// do any installs and uninstalls
ctxt = frk.getBundleContext();
ctxt.install().....
// start the right bundle, then get the application and launch it
Runnable app = (Runnable)getService("myapp.id") // THIS IS PSEUDOCODE
app.run();
// finally stop the framework
fwk.stop()
That was roughly it to get the code working, and reduce the client footprint by 8MB - of Eclipse plugins that I wasn't using!
