WebSphere Commerce EnterpriseWebSphere Commerce Professional

Troubleshooting: Automatic update mechanism

After you download the org.eclipse.update.scheduler plug-in and copy it into the SC_installdir\rcp\eclipse\plugins directory, the default value of the automatic update preference in the Automatic updates preference page is set to false during the first startup.

Problem

You can set the value of the automatic update preference to true by adding the following parameter to the plugin_customization.ini file:
org.eclipse.update.scheduler/enabled=true  
However, currently the Eclipse platform does not read this setting correctly. See:

Solution

Use the following code in your plug-in Startup code or Preference initializer.
// Initialize the location where the preference settings are located in your applications user workspace
String prefLocation = Platform.getInstanceLocation().getURL().getPath()+ ".metadata" + File.separator + ".plugins" + File.separator + "org.eclipse.core.runtime" + File.separator + ".settings" + File.separator + "org.eclipse.update.scheduler.prefs";
// Check if the application exists, if existing we don't do any thing. If not, 
if(!new File(prefLocation).exists()){

// create a new file and add the property value pair into the file in the correct format, this will make sure that the property will be
// enabled before the application starts for the first time.

try
{
boolean b1 = new File(prefLocation).createNewFile();
if(b1)
{
BufferedWriter out = new BufferedWriter(new FileWriter(new File(prefLocation)));
out.write("enabled=true");
out.close();
}
}
catch (IOException e) {	} 
}
The Eclipse platform will now load the preferences from the plugin_customization.ini file and change the value of the enabled attribute to true during the first startup. You can change this setting in the Automatic Updates preference page.