Index: java/AEInstaller2-Updater/.classpath
===================================================================
--- java/AEInstaller2-Updater/.classpath	(revision 734)
+++ java/AEInstaller2-Updater/.classpath	(revision 734)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/SVNAccess"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/PlatformTools"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
Index: java/AEInstaller2-Updater/.project
===================================================================
--- java/AEInstaller2-Updater/.project	(revision 734)
+++ java/AEInstaller2-Updater/.project	(revision 734)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>AEInstaller2-Updater</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
Index: java/AEInstaller2-Updater/src/net/oni2/aeinstaller/updater/AEInstaller2Updater.java
===================================================================
--- java/AEInstaller2-Updater/src/net/oni2/aeinstaller/updater/AEInstaller2Updater.java	(revision 734)
+++ java/AEInstaller2-Updater/src/net/oni2/aeinstaller/updater/AEInstaller2Updater.java	(revision 734)
@@ -0,0 +1,61 @@
+package net.oni2.aeinstaller.updater;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.PrintStream;
+
+import javax.swing.JFrame;
+import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
+
+import net.oni2.aeinstaller.updater.backend.Paths;
+import net.oni2.aeinstaller.updater.gui.MainWin;
+
+/**
+ * @author Christian Illy
+ * @version 1
+ */
+public class AEInstaller2Updater {
+
+	/**
+	 * @param args
+	 *            Command line arguments
+	 */
+	public static void main(String[] args) {
+		boolean debug = false;
+		for (String a : args)
+			if (a.equalsIgnoreCase("-debug"))
+				debug = true;
+		if (!debug) {
+			try {
+				PrintStream ps = new PrintStream(new File(Paths.getPrefsPath(),
+						"updater_output.log"));
+				System.setOut(ps);
+				System.setErr(ps);
+			} catch (FileNotFoundException e1) {
+				e1.printStackTrace();
+			}
+		}
+
+		System.setProperty("networkaddress.cache.ttl", "5");
+		System.setProperty("networkaddress.cache.negative.ttl", "1");
+
+		try {
+			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		JFrame.setDefaultLookAndFeelDecorated(true);
+
+		SwingUtilities.invokeLater(new Runnable() {
+
+			public void run() {
+				try {
+					new MainWin().setVisible(true);
+				} catch (Exception e) {
+					e.printStackTrace();
+				}
+			}
+		});
+	}
+}
Index: java/AEInstaller2-Updater/src/net/oni2/aeinstaller/updater/backend/Paths.java
===================================================================
--- java/AEInstaller2-Updater/src/net/oni2/aeinstaller/updater/backend/Paths.java	(revision 734)
+++ java/AEInstaller2-Updater/src/net/oni2/aeinstaller/updater/backend/Paths.java	(revision 734)
@@ -0,0 +1,56 @@
+package net.oni2.aeinstaller.updater.backend;
+
+import java.io.File;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+
+/**
+ * @author Christian Illy
+ */
+public class Paths {
+
+	/**
+	 * Get the Jar path
+	 * 
+	 * @return Path
+	 */
+	public static File getInstallerPath() {
+		String jarPath = Paths.class.getProtectionDomain().getCodeSource()
+				.getLocation().getPath();
+		String decodedPath = null;
+		try {
+			decodedPath = URLDecoder.decode(jarPath, "UTF-8");
+		} catch (UnsupportedEncodingException e) {
+			e.printStackTrace();
+		}
+		return new File(decodedPath).getParentFile();
+	}
+
+	/**
+	 * Get the preferences path
+	 * 
+	 * @return Path
+	 */
+	public static File getPrefsPath() {
+		return getInstallerPath();
+	}
+
+	/**
+	 * Get the path to store downloaded files
+	 * 
+	 * @return Download path
+	 */
+	public static File getDownloadPath() {
+		return new File(getTempPath(), "downloads");
+	}
+
+	/**
+	 * Get the systems temp-path
+	 * 
+	 * @return Path
+	 */
+	public static File getTempPath() {
+		return new File(System.getProperty("java.io.tmpdir"), "oni_aei");
+	}
+
+}
Index: java/AEInstaller2-Updater/src/net/oni2/aeinstaller/updater/gui/MainWin.java
===================================================================
--- java/AEInstaller2-Updater/src/net/oni2/aeinstaller/updater/gui/MainWin.java	(revision 734)
+++ java/AEInstaller2-Updater/src/net/oni2/aeinstaller/updater/gui/MainWin.java	(revision 734)
@@ -0,0 +1,156 @@
+package net.oni2.aeinstaller.updater.gui;
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.util.List;
+
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JProgressBar;
+import javax.swing.SwingWorker;
+
+import net.oni2.aeinstaller.updater.backend.Paths;
+import net.oni2.platformtools.applicationinvoker.ApplicationInvoker;
+import net.oni2.platformtools.applicationinvoker.EExeType;
+import net.oni2.platformtools.applicationinvoker.ERuntimeNotInstalledException;
+import net.oni2.svnaccess.SVN;
+import net.oni2.svnaccess.SVNUpdateListener;
+
+/**
+ * @author Christian Illy
+ */
+public class MainWin extends JFrame {
+	private static final long serialVersionUID = -3653187495409881426L;
+
+	JLabel step = new JLabel("Preparing");
+	JProgressBar bar = new JProgressBar(0, 1);
+	JButton closeBtn = new JButton("Close and launch AEI");
+
+	/**
+	 * Constructor of main window.
+	 */
+	public MainWin() {
+		super("AEInstaller2 self updater");
+		setLayout(new BorderLayout(2, 4));
+
+		bar.setPreferredSize(new Dimension(250, 16));
+		closeBtn.setEnabled(false);
+
+		add(bar, BorderLayout.CENTER);
+		add(step, BorderLayout.NORTH);
+		add(closeBtn, BorderLayout.SOUTH);
+
+		setResizable(false);
+		setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
+		pack();
+		setLocationRelativeTo(null);
+
+		closeBtn.addActionListener(new ActionListener() {
+			@Override
+			public void actionPerformed(ActionEvent e) {
+				exit();
+			}
+		});
+
+		addWindowListener(new WindowAdapter() {
+			@Override
+			public void windowClosing(WindowEvent e) {
+				super.windowClosing(e);
+				if (closeBtn.isEnabled()) {
+					exit();
+				}
+			}
+		});
+
+		Updater upd = new Updater();
+		upd.execute();
+	}
+
+	private void exit() {
+		File aei = new File(new File(Paths.getInstallerPath(), "bin"),
+				"AEInstaller2.jar");
+		if (aei.exists()) {
+			try {
+				ApplicationInvoker.execute(EExeType.JAR, null, aei, null);
+			} catch (FileNotFoundException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			} catch (ERuntimeNotInstalledException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+		}
+		dispose();
+	}
+
+	class Status {
+		public Status(int done, int total) {
+			this.done = done;
+			this.total = total;
+		}
+
+		/**
+		 * Steps done
+		 */
+		public int done;
+		/**
+		 * Steps in total to do
+		 */
+		public int total;
+	}
+
+	class Updater extends SwingWorker<Status, Status> {
+
+		@Override
+		protected Status doInBackground() throws Exception {
+			Thread.sleep(2000);
+			step.setText("Updating");
+			
+			SVN svn = new SVN();
+			try {
+				int x = svn.checkSVN("http://svn.aei.oni2.net",
+						new File(Paths.getPrefsPath(), "bin"));
+				if (x != 0) {
+					// Update available or no WC yet
+					svn.updateWC("http://svn.aei.oni2.net",
+							new File(Paths.getPrefsPath(), "bin"),
+							new SVNUpdateListener() {
+								public void statusUpdate(int done, int total) {
+									publish(new Status(done, total));
+								}
+							});
+				}
+			} catch (Exception e) {
+				e.printStackTrace();
+			}
+			return null;
+		}
+
+		@Override
+		protected void process(List<Status> chunks) {
+			super.process(chunks);
+			if (chunks.size() > 0) {
+				Status s = chunks.get(chunks.size() - 1);
+				bar.setValue(s.done);
+				bar.setMaximum(s.total);
+			}
+		}
+
+		@Override
+		protected void done() {
+			super.done();
+			step.setText("AEI is up to date");
+			bar.setValue(1);
+			bar.setMaximum(1);
+			closeBtn.setEnabled(true);
+		}
+	}
+
+}
