For now, create a new config.ini based on provided template
diff --git a/update/org.eclipse.update.configurator/config.ini b/update/org.eclipse.update.configurator/config.ini
new file mode 100644
index 0000000..4a2f84d
--- /dev/null
+++ b/update/org.eclipse.update.configurator/config.ini
@@ -0,0 +1,44 @@
+# Eclipse runtime configuration file
+# This file contains a number of key/value pairs that are merged into the
+# System properties on system startup. The values control the way the
+# runtime is structured and runs.
+
+# Note: Only platform:/base/ and file: URLs are supported. In general the
+# URLs given may include a version number (e.g., .../location_1.2.3).
+# If a version is not specified, the system binds
+# to the location which matches exactly or to the versioned location with the
+# latest version number. If a version number is given then only exact matches
+# are considered.
+
+# The URL for the runtime entry point. The default value is
+# platform:/base/plugins/org.eclipse.osgi
+#osgi.framework = platform:/base/plugins/org.eclipse.osgi
+
+# The classpath for the framework found at the osgi.framework location. This
+# comma-separated list contains either URLs or simple element names. Simple
+# names are assumed to be relative to the framework's install directory.
+# Typically this value need not be set as it is initialized by the framework itself.
+# Version match searching is not done for URLs listed here.
+#osgi.frameworkClassPath =
+
+# The comma-separated list of locations to search for the splash screen file (splash.bmp).
+# For each list element a subdirectory structure based on the pattern nl/<locale> is searched.
+# The system binds to the first matching file. There is no default value.
+osgi.splashPath = platform:/base/plugin/org.eclipse.platform
+
+# The location of the splash screen file. If this value is set at system startup it is used
+# in favour of the osgi.splashPath searching outlined above. If the value is not set
+# the searching is done and this key is bound to the result of the search.
+#osgi.splashLocation =
+
+# The comma-separated list of bundles which are automatically installed and started
+# once the system is up and running. Each entry if of the form
+# <URL | simple bundle location>[@<startlevel>]
+# Simple bundle locations are interepreted as relative to the framework's parent directory.
+# The startlevel indicates the OSGi start level at which the bundle should run.
+# If this value is not set, the system computes an appropriate default.
+# osgi.bundles =
+#osgi.bundles=org.eclipse.osgi.services, org.eclipse.osgi.util, org.eclipse.core.runtime@2, reference:file:d:/equinox/dev/org.eclipse.update.configurator/@3
+
+# End of file marker - must be here
+eof=eof
\ No newline at end of file
diff --git a/update/org.eclipse.update.configurator/src/org/eclipse/update/configurator/messages.properties b/update/org.eclipse.update.configurator/src/org/eclipse/update/configurator/messages.properties
index 1d3520c..eca1e5a 100644
--- a/update/org.eclipse.update.configurator/src/org/eclipse/update/configurator/messages.properties
+++ b/update/org.eclipse.update.configurator/src/org/eclipse/update/configurator/messages.properties
@@ -29,6 +29,7 @@
cfig.unableToSave.noURL=Configuration file save location not specified
cfig.unableToSave=Unable to save configuration file \"{0}\"
cfig.badVersion=Unsupported configuration version \"{0}\"
+cfg.unableToCreateConfig.ini = Unable to create config.ini
platform.running=The Platform is already running.
platform.mustNotBeRunning=The Platform must not be running.
diff --git a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/PlatformConfiguration.java b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/PlatformConfiguration.java
index f7e6d24..1df7121 100644
--- a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/PlatformConfiguration.java
+++ b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/PlatformConfiguration.java
@@ -13,9 +13,7 @@
import java.io.*;
import java.net.*;
import java.util.*;
-import org.eclipse.core.internal.boot.PlatformURLConnection;
-import org.eclipse.core.internal.boot.PlatformURLHandler;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.internal.boot.*;
import org.eclipse.update.configurator.*;
public class PlatformConfiguration implements IPlatformConfiguration {
@@ -55,6 +53,7 @@
private static final String CONFIG_NAME = "platform.cfg"; //$NON-NLS-1$
private static final String CONFIG_FILE = CONFIG_DIR + "/" + CONFIG_NAME; //$NON-NLS-1$
private static final String CONFIG_FILE_INIT = "install.ini"; //$NON-NLS-1$
+ private static final String CONFIG_INI = "config.ini"; //NON-NLS-1$
private static final String CONFIG_FILE_LOCK_SUFFIX = ".lock"; //$NON-NLS-1$
private static final String CONFIG_FILE_TEMP_SUFFIX = ".tmp"; //$NON-NLS-1$
private static final String CONFIG_FILE_BAK_SUFFIX = ".bak"; //$NON-NLS-1$
@@ -525,6 +524,9 @@
if (cfigDir != null)
cfigDir.mkdirs();
+ // If config.ini does not exist, generate it
+ writeConfigIni(cfigDir);
+
// first save the file as temp
File cfigTmp = new File(cfigFile.getAbsolutePath() + CONFIG_FILE_TEMP_SUFFIX);
os = new FileOutputStream(cfigTmp);
@@ -571,6 +573,19 @@
}
}
}
+
+ private void writeConfigIni(File configDir) {
+ try {
+ File configIni = new File(configDir, CONFIG_INI);
+ if (!configIni.exists()) {
+ URL configIniURL = ConfigurationActivator.getBundleContext().getBundle().getEntry(CONFIG_INI);
+ File sourceConfigIni = new File(configIniURL.getFile());
+ copy(sourceConfigIni, configIni);
+ }
+ } catch (IOException e) {
+ System.out.println(Messages.getString("cfg.unableToCreateConfig.ini"));
+ }
+ }
public BootDescriptor getPluginBootDescriptor(String id) {
// return the plugin descriptor for the specified plugin. This method