w.write( "<?xml version=\"1.0\"?>" + "<AutomatedInstallation langpack=\"en\">" + "    <com.izforge.izpack.panels.HelloPanel/>" + "    <com.izforge.izpack.panels.PacksPanel>" + "        <pack name=\"core\" index=\"0\" selected=\"true\"/>" + "        <pack name=\"sources\" index=\"1\" selected=\"true\"/>" + "        <pack name=\"javadoc\" index=\"2\" selected=\"true\"/>" + "    </com.izforge.izpack.panels.PacksPanel>" + "    <com.izforge.izpack.panels.TargetPanel>" + "        <installpath>" + installPath + "</installpath>" + "    </com.izforge.izpack.panels.TargetPanel>" + "    <com.izforge.izpack.panels.InstallPanel/>" + "    <com.izforge.izpack.panels.ShortcutPanel/>" + "    <com.izforge.izpack.panels.HTMLInfoPanel/>" + "    <com.izforge.izpack.panels.FinishPanel/>" + "</AutomatedInstallation>" );
w.write("<AutomatedInstallation langpack=\"eng\">\n"); w.write("<com.izforge.izpack.panels.HelloPanel/>\n" + "    <com.izforge.izpack.panels.PacksPanel>\n" + "        <selected>\n" + "            <pack index=\"0\"/>\n" + "            <pack index=\"1\"/>\n" + "            <pack index=\"2\"/>\n" + "        </selected>\n" + "    </com.izforge.izpack.panels.PacksPanel>\n"); w.write("<com.izforge.izpack.panels.TargetPanel>\n" + "        <installpath>" + installPath + "</installpath>\n" + "    </com.izforge.izpack.panels.TargetPanel>\n"); w.write("<com.izforge.izpack.panels.InstallPanel/>\n"); w.write("<com.izforge.izpack.panels.FinishPanel/>\n"); w.write("</AutomatedInstallation>");
	protected void execute(String[] args) throws Exception {		if (args.length == 0 && !System.getProperty("os.name").startsWith("OpenServer")) {			System.out.println("\neXist Installation");			System.out.println("------------------------");			System.out.println("Using GUI mode ...");			System.out.println("On a headless system, add parameter -p install-path");			System.out.println("to install without GUI. If you are running JDK 1.4, you may");			System.out.println("also try to pass: -Djava.awt.headless=true -p install-path");			System.out.println("as arguments to the Java executable."); 			 			// can't load the GUIInstaller class on headless machines, 			// so we use Class.forName to force lazy loading. 			Class.forName("com.izforge.izpack.installer.GUIInstaller").newInstance(); 		} else {            String installPath = System.getProperty("user.home") + "/eXist";            for(int i = 0; i < args.length; i++) {                if (args[i].equals("-h")) {                    printHelp();                    return;                } else if (args[i].equals("-p")) {                    if (++i == args.length) {                        System.out.println("Option -p requires an argument: the path to the directory " +                                "where you want to have eXist installed.");                        return;                    }                    installPath = args[i];                }            }			System.out.println("Installing into directory: " + installPath);                        String filename = File.createTempFile("inst", ".xml").getAbsolutePath();            Writer w = new FileWriter(filename);            w.write(                    "<?xml version=\"1.0\"?>" +                    "<AutomatedInstallation langpack=\"en\">" +                    "    <com.izforge.izpack.panels.HelloPanel/>" +                    "    <com.izforge.izpack.panels.PacksPanel>" +                    "        <pack name=\"core\" index=\"0\" selected=\"true\"/>" +                    "        <pack name=\"sources\" index=\"1\" selected=\"true\"/>" +                    "        <pack name=\"javadoc\" index=\"2\" selected=\"true\"/>" +                    "    </com.izforge.izpack.panels.PacksPanel>" +                    "    <com.izforge.izpack.panels.TargetPanel>" +                    "        <installpath>" + installPath + "</installpath>" +                    "    </com.izforge.izpack.panels.TargetPanel>" +                    "    <com.izforge.izpack.panels.InstallPanel/>" +                    "    <com.izforge.izpack.panels.ShortcutPanel/>" +                    "    <com.izforge.izpack.panels.HTMLInfoPanel/>" +                    "    <com.izforge.izpack.panels.FinishPanel/>" +                    "</AutomatedInstallation>"            );			w.close();						new AutomatedInstaller(filename);            new File(filename).delete(); 		}	}