[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.rcp] Re: Scheduled Update from RCP


Well I have spent most of the morning in Google and debug but have come up with the following which I am posting in case anyone else is interested.

This is for 3.3 but may work earlier but I have not tried.

First you have to include the org.eclipse.update.scheduler plugin in the product which does the work.

Next I set the default state of the preferences for the updater. I did this by setting them in the preference page and then scanning through the configuration folder until I found them in a file. You may not need all of them but as they were there I put them in.

Preferences node = new DefaultScope().getNode("org.eclipse.update.scheduler"); //$NON-NLS-1$
node.putBoolean("enabled", true); //$NON-NLS-1$
node.putBoolean("download", true); //$NON-NLS-1$
node.put("hour", "1\\:00 AM"); //$NON-NLS-1$ //$NON-NLS-2$
node.put("day", "Every day");  //$NON-NLS-1$//$NON-NLS-2$

Next I wanted to stop the user changing the preferences so I opened the update jar file in winzip and had a look at the plugin.xml to find the name of the preference page from the preferences extension definition then removed it with

final PreferenceManager pm = window.getWorkbench().getPreferenceManager();
pm.remove("org.eclipse.update.internal.ui.preferences.MainPreferencePage");

Now when I run my RCP application it starts a background update check and no preference page for the user to change anything.