Index: TXM/trunk/bundles/org.txm.groovy.core/src/java/org/txm/groovy/core/InstallGroovyFiles.java
===================================================================
--- TXM/trunk/bundles/org.txm.groovy.core/src/java/org/txm/groovy/core/InstallGroovyFiles.java	(revision 3807)
+++ TXM/trunk/bundles/org.txm.groovy.core/src/java/org/txm/groovy/core/InstallGroovyFiles.java	(revision 3808)
@@ -89,48 +89,58 @@
 		String bundle_id = "org.txm.groovy.core"; //$NON-NLS-1$
 		
 		// copy modified files in the backup directory
-		backupFiles(userDirectory, userDirectory.getParentFile(), bundle_id);
+		backupFiles(userDirectory, systemDirectory , userDirectory.getParentFile());
 		
+		BundleUtils.copyFiles(bundle_id, "", "src/groovy", "", systemDirectory, true); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 		BundleUtils.copyFiles(bundle_id, "", "src/groovy", "", userDirectory, true); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-		BundleUtils.copyFiles(bundle_id, "", "src/groovy", "", systemDirectory, true); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 		
 		bundle_id = "org.txm.core"; //$NON-NLS-1$
 		
+		// copy additional Groovy files from the src/java directory of 
 		File scriptsPackageDirectory = new File(userDirectory, "org/txm/scripts/importer"); //$NON-NLS-1$
 		scriptsPackageDirectory.mkdirs();
 		BundleUtils.copyFiles(bundle_id, "src/java/", "org/txm/scripts/importer", "", scriptsPackageDirectory, true); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 		
+		scriptsPackageDirectory = new File(systemDirectory, "org/txm/scripts/importer"); //$NON-NLS-1$
+		scriptsPackageDirectory.mkdirs();
+		BundleUtils.copyFiles(bundle_id, "src/java/", "org/txm/scripts/importer", "", scriptsPackageDirectory, true); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+		
 		return scriptsDirectory.exists();
 	}
 	
-	public static void backupFiles(File directorytoBackUp, File parentFiletoUse, String bundle_id) {
+	public static void backupFiles(File directorytoBackUp, File referenceDirectory, File parentFiletoUse) {
 		
+		if (Platform.inDevelopmentMode()) return; // don't recopy the groovy files in dev mode
+		
+		Log.fine("Backing up modified Groovy files of "+directorytoBackUp+" VS "+referenceDirectory+" to "+parentFiletoUse);
 		File backUserDirectory = new File(parentFiletoUse, directorytoBackUp.getName()+"-"+Toolbox.dateformat.format(new Date()));
 		int nBackupedFiles = 0;
 		
-		long updateTime = BundleUtils.getDate(bundle_id);
-		if (Platform.inDevelopmentMode()) updateTime = Long.MAX_VALUE; // don't recopy the groovy files in dev mode
-		
 //		System.out.println("update time: "+updateTime+" of "+bundle_id);
 		for (File f : DeleteDir.scanDirectory(directorytoBackUp, true, true)) {
-			long t = f.lastModified();
 			
-			if (f.isFile() && f.getName().endsWith(".groovy") && t > updateTime) { // backup the file if it was modified by the user
+			if (f.isFile() && f.getName().endsWith(".groovy")) { // backup the file if it was modified by the user
 				
 				String path = f.getAbsolutePath();
-				path = path.substring(directorytoBackUp.getAbsolutePath().length());
-				File backGroovy = new File(backUserDirectory, path);
+				String subpath = path.substring(directorytoBackUp.getAbsolutePath().length());
+				File backGroovy = new File(backUserDirectory, subpath);
+				File refGroovy = new File(referenceDirectory, subpath);
 				
-				try {
+				if (!refGroovy.exists() || refGroovy.lastModified() < f.lastModified()) {
 					Log.fine(NLS.bind("Backing {0} -> {1}", f, backGroovy));
-					backGroovy.getParentFile().mkdirs();
-					FileCopy.copy(f, backGroovy);
-					nBackupedFiles++;
+					
+					try {
+						backGroovy.getParentFile().mkdirs();
+						FileCopy.copy(f, backGroovy);
+						nBackupedFiles++;
+					}
+					catch (IOException e) {
+						// TODO Auto-generated catch block
+						e.printStackTrace();
+					}
+					
+					
 				}
-				catch (IOException e) {
-					// TODO Auto-generated catch block
-					e.printStackTrace();
-				}
 			}
 		}
 		if (nBackupedFiles > 0) {
Index: TXM/trunk/bundles/org.txm.core/src/java/org/txm/utils/BundleUtils.java
===================================================================
--- TXM/trunk/bundles/org.txm.core/src/java/org/txm/utils/BundleUtils.java	(revision 3807)
+++ TXM/trunk/bundles/org.txm.core/src/java/org/txm/utils/BundleUtils.java	(revision 3808)
@@ -3,6 +3,9 @@
 import java.io.File;
 import java.io.IOException;
 import java.net.URISyntaxException;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
 
 import org.eclipse.core.runtime.FileLocator;
 import org.eclipse.core.runtime.Platform;
@@ -150,16 +153,30 @@
 		return copyFiles(bundle_id, source_relative_directory, file_path, file_name, outputDirectory, true);
 	}
 	
+	public static final SimpleDateFormat qualifierDateFormatter = new SimpleDateFormat("YYYYMMDDHHmm");
+	
 	public static long getDate(String bundle_id) {
 		
-		File bundleDir = getBundleFile(bundle_id);
-		long l1 = bundleDir.lastModified();
-//		System.out.println("bundle dir "+bundleDir+" date="+l1);
+//		File bundleDir = getBundleFile(bundle_id);
+//		long l1 = bundleDir.lastModified();
+////		System.out.println("bundle dir "+bundleDir+" date="+l1);
+//		
+//		Bundle bundle = Platform.getBundle(bundle_id);
+//		long l2 = bundle.getLastModified();
+////		System.out.println("bundle dir "+bundle+" date="+l2);
+//		return Math.max(l1, l2);
 		
-		Bundle bundle = Platform.getBundle(bundle_id);
-		long l2 = bundle.getLastModified();
-//		System.out.println("bundle dir "+bundle+" date="+l2);
-		return Math.max(l1, l2);
+		Version v = getBundleVersion(bundle_id);
+		String qualifier = v.getQualifier(); // 	Textometrie.org	Macro	1.0.0.202305171515	org.txm.groovy.core 
+		// "(....)(..)(..)(..)(..)", "$1-$2-$3 $4h$5"
+		
+		try {
+			Date d = qualifierDateFormatter.parse(qualifier);
+			return d.getTime();
+		} catch(Exception e) {
+			return 0;
+		}
+		
 	}
 	
 	/**
