Index: tmp/org.txm.core/src/java/org/txm/core/preferences/TXMPreferences.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/core/preferences/TXMPreferences.java	(revision 1184)
+++ tmp/org.txm.core/src/java/org/txm/core/preferences/TXMPreferences.java	(revision 1185)
@@ -189,7 +189,7 @@
 	/**
 	 * 
 	 */
-	public TXMPreferences() {
+	protected TXMPreferences() {
 		super();
 		TXMPreferences.instances.put(this.getClass(), this);
 		this.commandPreferencesNodeQualifier = FrameworkUtil.getBundle(this.getClass()).getSymbolicName();
@@ -1436,7 +1436,9 @@
 	 * @param value
 	 */
 	public static void put(String nodePath, String key, Object value) {
-
+		if (!nodePath.startsWith("/project") && !nodePath.startsWith("/instance")) {
+			nodePath = "/instance/"+nodePath;
+		}
 		if (Integer.class.isInstance(value))	{
 			preferencesRootNode.node(nodePath).putInt(key, (Integer) value);
 		}
Index: tmp/org.txm.core/src/java/org/txm/objects/Project.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/Project.java	(revision 1184)
+++ tmp/org.txm.core/src/java/org/txm/objects/Project.java	(revision 1185)
@@ -176,7 +176,7 @@
 	 * @throws Exception
 	 */
 	public Project(Workspace workspace, String name, boolean needToBuild) throws Exception {
-		super("project/" + name + "/" + createUUID() + "_Project", workspace);
+		super("/project/" + name + "/" + createUUID() + "_Project", workspace);
 
 		this.needToBuild = needToBuild;
 		this.internalPersistable = true;
@@ -1122,11 +1122,11 @@
 	}
 
 	/**
-	 * Gets the project parameters root path ("project/[project name]/")
+	 * Gets the project parameters root path ("/project/[project name]/")
 	 * @return
 	 */
 	public String getParametersNodeRootPath()	{
-		return "project/" + this.rcpProject.getName() + "/";
+		return "/project/" + this.rcpProject.getName() + "/";
 	}
 
 	public List<? extends CorpusBuild> getCorpora() {
@@ -1161,7 +1161,7 @@
 	 */
 	public static void loadProjectsFromProjectScope(IProject rcpProject) {
 		//IScopeContext projectScope = new ProjectScope(projects[i]);
-		ArrayList<String> resultNodePaths = TXMPreferences.getAllResultsNodePaths("project/" + rcpProject.getName() + "/");
+		ArrayList<String> resultNodePaths = TXMPreferences.getAllResultsNodePaths("/project/" + rcpProject.getName() + "/");
 
 		Log.info("Toolbox.initialize(): loading project " + rcpProject.getName() + "...");
 		Log.info("Toolbox.initialize(): " + resultNodePaths.size() + " node(s) found in project " + rcpProject.getName() + "...");
Index: tmp/org.txm.chartsengine.jfreechart.core/build.properties
===================================================================
--- tmp/org.txm.chartsengine.jfreechart.core/build.properties	(revision 1184)
+++ tmp/org.txm.chartsengine.jfreechart.core/build.properties	(revision 1185)
@@ -1,5 +1,8 @@
 #Fri Jul 06 10:25:06 CEST 2018
 output..=bin/
-bin.includes=META-INF/,.,plugin.xml
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml,\
+               OSGI-INF/
 source..=src/
 qualifier=svn
Index: tmp/org.txm.chartsengine.r.core/build.properties
===================================================================
--- tmp/org.txm.chartsengine.r.core/build.properties	(revision 1184)
+++ tmp/org.txm.chartsengine.r.core/build.properties	(revision 1185)
@@ -1,5 +1,8 @@
 #Fri Jul 06 10:25:07 CEST 2018
 output..=bin/
-bin.includes=META-INF/,.,plugin.xml
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml,\
+               OSGI-INF/
 source..=src/
 qualifier=svn
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/Load079BinaryCorpus.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/Load079BinaryCorpus.java	(revision 1184)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/Load079BinaryCorpus.java	(revision 1185)
@@ -64,6 +64,12 @@
 		
 		String basedirname = Zip.getRoot(zipFile);
 		
+		Project p = Toolbox.workspace.getProject(basedirname.toUpperCase());
+		if (p != null) {
+			System.out.println("Aborting loading of "+zipFile+". A corpus with the same name already exists.");
+			return null;
+		}
+		
 		if (!Zip.hasEntries(zipFile, basedirname+"/import.xml", basedirname+"/data/", basedirname+"/txm/", basedirname+"/HTML/", basedirname+"/registry/")) {
 			System.out.println("Binary corpus is not a TXM 0.7.9 corpus (no import.xml file)");	
 			return null;
@@ -75,6 +81,10 @@
 		try {
 			//System.out.println(NLS.bind(Messages.AddBase_29, zipFile, corporaDir));
 			Zip.decompress(zipFile, corporaDir, false, monitor);
+			if (!basedirname.equals(basedirname.toUpperCase())) { // manage old corpus with lower cased names
+				new File(corporaDir, basedirname).renameTo(new File(corporaDir, basedirname.toUpperCase()));
+				basedirname = basedirname.toUpperCase();
+			}
 		} catch (Exception e) {
 			System.out.println(NLS.bind(TXMUIMessages.AddBase_31, e));
 			org.txm.rcp.utils.Logger.printStackTrace(e);
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/LoadBinaryCorpus.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/LoadBinaryCorpus.java	(revision 1184)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/LoadBinaryCorpus.java	(revision 1185)
@@ -316,6 +316,12 @@
 //
 //		Toolbox.workspace.save();
 		
+		Project p = Toolbox.workspace.getProject(corpusDirectory.getName().toUpperCase().toUpperCase());
+		if (p != null) {
+			System.out.println("Aborting loading of "+corpusDirectory+". A corpus with the same name already exists.");
+			return null;
+		}
+		
 		// seems like a binary corpus directory
 		// copy files in the new current corpora directory
 		File destDir = new File(Toolbox.workspace.getLocation(), corpusDirectory.getName().toUpperCase());
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/Load080BinaryCorpus.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/Load080BinaryCorpus.java	(revision 1184)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/Load080BinaryCorpus.java	(revision 1185)
@@ -59,6 +59,12 @@
 		
 		String basedirname = Zip.getRoot(zipFile);
 		
+		Project p = Toolbox.workspace.getProject(basedirname.toUpperCase());
+		if (p != null) {
+			System.out.println("Aborting loading of "+zipFile+". A corpus with the same name already exists.");
+			return null;
+		}
+		
 		if (!Zip.hasEntries(zipFile, basedirname+"/.settings/", basedirname+"/.project", basedirname+"/data/", basedirname+"/txm/", basedirname+"/HTML/", basedirname+"/registry/")) {
 			System.out.println(zipFile.getName()+" binary corpus is not a TXM 0.8.0 corpus (no .settings nor .project file)");
 			return null;
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/TxmPreferences.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/TxmPreferences.java	(revision 1184)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/TxmPreferences.java	(revision 1185)
@@ -39,6 +39,7 @@
 import org.eclipse.core.runtime.preferences.IPreferencesService;
 import org.osgi.service.prefs.BackingStoreException;
 import org.osgi.service.prefs.Preferences;
+import org.txm.core.preferences.TBXPreferences;
 
 // TODO: Auto-generated Javadoc
 /**
@@ -112,7 +113,7 @@
 				prop.load(input);
 				for (Object key : prop.keySet()) {
 					//System.out.println("prop: "+key.toString()+"="+prop.get(key).toString());
-					TxmPreferences.set(key.toString(), prop.get(key).toString());
+					TBXPreferences.getInstance().put(key.toString(), prop.get(key).toString());
 				}
 			} else {
 				String line = input.readLine();
@@ -120,7 +121,7 @@
 					String[] split = line.split("=", 2); //$NON-NLS-1$
 					if (split.length == 2) {
 						//System.out.println("Set preference: "+line);
-						TxmPreferences.set(split[0], split[1]);
+						TBXPreferences.getInstance().put(split[0], split[1]);
 					}
 					line = input.readLine();
 				}
@@ -137,261 +138,261 @@
 		return ret;
 	}
 
-	/**
-	 * set a property which value is a String.
-	 *
-	 * @param key the key
-	 * @param value the value
-	 */
-	protected static void set(String key, String value) {
-		IPreferencesService service = Platform.getPreferencesService();
-		service.getRootNode().node(SCOPE).node(Application.PLUGIN_ID).put(key, value); //$NON-NLS-1$
-		try {
-			service.getRootNode().flush();
-		} catch (BackingStoreException e) {
-			System.err.println(e);
-		}
-	}
-
-	/**
-	 * set a property which value is a boolean.
-	 *
-	 * @param key the key
-	 * @param value the value
-	 */
-	protected static void set(String key, boolean value) {
-		IPreferencesService service = Platform.getPreferencesService();
-		service.getRootNode()
-		.node(SCOPE).node(Application.PLUGIN_ID).putBoolean(key, value); //$NON-NLS-1$
-		try {
-			service.getRootNode().flush();
-		} catch (BackingStoreException e) {
-			System.err.println(e);
-		}
-	}
-
-	/**
-	 * set a property which value is a double.
-	 *
-	 * @param key the key
-	 * @param value the value
-	 */
-	protected static void set(String key, double value) {
-		IPreferencesService service = Platform.getPreferencesService();
-		service.getRootNode()
-		.node(SCOPE).node(Application.PLUGIN_ID).putDouble(key, value); //$NON-NLS-1$
-		try {
-			service.getRootNode().flush();
-		} catch (BackingStoreException e) {
-			System.err.println(e);
-		}
-	}
-
-	/**
-	 * set a property which value is a float.
-	 *
-	 * @param key the key
-	 * @param value the value
-	 */
-	protected static void set(String key, float value) {
-		IPreferencesService service = Platform.getPreferencesService();
-		service.getRootNode()
-		.node(SCOPE).node(Application.PLUGIN_ID).putFloat(key, value); //$NON-NLS-1$
-		try {
-			service.getRootNode().flush();
-		} catch (BackingStoreException e) {
-			System.err.println(e);
-		}
-	}
-
-	/**
-	 * set a property which value is a int.
-	 *
-	 * @param key the key
-	 * @param value the value
-	 */
-	protected static void set(String key, int value) {
-		IPreferencesService service = Platform.getPreferencesService();
-		service.getRootNode()
-		.node(SCOPE).node(Application.PLUGIN_ID).putInt(key, value); //$NON-NLS-1$
-		try {
-			service.getRootNode().flush();
-		} catch (BackingStoreException e) {
-			System.err.println(e);
-		}
-	}
-
-	/**
-	 * set a property which value is a long.
-	 *
-	 * @param key the key
-	 * @param value the value
-	 */
-	protected static void set(String key, long value) {
-		IPreferencesService service = Platform.getPreferencesService();
-		service.getRootNode()
-		.node(SCOPE).node(Application.PLUGIN_ID).putLong(key, value); //$NON-NLS-1$
-		try {
-			service.getRootNode().flush();
-		} catch (BackingStoreException e) {
-			System.err.println(e);
-		}
-	}
-
-	/**
-	 * set a property which value is a byte array.
-	 *
-	 * @param key the key
-	 * @param value the value
-	 */
-	protected static void set(String key, byte[] value) {
-		IPreferencesService service = Platform.getPreferencesService();
-		service.getRootNode()
-		.node(SCOPE).node(Application.PLUGIN_ID).putByteArray(key, value); //$NON-NLS-1$
-		try {
-			service.getRootNode().flush();
-		} catch (BackingStoreException e) {
-			System.err.println(e);
-		}
-	}
-
-	/**
-	 * get a property as a String.
-	 *
-	 * @param key the key
-	 * @return the string
-	 */
-	protected static String get(String key) {
-		IPreferencesService service = Platform.getPreferencesService();
-		return service.getRootNode()
-				.node(SCOPE).node(Application.PLUGIN_ID).get(key, null); //$NON-NLS-1$
-	}
-
-	/**
-	 * get a property as a String.
-	 *
-	 * @param key the key
-	 * @return the string
-	 */
-	protected static String get(String key, String def) {
-		String rez = get(key);
-		if (rez == null) rez = def;
-		return rez;
-	}
-
-	/**
-	 * get a property as a Boolean.
-	 *
-	 * @param key the key
-	 * @return the boolean
-	 */
-	protected static Boolean getBoolean(String key) {
-		IPreferencesService service = Platform.getPreferencesService();
-		return service.getRootNode()
-				.node(SCOPE).node(Application.PLUGIN_ID).getBoolean(key, false); //$NON-NLS-1$
-	}
-
-	/**
-	 * get a property as a Boolean.
-	 *
-	 * @param key the key
-	 * @param defaultvalue the defaultvalue
-	 * @return the boolean
-	 */
-	protected static Boolean getBoolean(String key, boolean defaultvalue) {
-		IPreferencesService service = Platform.getPreferencesService();
-		return service.getRootNode()
-				.node(SCOPE).node(Application.PLUGIN_ID).getBoolean(key, defaultvalue); //$NON-NLS-1$
-	}
-
-	/**
-	 * get a property as a Double.
-	 *
-	 * @param key the key
-	 * @return the double
-	 */
-	protected static Double getDouble(String key) {
-		IPreferencesService service = Platform.getPreferencesService();
-		return service.getRootNode()
-				.node(SCOPE).node(Application.PLUGIN_ID).getDouble(key, 0.0d); //$NON-NLS-1$
-	}
-
-	/**
-	 * get a property as a Integer.
-	 *
-	 * @param key the key
-	 * @return the int
-	 */
-	protected static Integer getInt(String key) {
-		return getInt(key, 0);
-	}
-
-	/**
-	 * Gets the int.
-	 *
-	 * @param key the key
-	 * @param i the i
-	 * @return the int
-	 */
-	protected static int getInt(String key, int i) {
-		IPreferencesService service = Platform.getPreferencesService();
-		return service.getRootNode()
-				.node(SCOPE).node(Application.PLUGIN_ID).getInt(key, i); //$NON-NLS-1$
-	}
-
-
-	/**
-	 * Gets the float.
-	 *
-	 * @param key the key
-	 * @param def the def
-	 * @return the float
-	 */
-	protected static float getFloat(String key, float def) {
-		IPreferencesService service = Platform.getPreferencesService();
-		return service.getRootNode()
-				.node(SCOPE).node(Application.PLUGIN_ID).getFloat(key, def); //$NON-NLS-1$
-	}
-
-	/**
-	 * remove a property.
-	 *
-	 * @param key the key
-	 */
-	protected static void remove(String key) {
-		IPreferencesService service = Platform.getPreferencesService();
-		service.getRootNode()
-		.node(SCOPE).node(Application.PLUGIN_ID).remove(key); //$NON-NLS-1$
-		try {
-			service.getRootNode().flush();
-		} catch (BackingStoreException e) {
-			System.err.println(e);
-		}
-	}
-
 //	/**
-//	 * return all stored properties.
+//	 * set a property which value is a String.
 //	 *
-//	 * @return the properties
+//	 * @param key the key
+//	 * @param value the value
 //	 */
-//	protected static Properties getProperties() {
-//		return ApplicationWorkbenchAdvisor.getProperties();
+//	protected static void set(String key, String value) {
+//		IPreferencesService service = Platform.getPreferencesService();
+//		service.getRootNode().node(SCOPE).node(Application.PLUGIN_ID).put(key, value); //$NON-NLS-1$
+//		try {
+//			service.getRootNode().flush();
+//		} catch (BackingStoreException e) {
+//			System.err.println(e);
+//		}
 //	}
+//
+//	/**
+//	 * set a property which value is a boolean.
+//	 *
+//	 * @param key the key
+//	 * @param value the value
+//	 */
+//	protected static void set(String key, boolean value) {
+//		IPreferencesService service = Platform.getPreferencesService();
+//		service.getRootNode()
+//		.node(SCOPE).node(Application.PLUGIN_ID).putBoolean(key, value); //$NON-NLS-1$
+//		try {
+//			service.getRootNode().flush();
+//		} catch (BackingStoreException e) {
+//			System.err.println(e);
+//		}
+//	}
+//
+//	/**
+//	 * set a property which value is a double.
+//	 *
+//	 * @param key the key
+//	 * @param value the value
+//	 */
+//	protected static void set(String key, double value) {
+//		IPreferencesService service = Platform.getPreferencesService();
+//		service.getRootNode()
+//		.node(SCOPE).node(Application.PLUGIN_ID).putDouble(key, value); //$NON-NLS-1$
+//		try {
+//			service.getRootNode().flush();
+//		} catch (BackingStoreException e) {
+//			System.err.println(e);
+//		}
+//	}
+//
+//	/**
+//	 * set a property which value is a float.
+//	 *
+//	 * @param key the key
+//	 * @param value the value
+//	 */
+//	protected static void set(String key, float value) {
+//		IPreferencesService service = Platform.getPreferencesService();
+//		service.getRootNode()
+//		.node(SCOPE).node(Application.PLUGIN_ID).putFloat(key, value); //$NON-NLS-1$
+//		try {
+//			service.getRootNode().flush();
+//		} catch (BackingStoreException e) {
+//			System.err.println(e);
+//		}
+//	}
+//
+//	/**
+//	 * set a property which value is a int.
+//	 *
+//	 * @param key the key
+//	 * @param value the value
+//	 */
+//	protected static void set(String key, int value) {
+//		IPreferencesService service = Platform.getPreferencesService();
+//		service.getRootNode()
+//		.node(SCOPE).node(Application.PLUGIN_ID).putInt(key, value); //$NON-NLS-1$
+//		try {
+//			service.getRootNode().flush();
+//		} catch (BackingStoreException e) {
+//			System.err.println(e);
+//		}
+//	}
+//
+//	/**
+//	 * set a property which value is a long.
+//	 *
+//	 * @param key the key
+//	 * @param value the value
+//	 */
+//	protected static void set(String key, long value) {
+//		IPreferencesService service = Platform.getPreferencesService();
+//		service.getRootNode()
+//		.node(SCOPE).node(Application.PLUGIN_ID).putLong(key, value); //$NON-NLS-1$
+//		try {
+//			service.getRootNode().flush();
+//		} catch (BackingStoreException e) {
+//			System.err.println(e);
+//		}
+//	}
+//
+//	/**
+//	 * set a property which value is a byte array.
+//	 *
+//	 * @param key the key
+//	 * @param value the value
+//	 */
+//	protected static void set(String key, byte[] value) {
+//		IPreferencesService service = Platform.getPreferencesService();
+//		service.getRootNode()
+//		.node(SCOPE).node(Application.PLUGIN_ID).putByteArray(key, value); //$NON-NLS-1$
+//		try {
+//			service.getRootNode().flush();
+//		} catch (BackingStoreException e) {
+//			System.err.println(e);
+//		}
+//	}
+//
+//	/**
+//	 * get a property as a String.
+//	 *
+//	 * @param key the key
+//	 * @return the string
+//	 */
+//	protected static String get(String key) {
+//		IPreferencesService service = Platform.getPreferencesService();
+//		return service.getRootNode()
+//				.node(SCOPE).node(Application.PLUGIN_ID).get(key, null); //$NON-NLS-1$
+//	}
+//
+//	/**
+//	 * get a property as a String.
+//	 *
+//	 * @param key the key
+//	 * @return the string
+//	 */
+//	protected static String get(String key, String def) {
+//		String rez = get(key);
+//		if (rez == null) rez = def;
+//		return rez;
+//	}
+//
+//	/**
+//	 * get a property as a Boolean.
+//	 *
+//	 * @param key the key
+//	 * @return the boolean
+//	 */
+//	protected static Boolean getBoolean(String key) {
+//		IPreferencesService service = Platform.getPreferencesService();
+//		return service.getRootNode()
+//				.node(SCOPE).node(Application.PLUGIN_ID).getBoolean(key, false); //$NON-NLS-1$
+//	}
+//
+//	/**
+//	 * get a property as a Boolean.
+//	 *
+//	 * @param key the key
+//	 * @param defaultvalue the defaultvalue
+//	 * @return the boolean
+//	 */
+//	protected static Boolean getBoolean(String key, boolean defaultvalue) {
+//		IPreferencesService service = Platform.getPreferencesService();
+//		return service.getRootNode()
+//				.node(SCOPE).node(Application.PLUGIN_ID).getBoolean(key, defaultvalue); //$NON-NLS-1$
+//	}
+//
+//	/**
+//	 * get a property as a Double.
+//	 *
+//	 * @param key the key
+//	 * @return the double
+//	 */
+//	protected static Double getDouble(String key) {
+//		IPreferencesService service = Platform.getPreferencesService();
+//		return service.getRootNode()
+//				.node(SCOPE).node(Application.PLUGIN_ID).getDouble(key, 0.0d); //$NON-NLS-1$
+//	}
+//
+//	/**
+//	 * get a property as a Integer.
+//	 *
+//	 * @param key the key
+//	 * @return the int
+//	 */
+//	protected static Integer getInt(String key) {
+//		return getInt(key, 0);
+//	}
+//
+//	/**
+//	 * Gets the int.
+//	 *
+//	 * @param key the key
+//	 * @param i the i
+//	 * @return the int
+//	 */
+//	protected static int getInt(String key, int i) {
+//		IPreferencesService service = Platform.getPreferencesService();
+//		return service.getRootNode()
+//				.node(SCOPE).node(Application.PLUGIN_ID).getInt(key, i); //$NON-NLS-1$
+//	}
+//
+//
+//	/**
+//	 * Gets the float.
+//	 *
+//	 * @param key the key
+//	 * @param def the def
+//	 * @return the float
+//	 */
+//	protected static float getFloat(String key, float def) {
+//		IPreferencesService service = Platform.getPreferencesService();
+//		return service.getRootNode()
+//				.node(SCOPE).node(Application.PLUGIN_ID).getFloat(key, def); //$NON-NLS-1$
+//	}
+//
+//	/**
+//	 * remove a property.
+//	 *
+//	 * @param key the key
+//	 */
+//	protected static void remove(String key) {
+//		IPreferencesService service = Platform.getPreferencesService();
+//		service.getRootNode()
+//		.node(SCOPE).node(Application.PLUGIN_ID).remove(key); //$NON-NLS-1$
+//		try {
+//			service.getRootNode().flush();
+//		} catch (BackingStoreException e) {
+//			System.err.println(e);
+//		}
+//	}
+//
+////	/**
+////	 * return all stored properties.
+////	 *
+////	 * @return the properties
+////	 */
+////	protected static Properties getProperties() {
+////		return ApplicationWorkbenchAdvisor.getProperties();
+////	}
+//
+//	/**
+//	 * Gets the string.
+//	 *
+//	 * @param key the key
+//	 * @param defaultvalue the defaultvalue
+//	 * @return the string
+//	 */
+//	protected static String getString(String key, String defaultvalue) {
+//		String ret = get(key);
+//		if (ret == null)
+//			return defaultvalue;
+//		return ret;
+//	}
 
-	/**
-	 * Gets the string.
-	 *
-	 * @param key the key
-	 * @param defaultvalue the defaultvalue
-	 * @return the string
-	 */
-	protected static String getString(String key, String defaultvalue) {
-		String ret = get(key);
-		if (ret == null)
-			return defaultvalue;
-		return ret;
-	}
-
 	protected static String[] getAllKeys() {
 		IPreferencesService service = Platform.getPreferencesService();
 		Preferences prefs = service.getRootNode().node(SCOPE).node(Application.PLUGIN_ID); //$NON-NLS-1$
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/ApplicationWorkbenchAdvisor.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/ApplicationWorkbenchAdvisor.java	(revision 1184)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/ApplicationWorkbenchAdvisor.java	(revision 1185)
@@ -87,6 +87,7 @@
 import org.txm.objects.Project;
 import org.txm.rcp.commands.OpenWelcomePage;
 import org.txm.rcp.commands.RestartTXM;
+import org.txm.rcp.commands.workspace.LoadBinaryCorporaDirectory;
 import org.txm.rcp.commands.workspace.LoadBinaryCorpus;
 import org.txm.rcp.handlers.results.DeleteObject;
 import org.txm.rcp.handlers.scripts.ExecuteGroovyScript;
@@ -177,7 +178,7 @@
 	}
 
 	private void openCGU() {
-		String cgu = TxmPreferences.get("cgu");
+		String cgu = TBXPreferences.getInstance().getString("cgu");
 		if (!"true".equals(cgu)) {
 			//System.out.println("Opening CGU...");
 			//Display.getCurrent() works because this code is run during the splash screen
@@ -192,7 +193,7 @@
 			};
 			boolean ret = (dialog.open() == MessageDialog.OK) && dialog.hasCheckBeenPressed();
 			if (ret) {
-				TxmPreferences.set("cgu", "true");
+				TBXPreferences.getInstance().put("cgu", "true");
 			} else {
 				System.exit(0);
 			}
@@ -256,21 +257,21 @@
 						// restore corpora if TXMHOME has been created
 						if (txmHomeRestored) {
 							//createBackUpDirectory(monitor);
+							System.out.println("Installing sample corpus...");
 							installCorporaFromSamplesDirectory(monitor);
-							this.syncExec(new Runnable() {
-								@Override
-								public void run() {
-									try {
-//										Toolbox.restartWorkspace(monitor);
-										SearchEnginesManager.getCQPSearchEngine().stop();
-										SearchEnginesManager.getCQPSearchEngine().start(monitor);
-										CorporaView.refresh();
-									} catch (Exception e) {
-										// TODO Auto-generated catch block
-										e.printStackTrace();
-									}
-								}
-							});
+//							this.syncExec(new Runnable() {
+//								@Override
+//								public void run() {
+//									try {
+//										SearchEnginesManager.getCQPSearchEngine().stop();
+//										SearchEnginesManager.getCQPSearchEngine().start(monitor);
+//										CorporaView.refresh();
+//									} catch (Exception e) {
+//										// TODO Auto-generated catch block
+//										e.printStackTrace();
+//									}
+//								}
+//							});
 						}
 
 						monitor.done();
@@ -583,6 +584,7 @@
 				}
 
 				TBXPreferences.getInstance().put(TBXPreferences.INSTALL_DIR, installDirectory.getAbsolutePath());
+				TBXPreferences.getInstance().flush();
 				TXMPreferences.saveAll();
 				return true;
 			}
@@ -674,7 +676,7 @@
 
 		// check if TXMHOME of the user is set and exists
 		needToRestoreTXMHOME = testTXMHOMEPreferenceAndDirectory();
-
+		Log.info("needToRestoreTXMHOME="+needToRestoreTXMHOME+" installPreferenceRestored="+installPreferenceRestored);
 		if (needToRestoreTXMHOME || installPreferenceRestored) {
 
 			System.out.println(TXMUIMessages.ApplicationWorkbenchAdvisor_7);
@@ -705,7 +707,8 @@
 
 				// save preference if USER_TXM_HOME has changed
 				TBXPreferences.getInstance().put(TBXPreferences.USER_TXM_HOME, txmhomedir.getAbsolutePath());
-				TXMPreferences.saveAll();
+				TBXPreferences.getInstance().flush();
+				//TXMPreferences.saveAll();
 
 				Log.info("TXM User directory is set to: "+txmhomedir);
 
@@ -811,58 +814,60 @@
 		
 		// load corpora from the install directory
 		if (sampleCorporaDirectory.exists()) { //$NON-NLS-1$
-			Log.info(TXMUIMessages.ApplicationWorkbenchAdvisor_11);
-			monitor.setTaskName(TXMUIMessages.ApplicationWorkbenchAdvisor_11);
-			//File corporaDir = new File(txmhomedir.getAbsolutePath(), "corpora"); //$NON-NLS-1$
 			
-
-			File[] sampleCorpusFiles = sampleCorporaDirectory.listFiles(); //$NON-NLS-1$
-
-			if (sampleCorpusFiles != null) for (File zipFile : sampleCorpusFiles) {
-				try {
-					String filename = zipFile.getName();
-					File basedir;
-					String basedirname;
-					if (filename.endsWith(".txm") || filename.endsWith(".zip")) { //$NON-NLS-1$ //$NON-NLS-2$
-						if (!zipFile.canRead()) {
-							System.out.println(NLS.bind(TXMUIMessages.ApplicationWorkbenchAdvisor_45, zipFile));
-							continue; // go to next binary file
-						}
-
-						//build binary dir path
-						basedirname = Zip.getRoot(zipFile);
-						basedir = new File(corporaDir, basedirname);
-
-						try {
-							Zip.decompress(zipFile.getAbsolutePath(), corporaDir.getAbsolutePath(), false);
-						} catch (IOException e) {
-							System.out.println(NLS.bind(TXMUIMessages.AddBase_31, e));
-						}
-					} else if (zipFile.isDirectory()) {
-						//basedir = zipFile;
-//						basedir = new File(corporaDir, zipFile.getName().toUpperCase());
-//						if (basedir.exists()) {
-//							System.out.println("Updating "+basedir.getName()+" corpus from TXM sample directory corpus.");
-//							DeleteDir.deleteDirectory(basedir);
+			LoadBinaryCorporaDirectory.loadBinaryCorpusFromCorporaDirectory(sampleCorporaDirectory);
+//			Log.info(TXMUIMessages.ApplicationWorkbenchAdvisor_11);
+//			monitor.setTaskName(TXMUIMessages.ApplicationWorkbenchAdvisor_11);
+//			//File corporaDir = new File(txmhomedir.getAbsolutePath(), "corpora"); //$NON-NLS-1$
+//			
+//
+//			File[] sampleCorpusFiles = sampleCorporaDirectory.listFiles(); //$NON-NLS-1$
+//
+//			if (sampleCorpusFiles != null) for (File zipFile : sampleCorpusFiles) {
+//				try {
+//					String filename = zipFile.getName();
+//					File basedir;
+//					String basedirname;
+//					if (filename.endsWith(".txm") || filename.endsWith(".zip")) { //$NON-NLS-1$ //$NON-NLS-2$
+//						if (!zipFile.canRead()) {
+//							System.out.println(NLS.bind(TXMUIMessages.ApplicationWorkbenchAdvisor_45, zipFile));
+//							continue; // go to next binary file
 //						}
-//						FileCopy.copyFiles(zipFile, basedir); // copy the sample corpus to load
-					} else {
-						System.out.println(NLS.bind(TXMUIMessages.AddBase_22, zipFile));
-						System.out.println(TXMUIMessages.AddBase_25);
-						continue;
-					}
-					
-//					Project project = LoadBinaryCorpus.loadBinaryCorpusAsDirectory(basedir, monitor);
-//					if (project != null) {
-//						basenames.add(project.getName());
-//						sampleCorpusLoaded.add(project.getName());
+//
+//						//build binary dir path
+//						basedirname = Zip.getRoot(zipFile);
+//						basedir = new File(corporaDir, basedirname);
+//
+//						try {
+//							Zip.decompress(zipFile.getAbsolutePath(), corporaDir.getAbsolutePath(), false);
+//						} catch (IOException e) {
+//							System.out.println(NLS.bind(TXMUIMessages.AddBase_31, e));
+//						}
+//					} else if (zipFile.isDirectory()) {
+//						//basedir = zipFile;
+////						basedir = new File(corporaDir, zipFile.getName().toUpperCase());
+////						if (basedir.exists()) {
+////							System.out.println("Updating "+basedir.getName()+" corpus from TXM sample directory corpus.");
+////							DeleteDir.deleteDirectory(basedir);
+////						}
+////						FileCopy.copyFiles(zipFile, basedir); // copy the sample corpus to load
+//					} else {
+//						System.out.println(NLS.bind(TXMUIMessages.AddBase_22, zipFile));
+//						System.out.println(TXMUIMessages.AddBase_25);
+//						continue;
 //					}
-					
-				} catch (Exception e) {
-					System.out.println(TXMUIMessages.ApplicationWorkbenchAdvisor_51+zipFile);
-					org.txm.rcp.utils.Logger.printStackTrace(e);
-				}
-			}
+//					
+////					Project project = LoadBinaryCorpus.loadBinaryCorpusAsDirectory(basedir, monitor);
+////					if (project != null) {
+////						basenames.add(project.getName());
+////						sampleCorpusLoaded.add(project.getName());
+////					}
+//					
+//				} catch (Exception e) {
+//					System.out.println(TXMUIMessages.ApplicationWorkbenchAdvisor_51+zipFile);
+//					org.txm.rcp.utils.Logger.printStackTrace(e);
+//				}
+//			}
 		}
 		
 //		for (File projectDir : corporaDir.listFiles()) { // load sample corpus and previous corpus as well
Index: tmp/org.txm.annotation.core/build.properties
===================================================================
--- tmp/org.txm.annotation.core/build.properties	(revision 1184)
+++ tmp/org.txm.annotation.core/build.properties	(revision 1185)
@@ -1,5 +1,9 @@
 #Fri Jul 06 10:25:02 CEST 2018
 output..=bin/
-bin.includes=plugin.xml,META-INF/,.,libs/
+bin.includes = plugin.xml,\
+               META-INF/,\
+               .,\
+               libs/,\
+               OSGI-INF/
 source..=src/
 qualifier=svn
