Index: /trunk/src/org/openstreetmap/josm/data/Preferences.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 872)
+++ /trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 873)
@@ -72,7 +72,18 @@
 	 */
 	public String getPreferencesDir() {
+		final String path = getPreferencesDirFile().getPath();
+		if (path.endsWith(File.separator))
+			return path;
+		return path + File.separator;
+	}
+
+	public File getPreferencesDirFile() {
 		if (System.getenv("APPDATA") != null)
-			return System.getenv("APPDATA")+"/JOSM/";
-		return System.getProperty("user.home")+"/.josm/";
+			return new File(System.getenv("APPDATA"), "JOSM");
+		return new File(System.getProperty("user.home"), ".josm");
+	}
+	
+	public File getPluginsDirFile() {
+		return new File(getPreferencesDirFile(), "plugins");
 	}
 
@@ -85,17 +96,19 @@
 		String s;
 		if ((s = System.getenv("JOSM_RESOURCES")) != null) {
-			if (!s.endsWith("/") && !s.endsWith("\\"))
-				s = s + "/";
+			if (!s.endsWith(File.separator))
+				s = s + File.separator;
 			locations.add(s);
 		}
 		if ((s = System.getProperty("josm.resources")) != null) {
-			if (!s.endsWith("/") && !s.endsWith("\\"))
-				s = s + "/";
+			if (!s.endsWith(File.separator))
+				s = s + File.separator;
 			locations.add(s);
 		}
 		String appdata = System.getenv("APPDATA");
-		if (System.getenv("ALLUSERSPROFILE") != null && appdata != null && appdata.lastIndexOf("\\") != -1) {
-			appdata = appdata.substring(appdata.lastIndexOf("\\"));
-			locations.add(System.getenv("ALLUSERSPROFILE")+appdata+"/JOSM/");
+		if (System.getenv("ALLUSERSPROFILE") != null && appdata != null
+		        && appdata.lastIndexOf(File.separator) != -1) {
+			appdata = appdata.substring(appdata.lastIndexOf(File.separator));
+			locations.add(new File(new File(System.getenv("ALLUSERSPROFILE"),
+			        appdata), "JOSM").getPath());
 		}
 		locations.add("/usr/local/share/josm/");
Index: /trunk/src/org/openstreetmap/josm/gui/MainApplication.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 872)
+++ /trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 873)
@@ -22,4 +22,5 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.plugins.PluginDownloader;
 import org.openstreetmap.josm.tools.BugReportExceptionHandler;
 /**
@@ -84,5 +85,5 @@
 		final File prefDir = new File(Main.pref.getPreferencesDir());
 		// check if preferences directory has moved (TODO: Update code. Remove this after some time)
-		File oldPrefDir = new File(System.getProperty("user.home")+"/.josm");
+		File oldPrefDir = new File(System.getProperty("user.home"), ".josm");
 		if (!prefDir.isDirectory() && oldPrefDir.isDirectory()) {
 			if (oldPrefDir.renameTo(prefDir)) {
@@ -119,4 +120,10 @@
 		}
 
+		if (!PluginDownloader.moveUpdatedPlugins()) {
+			JOptionPane.showMessageDialog(null,
+			        tr("Activating the updated plugins failed."),
+			        tr("Plugins"), JOptionPane.ERROR_MESSAGE);
+		}
+		
 		// load the early plugins
 		Main.loadPlugins(true);
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/PluginPreference.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/PluginPreference.java	(revision 872)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/PluginPreference.java	(revision 873)
@@ -102,4 +102,5 @@
 			public void actionPerformed(ActionEvent e) {
 				update();
+				refreshPluginPanel(gui);
 			}
 
@@ -168,4 +169,7 @@
 
 	private void update() {
+		// refresh description
+		PluginDownloader.downloadDescription();
+
 		Set<PluginDescription> toUpdate = new HashSet<PluginDescription>();
 		StringBuilder toUpdateStr = new StringBuilder();
@@ -212,5 +216,22 @@
 		for (final PluginDescription plugin : availablePlugins) {
 			boolean enabled = enabledPlugins.contains(plugin.name);
-			final JCheckBox pluginCheck = new JCheckBox(plugin.name+(plugin.version != null && !plugin.version.equals("") ? " Version: "+plugin.version : ""), enabled);
+			String remoteversion = plugin.version;
+			if(remoteversion == null || remoteversion.equals(""))
+				remoteversion = tr("unknown");
+
+			String localversion;
+			PluginInformation p = PluginInformation.findPlugin(plugin.name);
+			if(p != null)
+			{
+				if(p.version != null && !p.version.equals(""))
+					localversion = p.version;
+				else
+					localversion = tr("unknown");
+				localversion = " (" + localversion + ")";
+			}
+			else
+				localversion = "";
+
+			final JCheckBox pluginCheck = new JCheckBox(tr("{0}: Version {1}{2}", plugin.name, remoteversion, localversion), enabled);
 			pluginPanel.add(pluginCheck);
 
Index: /trunk/src/org/openstreetmap/josm/plugins/Plugin.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/plugins/Plugin.java	(revision 872)
+++ /trunk/src/org/openstreetmap/josm/plugins/Plugin.java	(revision 873)
@@ -53,5 +53,5 @@
 	 */
 	public final String getPluginDir() {
-		return Main.pref.getPreferencesDir()+"plugins/"+info.name+"/";
+		return new File(Main.pref.getPluginsDirFile(), info.name).getPath();
 	}
 
Index: /trunk/src/org/openstreetmap/josm/plugins/PluginDownloader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/plugins/PluginDownloader.java	(revision 872)
+++ /trunk/src/org/openstreetmap/josm/plugins/PluginDownloader.java	(revision 873)
@@ -13,4 +13,5 @@
 import java.io.FileOutputStream;
 import java.io.FileWriter;
+import java.io.FilenameFilter;
 import java.io.IOException;
 import java.io.InputStream;
@@ -54,12 +55,15 @@
 
 		@Override protected void realRun() throws SAXException, IOException {
+			File pluginDir = Main.pref.getPluginsDirFile();
+			if (!pluginDir.exists())
+				pluginDir.mkdirs();
 			for (PluginDescription d : toUpdate) {
-				File tempFile = new File(Main.pref.getPreferencesDir()+"temp.jar");
-				if (download(d.resource, tempFile)) {
-					tempFile.renameTo(new File(Main.pref.getPreferencesDir()+"plugins/"+d.name+".jar"));
+				File pluginFile = new File(pluginDir, d.name + ".jar.new");
+				if (download(d.resource, pluginFile))
 					count++;
-				} else
+				else
 					errors += d.name + "\n";
 			}
+			PluginDownloader.moveUpdatedPlugins();
 		}
 	}
@@ -79,5 +83,7 @@
 				r.close();
 				new File(Main.pref.getPreferencesDir()+"plugins").mkdir();
-				FileWriter out = new FileWriter(Main.pref.getPreferencesDir()+"plugins/"+count+"-site-"+site.replaceAll("[/:\\\\ <>|]", "_")+".xml");
+				FileWriter out = new FileWriter(new File(Main.pref
+				        .getPluginsDirFile(), count + "-site-"
+				        + site.replaceAll("[/:\\\\ <>|]", "_") + ".xml"));
 				out.append(txt);
 				out.close();
@@ -123,5 +129,5 @@
 
 	public static boolean downloadPlugin(PluginDescription pd) {
-		File file = new File(Main.pref.getPreferencesDir()+"plugins/"+pd.name+".jar");
+		File file = new File(Main.pref.getPluginsDirFile(), pd.name + ".jar");
 		if (!download(pd.resource, file)) {
 			JOptionPane.showMessageDialog(Main.parent, tr("Could not download plugin: {0} from {1}", pd.name, pd.resource));
@@ -163,3 +169,20 @@
 		Main.worker.execute(new UpdateTask(update));
 	}
+	
+	public static boolean moveUpdatedPlugins() {
+		File pluginDir = Main.pref.getPluginsDirFile();
+		boolean ok = true; 		
+		if (pluginDir.exists() && pluginDir.isDirectory()) {
+			final File[] files = pluginDir.listFiles(new FilenameFilter() {
+				public boolean accept(File dir, String name) {
+	                return name.endsWith(".new");
+                }});
+			for (File updatedPlugin : files) {
+				final String filePath = updatedPlugin.getPath();
+				File plugin = new File(filePath.substring(0, filePath.length() - 4));
+				ok = plugin.delete() && updatedPlugin.renameTo(plugin) && ok;
+			}
+		}
+		return ok;
+	}
 }
Index: /trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java	(revision 872)
+++ /trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java	(revision 873)
@@ -196,5 +196,5 @@
 
        	for (String s : locations) {
-       		File pluginFile = new File(s+"/"+pluginName+".jar");
+       		File pluginFile = new File(s, pluginName + ".jar");
        		if (pluginFile.exists()) {
 				PluginInformation info = new PluginInformation(pluginFile);
