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 739)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/LoadBinaryCorpus.java	(revision 740)
@@ -117,7 +117,7 @@
 				System.out.println(TXMUIMessages.LoadBinaryCorpus_15+backup);
 				return;
 			}
-			org.txm.Toolbox.restartWorkspace();
+			org.txm.Toolbox.restartWorkspace(null);
 			Toolbox.getEngineManager(EngineType.SEARCH).restartEngines();
 		}
 	}
@@ -208,7 +208,7 @@
 
 					this.acquireSemaphore();
 					//Toolbox.updateProperties(ApplicationWorkbenchAdvisor.getProperties());
-					org.txm.Toolbox.restartWorkspace();
+					org.txm.Toolbox.restartWorkspace(monitor);
 					Toolbox.getEngineManager(EngineType.SEARCH).restartEngines();
 					this.releaseSemaphore();
 
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/ConvertCorpus.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/ConvertCorpus.java	(revision 739)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/ConvertCorpus.java	(revision 740)
@@ -58,6 +58,19 @@
 							System.out.println(TXMUIMessages.ConvertCorpus_0);
 							return Status.CANCEL_STATUS;
 						}
+						
+						this.acquireSemaphore();
+						org.txm.Toolbox.restartWorkspace(monitor);
+						Toolbox.getEngineManager(EngineType.SEARCH).restartEngines();
+						this.releaseSemaphore();
+
+						syncExec(new Runnable() {
+							@Override
+							public void run() {
+								RestartTXM.reloadViews();
+							}
+						});
+						
 					} catch (Throwable e) {
 						System.out.println(NLS.bind(TXMUIMessages.RunGroovyScript_8,
 								e));
@@ -66,17 +79,7 @@
 						monitor.done();
 					}
 
-					this.acquireSemaphore();
-					org.txm.Toolbox.restartWorkspace();
-					Toolbox.getEngineManager(EngineType.SEARCH).restartEngines();
-					this.releaseSemaphore();
-
-					syncExec(new Runnable() {
-						@Override
-						public void run() {
-							RestartTXM.reloadViews();
-						}
-					});
+					
 				} catch (ThreadDeath td) {
 					monitor.done();
 					return Status.CANCEL_STATUS;
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 739)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/ApplicationWorkbenchAdvisor.java	(revision 740)
@@ -177,6 +177,29 @@
 
 		engine.setTheme(theme, true);
 	}
+	
+	private void openCGU() {
+		String cgu = TxmPreferences.get("cgu");
+		if (!"true".equals(cgu)) {
+			//System.out.println("Opening CGU...");
+			//Display.getCurrent() works because this code is run during the splash screen
+			String[] dialogButtonLabels = {"OK", "Cancel"};
+			CGUMessageDialog dialog = new CGUMessageDialog(Display.getCurrent().getActiveShell(), 
+					TXMUIMessages.CGU_TITLE, 
+					IImageKeys.getImage(IImageKeys.TXM_ICON), 
+					TXMUIMessages.CGU_MESSAGE, 
+					IImageKeys.getImage(IImageKeys.TXM), 
+					TXMUIMessages.CGU_CHECKMESSAGE, 
+					dialogButtonLabels, 0) {
+			};
+			boolean ret = (dialog.open() == MessageDialog.OK) && dialog.hasCheckBeenPressed();
+			if (ret) {
+				TxmPreferences.set("cgu", "true");
+			} else {
+				System.exit(0);
+			}
+		}
+	}
 
 	/**
 	 * initialization code done after the splash screen call a job which does the
@@ -194,60 +217,27 @@
 				protected IStatus run(IProgressMonitor monitor) {
 					JobsTimer.start();
 					this.runInit(monitor);
-					monitor.worked(1);
 					try {
 						// CGU popup
 						this.syncExec(new Runnable() {
 							@Override
 							public void run() {
-								String cgu = TxmPreferences.get("cgu");
-								if (!"true".equals(cgu)) {
-									//System.out.println("Opening CGU...");
-									//Display.getCurrent() works because this code is run during the splash screen
-									String[] dialogButtonLabels = {"OK", "Cancel"};
-									CGUMessageDialog dialog = new CGUMessageDialog(Display.getCurrent().getActiveShell(), 
-											TXMUIMessages.CGU_TITLE, 
-											IImageKeys.getImage(IImageKeys.TXM_ICON), 
-											TXMUIMessages.CGU_MESSAGE, 
-											IImageKeys.getImage(IImageKeys.TXM), 
-											TXMUIMessages.CGU_CHECKMESSAGE, 
-											dialogButtonLabels, 0) {
-									};
-									boolean ret = (dialog.open() == MessageDialog.OK) && dialog.hasCheckBeenPressed();
-									if (ret) {
-										TxmPreferences.set("cgu", "true");
-									} else {
-										System.exit(0);
-									}
-								}
+								openCGU();
+								printTXMVersion(); // print TXM version in the console
 							}
 						});
 						
 						monitor.beginTask("Starting TXM", 100);
-						monitor.subTask("Initialize");
-						// init with properties
-						Display.getDefault().syncExec(new Runnable() {
-							@Override
-							public void run() {
-								printTXMVersion(); // print TXM version in the console
-							}
-						});
-						Thread.sleep(1000);// let the startup messages be displayed
-						setPreferencesConfiguration(); // remove some preference pages
 
-						//fixUpdateProfile();
-
-						// SET PREFERENCES IF THIS IS THE FIRST RUN
 						monitor.setTaskName(TXMUIMessages.ApplicationWorkbenchAdvisor_2);
 						Log.warning(TXMUIMessages.ApplicationWorkbenchAdvisor_72);
-						if (!loadInstallPreferences(this)) {
+						if (!checkInstallDirectory(this)) {
 							monitor.done();
 							System.err.println(TXMUIMessages.ApplicationWorkbenchAdvisor_init_failed);
 							return Status.CANCEL_STATUS;
 						}
 						monitor.worked(10);
 
-						// CHECK IF THIS IS THE FIRST RUN
 						monitor.setTaskName(TXMUIMessages.ApplicationWorkbenchAdvisor_3);
 						Log.warning(TXMUIMessages.ApplicationWorkbenchAdvisor_73);
 						if (!checkTXMHOME(this, monitor)) {
@@ -263,12 +253,13 @@
 							monitor.done();
 							return Status.CANCEL_STATUS;
 						}
-						monitor.worked(30);
+						
+						// restore corpora if TXMHOME has been created
+						if (txmHomeRestored) {
+							createBackUpDirectory(monitor);
+							reloadCorporaFromBackUpDirectory(monitor);
+						}
 
-						// CLOSE Empty editors
-						closeEmptyEditors();
-
-
 						monitor.done();
 					} catch (Exception e) {
 						System.out.println(TXMUIMessages.ApplicationWorkbenchAdvisor_75+e);
@@ -301,7 +292,7 @@
 		}
 	}
 
-	public static  void closeEmptyEditors() {
+	public static void closeEmptyEditors() {
 		Log.info("Closing empty editors...");
 		String REF = "org.eclipse.ui.internal.emptyEditorTab";
 
@@ -524,7 +515,7 @@
 	 * @param jobHandler : the init job
 	 * @return true, if successful
 	 */
-	private boolean loadInstallPreferences(JobHandler jobHandler) {
+	private boolean checkInstallDirectory(JobHandler jobHandler) {
 		try {
 			installPreferenceRestored = false;
 			boolean needTosetInstallPreference = testTXMINSTALLPreferenceAndDirectory();
@@ -544,8 +535,7 @@
 				String installpath = Platform.getInstallLocation().getURL().getFile(); // the TXM.exe file path
 				File installDirectory = new File(installpath);
 				//installDirectory = installDirectory.getCanonicalFile();
-				TXMPreferences.put(TBXPreferences.PREFERENCES_NODE, TBXPreferences.INSTALL_DIR, installDirectory.getAbsolutePath());
-
+				
 				//TODO: ensure all preferences of install.prefs file are now stored in the default preferences
 //				File preferenceFile = new File(installDirectory, "install.prefs"); //$NON-NLS-1$
 //				if (preferenceFile.exists()) {
@@ -584,6 +574,14 @@
 //				}
 
 				installPreferenceRestored = true;
+				
+				if (installDirectory == null || !installDirectory.exists()) {
+					Log.severe("Error: The provided install directory does not exists. Aborting.");
+					return false;
+				}
+				
+				TXMPreferences.put(TBXPreferences.PREFERENCES_NODE, TBXPreferences.INSTALL_DIR, installDirectory.getAbsolutePath());
+				
 				return true;
 			}
 		} catch (Exception e) {
@@ -658,6 +656,10 @@
 		@Override
 		public void close() throws SecurityException { }
 	};
+	/**
+	 * internal variable to know if the txm home directory has been created
+	 */
+	private boolean txmHomeRestored;
 	{
 		Log.addHandler(severeDialobBoxHandler);
 		severeDialobBoxHandler.setLevel(Level.SEVERE);
@@ -670,44 +672,11 @@
 		// check if TXMHOME of the user is set and exists
 		needToRestoreTXMHOME = testTXMHOMEPreferenceAndDirectory();
 		
-		System.setProperty("org.txm.rcp.wasfirstrun", Boolean.toString(needToRestoreTXMHOME || installPreferenceRestored)); //$NON-NLS-1$
 		if (needToRestoreTXMHOME || installPreferenceRestored) {
 			
 			System.out.println(TXMUIMessages.ApplicationWorkbenchAdvisor_7);
-			try {
-				Log.info(TXMUIMessages.ApplicationWorkbenchAdvisor_68);
-				Display.getDefault().syncExec(new Runnable() {
-					@Override
-					public void run() {
-						setDefaultTheme();
-					}
-				});
-			} catch(Exception e) {
-				Log.warning(TXMUIMessages.ApplicationWorkbenchAdvisor_69+e);
-				Log.printStackTrace(e);
-			}
 
 			try {
-				Log.info("Checking TXM install directory.");
-				installDirectory = new File(TXMPreferences.getString(TBXPreferences.INSTALL_DIR, TBXPreferences.PREFERENCES_NODE));
-				if (!installDirectory.exists()) { // the TXM install directory could not be read !! :o
-					Display.getDefault().syncExec(new Runnable() {
-						@Override
-						public void run() {
-							DirectoryDialog dialog = new DirectoryDialog(Display.getCurrent().getActiveShell(), SWT.OPEN);
-							dialog.setText("TXM install directory is not set, Please select it.");
-							String path = dialog.open();
-							if (path != null) {
-								installDirectory = new File(path);
-								TXMPreferences.put(TBXPreferences.PREFERENCES_NODE, TBXPreferences.INSTALL_DIR, path);
-							}
-						}
-					});
-				}
-				if (installDirectory == null || !installDirectory.exists()) {
-					Log.severe("Error: The provided install directory does not exists. Aborting.");
-					return false;
-				}
 				Log.info(NLS.bind(TXMUIMessages.ApplicationWorkbenchAdvisor_8, TXMPreferences.getString(TBXPreferences.INSTALL_DIR, TBXPreferences.PREFERENCES_NODE)));
 
 				Log.info("Checking TXM user directory.");
@@ -726,90 +695,19 @@
 				
 				txmhomedir.mkdirs(); // creates the directory if needed
 				
-				if (!txmhomedir.exists()) { // the TXM user directory could not be created !! :o
-					Log.warning(NLS.bind(TXMUIMessages.ApplicationWorkbenchAdvisor_12, txmhomedir));
-					Display.getDefault().syncExec(new Runnable() {
-						@Override
-						public void run() {
-							DirectoryDialog dialog = new DirectoryDialog(Display.getCurrent().getActiveShell(), SWT.OPEN);
-							dialog.setText("Please choose the TXM user directory to use.");
-							String path = dialog.open();
-							if (path != null) {
-								txmhomedir = new File(path);
-								txmhomedir.mkdirs();
-							}
-						}
-					});
-				}
-				if (txmhomedir == null || !txmhomedir.exists()) {
+				if (!txmhomedir.exists()) {
 					Log.severe("Error: The provided TXMHOME directory does not exists: "+txmhomedir+". Aborting");
 					return false;
 				}
-				Log.info("TXM User directory is set to: "+txmhomedir);
 				
-				backup = new File(txmhomedir, "corpus-backup"); //$NON-NLS-1$
-				oldbackup = new File(txmhomedir, "corpus-backup-old"); //$NON-NLS-1$
-				errorbackup = new File(txmhomedir, "corpus-backup-error"); //$NON-NLS-1$
+				// save preference if USER_TXM_HOME has changed
+				TXMPreferences.put(TBXPreferences.PREFERENCES_NODE, 
+							TBXPreferences.USER_TXM_HOME, txmhomedir.getAbsolutePath());
 				
-				corporaDir = new File(txmhomedir, "corpora"); //$NON-NLS-1$
-				File[] corporaDirFiles = corporaDir.listFiles();
-				if (corporaDir.exists() && corporaDirFiles != null && corporaDirFiles.length > 0) { // if the txmhomedir is not empty, try to restore its content
-					Display.getDefault().syncExec(new Runnable() {
-						@Override
-						public void run() {
-							Display display = Display.getDefault();
-							Shell shell = display.getActiveShell();
-							go = MessageDialog.openConfirm(shell, TXMUIMessages.ApplicationWorkbenchAdvisor_28, NLS.bind(TXMUIMessages.ApplicationWorkbenchAdvisor_27, txmhomedir));
-						}
-					});
-
-					if (go) {
-						monitor.setTaskName(TXMUIMessages.bind(TXMUIMessages.ApplicationWorkbenchAdvisor_30, backup.getAbsolutePath()));
-						backup.mkdir();
-
-						if (!backup.exists()) {
-							System.out.println(TXMUIMessages.ApplicationWorkbenchAdvisor_34 + backup);
-							return false;
-						}
-
-						//$NON-NLS-1$
-						if (oldbackup.exists()) {
-							Log.info(TXMUIMessages.bind(TXMUIMessages.ApplicationWorkbenchAdvisor_16, oldbackup));
-							DeleteDir.deleteDirectory(oldbackup); // ]8)
-						}
-
-						File[] corpDirs = corporaDir.listFiles();
-						ArrayList<String> moved = new ArrayList<String>();
-						ArrayList<String> failed = new ArrayList<String>();
-
-						if (corpDirs != null) {
-							Arrays.sort(corpDirs);
-							System.out.print(TXMUIMessages.bind(TXMUIMessages.ApplicationWorkbenchAdvisor_30, backup.getAbsolutePath()));
-							for (File corpusdir : corpDirs) {
-								File backCorpus = new File(backup, corpusdir.getName());
-								if (corpusdir.canRead() && corpusdir.isDirectory()) {
-									System.out.print("."); //$NON-NLS-1$
-									if (backCorpus.exists()) {
-										moved.add(corpusdir.getName());
-										oldbackup.mkdir();
-										backCorpus.renameTo(new File(oldbackup, corpusdir.getName()));
-									}
-
-									if (!corpusdir.renameTo(backCorpus)) {
-										failed.add(corpusdir.getName());
-									}
-								}
-							}
-							System.out.println();
-						}
-						if (moved.size() > 0) {
-							Log.info(TXMUIMessages.bind(TXMUIMessages.ApplicationWorkbenchAdvisor_18,oldbackup,StringUtils.join(moved,", "))); //$NON-NLS-1$
-						}
-						if (failed.size() > 0) {
-							System.out.println(TXMUIMessages.ApplicationWorkbenchAdvisor_44+failed+TXMUIMessages.ApplicationWorkbenchAdvisor_37+backup);
-						}
-					}
-				}
+				
+				Log.info("TXM User directory is set to: "+txmhomedir);
+				
+				txmHomeRestored = true;
 			} catch (Exception e) {
 				org.txm.rcp.utils.Logger.printStackTrace(e);
 				System.out.println(TXMUIMessages.ApplicationWorkbenchAdvisor_47+" "+e.getLocalizedMessage()); //$NON-NLS-1$
@@ -818,198 +716,228 @@
 			}
 
 
-			// create or update the workspace & create TXM default.xml workspace file
-			Toolbox.workspace = Workspace.createOrUpdate(txmhomedir); //$NON-NLS-1$
+			
 
-			// test
-			if (Toolbox.workspace == null) {
-				System.out.println(TXMUIMessages.ApplicationWorkbenchAdvisor_31);
-				return false;
-			}
+			
+		} // end if
+		
+		return true;
+	}
 
-			try {
-				TXMPreferences.put(TBXPreferences.PREFERENCES_NODE, 
-						TBXPreferences.USER_TXM_HOME, txmhomedir.getAbsolutePath());
-			} catch (Exception e) {
-				Log.severe(NLS.bind(TXMUIMessages.ApplicationWorkbenchAdvisor_41, e.getLocalizedMessage()));
-				System.out.println(NLS.bind(TXMUIMessages.ApplicationWorkbenchAdvisor_41, e.getLocalizedMessage()));
-				return false;
-			}
+	private void createBackUpDirectory(IProgressMonitor monitor) {
+		
+		backup = new File(txmhomedir, "corpus-backup"); //$NON-NLS-1$
+		oldbackup = new File(txmhomedir, "corpus-backup-old"); //$NON-NLS-1$
+		errorbackup = new File(txmhomedir, "corpus-backup-error"); //$NON-NLS-1$
+		
+		corporaDir = new File(txmhomedir, "corpora"); //$NON-NLS-1$
+		
+		File[] corporaDirFiles = corporaDir.listFiles();
+		if (corporaDir.exists() && corporaDirFiles != null && corporaDirFiles.length > 0) { // if the txmhomedir is not empty, try to restore its content
+			Display.getDefault().syncExec(new Runnable() {
+				@Override
+				public void run() {
+					Display display = Display.getDefault();
+					Shell shell = display.getActiveShell();
+					go = MessageDialog.openConfirm(shell, TXMUIMessages.ApplicationWorkbenchAdvisor_28, NLS.bind(TXMUIMessages.ApplicationWorkbenchAdvisor_27, txmhomedir));
+				}
+			});
 
-			try {
-				ArrayList<String> basenames = new ArrayList<String>();
-				ArrayList<String> sampleCorpusLoaded = new ArrayList<String>();
-				
-				String installdirpath = TXMPreferences.getString(TBXPreferences.PREFERENCES_NODE, TBXPreferences.INSTALL_DIR);
-				File sampleCorporaDirectory = new File(installdirpath, "samples");
-				// 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$
-					corporaDir.mkdir();
+			if (go) {
+				monitor.setTaskName(TXMUIMessages.bind(TXMUIMessages.ApplicationWorkbenchAdvisor_30, backup.getAbsolutePath()));
+				backup.mkdir();
 
-					File[] sampleCorpusFiles = sampleCorporaDirectory.listFiles(); //$NON-NLS-1$
+				if (!backup.exists()) {
+					System.out.println(TXMUIMessages.ApplicationWorkbenchAdvisor_34 + backup);
+					return;
+				}
 
-					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
-								}
+				//$NON-NLS-1$
+				if (oldbackup.exists()) {
+					Log.info(TXMUIMessages.bind(TXMUIMessages.ApplicationWorkbenchAdvisor_16, oldbackup));
+					DeleteDir.deleteDirectory(oldbackup); // ]8)
+				}
 
-								//build binary dir path
-								basedirname = Zip.getRoot(zipFile);
-								basedir = new File(corporaDir, basedirname);
+				File[] corpDirs = corporaDir.listFiles();
+				ArrayList<String> moved = new ArrayList<String>();
+				ArrayList<String> failed = new ArrayList<String>();
 
-								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;
-							} else {
-								System.out.println(NLS.bind(TXMUIMessages.AddBase_22, zipFile));
-								System.out.println(TXMUIMessages.AddBase_25);
-								continue;
+				if (corpDirs != null) {
+					Arrays.sort(corpDirs);
+					System.out.print(TXMUIMessages.bind(TXMUIMessages.ApplicationWorkbenchAdvisor_30, backup.getAbsolutePath()));
+					for (File corpusdir : corpDirs) {
+						File backCorpus = new File(backup, corpusdir.getName());
+						if (corpusdir.canRead() && corpusdir.isDirectory()) {
+							System.out.print("."); //$NON-NLS-1$
+							if (backCorpus.exists()) {
+								moved.add(corpusdir.getName());
+								oldbackup.mkdir();
+								backCorpus.renameTo(new File(oldbackup, corpusdir.getName()));
 							}
 
-							Base base = LoadBinaryCorpus.loadBinaryCorpus(basedir);
-							if (base != null) {
-								basenames.add(base.getName());
-								sampleCorpusLoaded.add(base.getName());
+							if (!corpusdir.renameTo(backCorpus)) {
+								failed.add(corpusdir.getName());
 							}
-						} catch (Exception e) {
-							System.out.println(TXMUIMessages.ApplicationWorkbenchAdvisor_51+zipFile);
-							org.txm.rcp.utils.Logger.printStackTrace(e);
 						}
 					}
+					System.out.println();
 				}
+				if (moved.size() > 0) {
+					Log.info(TXMUIMessages.bind(TXMUIMessages.ApplicationWorkbenchAdvisor_18,oldbackup,StringUtils.join(moved,", "))); //$NON-NLS-1$
+				}
+				if (failed.size() > 0) {
+					System.out.println(TXMUIMessages.ApplicationWorkbenchAdvisor_44+failed+TXMUIMessages.ApplicationWorkbenchAdvisor_37+backup);
+				}
+			}
+		}
+	}
 
-				// after loading sample corpora, restore older corpus
-				if (backup.exists()) {
-					System.out.print(NLS.bind(TXMUIMessages.ApplicationWorkbenchAdvisor_53, backup));
-					monitor.setTaskName(NLS.bind(TXMUIMessages.ApplicationWorkbenchAdvisor_53, backup));
+	private void reloadCorporaFromBackUpDirectory(IProgressMonitor monitor) {
+		ArrayList<String> basenames = new ArrayList<String>();
+		ArrayList<String> sampleCorpusLoaded = new ArrayList<String>();
+		
+		String installdirpath = TXMPreferences.getString(TBXPreferences.PREFERENCES_NODE, TBXPreferences.INSTALL_DIR);
+		File sampleCorporaDirectory = new File(installdirpath, "samples");
+		// 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$
+			corporaDir.mkdir();
 
-					File[] corpusDirs = backup.listFiles();
+			File[] sampleCorpusFiles = sampleCorporaDirectory.listFiles(); //$NON-NLS-1$
 
-					if (corpusDirs != null) {
+			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
+						}
 
-						for (File corpusDir : corpusDirs) { // fix corpus name lowercase letters
-							if (!corpusDir.getName().equals(corpusDir.getName().toUpperCase())) {
-								File upperCasedCorpusDir = new File(corpusDir.getParentFile(), corpusDir.getName().toUpperCase());
-								if (!upperCasedCorpusDir.exists()) {
-									corpusDir.renameTo(upperCasedCorpusDir);
-								}
-							}
+						//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));
 						}
-						corpusDirs = backup.listFiles();
+					} else if (zipFile.isDirectory()) {
+						basedir = zipFile;
+					} else {
+						System.out.println(NLS.bind(TXMUIMessages.AddBase_22, zipFile));
+						System.out.println(TXMUIMessages.AddBase_25);
+						continue;
+					}
 
-						ArrayList<String> notMoved = new ArrayList<String>();
-						ArrayList<File> broken = new ArrayList<File>();
+					Base base = LoadBinaryCorpus.loadBinaryCorpus(basedir);
+					if (base != null) {
+						basenames.add(base.getName());
+						sampleCorpusLoaded.add(base.getName());
+					}
+				} catch (Exception e) {
+					System.out.println(TXMUIMessages.ApplicationWorkbenchAdvisor_51+zipFile);
+					org.txm.rcp.utils.Logger.printStackTrace(e);
+				}
+			}
+		}
 
-						for (File corpusDir : corpusDirs) {
-							if (!corpusDir.isDirectory()) continue; // ignore
-							System.out.print("."); //$NON-NLS-1$
-							File outdir = new File(corporaDir, corpusDir.getName());
-							if (outdir.exists()) {
-								//System.out.println("This setup provides a new version of the "+corpusDir.getName()+" sample corpus. Skipping the backup of "+corpusDir);
-								notMoved.add(corpusDir.getName());
-								continue;
-							}
+		// after loading sample corpora, restore older corpus
+		if (backup.exists()) {
+			System.out.print(NLS.bind(TXMUIMessages.ApplicationWorkbenchAdvisor_53, backup));
+			monitor.setTaskName(NLS.bind(TXMUIMessages.ApplicationWorkbenchAdvisor_53, backup));
 
-							try {
-								Convert5To6 converter = new Convert5To6(corpusDir, outdir);
-								if (converter.is5(true)) {
-									if (!converter.start()) {
-										System.out.println(TXMUIMessages.ApplicationWorkbenchAdvisor_22+corpusDir+TXMUIMessages.ApplicationWorkbenchAdvisor_23);
-										System.out.println(TXMUIMessages.ApplicationWorkbenchAdvisor_54+corpusDir+TXMUIMessages.ApplicationWorkbenchAdvisor_55);
-										System.out.println(TXMUIMessages.ApplicationWorkbenchAdvisor_56);
+			File[] corpusDirs = backup.listFiles();
+
+			if (corpusDirs != null) {
+
+				for (File corpusDir : corpusDirs) { // fix corpus name lowercase letters
+					if (!corpusDir.getName().equals(corpusDir.getName().toUpperCase())) {
+						File upperCasedCorpusDir = new File(corpusDir.getParentFile(), corpusDir.getName().toUpperCase());
+						if (!upperCasedCorpusDir.exists()) {
+							corpusDir.renameTo(upperCasedCorpusDir);
+						}
+					}
+				}
+				corpusDirs = backup.listFiles();
+
+				ArrayList<String> notMoved = new ArrayList<String>();
+				ArrayList<File> broken = new ArrayList<File>();
+
+				for (File corpusDir : corpusDirs) {
+					if (!corpusDir.isDirectory()) continue; // ignore
+					System.out.print("."); //$NON-NLS-1$
+					File outdir = new File(corporaDir, corpusDir.getName());
+					if (outdir.exists()) {
+						//System.out.println("This setup provides a new version of the "+corpusDir.getName()+" sample corpus. Skipping the backup of "+corpusDir);
+						notMoved.add(corpusDir.getName());
+						continue;
+					}
+
+					try {
+						Convert5To6 converter = new Convert5To6(corpusDir, outdir);
+						if (converter.is5(true)) {
+							if (!converter.start()) {
+								System.out.println(TXMUIMessages.ApplicationWorkbenchAdvisor_22+corpusDir+TXMUIMessages.ApplicationWorkbenchAdvisor_23);
+								System.out.println(TXMUIMessages.ApplicationWorkbenchAdvisor_54+corpusDir+TXMUIMessages.ApplicationWorkbenchAdvisor_55);
+								System.out.println(TXMUIMessages.ApplicationWorkbenchAdvisor_56);
+								broken.add(corpusDir);
+							} else {
+								//System.out.println(Messages.ApplicationWorkbenchAdvisor_57+outdir);
+								Base base = LoadBinaryCorpus.loadBinaryCorpus(outdir);
+								basenames.add(base.getName());
+							}
+						} else {
+							if (Convert5To6.is6(corpusDir)) {
+								if (corpusDir.renameTo(outdir)) {
+									Base base = LoadBinaryCorpus.loadBinaryCorpus(outdir);
+									if (base == null) {
+										System.out.println(TXMUIMessages.ApplicationWorkbenchAdvisor_58+outdir);
+										System.out.println(TXMUIMessages.ApplicationWorkbenchAdvisor_59+corpusDir);
+										outdir.renameTo(corpusDir);
 										broken.add(corpusDir);
 									} else {
-										//System.out.println(Messages.ApplicationWorkbenchAdvisor_57+outdir);
-										Base base = LoadBinaryCorpus.loadBinaryCorpus(outdir);
 										basenames.add(base.getName());
 									}
 								} else {
-									if (Convert5To6.is6(corpusDir)) {
-										if (corpusDir.renameTo(outdir)) {
-											Base base = LoadBinaryCorpus.loadBinaryCorpus(outdir);
-											if (base == null) {
-												System.out.println(TXMUIMessages.ApplicationWorkbenchAdvisor_58+outdir);
-												System.out.println(TXMUIMessages.ApplicationWorkbenchAdvisor_59+corpusDir);
-												outdir.renameTo(corpusDir);
-												broken.add(corpusDir);
-											} else {
-												basenames.add(base.getName());
-											}
-										} else {
-											System.out.println(TXMUIMessages.ApplicationWorkbenchAdvisor_24+corpusDir+TXMUIMessages.ApplicationWorkbenchAdvisor_26+outdir);
-											broken.add(corpusDir);
-										}
-									} else {
-										System.out.println(TXMUIMessages.ApplicationWorkbenchAdvisor_60+corpusDir+TXMUIMessages.ApplicationWorkbenchAdvisor_61);
-										broken.add(corpusDir);
-									}
+									System.out.println(TXMUIMessages.ApplicationWorkbenchAdvisor_24+corpusDir+TXMUIMessages.ApplicationWorkbenchAdvisor_26+outdir);
+									broken.add(corpusDir);
 								}
-							} catch (Throwable e) {
-								System.out.println(TXMUIMessages.ApplicationWorkbenchAdvisor_59+corpusDir);
-								System.out.println(TXMUIMessages.ERROR+e);
-								outdir.renameTo(corpusDir);
-							}
-						}
-						System.out.println();
-						if (sampleCorpusLoaded.size() > 0) {
-							if (sampleCorpusLoaded.size() == 1) {
-								System.out.println(TXMUIMessages.bind(TXMUIMessages.ApplicationWorkbenchAdvisor_43_single, StringUtils.join(sampleCorpusLoaded, ", "))); //$NON-NLS-1$
 							} else {
-								System.out.println(TXMUIMessages.bind(TXMUIMessages.ApplicationWorkbenchAdvisor_43, StringUtils.join(sampleCorpusLoaded, ", "))); //$NON-NLS-1$
+								System.out.println(TXMUIMessages.ApplicationWorkbenchAdvisor_60+corpusDir+TXMUIMessages.ApplicationWorkbenchAdvisor_61);
+								broken.add(corpusDir);
 							}
 						}
-
-						if (broken.size() > 0) {
-							errorbackup.mkdir();
-							System.out.println(TXMUIMessages.bind(TXMUIMessages.ApplicationWorkbenchAdvisor_48, StringUtils.join(broken, ", "), errorbackup)); //$NON-NLS-1$
-							for(File corpusDir : broken) {
-								if (corpusDir.exists())
-									corpusDir.renameTo(new File(errorbackup, corpusDir.getName()));
-							}
-						}
+					} catch (Throwable e) {
+						System.out.println(TXMUIMessages.ApplicationWorkbenchAdvisor_59+corpusDir);
+						System.out.println(TXMUIMessages.ERROR+e);
+						outdir.renameTo(corpusDir);
 					}
 				}
-
-				Toolbox.workspace.save();
-
-				// init with properties
-				if (Toolbox.initialize(TBXPreferences.class, monitor)) {
-					System.out.println(TXMUIMessages.ApplicationWorkbenchAdvisor_ready);
-				} else {
-					System.err.println(TXMUIMessages.ApplicationWorkbenchAdvisor_init_failed);
-					return false;
+				System.out.println();
+				if (sampleCorpusLoaded.size() > 0) {
+					if (sampleCorpusLoaded.size() == 1) {
+						System.out.println(TXMUIMessages.bind(TXMUIMessages.ApplicationWorkbenchAdvisor_43_single, StringUtils.join(sampleCorpusLoaded, ", "))); //$NON-NLS-1$
+					} else {
+						System.out.println(TXMUIMessages.bind(TXMUIMessages.ApplicationWorkbenchAdvisor_43, StringUtils.join(sampleCorpusLoaded, ", "))); //$NON-NLS-1$
+					}
 				}
 
-				if (Toolbox.isInitialized()) {
-					monitor.setTaskName("Executing start.groovy script...");
-					callStartScript();
-					monitor.setTaskName("Saving workspace...");
-					Toolbox.workspace.save();
-				} else {
-					return false;
+				if (broken.size() > 0) {
+					errorbackup.mkdir();
+					System.out.println(TXMUIMessages.bind(TXMUIMessages.ApplicationWorkbenchAdvisor_48, StringUtils.join(broken, ", "), errorbackup)); //$NON-NLS-1$
+					for(File corpusDir : broken) {
+						if (corpusDir.exists())
+							corpusDir.renameTo(new File(errorbackup, corpusDir.getName()));
+					}
 				}
-			} catch (Exception e) {
-				Log.severe(NLS.bind(TXMUIMessages.ApplicationWorkbenchAdvisor_52, e.getLocalizedMessage()));
-				System.err.println(NLS.bind(TXMUIMessages.ApplicationWorkbenchAdvisor_52, e.getLocalizedMessage()));
-				org.txm.rcp.utils.Logger.printStackTrace(e);
-				return false;
 			}
-		} // end if
-		
-		return true;
+		}
 	}
 
 	/**
@@ -1098,8 +1026,14 @@
 
 	/**
 	 * after TXMHOME AND INSTALLDIR are ok, we start launch the Toolbox after
-	 * init, we refresh the views (corpora, bases and query).
-	 *
+	 * init, 
+	 * <p>
+	 * we refresh the views (corpora, bases and query).
+	 * <p>
+	 * we close empty editors
+	 * <p>
+	 * we remove some preferences pages not useful
+	 * 
 	 * @param jobHandler the job
 	 * @return true, if successful
 	 * @throws Exception
@@ -1119,7 +1053,13 @@
 								try {
 									monitor.worked(1);
 									monitor.setTaskName("Initializing Toolbox (engines and corpora)...");
-									Toolbox.initialize(TBXPreferences.class, monitor);
+									// init with Eclipse preference stores
+									if (Toolbox.initialize(TBXPreferences.class, monitor)) {
+										System.out.println(TXMUIMessages.ApplicationWorkbenchAdvisor_ready);
+									} else {
+										System.err.println(TXMUIMessages.ApplicationWorkbenchAdvisor_init_failed);
+										return;
+									}
 									monitor.setTaskName("Calling start script...");
 									callStartScript();
 								}
@@ -1132,9 +1072,27 @@
 							monitor.done(); 
 						}
 					});
+					
+					Log.warning(TXMUIMessages.ApplicationWorkbenchAdvisor_88);
+					RestartTXM.reloadViews(); // reload views
+					
+					if (Toolbox.isInitialized()) {
+						StatusLine.setMessage(TXMUIMessages.ApplicationWorkbenchAdvisor_ready);
+					} else {
+						StatusLine.setMessage(TXMUIMessages.ApplicationWorkbenchAdvisor_init_failed);
+					}
+					
+					setDefaultTheme();
+					
+					// CLOSE Empty&Error editors
+					closeEmptyEditors();
+					
+					// remove some preference pages
+					setPreferencesConfiguration(); 
+					
 				}
 				catch(Exception e) {
-					// TODO Auto-generated catch block
+					System.out.println("Error during UI initialization: "+e.getLocalizedMessage());
 					e.printStackTrace();
 				}
 			}
@@ -1172,21 +1130,6 @@
 		//			}
 		//		}
 
-		// reload corpora and bases views
-		Display.getDefault().syncExec(new Runnable() {
-			@Override
-			public void run() {
-				Log.warning(TXMUIMessages.ApplicationWorkbenchAdvisor_88);
-				RestartTXM.reloadViews();
-				
-				if (Toolbox.isInitialized()) {
-					StatusLine.setMessage(TXMUIMessages.ApplicationWorkbenchAdvisor_ready);
-				} else {
-					StatusLine.setMessage(TXMUIMessages.ApplicationWorkbenchAdvisor_init_failed);
-				}
-			}
-		});
-
 		//TxmPreferences.dump();
 		return true;
 	}
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/results/DeleteObject.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/results/DeleteObject.java	(revision 739)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/results/DeleteObject.java	(revision 740)
@@ -172,7 +172,7 @@
 		if (allObjectDeleted.size() > 0) {
 			
 			if (shouldRestartToolbox) {
-				org.txm.Toolbox.restartWorkspace();
+				org.txm.Toolbox.restartWorkspace(null);
 				Toolbox.getEngineManager(EngineType.SEARCH).restartEngines();
 				
 				System.err.println(TXMUIMessages.AddBase_10);
Index: tmp/org.txm.rcp/plugin.xml
===================================================================
--- tmp/org.txm.rcp/plugin.xml	(revision 739)
+++ tmp/org.txm.rcp/plugin.xml	(revision 740)
@@ -2852,13 +2852,6 @@
                </with>
             </definition>
             <definition
-                  id="WasNotFirstTXMRun">
-               <systemTest
-                     property="org.txm.rcp.wasfirstrun"
-                     value="false">
-               </systemTest>
-            </definition>
-            <definition
                   id="OneLexicalTableAbleSelected">
                <with
                      variable="selection">
Index: tmp/trunk/org.txm.setups/BuildLinux64bit.sh
===================================================================
--- tmp/trunk/org.txm.setups/BuildLinux64bit.sh	(revision 739)
+++ tmp/trunk/org.txm.setups/BuildLinux64bit.sh	(revision 740)
@@ -70,8 +70,8 @@
 find "$APP/DEBIAN/preinst" -type f -exec sed -i "s/\/usr\/share\/TXM/\/usr\/share\/TXM_$VERSION/g" {} \;
 find "$APP/DEBIAN/preinst" -type f -exec sed -i "s/\/usr\/share\/applications\/TXM.desktop/\/usr\/share\/applications\/TXM_$VERSION.desktop/g" {} \;
 find "$APP/DEBIAN/preinst" -type f -exec sed -i "s/\/usr\/share\/applications\/TXM debug.desktop/\/usr\/share\/applications\/TXM_$VERSION debug.desktop/g" {} \;
-find "$APP/DEBIAN/preinst" -type f -exec sed -i "s/\/usr\/share\/doc/\txm/\/usr\/share\/doc/\txm-$VERSION/g" {} \;
-find "$APP/DEBIAN/preinst" -type f -exec sed -i "s/\/usr\/share\/lintiant/overrides/\txm/\/usr\/share\/lintiant/overrides/\txm-$VERSION/g" {} \;
+find "$APP/DEBIAN/preinst" -type f -exec sed -i "s/\/usr\/share\/doc\/txm/\/usr\/share\/doc\/txm-$VERSION/g" {} \;
+find "$APP/DEBIAN/preinst" -type f -exec sed -i "s/\/usr\/share\/lintiant\/overrides\/txm/\/usr\/share\/lintiant\/overrides\/txm-$VERSION/g" {} \;
 find "$APP/DEBIAN/postinst" -type f -exec sed -i "s/\/usr\/lib\/TXM/\/usr\/lib\/TXM_$VERSION/g" {} \;
 find "$APP/DEBIAN/postinst" -type f -exec sed -i "s/TXM\&/TXM-{VERSION}\&/g" {} \;
 find "$APP/DEBIAN/control" -type f -exec sed -i "s/Package: txm/Package: txm-${VERSION}/g" {} \;
Index: tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/InstallRUserPart.java
===================================================================
--- tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/InstallRUserPart.java	(revision 739)
+++ tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/InstallRUserPart.java	(revision 740)
@@ -13,12 +13,11 @@
 		File dir = new File(workspace.getLocation(), "R/libraries");
 		dir.mkdirs();
 		
-		File scriptsDirectory = new File(workspace.getLocation(), "scripts");
-		File samplesDirectory = new File(scriptsDirectory, "samples/R");
-		samplesDirectory.mkdirs();
-		BundleUtils.copyFiles("org.txm.statsengine.r.core", "", "", "R", scriptsDirectory);
+		File scriptsDirectory = new File(workspace.getLocation(), "scripts/samples");
+		scriptsDirectory.mkdirs();
+		BundleUtils.copyFiles("org.txm.statsengine.r.core", "", "", "R/", scriptsDirectory);
 		
-		return dir.exists() && samplesDirectory.exists();
+		return dir.exists() && scriptsDirectory.exists();
 	}
 
 	@Override
Index: tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/preferences/RPreferences.java
===================================================================
--- tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/preferences/RPreferences.java	(revision 739)
+++ tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/preferences/RPreferences.java	(revision 740)
@@ -161,8 +161,6 @@
 		Log.info("Updating R preferences for R plugin version="+currentVersion);
 		
 		
-		
-		
 		Log.warning("SearchEngine preferences set with: "+OSDir.getAbsolutePath()+" and "+execFile.getAbsolutePath());
 		TXMPreferences.put(RPreferences.PREFERENCES_NODE, RPreferences.VERSION, currentVersion.toString());
 		
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/groovy/core/InstallGroovyFiles.java
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/groovy/core/InstallGroovyFiles.java	(revision 739)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/groovy/core/InstallGroovyFiles.java	(revision 740)
@@ -1,69 +0,0 @@
-package org.txm.groovy.core;
-
-import java.io.File;
-import java.util.HashMap;
-
-import org.txm.PostTXMHOMEInstallationStep;
-import org.txm.objects.Workspace;
-import org.txm.utils.BundleUtils;
-import org.txm.utils.DeleteDir;
-
-public class InstallGroovyFiles extends PostTXMHOMEInstallationStep {
-
-	@Override
-	public boolean install(Workspace workspace) {
-		File txmhomedir = workspace.getLocation();
-		
-		String createfolders[] = {"scripts", "scripts/lib", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-				"scripts/macro", "scripts/user", "scripts/import"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-		
-		for (String folder : createfolders) {
-			new File(txmhomedir, folder).mkdirs();
-		}
-		File scriptsDirectory = new File(txmhomedir, "scripts");
-		File importDirectory = new File(scriptsDirectory, "import");
-		File macroDirectory = new File(scriptsDirectory, "macro/org/txm");
-		File samplesDirectory = new File(scriptsDirectory, "samples/groovy");
-		
-		HashMap<String, String> publishedImports = new HashMap<String, String>();
-		String IMPORTERPACKAGE="org/txm/importer/";
-		publishedImports.put(IMPORTERPACKAGE+"alceste","alcesteLoader.groovy");
-		publishedImports.put(IMPORTERPACKAGE+"discours","discoursLoader.groovy");
-		publishedImports.put(IMPORTERPACKAGE+"bfm","bfmLoader.groovy");
-		publishedImports.put(IMPORTERPACKAGE+"frantext","frantextLoader.groovy");
-		publishedImports.put(IMPORTERPACKAGE+"hyperbase","hyperbaseLoader.groovy");
-		publishedImports.put(IMPORTERPACKAGE+"txt","txtLoader.groovy");
-		publishedImports.put(IMPORTERPACKAGE+"xml","xmlLoader.groovy");
-		publishedImports.put(IMPORTERPACKAGE+"factiva","factivaLoader.groovy");
-		publishedImports.put(IMPORTERPACKAGE+"factiva","factivamailLoader.groovy");
-		publishedImports.put(IMPORTERPACKAGE+"xmltxm","xmltxmLoader.groovy");
-		publishedImports.put(IMPORTERPACKAGE+"transcriber","transcriberLoader.groovy");
-		publishedImports.put(IMPORTERPACKAGE+"tmx","tmxLoader.groovy");
-		publishedImports.put(IMPORTERPACKAGE+"doc","docLoader.groovy");
-		publishedImports.put(IMPORTERPACKAGE+"wtc","wtcLoader.groovy");
-		
-		String bundle_id = "org.txm.groovy.core";
-		for (String p : publishedImports.keySet()) {
-			BundleUtils.copyFiles(bundle_id, "src/groovy/", p, publishedImports.get(p), importDirectory);
-		}
-		
-		// copy published macros
-		macroDirectory.mkdirs();
-		BundleUtils.copyFiles(bundle_id, "src/groovy/", "org/txm", "macro", macroDirectory);
-		
-		// copy sample Groovy scripts
-		BundleUtils.copyFiles(bundle_id, "src/groovy/", "org/txm", "export", samplesDirectory);
-		BundleUtils.copyFiles(bundle_id, "src/groovy/", "org/txm", "functions", samplesDirectory);
-		BundleUtils.copyFiles(bundle_id, "src/groovy/", "org/txm", "importer", samplesDirectory);
-		BundleUtils.copyFiles(bundle_id, "src/groovy/", "org/txm", "sw", samplesDirectory);
-		BundleUtils.copyFiles(bundle_id, "src/groovy/", "org/txm", "tal", samplesDirectory);
-			
-		return scriptsDirectory.exists();
-	}
-
-	@Override
-	public String getName() {
-		return "Groovy (org.txm.groovy.core)";
-	}
-
-}
Index: tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/InstallGroovyFiles.java
===================================================================
--- tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/InstallGroovyFiles.java	(revision 0)
+++ tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/InstallGroovyFiles.java	(revision 740)
@@ -0,0 +1,69 @@
+package org.txm.groovy.core;
+
+import java.io.File;
+import java.util.HashMap;
+
+import org.txm.PostTXMHOMEInstallationStep;
+import org.txm.objects.Workspace;
+import org.txm.utils.BundleUtils;
+import org.txm.utils.DeleteDir;
+
+public class InstallGroovyFiles extends PostTXMHOMEInstallationStep {
+
+	@Override
+	public boolean install(Workspace workspace) {
+		File txmhomedir = workspace.getLocation();
+		
+		String createfolders[] = {"scripts", "scripts/lib", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+				"scripts/macro", "scripts/user", "scripts/import"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+		
+		for (String folder : createfolders) {
+			new File(txmhomedir, folder).mkdirs();
+		}
+		File scriptsDirectory = new File(txmhomedir, "scripts");
+		File importDirectory = new File(scriptsDirectory, "import");
+		File macroDirectory = new File(scriptsDirectory, "macro/org/txm");
+		File samplesDirectory = new File(scriptsDirectory, "samples/groovy");
+		
+		HashMap<String, String> publishedImports = new HashMap<String, String>();
+		String IMPORTERPACKAGE="org/txm/importer/";
+		publishedImports.put(IMPORTERPACKAGE+"alceste","alcesteLoader.groovy");
+		publishedImports.put(IMPORTERPACKAGE+"discours","discoursLoader.groovy");
+		publishedImports.put(IMPORTERPACKAGE+"bfm","bfmLoader.groovy");
+		publishedImports.put(IMPORTERPACKAGE+"frantext","frantextLoader.groovy");
+		publishedImports.put(IMPORTERPACKAGE+"hyperbase","hyperbaseLoader.groovy");
+		publishedImports.put(IMPORTERPACKAGE+"txt","txtLoader.groovy");
+		publishedImports.put(IMPORTERPACKAGE+"xml","xmlLoader.groovy");
+		publishedImports.put(IMPORTERPACKAGE+"factiva","factivaLoader.groovy");
+		publishedImports.put(IMPORTERPACKAGE+"factiva","factivamailLoader.groovy");
+		publishedImports.put(IMPORTERPACKAGE+"xmltxm","xmltxmLoader.groovy");
+		publishedImports.put(IMPORTERPACKAGE+"transcriber","transcriberLoader.groovy");
+		publishedImports.put(IMPORTERPACKAGE+"tmx","tmxLoader.groovy");
+		publishedImports.put(IMPORTERPACKAGE+"doc","docLoader.groovy");
+		publishedImports.put(IMPORTERPACKAGE+"wtc","wtcLoader.groovy");
+		
+		String bundle_id = "org.txm.groovy.core";
+		for (String p : publishedImports.keySet()) {
+			BundleUtils.copyFiles(bundle_id, "src/", "groovy/"+p, publishedImports.get(p), importDirectory);
+		}
+		
+		// copy published macros
+		macroDirectory.mkdirs();
+		BundleUtils.copyFiles(bundle_id, "src/", "groovy/org/txm", "macro/", macroDirectory);
+		
+		// copy sample Groovy scripts
+		BundleUtils.copyFiles(bundle_id, "src/", "groovy/org/txm", "export/", samplesDirectory);
+		BundleUtils.copyFiles(bundle_id, "src/", "groovy/org/txm", "functions/", samplesDirectory);
+		BundleUtils.copyFiles(bundle_id, "src/", "groovy/org/txm", "importer/", samplesDirectory);
+		BundleUtils.copyFiles(bundle_id, "src/", "groovy/org/txm", "sw/", samplesDirectory);
+		BundleUtils.copyFiles(bundle_id, "src/", "groovy/org/txm", "tal/", samplesDirectory);
+			
+		return scriptsDirectory.exists();
+	}
+
+	@Override
+	public String getName() {
+		return "Groovy (org.txm.groovy.core)";
+	}
+
+}

Property changes on: tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/InstallGroovyFiles.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.groovy.core/build.properties
===================================================================
--- tmp/org.txm.groovy.core/build.properties	(revision 739)
+++ tmp/org.txm.groovy.core/build.properties	(revision 740)
@@ -3,5 +3,6 @@
 bin.includes = META-INF/,\
                .,\
                bin/,\
-               plugin.xml
+               plugin.xml,\
+               src/groovy/
 jars.compile.order = .
Index: tmp/org.txm.utils/src/org/txm/utils/zip/Zip.java
===================================================================
--- tmp/org.txm.utils/src/org/txm/utils/zip/Zip.java	(revision 739)
+++ tmp/org.txm.utils/src/org/txm/utils/zip/Zip.java	(revision 740)
@@ -31,6 +31,7 @@
 import java.io.BufferedOutputStream;
 import java.io.File;
 import java.io.FileInputStream;
+import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
@@ -44,6 +45,7 @@
 import java.util.zip.ZipInputStream;
 import java.util.zip.ZipOutputStream;
 
+import org.apache.commons.lang.StringUtils;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.utils.logger.Log;
 
@@ -425,17 +427,21 @@
 	public static boolean extractOneFile(File zipFile, String path, File outputFile) {
 		return extractOneFile(zipFile, path, outputFile, false);
 	}
-
+	
 	/**
 	 * Extract one file from an archive given a relative path in the archive
 	 * 
 	 * @param zipFile the archive
-	 * @param path the relative path in the archive
+	 * @param path the relative path in the archive of the file to extract (file or directory)
 	 * @param outputFile the output file
 	 * @param replaceOnlyIfNewer if true the file is replaced only if the archive file is more recent
 	 * @return true if success
 	 */
 	public static boolean extractOneFile(File zipFile, String path, File outputFile, boolean replaceOnlyIfNewer) {
+		
+		boolean copySubEntries = false; // internal variable to copy entries of a directory
+		boolean pathFound = false; // internal variable to know if path was found
+		
 		try {
 			long oldFileTime = outputFile.lastModified();			
 
@@ -443,36 +449,39 @@
 					new FileInputStream(zipFile.getCanonicalFile())));
 			ZipEntry ze;
 
+			
 			// Parcourt tous les fichiers
 			while (null != (ze = zis.getNextEntry())) {
 				//System.out.println("P="+ze.getName());
-				if (ze.getName().equals(path)) { // this is the file to extract !
+				String currentpath = ze.getName();
+				if (currentpath.equals(path)) { // this is the file to extract !
 					if (replaceOnlyIfNewer && ze.getTime() < oldFileTime) { // don't replace the file
 						zis.close();
 						return true;
 					}
-
-					OutputStream fos = new BufferedOutputStream(new FileOutputStream(outputFile));
-
-					// Ecriture des fichiers
-					try {
-						try {
-							final byte[] buf = new byte[8192];
-							int bytesRead;
-							while (-1 != (bytesRead = zis.read(buf)))
-								fos.write(buf, 0, bytesRead);
-						} finally {
-							fos.close();
-							zis.close();
-						}
-					} catch (final IOException ioe) {
-						throw ioe;
-					}					
-
-					return true;
+					if (ze.isDirectory()) { // the path point a directory
+						copySubEntries = true;
+						outputFile.mkdirs();
+						pathFound = true;
+					} else { // the path point a file
+						writeFileEntry(zis, outputFile);
+						pathFound = true;
+					}
+				} else if (currentpath.startsWith(path) && copySubEntries) {
+					String subpath = currentpath.substring(path.length());
+					
+					if (ze.isDirectory()) { // a sub directory of the pointed path
+						new File(outputFile, subpath).mkdirs();
+					} else { // a sub file of the pointed path (directory)
+						writeFileEntry(zis, new File(outputFile, subpath));
+					}
+				} else {
+					copySubEntries = false; // stop copying sub entries
 				}
 			}
-			System.out.println("Error: "+path+" not found.");
+			if (!pathFound) {
+				System.out.println("Error: "+path+" not found.");
+			}
 
 			if (zis != null) {
 				try {
@@ -486,10 +495,34 @@
 			Log.printStackTrace(e);
 		} 
 
-		return false; // no suitable entry found
+		return pathFound; // no suitable entry found
 	}
 
 	/**
+	 * Write the current Zis entry to a file
+	 * @param zis
+	 * @param outputFile
+	 * @throws IOException
+	 */
+	private static void writeFileEntry(ZipInputStream zis, File outputFile) throws IOException {
+		OutputStream fos = new BufferedOutputStream(new FileOutputStream(outputFile));
+
+		// Ecriture des fichiers
+		try {
+			try {
+				final byte[] buf = new byte[8192];
+				int bytesRead;
+				while (-1 != (bytesRead = zis.read(buf)))
+					fos.write(buf, 0, bytesRead);
+			} finally {
+				fos.close();
+			}
+		} catch (final IOException ioe) {
+			throw ioe;
+		}
+	}
+
+	/**
 	 * Try to get the root folder of the archive. If there is no root folder, the Zip filename is used
 	 * 
 	 * @param zipFile
@@ -553,11 +586,12 @@
 		//		System.out.println(list);
 		//		System.out.println("outdir: "+list.get(0));
 		//		System.out.println("outdir fixed: "+Zip.getRoot(zipFile));
-		File toolboxJar = new File("/usr/lib/TXM/TXM/plugins/org.txm.toolbox_0.7.0.201509251550.jar");
-		File script = new File("/home/mdecorde/TEMP/xmlLoader.groovy");
-		script.delete();
-		System.out.println("Zip result: "+Zip.extractOneFile(toolboxJar, "org/txm/importer/xml/xmlLoader.groovy", script));
-		System.out.println("Done: exists="+script.exists()+" size="+script.length());
+		File dir = new File("/home/mdecorde/workspace079/org.txm.setups/exportRCP/linux.gtk.x86_64/TXM/plugins");
+		File jarFile = new File(dir, "org.txm.statsengine.r.core_1.0.0.201805091353.jar");
+		File outDir = new File("/home/mdecorde/TEMP");
+		//System.out.println(StringUtils.join(Zip.listFiles(jarFile), "\n"));
+		System.out.println("Zip result: "+Zip.extractOneFile(jarFile, "R/", outDir));
+		
 	}
 }
 
Index: tmp/org.txm.utils/src/org/txm/utils/io/FileCopy.java
===================================================================
--- tmp/org.txm.utils/src/org/txm/utils/io/FileCopy.java	(revision 739)
+++ tmp/org.txm.utils/src/org/txm/utils/io/FileCopy.java	(revision 740)
@@ -147,9 +147,11 @@
 		
 		// is it a directory ?
 		if (src.isDirectory()) {
+			
 			if (!dest.exists()) { // does the destination already exist?
 				// if not create the file hierarchy
-				if (!dest.mkdirs()) {
+				dest.mkdirs();
+				if (!dest.exists()) {
 					throw new IOException(UtilsCoreMessages.FileCopy_4
 							+ dest.getAbsolutePath() + "."); //$NON-NLS-1$ 
 				}
Index: tmp/org.txm.core/src/java/org/txm/core/preferences/TBXPreferences.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/core/preferences/TBXPreferences.java	(revision 739)
+++ tmp/org.txm.core/src/java/org/txm/core/preferences/TBXPreferences.java	(revision 740)
@@ -10,6 +10,8 @@
 	
 	public static String PREFERENCES_NODE = FrameworkUtil.getBundle(TBXPreferences.class).getSymbolicName();
 
+	public static String VERSION = "version";
+
 	public static final String FETCH_UPDATES_AT_STARTUP = "fetch_updates_at_startup";
 	
 	/** The Constants for Toolbox properties. */
Index: tmp/org.txm.core/src/java/org/txm/utils/BundleUtils.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/utils/BundleUtils.java	(revision 739)
+++ tmp/org.txm.core/src/java/org/txm/utils/BundleUtils.java	(revision 740)
@@ -82,14 +82,14 @@
 	 * @param bundle_id
 	 * @param source_relative_directory only used when TXM is run from Eclipse
 	 * @param file_path relative path to the file to copy
-	 * @param file_name if file_name is a directory, the content is copied
+	 * @param file_name the file name to copy <b>if file_name is a directory be sure to add "/" at the end of the file<b/>
 	 * @param outputDirectory
 	 * @return true if success
 	 */
 	public static boolean copyFiles(String bundle_id, String source_relative_directory, String file_path, String file_name, File outputDirectory) {
 		
-		if (!source_relative_directory.endsWith("/")) source_relative_directory += "/";
-		if (!file_path.endsWith("/")) file_path += "/";
+		if (source_relative_directory.length() > 0 && !source_relative_directory.endsWith("/")) source_relative_directory += "/";
+		if (file_path.length() > 0 && !file_path.endsWith("/")) file_path += "/";
 		
 		File bundleDir = getBundleFile(bundle_id);
 		String bundleLocation = getBundleLocation(bundle_id);
Index: tmp/org.txm.core/src/java/org/txm/Toolbox.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/Toolbox.java	(revision 739)
+++ tmp/org.txm.core/src/java/org/txm/Toolbox.java	(revision 740)
@@ -48,12 +48,15 @@
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.SafeRunner;
 import org.osgi.framework.Bundle;
+import org.osgi.framework.Version;
 import org.eclipse.core.runtime.preferences.DefaultScope;
 import org.eclipse.core.runtime.preferences.IPreferencesService;
+import org.eclipse.osgi.util.NLS;
 import org.txm.core.messages.TXMCoreMessages;
 import org.txm.core.preferences.TBXPreferences;
 import org.txm.core.preferences.TXMPreferences;
 import org.txm.objects.Workspace;
+import org.txm.utils.BundleUtils;
 import org.txm.utils.OSDetector;
 import org.txm.utils.logger.Log;
 
@@ -71,7 +74,7 @@
 	private static LinkedHashMap<EngineType, EnginesManager<?>> engines = new LinkedHashMap<EngineType, EnginesManager<?>>();
 
 	private static boolean initializing = false;
-	
+
 	/** The state. */
 	private static boolean state = false;
 
@@ -80,7 +83,7 @@
 	private static void addEngineManager(EnginesManager<?> engine) {
 		engines.put(engine.getEnginesType(), engine);
 	}
-	
+
 	/**
 	 * if searchengine or statengine or workspace is not ready then the toolbox
 	 * is not ready.
@@ -124,9 +127,9 @@
 	public static String getParam(String key) {
 		return TXMPreferences.getString(key, TBXPreferences.PREFERENCES_NODE);
 	}
-	
+
 	public static EnginesManager<?> getEngineManager(EngineType et) {
-		
+
 		if (engines == null) {
 			return null;
 		}
@@ -140,7 +143,7 @@
 	public static String getTXMHOMEPATH() {
 		return TXMPreferences.getString(TBXPreferences.USER_TXM_HOME, TBXPreferences.PREFERENCES_NODE);
 	}
-	
+
 	/**
 	 * Initializes the toolbox with the parameters read in the file
 	 * textometrie.properties found in the user home directory
@@ -171,7 +174,7 @@
 	public static boolean initialize(Class preferencesStore) throws Exception {
 		return initialize(preferencesStore, null);
 	}
-	
+
 	/**
 	 * Initializes the Toolbox using the INSTANCE SCOPE preferences of TXMPreferences
 	 *
@@ -193,13 +196,15 @@
 		} catch(Exception e) {
 			System.out.println("Error while pre-installing plugins: " + e.getLocalizedMessage());
 		}
-	
+
 		try {
 			Log.info(TXMCoreMessages.Toolbox_4 + TBXPreferences.getID()); 
 
 			// initialize workspace : list of corpus loaded in TXM
-			state = startWorkspace();
+			// copy shared files if needed
+			state = startWorkspace(monitor);
 
+
 			Log.warning("Initializing logger");
 			String level = TXMPreferences.getString(TBXPreferences.LOG_LEVEL, TBXPreferences.PREFERENCES_NODE);
 			if (level == "") {
@@ -214,21 +219,21 @@
 			else {
 				Log.setPrintInFile(Boolean.parseBoolean(TXMPreferences.getString(TBXPreferences.LOG_IN_FILE, TBXPreferences.PREFERENCES_NODE)));
 			}
-			
+
 		} catch (Exception e) {
 			initializing = false;
 			throw e;
 		}
-		
+
 		try {
 			startsEngineManagers(monitor);
 		} catch (Exception e) {
 			initializing = false;
 			throw e;
 		}
-			
+
 		Log.info("Toolbox states: "+TXMCoreMessages.Toolbox_22 + state); //$NON-NLS-1$
-		
+
 		try {
 			if (monitor != null) {
 				monitor.subTask("Loading extensions (post-installation)...");
@@ -237,8 +242,8 @@
 		} catch(Exception e) {
 			System.out.println("Error while post-installaing plugins: "+e.getLocalizedMessage());
 		}
-		
-		
+
+
 		// FIXME: persistence tests
 		if (TBXPreferences.getBoolean(TBXPreferences.AUTO_SAVE_RESULTS, TBXPreferences.PREFERENCES_NODE)) {
 			System.out.println("Toolbox.initialize(): reloading persitent results...");
@@ -260,9 +265,9 @@
 				}
 			}
 		}
-		
-		
-		
+
+
+
 		initializing = false;
 		return checkState();
 	}
@@ -336,12 +341,12 @@
 	public static boolean isInitialized() {
 		return checkState();
 	}
-	
+
 	public static boolean isInitializing() {
 		return initializing;
 	}
 
-	
+
 	/**
 	 * Allow to install a TXM extension AFTER the Toolbox is initialized
 	 */
@@ -374,7 +379,7 @@
 			}
 		}
 	}
-	
+
 	/**
 	 * Allow to install a TXM extension BEFORE the Toolbox is initialized
 	 */
@@ -430,10 +435,10 @@
 	 *
 	 * @return true, if successful
 	 */
-	public static boolean restartWorkspace() {
+	public static boolean restartWorkspace(IProgressMonitor monitor) {
 		try {
 			shutdownWorkspace();
-			startWorkspace();
+			startWorkspace(monitor);
 		} catch (Exception e) {
 			Log.severe("Error while restarting workspace: "+e.getLocalizedMessage());
 		}
@@ -444,32 +449,32 @@
 	 * Shut the toolbox down.
 	 */
 	public static void shutdown() {
-		
+
 		stopEngineManagers();
-		
+
 		if(Toolbox.workspace != null)
 			Toolbox.workspace.save();
 		Toolbox.workspace = null;
 		state = false;
-		
+
 		//save preferences
 		IPreferencesService service = Platform.getPreferencesService();
 		try {
-		service.getRootNode().flush();
-//		.childrenNames()) {
-//			System.out.println("********************************************************************************************************"); //$NON-NLS-1$
-//			System.out.println(" scope: " + children); //$NON-NLS-1$
-//			String[] subchildren = service.getRootNode().node(children).childrenNames();
-//			Arrays.sort(subchildren);
-//			for (String children2 : subchildren) {
-//				System.out.println("  node: "+ children2); //$NON-NLS-1$
-//				service.getRootNode().node(children).node(children2).keys();
-//				Arrays.sort(keys);
-//				for (String key2 : keys) {
-//					System.out.println("          " + key2 + " = " + service.getRootNode().node(children).node(children2).get(key2, null)); //$NON-NLS-1$ //$NON-NLS-2$
-//				}
-//			}
-//		}
+			service.getRootNode().flush();
+			//		.childrenNames()) {
+			//			System.out.println("********************************************************************************************************"); //$NON-NLS-1$
+			//			System.out.println(" scope: " + children); //$NON-NLS-1$
+			//			String[] subchildren = service.getRootNode().node(children).childrenNames();
+			//			Arrays.sort(subchildren);
+			//			for (String children2 : subchildren) {
+			//				System.out.println("  node: "+ children2); //$NON-NLS-1$
+			//				service.getRootNode().node(children).node(children2).keys();
+			//				Arrays.sort(keys);
+			//				for (String key2 : keys) {
+			//					System.out.println("          " + key2 + " = " + service.getRootNode().node(children).node(children2).get(key2, null)); //$NON-NLS-1$ //$NON-NLS-2$
+			//				}
+			//			}
+			//		}
 		} catch(Exception e) {
 			System.out.println("Error while saving preferences: "+e.getLocalizedMessage());
 		}
@@ -489,17 +494,17 @@
 	}
 
 	private static boolean startsEngineManagers(IProgressMonitor monitor) {
-		
+
 		fetchEngineManagers();
 
 		Log.info("Starting "+engines.keySet().size()+" engines managers...");
-		
+
 		boolean result = true;
 		for (EngineType et : engines.keySet()) {
 			try {
-			EnginesManager<?> e = engines.get(et);
-			Log.info("Start engine manager: "+e.getClass());
-			result = e.startEngines(monitor) && result; // order is important
+				EnginesManager<?> e = engines.get(et);
+				Log.info("Start engine manager: "+e.getClass());
+				result = e.startEngines(monitor) && result; // order is important
 			} catch(Exception e) {
 				System.out.println("Error while starting engine manager: "+e);
 				e.printStackTrace();
@@ -508,24 +513,62 @@
 		return result;
 	}
 
-	private static boolean startWorkspace() {
-		String txmhome = TXMPreferences.getString(TBXPreferences.USER_TXM_HOME, TBXPreferences.PREFERENCES_NODE);
-		if (txmhome ==null || txmhome.length() == 0) {
+	private static boolean startWorkspace(IProgressMonitor monitor) {
+		String txmhomedir = TXMPreferences.getString(TBXPreferences.USER_TXM_HOME, TBXPreferences.PREFERENCES_NODE);
+		if (txmhomedir ==null || txmhomedir.length() == 0) {
 			state = false;
 			return false;
 		}
-		String location = txmhome+"workspaces/default.xml";
+
+		String location = txmhomedir+"/workspaces/default.xml";
+		
+		Version currentVersion = BundleUtils.getBundleVersion("org.txm.core");
+		Log.info("CURRENT TBX VERSION: "+currentVersion);
+		String installedVersionString = TXMPreferences.getString(TBXPreferences.VERSION, TBXPreferences.PREFERENCES_NODE);
+		if ("".equals(installedVersionString)) {
+			installedVersionString = "0.0.0";
+		}
+		Version installedVersion = new Version(installedVersionString);
+		Log.info("INSTALLED TBX VERSION: "+installedVersion);
 		try {
-			
-			
+
 			//System.out.println("Toolbox.startWorkspace(): workspace location = " + location);
+
+			boolean doUpdateworkspace = currentVersion.compareTo(installedVersion) > 0;
 			
-			if (!new File(location).exists()) {
+			if (!new File(location).exists() // no directory
+				) {
+				
 				Log.info(TXMCoreMessages.Toolbox_10 + location); 
-				workspace = Workspace.createEmptyWorkspaceDefinition(new File(location));
-			} else {
+
+				// create or update the workspace & create TXM default.xml workspace file
+				Toolbox.workspace = Workspace.createOrUpdate(new File(txmhomedir)); //$NON-NLS-1$
+
+				// test
+				if (Toolbox.workspace == null) {
+					System.out.println("Error: workspace not created (null)");
+					return false;
+				}
+				
+				TXMPreferences.put(TBXPreferences.PREFERENCES_NODE, TBXPreferences.VERSION, currentVersion.toString());
+			} else if (doUpdateworkspace // newer install
+					) {
+				System.out.println("Updating Toolbox workspace");
+
+				// create or update the workspace & create TXM default.xml workspace file
+				Toolbox.workspace = Workspace.createOrUpdate(new File(txmhomedir)); //$NON-NLS-1$
+
+				// test
+				if (Toolbox.workspace == null) {
+					System.out.println("Error: workspace not created (null)");
+					return false;
+				}
+				
+				TXMPreferences.put(TBXPreferences.PREFERENCES_NODE, TBXPreferences.VERSION, currentVersion.toString());
+			} else { // already existing workspace
 				workspace = new Workspace(new File(location));
 			}
+			
 			Log.info(TXMCoreMessages.Toolbox_12 + location); 
 			state = true;
 
@@ -547,7 +590,7 @@
 	}
 
 	private static boolean stopEngineManagers() {
-		
+
 		if (engines == null) return true;
 		if (engines.size() == 0) return true;
 
@@ -558,10 +601,10 @@
 			result = result && e.stopEngines();
 			removeEngineManager(e); // remove the engine anyway
 		}
-		
+
 		return true;
 	}
-	
+
 	/* (non-Javadoc)
 	 * @see java.lang.Object#finalize()
 	 */
Index: tmp/org.txm.core/build.properties
===================================================================
--- tmp/org.txm.core/build.properties	(revision 739)
+++ tmp/org.txm.core/build.properties	(revision 740)
@@ -33,7 +33,8 @@
                lib/sqlite-jdbc-3.8.11.2.jar,\
                lib/postgresql-9.4.1207.jre6.jar,\
                lib/jodconverter-core-3.1-beta.jar,\
-               log4j.properties
+               log4j.properties,\
+               res/org/
 output.. = bin/
 source.. = src/java/,\
            res/
Index: tmp/org.txm.core/.classpath
===================================================================
--- tmp/org.txm.core/.classpath	(revision 739)
+++ tmp/org.txm.core/.classpath	(revision 740)
@@ -27,7 +27,7 @@
 	<classpathentry exported="true" kind="lib" path="lib/jtidy-r938.jar"/>
 	<classpathentry exported="true" kind="lib" path="lib/sqlite-jdbc-3.8.11.2.jar"/>
 	<classpathentry exported="true" kind="lib" path="lib/postgresql-9.4.1207.jre6.jar"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
 	<classpathentry exported="true" kind="con" path="org.eclipse.pde.core.requiredPlugins">
 		<attributes>
 			<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="org.txm.toolbox/native"/>
Index: tmp/org.txm.core/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- tmp/org.txm.core/.settings/org.eclipse.jdt.core.prefs	(revision 739)
+++ tmp/org.txm.core/.settings/org.eclipse.jdt.core.prefs	(revision 740)
@@ -1,8 +1,8 @@
 eclipse.preferences.version=1
 org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch,*.groovy
 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.compliance=1.7
 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.source=1.7
