Index: tmp/CQP/bin/cwbinstaller/Activator.class
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/CQP/bin/cwbinstaller/Activator.class
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/CQP/bin/cwbinstaller/commands/DoInstallStep.class
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/CQP/bin/cwbinstaller/commands/DoInstallStep.class
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/CQP/bin/cqpserver.init
===================================================================
--- tmp/CQP/bin/cqpserver.init	(revision 0)
+++ tmp/CQP/bin/cqpserver.init	(revision 288)
@@ -0,0 +1,4 @@
+host *;               # allow access from any host (including localhost)
+
+# users must login with name "anonymous" and explicit "" as password!
+user anonymous "";
\ No newline at end of file
Index: tmp/CQP/res/cqpserver.init
===================================================================
--- tmp/CQP/res/cqpserver.init	(revision 0)
+++ tmp/CQP/res/cqpserver.init	(revision 288)
@@ -0,0 +1,4 @@
+host *;               # allow access from any host (including localhost)
+
+# users must login with name "anonymous" and explicit "" as password!
+user anonymous "";
\ No newline at end of file
Index: tmp/CQP/build.properties
===================================================================
--- tmp/CQP/build.properties	(revision 0)
+++ tmp/CQP/build.properties	(revision 288)
@@ -0,0 +1,7 @@
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+               META-INF/,\
+               .,\
+               icons/,\
+               res/

Property changes on: tmp/CQP/build.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/CQP/plugin.xml
===================================================================
--- tmp/CQP/plugin.xml	(revision 0)
+++ tmp/CQP/plugin.xml	(revision 288)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+   <extension
+         point="org.txm.rcp.extentionpoint.command">
+      <installcommand
+            class="cwbinstaller.commands.DoInstallStep">
+      </installcommand>
+   </extension>
+
+
+</plugin>

Property changes on: tmp/CQP/plugin.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/CQP/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- tmp/CQP/.settings/org.eclipse.jdt.core.prefs	(revision 0)
+++ tmp/CQP/.settings/org.eclipse.jdt.core.prefs	(revision 288)
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+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.7

Property changes on: tmp/CQP/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/CQP/.classpath
===================================================================
--- tmp/CQP/.classpath	(revision 0)
+++ tmp/CQP/.classpath	(revision 288)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**"/>
+		</accessrules>
+	</classpathentry>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="src" path="res"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Property changes on: tmp/CQP/.classpath
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/CQP/META-INF/MANIFEST.MF
===================================================================
--- tmp/CQP/META-INF/MANIFEST.MF	(revision 0)
+++ tmp/CQP/META-INF/MANIFEST.MF	(revision 288)
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: CQP
+Bundle-SymbolicName: CQP;singleton:=true
+Bundle-Version: 1.1.0.qualifier
+Bundle-Activator: cwbinstaller.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.txm.rcp;bundle-version="0.7.8",
+ org.txm.core;bundle-version="0.7.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ClassPath: res/,
+ .
+Bundle-Vendor: Textometrie.org
+Export-Package: cwbinstaller,
+ cwbinstaller.commands
+Bundle-ActivationPolicy: lazy

Property changes on: tmp/CQP/META-INF/MANIFEST.MF
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/CQP/.project
===================================================================
--- tmp/CQP/.project	(revision 0)
+++ tmp/CQP/.project	(revision 288)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>CQP</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Property changes on: tmp/CQP/.project
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/CQP/src/cwbinstaller/Activator.java
===================================================================
--- tmp/CQP/src/cwbinstaller/Activator.java	(revision 0)
+++ tmp/CQP/src/cwbinstaller/Activator.java	(revision 288)
@@ -0,0 +1,61 @@
+package cwbinstaller;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+	// The plug-in ID
+	public static final String PLUGIN_ID = "CQP"; //$NON-NLS-1$
+
+	// The shared instance
+	private static Activator plugin;
+	
+	/**
+	 * The constructor
+	 */
+	public Activator() {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+		super.start(context);
+		plugin = this;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+		plugin = null;
+		super.stop(context);
+	}
+
+	/**
+	 * Returns the shared instance
+	 *
+	 * @return the shared instance
+	 */
+	public static Activator getDefault() {
+		return plugin;
+	}
+
+	/**
+	 * Returns an image descriptor for the image file at the given
+	 * plug-in relative path
+	 *
+	 * @param path the path
+	 * @return the image descriptor
+	 */
+	public static ImageDescriptor getImageDescriptor(String path) {
+		return imageDescriptorFromPlugin(PLUGIN_ID, path);
+	}
+}

Property changes on: tmp/CQP/src/cwbinstaller/Activator.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/CQP/src/cwbinstaller/commands/DoInstallStep.java
===================================================================
--- tmp/CQP/src/cwbinstaller/commands/DoInstallStep.java	(revision 0)
+++ tmp/CQP/src/cwbinstaller/commands/DoInstallStep.java	(revision 288)
@@ -0,0 +1,89 @@
+package cwbinstaller.commands;
+
+import java.io.File;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.util.Util;
+import org.osgi.framework.Version;
+import org.txm.rcpapplication.TxmPreferences;
+import org.txm.rcpapplication.preferences.CQPPreferencePage;
+import org.txm.utils.BundleUtils;
+import org.txm.utils.logger.Log;
+
+public class DoInstallStep extends org.txm.rcpapplication.commands.TxmCommand {
+	protected String name = "cwbbinaries.commands.DoInstallStep"; //$NON-NLS-1$
+	public static final String VERSION = "cwbinstaller.commands.version";
+	
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public void install() {	
+		
+	}
+	
+	@Override
+	public void preInstall() {	
+		String CQPFRAGMENT = "CQP."+System.getProperty("osgi.os");
+		
+		Log.info("CQP.DoInstallStep.install()");
+		String saved = TxmPreferences.getString(VERSION, "");
+		Version currentVersion = BundleUtils.getBundleVersion(CQPFRAGMENT); // the CQPFRAGMENT plugin contains the right version
+		
+		if (saved != null && saved.length() > 0) {
+			Version savedVersion = new Version(saved);
+			if (currentVersion.compareTo(savedVersion) <= 0) {
+				Log.info("No post-installation of CQP to do");
+				return; // nothing to do
+			}
+		}
+		System.out.println("Updating CWB preferences for CQP version="+currentVersion);
+		
+		String os = "win";
+		String ext = "";
+		if (Util.isWindows()) { //$NON-NLS-1$
+			if (System.getProperty("os.arch").contains("64")) { os = "win64"; } 
+			else { os = "win32"; }
+			ext = ".exe";
+		} else if (Util.isMac()) { //$NON-NLS-1$
+			os = "macosx";
+		} else {
+			os = "linux32";
+			if (System.getProperty("os.arch").contains("64")) 
+				os = "linux64";
+		}
+
+		File bundleDir = BundleUtils.getBundleFile(CQPFRAGMENT);
+		if (bundleDir == null) {
+			System.out.println("Error while retrieving TreeTaggerInstaller bundle directory.");
+			return;
+		}
+		File cwbDir = new File(bundleDir, "res");
+		File initFile = new File(cwbDir, "cqpserver.init");
+		File OSDir = new File(cwbDir, os);
+		File execFile = new File(OSDir, "cqpserver"+ext);
+
+		TxmPreferences.set(CQPPreferencePage.CQI_SERVER_PATH_TO_CQPLIB, OSDir.getAbsolutePath());
+		TxmPreferences.set(CQPPreferencePage.CQI_SERVER_PATH_TO_INIT_FILE, initFile.getAbsolutePath());
+		TxmPreferences.set(CQPPreferencePage.CQI_SERVER_PATH_TO_EXECUTABLE, execFile.getAbsolutePath());
+		if (!Util.isWindows()) { 
+			try {
+				Log.info("Setting execution file rights to: "+OSDir.getAbsolutePath());
+				Runtime.getRuntime().exec("chmod -R +x "+OSDir.getAbsolutePath()).waitFor();
+			} catch (Exception e) {
+				System.out.println("Error while setting execution file rights to: "+OSDir.getAbsolutePath());
+				e.printStackTrace();
+			}
+		}
+	
+		if (!execFile.canExecute()) {
+			System.out.println("File right setting error, cannot execute: "+execFile);
+		}
+		Log.warning("SearchEngine preferences set with: "+OSDir.getAbsolutePath()+ ", "+initFile.getAbsolutePath()+ " and "+execFile.getAbsolutePath());
+		TxmPreferences.set(VERSION, currentVersion.toString());
+	}
+}

Property changes on: tmp/CQP/src/cwbinstaller/commands/DoInstallStep.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

