private void setupSecurity() {
		if (Modeler.hostIsLocal)
			return;
		if (Modeler.runOnCD)
			return;
		File file = new File(propDirectory, "mw2.policy");
		if (!file.exists()) {
			PrintWriter writer = null;
			try {
				writer = new PrintWriter(file);
			} catch (FileNotFoundException e) {
				e.printStackTrace();
			}
			if (writer != null) {
				writer.println("grant codeBase \"file:mw.jar\" {");
				writer.println("    permission java.security.AllPermission;");
				writer.println("};");
				writer.println("grant codeBase \"file:dist/mw.jar\" {");
				writer.println("    permission java.security.AllPermission;");
				writer.println("};");
				String s = null;
				try {
					s = pluginDirectory.toURI().toURL().toString();
				} catch (MalformedURLException e) {
					e.printStackTrace();
				}
				if (s != null) {
					writer.println("grant codeBase \"" + s + "*\" {");
					writer.println("    permission java.security.AllPermission;");
					writer.println("};");
				}
				writer.close();
			}
		}
		System.setProperty("java.security.policy", file.toString());
		Policy.getPolicy().refresh();
		System.setSecurityManager(new SecurityManager());
	}