Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Automatic Update
Automatic Update [message #459827] Thu, 07 December 2006 07:53 Go to next message
Eclipse UserFriend
Hi, I've developed an RCP application that updates automatically from a
remote site. To do this, the user has to click a button, and then go through
some wizard steps to install and restart the application. I'm trying to do
that the user click on that button but avoid the update wizard, to be
completely automatic. Can somebody help me with this?
Re: Automatic Update [message #459839 is a reply to message #459827] Thu, 07 December 2006 12:16 Go to previous messageGo to next message
Eclipse UserFriend
This doesn't answer your question directly:

http://help.eclipse.org/help32/topic/org.eclipse.platform.do c.isv/reference/misc/update_standalone.html

However, it does use all the UpdateAction etc. from here:

http://help.eclipse.org/help32/topic/org.eclipse.platform.do c.isv/reference/api/org/eclipse/update/standalone/package-su mmary.html

which you might be able to look through to do instead.

Alex.
Re: Automatic Update [message #459840 is a reply to message #459827] Thu, 07 December 2006 14:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: danclemson.gmail.com

how about making it a webstart application, so it can be auto-updated?
Re: Automatic Update [message #460045 is a reply to message #459827] Tue, 12 December 2006 07:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vconesa.hotmail.com

I've used this code to implement my own update action, I hope it will be
useful to you:

IRunnableWithProgress op = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor)
throws InvocationTargetException, InterruptedException {
try {
ISite rs = SiteManager.getSite(new URL(
"http://192.168.1.5/EVC"), monitor);
IFeatureReference[] frs = rs.getFeatureReferences();
ILocalSite ls = SiteManager.getLocalSite();
IConfiguredSite ics = ls.getCurrentConfiguration()
.getConfiguredSites()[0];
IFeatureReference[] lfrs = ics.getConfiguredFeatures();
List installOps = new ArrayList();
for (int i = 0; i < frs.length; i++) {
for (int j = 0; j < lfrs.length; j++) {
if (frs[i].getVersionedIdentifier().getIdentifier()
.equals(
lfrs[j].getVersionedIdentifier()
.getIdentifier())) {

if (frs[i]
.getVersionedIdentifier()
.getVersion()
.isGreaterThan(
lfrs[j]
.getVersionedIdentifier()
.getVersion())) {
installOps.add(OperationsManager
.getOperationFactory()
.createInstallOperation(ics,
frs[i].getFeature(monitor),
null, null, null));
}
}
}
}
if (installOps.size() > 0) {
for (Iterator iter = installOps.iterator(); iter
.hasNext();) {
IInstallFeatureOperation op = (IInstallFeatureOperation) iter
.next();
op.execute(monitor, null);
}
ls.save();
MessageBox exception = new MessageBox(
getWindowConfigurer().getWindow().getShell(),
SWT.OK);
exception
.setMessage("The application will be restarted");
exception.open();
getWindowConfigurer().getWindow().getWorkbench()
.restart();
} else {
monitor.setTaskName("No updates pending.");
Thread.sleep(2000);
}
} catch (MalformedURLException e) {
/*
* MessageBox exception = new
* MessageBox(getWindowConfigurer().getWindow().getShell(),
* SWT.OK); exception.setMessage("Internal error: please
* check the logs file");
*/
EVCConstants.log.error(this, e);
e.printStackTrace();
// exception.open();
} catch (CoreException e) {
/*
* MessageBox exception = new
* MessageBox(getWindowConfigurer().getWindow().getShell(),
* SWT.OK); exception.setMessage("Internal error: please
* check the logs file");
*/
EVCConstants.log.error(this, e);
e.printStackTrace();
// exception.open();
} catch (Exception e) {
EVCConstants.log.error(this, e);
e.printStackTrace();
}
}
};
ProgressMonitorDialog pmd = new ProgressMonitorDialog(PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getShell());
try {
pmd.run(true, true, op);
"Jos
Re: Automatic Update [message #460194 is a reply to message #460045] Sat, 16 December 2006 12:12 Go to previous message
Eclipse UserFriend
Victor can u send me the whole class?
Previous Topic:Update Site - Can't Get Update To Work
Next Topic:How to get the file path with the rcp located?
Goto Forum:
  


Current Time: Sun Mar 16 21:28:57 EDT 2025

Powered by FUDForum. Page generated in 0.03533 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top