changeset 2059:81dc4ec05f62 8.0-b69

branch merge
author David Grieve<david.grieve@oracle.com>
date Wed, 19 Dec 2012 17:04:18 -0500
parents 2da959decb7d 469a4e88a807
children d146d333b063 3d6efc68bef3 1889ef1d7c4d
files
diffstat 127 files changed, 24308 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore	Wed Dec 19 09:50:21 2012 -0500
+++ b/.hgignore	Wed Dec 19 17:04:18 2012 -0500
@@ -9,8 +9,14 @@
 build/
 bin/
 dist/
+test.keystore
 ^webrev/
 ^webrev\.zip$
 nbproject/private/
 target/
 ^.*~$
+syntax: glob
+*.vcxproj.user
+*/Release/*
+*/Debug/*
+*~
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/.classpath	Wed Dec 19 17:04:18 2012 -0500
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="lib"/>
+	<classpathentry kind="src" path="javafx-deploy/src"/>
+	<classpathentry kind="src" path="javafx-launcher/src"/>
+	<classpathentry kind="src" path="packager/src"/>
+	<!--
+	<classpathentry kind="src" path="packager/test"/>
+	-->
+	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/rt"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/rt-closed"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/media"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/webnode"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/.project	Wed Dec 19 17:04:18 2012 -0500
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>deploy</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>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/build.xml	Wed Dec 19 17:04:18 2012 -0500
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="JavaFX Deployment" default="default" basedir=".">
+<!--
+ /* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+-->
+    <!-- Import common properties and definitions -->
+    <import file="../../build-defs.xml"/>
+
+    <property name="ws.deploy.cache.dir"
+              location="${jfx.root.dir}/rt/deploy/cache"/>
+
+    <target name="default" depends="jfx-sdk"/>
+
+    <target name="-init">
+        <mkdir dir="${jfx.deployed.dir}"/>
+        <property name="fx.dt.dir" location="${jfx.deployed.dir}/public-dt-files"/>
+    </target>
+
+    <!-- Prepare a set of files to be embedded into the ant task.
+         We expect them to be shipped with every sample in the "web-files" subdir -->
+    <target name="deployfx-resources" depends="launcher">
+        <property name="build.anttask.web.dir" value="build/deployfx/resources/web-files"/>
+        <mkdir dir="${build.anttask.web.dir}"/>
+        <ant target="js" inheritAll="false">
+           <property name="fx.dt.dir" value="${build.anttask.web.dir}"/>
+        </ant>
+        <!-- Launcher classes -->
+        <property name="build.anttask.class.dir"
+                  value="build/deployfx/resources/classes"/>
+        <mkdir dir="${build.anttask.class.dir}"/>
+        <copy todir="${build.anttask.class.dir}">
+           <fileset dir="javafx-launcher/build/classes">
+              <include name="**/*.class"/>
+           </fileset>
+        </copy>
+    </target>
+
+    <!-- This step creates a local copy of DeployToolkit so you can test and try out your -->
+    <!-- deployment locally. For production use, use the public DeployToolkit support. -->
+    <target name="js" depends="-init"
+           description="Copy deploy toolkit to output">
+       <mkdir dir="${fx.dt.dir}"/>
+       <copy file="javafx-deploy/src/js/dtjava.js" todir="${fx.dt.dir}"/>
+       <copy file="lib/javafx-loading-100x100.gif" todir="${fx.dt.dir}" overwrite="true"/>
+       <copy file="lib/javafx-loading-25x25.gif" todir="${fx.dt.dir}" overwrite="true"/>
+       <copy file="lib/get_javafx.png" todir="${fx.dt.dir}" overwrite="true"/>
+       <copy file="lib/javafx-chrome.png" todir="${fx.dt.dir}" overwrite="true"/>
+       <copy file="lib/upgrade_javafx.png" todir="${fx.dt.dir}" overwrite="true"/>
+       <copy file="lib/get_java.png" todir="${fx.dt.dir}" overwrite="true"/>
+       <copy file="lib/upgrade_java.png" todir="${fx.dt.dir}" overwrite="true"/>
+       <copy file="lib/error.png" todir="${fx.dt.dir}" overwrite="true"/>
+    </target>
+
+    <target name="launcher">
+        <ant dir="javafx-launcher" target="jar"/>
+    </target>
+
+    <target name="anttasks" depends="packager"
+            description="Prepare ant tasks used to deploy FX apps" />
+
+    <target name="packager" depends="deployfx-resources">
+        <ant dir="packager" antfile="build.xml"/>
+    </target>
+
+    <target name="man">
+        <ant dir="man" antfile="build.xml"/>
+    </target>
+
+    <target name="clean">
+        <ant dir="javafx-launcher" target="clean"/>
+        <ant dir="packager" antfile="build.xml" target="clean"/>
+        <ant dir="man" antfile="build.xml" target="clean"/>
+        <delete dir="build" />
+    </target>
+
+    <!-- Targets required by and used by the top repository build. -->
+    <target name="jfx-clean" depends="clean" />
+
+    <target name="jfx-sdk"
+            depends="launcher,js,anttasks,packager,man"/>
+
+    <target name="jfx-deploy"/>
+    <target name="jfx-clean-deploy" depends="clean"/>
+    <target name="jfx-clean-sdk" />
+    <target name="jfx-test"/>
+    <target name="jfx-full-test"/>
+    <target name="jfx-perf"/>
+    <target name="jfx-sdk-docs"/>
+
+</project>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/javafx-deploy/src/js/dtjava.js	Wed Dec 19 17:04:18 2012 -0500
@@ -0,0 +1,3253 @@
+/*
+ * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
+ * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+/**
+  The Java Deployment Toolkit is utility to deploy Java content in
+  the browser as applets or applications using right version of Java.
+  If needed it can initiate upgrade of user's system to install required
+  components of Java platform.
+  <p>
+  Note that some of Deployment Toolkit methods may not be fully operational if
+  used before web page body is loaded (because DT native plugins could not be instantiated).
+  If you intend to use it before web page DOM tree is ready then dtjava.js
+  need to be loaded inside the body element of the page and before use of other DT APIs.
+
+  @module java/deployment_toolkit
+*/
+var dtjava = function() {
+    function notNull(o) {
+        return (o != undefined && o != null);
+    }
+
+    function isDef(fn) {
+        return (fn != null && typeof fn != "undefined");
+    }
+
+    //return true if any of patterns from query list is found in the given string
+    function containsAny(lst, str) {
+        for (var q = 0; q < lst.length; q++) {
+            if (str.indexOf(lst[q]) != -1) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /* Location of static web content - images, javascript files. */
+    var jscodebase =  (function () {
+        // <script> elements are added to the DOM and run synchronously,
+        // the currently running script will also be the last element in the array
+        var scripts = document.getElementsByTagName("script");
+        var src = scripts[scripts.length - 1].getAttribute("src");
+        return src.substring(0, src.lastIndexOf('/') + 1);
+    })();
+
+    //set to true to disable FX auto install (before release)
+    var noFXAutoInstall = false;
+    
+    // JRE version we start to have JRE and FX true co-bundle
+    var minJRECobundleVersion = "1.7.0_06";
+
+    //aliases
+    var d = document;
+    var w = window;
+
+    var cbDone = false;  //done with onload callbacks
+    var domCb = [];      //list of callbacks
+    var ua = null;
+
+    //add function to be called on DOM ready event
+    function addOnDomReady(fn) {
+        if (cbDone) {
+            fn();
+        } else {
+            domCb[domCb.length] = fn;
+        }
+    }
+
+    //invoke pending onload callbacks
+    function invokeCallbacks() {
+        if (!cbDone) {
+            //swfoject.js tests whether DOM is actually ready first
+            //  in order to not fire too early. Use same heuristic
+            try {
+                var t = d.getElementsByTagName("body")[0].appendChild(
+                    d.createElement("div"));
+                t.parentNode.removeChild(t);
+            } catch (e) {
+                return;
+            }
+            cbDone = true;
+            for (var i = 0; i < domCb.length; i++) {
+                domCb[i]();
+            }
+        }
+    }
+
+    //cross browser onload support.
+    //Derived from swfobject.js
+    function addOnload(fn) {
+        if (isDef(w.addEventListener)) {
+            w.addEventListener("load", fn, false);
+        } else if (isDef(d.addEventListener)) {
+            d.addEventListener("load", fn, false);
+        } else if (isDef(w.attachEvent)) {
+            w.attachEvent("onload", fn);
+            //TODO: swfobject also keeps references to the listeners to detach them on onload
+            // to avoid memory leaks ...
+        } else if (typeof w.onload == "function") {
+            var fnOld = w.onload;
+            w.onload = function() {
+                fnOld();
+                fn();
+            };
+        } else {
+            w.onload = fn;
+        }
+    }
+
+    function detectEnv() {
+        var dom = isDef(d.getElementById) && isDef(d.getElementsByTagName) && isDef(d.createElement);
+        var u = navigator.userAgent.toLowerCase(),
+            p = navigator.platform.toLowerCase();
+
+        //NB: may need to be refined as some user agent may contain strings related to other browsers
+        //   (e.g. Chrome has both Safari and mozilla, Safari also has mozilla
+        var windows = p ? /win/.test(p) : /win/.test(u),
+            mac = p ? /mac/.test(p) : /mac/.test(u),
+            linux = p ? /linux/.test(p) : /linux/.test(u),
+            chrome = /chrome/.test(u),
+            // get webkit version or false if not webkit
+            webkit = !chrome && /webkit/.test(u) ?
+                parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false,
+            opera = /opera/.test(u),
+            cputype = null,
+            osVersion = null;
+
+        var ie = false;
+        try {
+            //Used to be using trick from
+            //  http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
+            //ie = !+"\v1",
+            //but it does not work with IE9 in standards mode
+            //Reverting to alternative - use execScript
+            ie = isDef(window.execScript);
+        } catch (ee) {
+            //if javafx app is in the iframe and content of main window is coming from other domain
+            //  then some browsers may restrict access to outer window properties,
+            //  e.g. FF can throw exception for top.execScript (see RT-17885)
+            //We could revert to more naive test, e.g. test user agent for "MSIE " string
+            // but so far IE does not seem to throw exception => if we get here it is not IE anyways
+            ie = false;
+        }
+
+        //we are not required to detect everything and can leave values null as
+        // long as we later treat them accordingly.
+        //We use "cputype" to detect if given hardware is supported,
+        // e.g. we do not support PPC or iPhone/iPad despite they are running Mac OS
+        //We use "osVersion" to detect if Java/JavaFX can be installed on this OS
+        // e.g. Oracle Java for Mac requires 10.7.3
+        if (mac) {
+            if ((p && /intel/.test(p)) || /intel/.test(u)) {
+                cputype = "intel";
+            }
+            //looking for things like 10_7, 10_6_8, 10.4, 11_2_2 in the user agent
+            var t = u.match(/(1[0-9_\.]+)[^0-9_\.]/);
+            //normalize to "." separators
+            osVersion = notNull(t) ? t[0].replace(/_/g, ".") : null;
+        }
+
+        // Check mime types. Works with netscape family browsers and checks latest installed plugin only
+        var mm = navigator.mimeTypes;
+        var jre = null;
+        var deploy = null;
+        var fx = null;
+
+        //Cache configuration from plugin mimetypes
+        //It is only available for NPAPI browsers
+        for (var t = 0; t < mm.length; t++) {
+            // The jpi-version is the JRE version.
+            var m = navigator.mimeTypes[t].type;
+            if (m.indexOf("application/x-java-applet;jpi-version") != -1 && m.indexOf('=') != -1) {
+                jre = m.substring(m.indexOf('=') + 1);
+            }
+            //Supported for 7u6 or later
+            if (m.indexOf("application/x-java-applet;deploy") != -1 && m.indexOf('=') != -1) {
+                deploy = m.substring(m.indexOf('=') + 1);
+            }
+            //javafx version for cobundled javafx (7u6+)
+            if (m.indexOf("application/x-java-applet;javafx") != -1 && m.indexOf('=') != -1) {
+                fx = m.substring(m.indexOf('=') + 1);
+            }
+        }
+        return {haveDom:dom, wk:webkit, ie:ie, win:windows,
+                linux:linux, mac:mac, op: opera, chrome:chrome,
+                jre:jre, deploy:deploy, fx:fx,
+                cputype: cputype, osVersion: osVersion};
+    }
+
+    //partially derived from swfobject.js
+    var initDone = false;
+
+    function init() {
+        if (initDone) return;
+
+        ua = detectEnv();
+        if (!ua.haveDom) {
+            return;
+        }
+
+        //NB: dtjava.js can be added dynamically and init() can be called after
+        //    document onload event is fired
+        if (( isDef(d.readyState) && d.readyState == "complete") ||
+            (!isDef(d.readyState) &&
+                (d.getElementsByTagName("body")[0] || d.body))) {
+            invokeCallbacks();
+        }
+
+        if (!cbDone) {
+            if (isDef(d.addEventListener)) {
+                d.addEventListener("DOMContentLoaded",
+                    invokeCallbacks, false);
+            }
+            if (ua.ie && ua.win) {
+                d.attachEvent("onreadystatechange", function() {
+                    if (d.readyState == "complete") {
+                        d.detachEvent("onreadystatechange", arguments.callee);
+                        invokeCallbacks();
+                    }
+                });
+                if (w == top) { // if not inside an iframe
+                    (function() {
+                        if (cbDone) {
+                            return;
+                        }
+                        //AI: what for??
+                        try {
+                            d.documentElement.doScroll("left");
+                        } catch(e) {
+                            setTimeout(arguments.callee, 0);
+                            return;
+                        }
+                        invokeCallbacks();
+                    })();
+                }
+            }
+            if (ua.wk) {
+                (function() {
+                    if (cbDone) {
+                        return;
+                    }
+                    if (!/loaded|complete/.test(d.readyState)) {
+                        setTimeout(arguments.callee, 0);
+                        return;
+                    }
+                    invokeCallbacks();
+                })();
+            }
+            addOnload(invokeCallbacks);
+        }
+        //only try to install native plugin if we do not have DTLite
+        //Practically this means we are running NPAPI browser on Windows
+        //(Chrome or FF) and recent JRE (7u4+?)
+        if (!haveDTLite()) {
+            installNativePlugin();
+        }
+    }
+
+    /**
+     This class provides details on why current platform does not meet
+     application platform requirements. Note that severe problems are
+     reported immediately and therefore full check may be not performed and
+     some (unrelated to fatal problem)
+     methods may provide false positive answers.
+     <p>
+     If multiple components do not match then worst status is reported.
+     Application need to repeat checks on each individual component
+     if it want to find out all details.
+
+     @class PlatformMismatchEvent
+     @for   dtjava
+     */
+    function PlatformMismatchEvent(a) {
+
+        //expect to get all parameters needed
+        for (var p in a) {
+            this[p] = a[p];
+        }
+
+        /**
+         * @method toString
+         * @return {string}
+         *    Returns string replesentation of event. Useful for debugging.
+         */
+        this.toString = function() {
+            return "MISMATCH [os=" + this.os + ", browser=" + this.browser
+                + ", jre=" + this.jre + ", fx=" + this.fx
+                + ", relaunch=" + this.relaunch + ", platform=" 
+                + this.platform + "]";
+        };
+
+        /**
+         @method isUnsupportedPlatform
+         @return {boolean}
+         Returns true if this platform (OS/hardware) is not supported in a way
+         to satisfy all platfrom requirements.
+         (E.g. page is viewed on iPhone or JavaFX 2.0 application on Solaris.)
+         <p>
+         Note that this does not include browser match data.
+         If platform is unsupported then application can not be
+         launched and user need to use another platform to view it.
+         */
+
+        this.isUnsupportedPlatform = function() {
+            return this.os;
+        };
+
+        /**
+         @method isUnsupportedBrowser
+         @return {boolean}
+         Returns true if error is because current browser is not supported.
+         <p>
+         If true is returned and isRelaunchNeeded() returns true too then
+         there are known supported browsers browsers for this platform.
+         (but they are not necessary installed on end user system)
+         */
+        this.isUnsupportedBrowser = function() {
+            return this.browser;
+        };
+
+        /**
+         @method jreStatus
+         @return {string}
+
+         Returns "ok" if error was not due to missing JRE.
+         Otherwise return error code characterizing the problem:
+         <ul>
+         <li> none - no JRE were detected on the system
+         <li> old - some version of JRE was detected but it does not match platform requirements
+         <li> oldplugin - matching JRE found but it is configured to use deprecated Java plugin that
+         does not support Java applets
+         <ul>
+         <p>
+         canAutoInstall() and isRelaunchNeeded() can be used to
+         get more details on how seamless user' install experience will be.
+         */
+        this.jreStatus = function() {
+            return this.jre;
+        };
+
+        /**
+         * @method jreInstallerURL
+         * @param {string} locale (optional) Locale to be used for installation web page
+         * @return {string}
+         *
+         * Return URL of page to visit to install required version of Java.
+         * If matching java runtime is already installed or not officially supported
+         * then return value is null.
+         */
+        this.jreInstallerURL = function(locale) {
+            if (this.os && (this.jre == "old" || this.jre == "none")) {
+                return getJreUrl(locale);
+            }
+            return null;
+        };
+
+        /**
+         @method javafxStatus
+         @return {string}
+
+         Returns "ok" if error was not due to missing JavaFX.
+         Otherwise return error code characterizing the problem:
+         <ul>
+         <li> none - no JavaFX runtime is detected on the system
+         <li> old - some version of JavaFX runtime iss detected but it does not match platform requirements
+         <li> disabled - matching JavaFX is detected but it is disabled
+         <li> unsupported - JavaFX is not supported on this platform
+         <ul>
+         <p>
+         canAutoInstall() and isRelaunchNeeded() can be used to
+         get more details on how seamless user' install experience will be.
+         */
+        this.javafxStatus = function() {
+            return this.fx;
+        };
+
+        /**
+         * @method javafxInstallerURL
+         * @param {string} locale (optional) Locale to be used for installation web page
+         * @return {string}
+         *
+         * Return URL of page to visit to install required version of JavaFX.
+         * If matching JavaFX runtime is already installed or not officially supported
+         * then return value is null.
+         */
+        this.javafxInstallerURL = function(locale) {
+            if (!this.os && (this.fx == "old" || this.fx == "none")) {
+                return getFxUrl(locale);
+            }
+            return null;
+        };
+
+        /**
+         @method canAutoInstall
+         @return {boolean}
+         Returns true if installation of missing components can be
+         triggered automatically. In particular, ture is returned
+         if there are no missing components too.
+         <p>
+         If any of missing components need to be installed manually
+         (i.e. click through additional web pages) then false is returned.
+         */
+        this.canAutoInstall = function() {
+            return isAutoInstallEnabled(this.platform, this.jre, this.fx);
+        };
+
+        /**
+         @method isRelaunchNeeded
+         @return {boolean}
+
+         Returns true if browser relaunch is needed before application can be loaded.
+         This often is true in conjuction with need to perform installation.
+         <p>
+         Other typical case - use of unsupported browser when
+         it is known that there are supported browser for this pltaform.
+         Then both isUnsupportedBrowser() and isRelaunchNeeded() return true.
+         */
+        this.isRelaunchNeeded = function() {
+            return this.relaunch;
+        };
+    }
+
+    //returns version of instaled JavaFX runtime matching requested version
+    //or null otherwise
+    function getInstalledFXVersion(requestedVersion) {
+        //NPAPI browser and JRE with cobundle
+        if (ua.fx != null && versionCheckFX(requestedVersion, ua.fx)) {
+            return ua.fx;
+        }
+        //try to use DT
+        var p = getPlugin();
+        if (notNull(p)) {
+            try {
+                return p.getInstalledFXVersion(requestedVersion);
+            } catch(e) {}
+        }
+        return null;
+    }
+
+    //concatenate list with space as separator
+    function listToString(lst) {
+      if (lst != null) {
+          return lst.join(" ");
+      } else {
+          return null;
+      }
+    }
+
+    function addArgToList(lst, arg) {
+        if (notNull(lst)) {
+           lst.push(arg);
+           return lst;
+        } else {
+            var res = [arg];
+            return res;
+        }
+    }
+
+    function doLaunch(ld, platform, cb) {
+        var app = normalizeApp(ld, true);
+
+        //required argument is missing
+        if (!(notNull(app) && notNull(app.url))) {
+            throw "Required attribute missing! (application url need to be specified)";
+        }
+
+        //if we got array we need to copy over!
+        platform = new dtjava.Platform(platform);
+
+        //normalize handlers
+        cb = new dtjava.Callbacks(cb);
+
+        var launchFunc = function() {
+            //prepare jvm arguments
+            var jvmArgs = notNull(platform.jvmargs) ? platform.jvmargs : null;
+            if (notNull(platform.javafx)) {
+                //if FX is needed we know it is available or
+                // we will not get here
+                var v = getInstalledFXVersion(platform.javafx);
+                //add hint that we need FX toolkit to avoid relaunch
+                // if JNLP is not embedded
+                jvmArgs = addArgToList(jvmArgs, " -Djnlp.fx=" + v);
+                //for swing applications embedding FX we do not want this property as it will
+                // trigger FX toolkit and lead to app failure!
+                //But for JavaFX application it saves us relaunch as otherwise we wil launch with AWT toolkit ...
+                if (!notNull(ld.toolkit) || ld.toolkit == "fx") {
+                    jvmArgs = addArgToList(jvmArgs, " -Djnlp.tk=jfx");
+                }
+
+            }
+
+
+            //if we on 7u6+ we can use DTLite plugin in the NPAPI browsers
+            //Caveat: as of 7u6 it does not work with Chrome on Linux because Chrome expects
+            //   DTLite plugin to implement xembed (or claim to support xembed)
+            if (haveDTLite() && !(ua.linux && ua.chrome)) {
+                if (doLaunchUsingDTLite(app, jvmArgs, cb)) {
+                    return;
+                }
+            }
+
+            //Did not launch yet? Try DT plugin (7u2+)
+            var p =  getPlugin();
+            if (notNull(p)) {
+                try {
+                    try {
+                        //check if new DT APIs are available
+                        if (versionCheck("10.6+", ua.deploy)) {
+                            //    obj.launchApp({"url" : "http://somewhere/my.jnlp",
+                            //                   "jnlp_content" : "... BASE 64 ...",
+                            //                   "vmargs" : [ "-ea -Djnlp.foo=bar"
+                            //                   "appargs" : [ "first arg,  second arg" ]
+                            //                   "params" : {"p1" : "aaa", "p2" : "bbb"}});
+                            var callArgs = {"url":app.url};
+                            if (notNull(jvmArgs)) {
+                                callArgs["vmargs"] = jvmArgs;
+                            }
+                            //Only use HTML parameters, they are supposed to overwrite values in the JNLP
+                            //In the future we want to pass arguments too but this needs also be exposed for
+                            // embedded deployment
+                            if (notNull(app.params)) {
+                                //copy over and ensure all values are strings
+                                // (native code will ignore them otherwise)
+                                var ptmp = {};
+                                for (var k in app.params) {
+                                    ptmp[k] = String(app.params[k]);
+                                }
+                                callArgs["params"] = ptmp;
+                            }
+                            if (notNull(app.jnlp_content)) {
+                                callArgs["jnlp_content"] = app.jnlp_content;
+                            }
+                            var err = p.launchApp(callArgs);
+                            if (err == 0) { //0 - error
+                                if (isDef(cb.onRuntimeError)) {
+                                    cb.onRuntimeError(app.id);
+                                }
+                            }
+                        } else { //revert to old DT APIs
+                            //older DT APIs expects vmargs as a single string
+                            if (!p.launchApp(app.url, app.jnlp_content, listToString(jvmArgs))) {
+                                if (isDef(cb.onRuntimeError)) {
+                                    cb.onRuntimeError(app.id);
+                                }
+                            }
+                        }
+                        return;
+                    } catch (ee) { //temp  support for older build of DT
+                        if (!p.launchApp(app.url, app.jnlp_content)) {
+                           if (isDef(cb.onRuntimeError)) {
+                              cb.onRuntimeError(app.id);
+                           }
+                        }
+                        return;
+                    }
+                } catch (e) {
+                    //old DT
+                }
+            } //old Java (pre DTLite)? not Windows? or old DT
+
+            //use old way to launch it using java plugin
+            var o = getWebstartObject(app.url);
+            if (notNull(d.body)) {
+                d.body.appendChild(o);
+            } else {
+                //should never happen
+                d.write(o.innerHTML);
+            }
+        }
+
+        var r = doValidateRelaxed(platform);
+        //can not launch, try to fix
+        if (r != null) {
+            resolveAndLaunch(app, platform, r, cb, launchFunc);
+        } else {
+            launchFunc();
+        }
+    }
+
+    //process unhandled platform error - convert to code and call callback
+    function reportPlatformError(app, r, cb) {
+        if (isDef(cb.onDeployError)) {
+            cb.onDeployError(app, r);
+        }
+    }
+
+    function isDTInitialized(p) {
+        //if plugin is blocked then p.version will be undefined
+        return p != null && isDef(p.version);
+    }
+
+    //Wait until DT plugin is initialized and then run the code
+    //Currently we only use it for embeded apps and Chrome on Windows
+    function runUsingDT(label, f) {
+        //  Possible situations:
+        //   a) plugin is live and we can simply run code
+        //        - just run the code
+        //   b) plugin is in the DOM tree but it is not initialized yet (e.g. Chrome blocking)
+        //      and there is live timer (pendingCount > 0)
+        //        - there could be another request. We will APPEND to it
+        //        (this is different from dtlite as in this case we can not have multiple clicks)
+        //        - renew timer life counter (do not want new timer)
+        //   c) plugin is in the DOM tree and it is not fully initialized yet but timer is stopped
+        //        - overwrite old request
+        //        - restart timer
+        //
+        // Problem we are solving:
+        //    when plugin is ready to serve request? How do we schedule call to happen when plugin is initialized?
+        // Caveat:
+        //    Chrome can popup dialog asking user to grant permissions to load the plugin.
+        //    There is no API to detect dialog is shown and when user grants or declines permissions
+        //
+        // Note:
+        //    If we set property on plugin object before it is unblocked then they seem to be lost
+        //   and are not propagated to the final object once it is instantiated.
+        //
+        // Workaround we use:
+        //    Once plugin is added we will be checking if it is initialized and once we detect it we will execute code.
+        //  We will stop checking after some time.
+        var p = getPlugin();
+        if (p == null) {
+            return; //NO DT
+        }
+
+        if (isDTInitialized(p)) {
+            f(p);
+        } else {
+            // see if we need new timer
+            var waitAndUse = null;
+            if (!isDef(dtjava.dtPendingCnt) || dtjava.dtPendingCnt == 0) {
+                waitAndUse = function () {
+                    if (isDTInitialized(p)) {
+                        if (notNull(dtjava.dtPending)) {
+                            for (var i in dtjava.dtPending) {
+                                dtjava.dtPending[i]();
+                            }
+                        }
+                        return;
+                    }
+                    if (dtjava.dtPendingCnt > 0) {
+                        dtjava.dtPendingCnt--;
+                        setTimeout(waitAndUse, 500);
+                    }
+                }
+            }
+            //add new task in queue
+            if (!notNull(dtjava.dtPending) || dtjava.dtPendingCnt == 0) {
+                dtjava.dtPending = {};
+            }
+            dtjava.dtPending[label] = f; //use map to ensure repitative actions are not queued (e.g. multiple click to launch webstart)
+            //reset the timer counter
+            dtjava.dtPendingCnt = 1000; //timer is gone after 500s
+            //start timer if needed
+            if (waitAndUse != null) waitAndUse();
+        }
+    }
+
+    //returns same mismatch event if not resolved, null if resolved
+    function resolveAndLaunch(app, platform, v, cb, launchFunction) {
+        var p = getPlugin();
+
+        //Special case: Chrome/Windows
+        // (Note: IE may also block activeX control but then it will block attempts to use it too)
+        if (ua.chrome && ua.win && p != null && !isDTInitialized(p)) {
+            //this likely means DT plugin is blocked by Chrome
+            //tell user to grant permissions and retry
+            var actionLabel;
+            if (notNull(app.placeholder)) {
+                var onClickFunc = function() {w.open("http://www.java.com/en/download/faq/chrome.xml"); return false;};
+                var msg1 = "Please give Java permission to run on this browser web page.";
+                var msg2 = "Click for more information.";
+                var altText = "";
+                doShowMessageInTheArea(app, msg1, msg2, altText, "javafx-chrome.png", onClickFunc);
+                actionLabel = app.id + "-embed";
+            } else {
+                v.jre = "blocked";
+                reportPlatformError(app, v, cb);
+                actionLabel = "launch"; //we only queue ONE webstart launch.
+                                        //Do not want to try to queue different apps - bad UE
+                                        // (once user enable multiple things can spawn)
+                                        //Note: what if multiple webstart apps are set to launch on page load (suer do not need to click)?
+                                        //      Guess do not worry for now
+                                        //Note: app.id may be null in case of webstart app.
+            }
+
+            //now we need to start waiter. Once DT is initialized we can proceeed
+            var retryFunc = function() {
+                var vnew = doValidateRelaxed(platform);
+                if (vnew == null) { //no problems with env
+                    launchFunction();
+                } else {
+                    resolveAndLaunch(app, platform, vnew, cb, launchFunction);
+                }
+            };
+            runUsingDT(actionLabel, retryFunc);
+
+            return;
+        }
+
+        if (!v.isUnsupportedPlatform() && !v.isUnsupportedBrowser()) { //otherwise fatal, at least until restart of browser
+            if (isMissingComponent(v) && isDef(cb.onInstallNeeded)) {
+                var resolveFunc= function() {
+                    //once install is over we need to revalidate
+                    var vnew = doValidateRelaxed(platform);
+                    if (vnew == null) { //if no problems found - can launch
+                        launchFunction();
+                    } else { //TODO: what happens if we installed everything but relaunch is needed??
+                        //We can not get here if component install was not offered for any or missing componens
+                        //(if auto install was possible, see doInstall() implementation)
+                        //Hence, it is safe to assume we failed to meet requirements
+                        reportPlatformError(app, vnew, cb);
+
+                        //TODO: may be should call itself again but
+                        // then it easy can become infinite loop
+
+                        //e.g. user installs but we fail to detect it because DT
+                        // is not FX aware and retry, etc.
+                        //TODO: think it through
+                    }
+                };
+
+                cb.onInstallNeeded(app, platform, cb,
+                            v.canAutoInstall(), v.isRelaunchNeeded(), resolveFunc);
+                return;
+            }
+        }
+        reportPlatformError(app, v, cb);
+    }
+
+    function haveDTLite() {
+        if (ua.deploy != null) {
+            return versionCheck("10.6+", ua.deploy);
+        }
+        return false;
+    }
+
+    function isDTLiteInitialized(p) {
+        //if plugin is blocked then p.version will be undefined
+        return p != null && isDef(p.version);
+    }
+
+    function getDTLitePlugin() {
+        return document.getElementById("dtlite");
+    }
+
+    function doInjectDTLite() {
+        //do not want more than one plugin
+        if (getDTLitePlugin() != null) return;
+
+        var p = document.createElement('embed');
+        p.width = '10px';
+        p.height = '10px';
+        p.id = "dtlite";
+        p.type = "application/x-java-applet";  //means we get latest
+
+        var div = document.createElement("div");
+        div.style.position = "relative";
+        div.style.left = "-10000px";
+        div.appendChild(p);
+
+        var e = document.getElementsByTagName("body");
+        e[0].appendChild(div);
+    }
+
+    function runUsingDTLite(f) {
+        //  Possible situations:
+        //   a) first request, plugin is not in the DOM tree yet
+        //        - add plugin
+        //        - setup wait mechanism and run f() once plugin is ready
+        //   b) plugin is live and we can simply run code
+        //        - just run the code
+        //   c) plugin is in the DOM tree but it is not initialized yet (e.g. Chrome blocking)
+        //      and there is live timer (pendingCount > 0)
+        //        - there could be another request. We will override it (e.g. user clicked multiple times)
+        //        - renew timer life counter (do not want new timer)
+        //   d) plugin is in the DOM tree and it is not fully initialized yet but timer is stopped
+        //        - overwrite old request
+        //        - restart timer
+        //
+        // Problem:
+        //    when plugin is ready to serve request? How do we schedule call to happen when plugin is initialized?
+        // Caveat:
+        //    Chrome can popup dialog asking user to grant permissions to load the plugin.
+        //    There is no API to detect dialog is shown and when user grants or declines permissions
+        //
+        // Note:
+        //    If we set property on plugin object before it is unblocked then they seem to be lost
+        //   and are not propagated to the final object once it is instantiated.
+        //
+        // Workaround we use:
+        //    Once plugin is added we will be checking if it is initialized and once we detect it we will execute code.
+        //  We will stop checking after some time.
+        var p = getDTLitePlugin();
+        if (p == null) {
+            doInjectDTLite();
+            p = getDTLitePlugin();
+        }
+
+        if (isDTLiteInitialized(p)) {
+            f(p);
+        } else {
+            // see if we need new timer
+            var waitAndUse = null;
+            if (!isDef(dtjava.dtlitePendingCnt) || dtjava.dtlitePendingCnt == 0) {
+                waitAndUse = function () {
+                    if (isDef(p.version)) {
+                        if (dtjava.pendingLaunch != null) {
+                            dtjava.pendingLaunch(p);
+                        }
+                        dtjava.pendingLaunch = null;
+                        return;
+                    }
+                    if (dtjava.dtlitePendingCnt > 0) {
+                        dtjava.dtlitePendingCnt--;
+                        setTimeout(waitAndUse, 500);
+                    }
+                }
+            }
+            //add new task in queue
+            dtjava.pendingLaunch = f;
+            //reset the timer counter
+            dtjava.dtlitePendingCnt = 1000; //timer is gone after 500s
+            //start timer if needed
+            if (waitAndUse != null) {
+                waitAndUse();
+            }
+        }
+    }
+
+    function doLaunchUsingDTLite(app, jvmargs, cb) {
+        var launchIt = function() {
+            var pp = getDTLitePlugin();
+            if (pp == null) {
+                //should not be possible as we guard before enter this function
+                if (isDef(cb.onRuntimeError)) {
+                    cb.onRuntimeError(app.id);
+                }
+            }
+            
+            //DTLite only support new invocation API
+            //    obj.launchApp({"url" : "http://somewhere/my.jnlp",
+            //                   "jnlp_content" : "... BASE 64 ...",
+            //                   "vmargs" : [ "-ea -Djnlp.foo=bar"
+            //                   "appargs" : [ "first arg,  second arg" ]
+            //                   "params" : {"p1" : "aaa", "p2" : "bbb"}});
+            var callArgs = {"url" : app.url};
+            if (notNull(jvmargs)) {
+               callArgs["vmargs"] = jvmargs;
+            }
+            //Only use HTML parameters, they are supposed to overwrite values in the JNLP
+            //In the future we want to pass arguments too but this needs also be exposed for
+            // embedded deployment
+            if (notNull(app.params)) {
+                //copy over and ensure all values are stings
+                // (native code will ignore them otherwise)
+                var ptmp = {};
+                for (var k in app.params) {
+                    ptmp[k] = String(app.params[k]);
+                }
+                callArgs["params"] = ptmp;
+            }
+            if (notNull(app.jnlp_content)) {
+               callArgs["jnlp_content"] = app.jnlp_content;
+            }
+            var err = pp.launchApp(callArgs);
+            if (err == 0) { //0 - error
+                if (isDef(cb.onRuntimeError)) {
+                    cb.onRuntimeError(app.id);
+                }
+            }
+        };
+        
+        if (versionCheck("10.4+", ua.deploy)) { //only for NPAPI browsers
+            runUsingDTLite(launchIt);
+            return true;
+        }
+        return false;
+    }
+    
+    function getWebstartObject(jnlp) {
+        var wo = null;
+        if (ua.ie) { //TODO: attempt to use object in FF 3.6 lead to hang. Revert to embed for now
+                     //TODO: Should Chrome use object?
+            //object tag itself
+            wo = d.createElement('object');
+            wo.width = '1px'; //zero size reports invalid argument in IE!
+            wo.height = '1px'; //TODO: make it less distruptive to page layout? hide div?
+            var p = d.createElement('param');
+            p.name = 'launchjnlp';
+            p.value = jnlp;
+            wo.appendChild(p);
+            p = d.createElement('param');
+            p.name = 'docbase';
+            p.value = notNull(d.documentURI) ? d.documentURI : d.URL;
+            wo.appendChild(p);
+
+            if (!ua.ie) {
+                //NB:do not need to use exact version in mime type as generic should be mapped to latest?
+                wo.type = "application/x-java-applet;version=1.7";
+            } else {
+                wo.classid = "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93";
+            }
+        } else { //TODO: else part should go away once we figure out what is going on with FF
+            wo = d.createElement('embed');
+            wo.width = '0px';
+            wo.height = '0px';
+            //NB: dot notation did not work for custom attributes??? revert to setAttribute
+            wo.setAttribute('launchjnlp', jnlp);
+            wo.setAttribute('docbase', (notNull(d.documentURI) ? d.documentURI : d.URL));
+            //NB:do not need to use exact version in mime type as generic should be mapped to latest?
+            wo.type = "application/x-java-applet;version=1.7";
+        }
+
+        var div = d.createElement("div");
+        div.style.position = "relative";
+        div.style.left = "-10000px";
+        div.appendChild(wo);
+        return div;
+    }
+
+    //this is similar to version check rules except for
+    // JavaFX we treat version slightly differently.
+    //For Javafx version really is FAMILY.UPDATE_VERSION
+    // where FAMILY is everything before first dot
+    // E.g.
+    //     2.0.1 => family 2, update 0.1
+    //     2.0   => family 2. update 0.0
+    //
+    // JavaFX version requirements are always treated as "not earlier than this update".
+    // I.e. we expect
+    //     2.2.0 to match 2.2*, 2.2+, 2.1+, 2.1*, 2.0 and 1+
+    //           but not match 2.2.1+, 2.2.1*, 2.3*, 2.3+ or 1*
+    function versionCheckFX(query, version) {
+        if (query == null || query.length == 0) {
+            return true;
+        }
+        var endChar = query.charAt(query.length - 1);
+        var familyOnly = (endChar == '*');
+        if (!familyOnly) {
+            if (endChar == '+') {
+                return versionCheck(query, version);
+            } else { //must be fixed version, e.g. 2.0
+                return versionCheck(query + '+', version);
+            }
+        } else {
+            return (versionCheck(query.charAt(0)+".*", version) && //required family (version belongs to family 2)
+                    versionCheck(query.substring(0, query.length - 1)+"+", version)); //global lookup (version >= 2.1.1), replace * with +
+        }
+    }
+
+    //Convert version string into 4 element array with version components
+    //If input string has fewer components then pad with zeros from the right
+    //If input string ends with suffix like '+' or '*' then it is stripped
+    //
+    //Examples:
+    //    10.1.2.3 => {10, 1, 2, 3}
+    //    10.1     => {10, 1, 0, 0}
+    //    10.1+    => {10, 1, 0, 0}
+    function convertVersionToArray(versionString) {
+        if (versionString != null) {
+            var c = versionString.charAt(versionString.length - 1);
+            //if it is not digit we want to strip last char
+            if (c <= '0' || c >= '9') {
+                versionString = versionString.substring(0, versionString.length - 1);
+            }
+        }
+
+        //corner case inputs
+        if (versionString == null || versionString.length == 0) {
+            return [0, 0, 0, 0];
+        }
+
+        var arr = versionString.split(".");
+        while (arr.length < 4) {
+            arr.push(0);
+        }
+        return arr;
+    }
+
+    //checks where given version string matches query
+    //
+    //NB: assume format is correct. Can add format check later if needed
+    function versionCheck(query, version) {
+        if (query == null || query.length == 0) return true;
+
+        var c = query.charAt(query.length - 1);
+
+        //if it is not explicit pattern but does not have update version then need to append *
+        if (c != '+' && c != '*' && (query.indexOf('_') != -1 && c != '_')) {
+            query = query + "*";
+            c = '*';
+        }
+
+        query = query.substring(0, query.length - 1);
+        //if query ends with ".", "_" then we want to strip it to allow match of "1.6.*" to shorter form such as "1.6"
+        //TODO: add support for match of "1.7.0*" to "1.7"?
+        if (query.length > 0) {
+            var z = query.charAt(query.length - 1);
+            if (z == '.' || z == '_') {
+                query = query.substring(0, query.length - 1);
+            }
+        }
+        if (c == '*') {
+            //it is match if version starts from it
+            return (version.indexOf(query) == 0);
+        } else if (c == '+') {
+            //lexicographical comparison is not good here as we may have case like
+            //   query="10.6*" and version="10.10.2"
+            //Approach:
+            //   split into tokens and compare each of tokens numerically
+            //Keep comparing until tokens are the same or we reached end.
+            //If tokens differ then we have a match if query is smaller and
+            // non-match if it is greater
+            var qArr = convertVersionToArray(query);
+            var vArr = convertVersionToArray(version);
+
+            //qArr and vArr are expected to be arrays of same length
+            for (var idx=0; idx < qArr.length; idx++) {
+                if (qArr[idx] < vArr[idx]) {
+                    //query is smaller
+                    return true;
+                } else if (qArr[idx] < vArr[idx]) {
+                    //query is larger => fail
+                    return false;
+                }
+            }
+            //query is equal to version => it is ok
+            return true;
+        }
+        return false;
+    }
+
+    //as JavaFX comes with own plugin binaries then check based on mime types, etc.
+    // may be false positive as it only checks for plugin version, not real JRE
+    //Here we check that DT plugin is aware of JRE installations
+    //Note that:
+    //  - if DT is not available we will return false but we only do this i
+    //    ready to launch => DT must be found
+    //  - we do not want to check in jreCheck() as we want to avoid loading
+    //    DT plugin if we can (as old DT may make it not possible to autostart)
+    function doublecheckJrePresence() {
+        if (!haveDTLite()) { //basically IE on windows or Old JRE on windows
+          var p = getPlugin();
+          if (p != null) {
+            return true;
+            //WORKAROUND: bug in native DT!!! TODO: What version? bypass for it only
+            //return (p.jvms.getLength() > 0);
+          }
+
+          return false;
+        }
+
+        //if we are not using native DT plugin (i.e. using DTLite) then no way we can do sanity check
+        //   => assume first check is accurate
+        return true;
+    }
+
+    function jreCheck(jre) {
+        // Check if latest JRE is exposed in mimetype and if it is good enough (only for NPAPI browsers)
+        if (ua.jre != null) {
+            if (versionCheck(jre, ua.jre)) {
+               return "ok";
+            }
+            //Note: if we have JRE but it is not match that means we may need an upgrade message
+            // but we still could be able to get more accurate answer with native DT plugin
+        }
+
+        //try to use DT plugin
+        var p = getPlugin();
+        if (p != null) {
+            var VMs = p.jvms;
+            for (var i = 0; VMs != null && i < VMs.getLength(); i++) {
+                if (versionCheck(jre, VMs.get(i).version)) {
+                    if (!ua.ie && notNull(navigator.mimeTypes)) {
+                        //if mime types are available but plugin is not there =>
+                        //  it is disabled
+                        if (!notNull(navigator.mimeTypes["application/x-java-applet"])) {
+                            return "disabled";
+                        }
+                    }
+                    return "ok";
+                }
+            }
+            //do not need to try other ways if used DT
+            return "none";
+        }
+
+        //No full DT => On Windows we can not launch FX anyways
+        //   but may have old JRE
+        //And we might be able to launch on Mac/Linux
+
+
+        //This is only IE on Windows. This gives no update version. only e.g. 1.6.0
+        //and also cause java plugin to be loaded => browser will need to be restarted
+        //if new JRE is installed.
+        //However, if we got here than DT is not available and autoinstall is not possible
+        if (ua.ie) {
+            var lst = ["1.8.0", "1.7.0", "1.6.0", "1.5.0"];
+            for (var v = 0; v < lst.length; v++) {
+                if (versionCheck(jre, lst[v])) {
+                    try {
+                        //TODO: FIXME: This does not seem to work in my testing in IE7?
+                        var axo = new ActiveXObject("JavaWebStart.isInstalled." + lst[v] + ".0");
+                        // This is not hit if the above throws an exception.
+                        return "ok";
+                    } catch (ignored) {
+                    }
+                }
+            }
+        }
+
+
+        return "none";
+    }
+
+    function checkJRESupport() {
+        //Negative test. New platforms will not be rejected
+        var osProblem = ['iPhone', 'iPod'];
+        var os = containsAny(osProblem, navigator.userAgent);
+
+        //Do not support Chrome/Mac as Chrome is 32 bit only
+        var browser = (ua.mac && ua.chrome && ua.cputype == "intel");
+
+        //autoinstall possible if native plugin is detected or OS is fine
+        auto = os || (getPlugin() != null);
+
+        //false is no problem found
+        return {os: os, browser: browser, auto: auto};
+    }
+
+    //it is not clear if we can work in IE6
+    // but it is hard to test and JRE7 does not even support it
+    // mark as unsupported for now
+    function isUnsupportedVersionOfIE() {
+        if (ua.ie) {
+            try {
+              //these functions are defined in IE only
+              var v = 10*ScriptEngineMajorVersion() + ScriptEngineMinorVersion();
+              if (v < 57) return true; //IE7 will have 57
+            } catch (err) {
+                //really old IE?
+                return true;
+            }
+        }
+        return false;
+    }
+
+    function checkFXSupport() {
+        var browser;
+        if (ua.win) {
+            //do not support Opera and Safari
+            // (not really tested, may be it works but known to have problems with DT detection)
+            browser = ua.op || ua.wk || isUnsupportedVersionOfIE();
+
+            //false is no problem found
+            return {os: false, browser: browser};
+        } else if (ua.mac && ua.cputype == "intel") { //do not support PPC/iphone/ipad ...
+            var os = !versionCheck("10.7.3+", ua.osVersion); //10.7.3 or later!
+            browser = ua.op ||
+                (ua.mac && ua.chrome); //Opera is not supported
+            //Chrome on Mac is 32 bit => plugin only work in 64 bit ...
+            //TODO: How do we detect FF running in 32 bit mode?
+
+            //false is no problem found
+            return {os: os, browser: browser};
+        } else if (ua.linux) {
+            browser = ua.op; //Opera unsupported
+
+            //false is no problem found
+            return {os: false, browser: browser};
+        } else {
+            //unknown unsupported OS
+            return {os: true, browser: false};
+        }
+    }
+
+    function relaxVersion(v) {
+        if (notNull(v) && v.length > 0) {
+            var c = v.charAt(v.length - 1);
+            if (c == '*') {
+              v = v.substring(0, v.length - 1)+"+";
+            } else if (c != '+') { //exact version (e.g. 1.6)
+                v = v + "+";
+            }
+        }
+        return v;
+    }
+
+    //we relax validation rules where we try to embed or launch app
+    // in order to deal with requests for OLDER jres at the java level
+    //Basically we convert request for version in JRE family to request for any future JRE
+    //We do NOT do same for JavaFX right now. There is no real need before 3.0 and it is not clear if it is good thing
+    //
+    //Note we keep validation strict for install and validate-only scenarios.
+    // This allows to query accurate details from javascript
+    function doValidateRelaxed(platform) {
+        var p = new dtjava.Platform(platform);
+
+        p.jvm = relaxVersion(p.jvm);
+        //p.javafx = relaxVersion(p.javafx);
+
+        return doValidate(p);
+    }
+
+    function doValidate(platform) {
+        //ensure some platform is set (we could get array too!)
+        platform = new dtjava.Platform(platform);
+
+        //problem markers
+        var fx = "ok", jre = "ok", restart = false, os = false, browser = false,
+            p, details;
+
+        //check JRE
+        if (notNull(platform.jvm) && jreCheck(platform.jvm) != "ok") { //matching JRE not found
+            var res = jreCheck("*");
+            if (res == "ok") {
+                jre = "old";
+            } else {
+                jre = res; //"none" or "disabled"
+            }
+
+            details = checkJRESupport();
+            if (details.os) {
+                jre = "unsupported";
+                os = true;
+            }
+            browser = details.browser;
+        }
+/*        if (notNull(platform.plugin) && jre == "ok") {
+            try {
+                p = getPlugin();
+                //TEMPORARY DISABLE because isPlugin2() is broken in 1.7.0
+                // it is not fixed in 7-client but if FX is enabled then
+                // it must be new plugin anyways
+                //=> keep this disabled for now until we find use case
+                if (false && (p == null || !p.isPlugin2())) {
+                    //TODO: FIXME: seem to get here always because isPlugin2() returns 0?
+                    jre = "oldplugin";
+                    relaunch = true;
+                }
+            } catch (err) { //pre 6u10 or no DT
+                jre = "oldplugin";
+                relaunch = true;
+            }
+        }
+*/
+        //check FX
+        if (notNull(platform.javafx)) {
+            details = checkFXSupport();
+            if (details.os || details.browser) { //FX is not supported,
+                                                  //do not even try
+                fx = "unsupported";
+                os = os || details.os;
+                browser = browser || details.browser;
+            } else {
+                //on non windows platforms automated install is not possible
+                // (if it is needed on windows and possible we will set it to false later)
+                
+                if (ua.fx != null) {
+                  //found cobundled JavaFX on 7u6+ (and it is NPAPI-based browser)
+                  if (versionCheckFX(platform.javafx, ua.fx)) {
+                        fx = "ok";
+                  } else if (versionCheckFX("2.0+", ua.fx)) {
+                        fx = "old";
+                  }
+                } else if (ua.win) { //could be 7u6(cobundle)/IE or JRE6/FX
+                  try {
+                    p = getPlugin();
+                    //typeof did not work in IE
+                    var v = p.getInstalledFXVersion(platform.javafx);
+                    //if found we should get version string, otherwise empty string or null. If found then fx=false!
+                    if (v == "" || v == null) {
+                        v = p.getInstalledFXVersion("2.0+"); //check for any FX version
+                        if (v == null || v == "") {
+                            fx = "none";
+                        } else {
+                            fx = "old";
+                        }
+                    }
+                  } catch(err) {
+                    //If we got here then environment is supported but
+                    //this is non FX aware JRE => no FX and can only offer manual install
+                    // (restart needed as toolkit is already loaded)
+                    fx = "none";
+                  }
+                } else if (ua.mac || ua.linux) {
+                    fx = "none";
+                }
+            }
+        }
+
+        //recommend relaunch if OS is ok but browser is not supported
+        restart = restart || (!os && browser);
+
+        //TODO: need a way to find out if java plugin is loaded => will need to relaunch
+
+        //we need to return null if everything is ok. Check for problems.
+        if (fx != "ok" || jre != "ok" || restart || os || browser) {
+            return new PlatformMismatchEvent(
+                {fx: fx, jre: jre, relaunch: restart, os: os, browser: browser,
+                    platform: platform});
+        } else {
+            //if all looks good check JRE again, it could be false positive
+            if (!doublecheckJrePresence()) {
+               return new PlatformMismatchEvent(
+                 {fx: fx, jre: "none", relaunch: restart, os: os, 
+                     browser: browser, platform: platform});
+            }
+        }
+
+        return null;
+    }
+
+    //TODO: does it make sense to have a way to explicitly request locale?
+    function guessLocale() {
+        var loc = null;
+
+        loc = navigator.userLanguage;
+        if (loc == null)
+            loc = navigator.systemLanguage;
+        if (loc == null)
+            loc = navigator.language;
+
+        if (loc != null) {
+            loc = loc.replace("-", "_")
+        }
+        return loc;
+    }
+
+    function getJreUrl(loc) {
+        if (!notNull(loc)) {
+            loc = guessLocale();
+        }
+        return 'http://jdl.sun.com/webapps/getjava/BrowserRedirect?host=java.com' +
+            ((notNull(window.location) && notNull(window.location.href)) ?
+                ('&returnPage=' + window.location.href) : '') +
+            (notNull(loc) ? ('&locale=' + loc) : '');
+        //NB: brand parameter is not supported for now
+    }
+
+    function getFxUrl(locale) {
+        return "http://www.oracle.com/technetwork/java/javafx/downloads/index.html";
+    }
+
+    //return true if mismatch event suggest to perform installation
+    function isMissingComponent(v) {
+        if (v != null) {
+            var jre = v.jreStatus();
+            var fx = v.javafxStatus();
+            //if anything is disabled then this need to be resolved before any further installs
+            return (jre == "none" || fx == "none" || jre == "old" || fx == "old")
+               && (fx != "disabled" && jre != "disabled");
+        }
+        return false;
+    }
+
+    function showClickToInstall(ld, isJRE, isUpgrade, isAutoinstall, isRelaunchNeeded, actionFunc) {
+        //what product?
+        var productName, productLabel;
+        if (isJRE) {
+            productName = "Java";
+            productLabel = "java";
+        } else {
+            productName = "JavaFX";
+            productLabel = "javafx";
+        }
+
+        var msg1, msg2, imgName;
+        if (isUpgrade) {
+            msg1 = "A newer version of " + productName + "is required to view the content on this page.";
+            msg2 = "Please click here to update " + productName;
+            imgName = "upgrade_"+productLabel+".png";
+        } else {
+            msg1 = "View the content on this page.";
+            msg2 = "Please click here to install " + productName;
+            imgName = "get_"+productLabel+".png";
+        }
+        var altText = "Click to install "+productName;
+
+        doShowMessageInTheArea(ld, msg1, msg2, altText, imgName, actionFunc);
+    }
+
+    function doShowMessageInTheArea(ld, msg1, msg2, altText, imgName, actionFunc) {
+        //if image will fit (size 238x155)
+        var r = d.createElement("div");
+        r.width = normalizeDimension(ld.width);
+        r.height = normalizeDimension(ld.height);
+
+        var lnk = d.createElement("a");
+        lnk.href="";
+        lnk.onclick = function() {actionFunc(); return false;};
+        if (ld.width < 250 || ld.height < 160) { //if relative size this will fail =>
+                                                 // will choose image
+            r.appendChild(
+               d.createElement("p").appendChild(
+                  d.createTextNode(msg1)));
+            lnk.appendChild(d.createTextNode(msg2));
+            r.appendChild(lnk);
+        } else {
+            var img = d.createElement("img");
+            img.src = jscodebase + imgName;
+            img.alt = altText;
+            img.style.borderWidth="0px";
+            img.style.borderStyle="none";
+//FIXME: centering image does not work (in a way it also work with relative dimensions ...)
+//            lnk.style.top="50%";
+//            lnk.style.left="50%";
+//            lnk.style.marginTop = -119; // 238/2
+//            lnk.style.marginLeft = -77; //155/2
+            lnk.appendChild(img);
+            r.appendChild(lnk);
+        }
+        wipe(ld.placeholder);
+        ld.placeholder.appendChild(r);
+    }
+
+    function canJavaFXCoBundleSatisfy(platform) {     
+        // check if latest co-bundle can satisfy
+        if (versionCheck(platform.jvm, minJRECobundleVersion) &&
+            versionCheckFX(platform.javafx, "2.2.0")) {
+            return true;        
+        }
+        return false;
+    }
+
+    function defaultInstallHandler(app, platform, cb,
+                                   isAutoinstall, needRelaunch, launchFunc) {
+        var installFunc = function() {
+            doInstall(app, platform, cb, launchFunc);
+        };
+
+        var s = doValidate(platform);
+        if (!notNull(s)) { //platform match => nothing to install
+            if (notNull(launchFunc)) {
+                launchFunc();
+            }
+        }
+
+        var isUpgrade = notNull(s) && (s.javafxStatus() == "old" || s.jreStatus() == "old");
+        if (notNull(app.placeholder)) { //embedded
+            if (canJavaFXCoBundleSatisfy(platform)) { //if both JRE and FX are missing we will start install from JRE
+                //it is only JRE that needs to be updated
+               showClickToInstall(app, true, isUpgrade, isAutoinstall, needRelaunch, installFunc);
+            } else {
+               showClickToInstall(app, (s.jreStatus() != "ok"), isUpgrade, isAutoinstall, needRelaunch, installFunc);
+            }
+        } else { //webstart
+          var r = isAutoinstall;
+          var msg = null;
+          if (!r) {
+             if (canJavaFXCoBundleSatisfy(platform)) { //if both JRE and FX are missing we will start install from JRE
+                 //it is only JRE that needs to be updated
+                 if (isUpgrade) {
+                     msg = "A newer version of Java is required to view the content on this page. Please click here to update Java.";
+                 } else {
+                     msg = "To view the content on this page, please click here to install Java.";
+                 }
+                 r = confirm(msg);
+             } else {
+                 if (isUpgrade) {
+                     msg = "A newer version of JavaFX is required to view the content on this page. Please click here to update JavaFX.";
+                 } else {
+                     msg = "To view the content on this page, please click here to install JavaFX.";
+                 }
+                 r = confirm(msg);
+             }
+          }
+          if (r)
+             installFunc();
+        }
+    }
+    
+    /** 
+     * returns true if we can enable DT plugin auto-install without chance of
+     * deadlock on cert mismatch dialog
+     *
+     * requestedJREVersion param is optional - if null, it will be
+     * treated as installing any JRE version
+     * 
+     * DT plugin for 6uX only knows about JRE installer signed by SUN cert.
+     * If it encounter Oracle signed JRE installer, it will have chance of
+     * deadlock when running with IE.  This function is to guard against this.
+     */
+    function enableWithoutCertMisMatchWorkaround(requestedJREVersion) {
+
+       // Non-IE browser are okay
+       if (!ua.ie) return true;
+
+       // if DT plugin is 10.0.0 or above, return true
+       // This is because they are aware of both SUN and Oracle signature and
+       // will not show cert mismatch dialog that might cause deadlock
+       if (versionCheck("10.0.0+", getPlugin().version)) {
+          return true;
+       }
+
+       // If we got there, DT plugin is 6uX
+
+       if (requestedJREVersion  == null) {
+          // if requestedJREVersion is not defined - it means ANY.
+          // can not guarantee it is safe to install ANY version because 6uX 
+          // DT does not know about Oracle certificates and may deadlock
+          return false;
+       }
+
+       // 6u32 or earlier JRE installer used Sun certificate
+       // 6u33+ uses Oracle's certificate
+       // DT in JRE6 does not know about Oracle certificate => can only 
+       // install 6u32 or earlier without risk of deadlock
+       return !versionCheck("1.6.0_33+", requestedJREVersion);
+    }
+    
+    // return true if we can auto-install to satisfy the platform requirement
+    // return false otherwise
+    // 
+    // We can auto-install if all below is true:
+    //   - windows platform
+    //   - native DT plugin available
+    //   - if JRE install is required, JRE exe is signed by compatible 
+    //       certificate
+    //   - if FX install is required, JRE co-bundle can satisfy the 
+    //       requirement or DT plugin supports FX auto-install
+    function isAutoInstallEnabled(platform, jre, fx) {
+       // auto-install is windows only
+       if (!ua.win) return false;
+       
+       // if no DT plugin, return false
+       // if DT plugin is there but not operational (e.g. blocked)
+       //  then pretend there is no autoinstall
+       var p = getPlugin();
+       if (p == null || !isDef(p.version)) return false;
+
+       if (jre != "ok") {
+           // need JRE install
+           if (!enableWithoutCertMisMatchWorkaround(platform.jvm)) {
+               return false;
+           }
+       }
+       
+       if (fx != "ok") {
+            if (!canJavaFXCoBundleSatisfy(platform)) {
+                // no cobundle, check if there is standalone FX auto-install
+                // DT from Java 7 or later should be ok
+                if (!versionCheck("10.0.0+", getPlugin().version)) {
+                    return false;
+                }
+            } else {
+                // we are going to install co-bundle JRE - check if we can do
+                // that
+                if (!enableWithoutCertMisMatchWorkaround(minJRECobundleVersion)) {
+                    return false;
+                }
+            }
+        }
+        return true;
+    }
+
+    function doInstall(app, platform, cb, postInstallFunc) {
+        var s = doValidate(platform);
+
+        cb = new dtjava.Callbacks(cb);
+
+        if (notNull(s) && s.isUnsupportedPlatform()) {
+            reportPlatformError(app, s, cb);
+            return false; //no install
+        }
+
+        var placeholder = (app != null) ? app.placeholder : null;
+
+        var codes, status;
+        if (isMissingComponent(s)) { //otherwise nothing to install
+            if (s.canAutoInstall()) {
+                var p = getPlugin();
+                //helper function to launch FX installer
+                var installFX = function() {
+                    var handleResultFX = function(cd) {
+                        //return codes from DT (JREInstall.h) where BASE is 10000:
+                        //  #define INSTALL_ERR_SUCCESS  BASE+0
+                        //  #define INSTALL_ERR_STARTED  BASE+1
+                        //  #define INSTALL_ERR_DOWNLOAD BASE+2
+                        //  #define INSTALL_ERR_VALIDATE BASE+3
+                        //  #define INSTALL_ERR_EXEC     4
+                        //  #define INSTALL_ERR_PLATFORM BASE+5
+                        //  #define INSTALL_ERR_SYSTEM   BASE+6
+                        //  #define INSTALL_ERR_USER_CANCEL BASE+7
+                        if (cd == 10000+1) { //skip start notification
+                           return;
+                        }
+                        codes = ["success", "ignore", "error:download", "error:generic",
+                            "error:generic", "error:generic", "error:generic", "error:cancelled"];
+                        if (cd > 19900) {
+                            //we got process exit code (20000 + code) and it is not good
+                            //for now treat everything as same error
+                            if (cd == 20000 + 1602 || cd === 20000 - 2) {
+                                //-2 is exit code for welcome panel
+                                //1602 is MSI exit code for user cancel
+                                status = "error:cancelled";
+                            } else {
+                                status = "error:generic";
+                            }
+                        } else if (cd >= 10000 && cd <= 19900) {
+                            //this is DT error case
+                            status = (cd >= 10000 && cd < 10000+codes.length) ?
+                                codes[cd-10000] : "error:unknown";
+                        } else {
+                            //Generally we do not expect codes in this range
+                            // unless it is old DT?
+                            //JRE7 DT will return 1 for any error
+                            status = "error:generic";
+                        }
+                        if (isDef(cb.onInstallFinished)) {
+                            cb.onInstallFinished(placeholder, "javafx",
+                                                 status, s.isRelaunchNeeded());
+                        }
+                        if (cd == 0) { //proceed on success only
+                            if (notNull(postInstallFunc)) {
+                                postInstallFunc();
+                            }
+                        }
+                    }
+                    //TODO: hook install progress callback once installer support it
+                    if (isDef(cb.onInstallStarted)) {
+                        cb.onInstallStarted(placeholder, "JavaFX",
+                        //need to restart as DT plugin is used for sure ..
+                        //TODO: restart not needed if can detect FX version
+                        //  (if DT does not know how to detect then
+                        //   need to restart)
+                        // NOte - for launchable apps it is different!
+                                            true, true);
+                    }
+                    var ret = 0;
+                    try {
+                       //try new way (callbacks first)
+                       ret = p.installJavaFX(platform.javafx, handleResultFX);
+                    } catch (ee) { //in IE it will throw exception,
+                                   //in FF/Chrome will return 0
+                        ret = 0;
+                    }
+                    if (ret == 0) { //failed to call installJavaFX with 2 args
+                           // or we called it but it did nothing (returned -1)
+                           // => will try to use JRE7 API (one arg and no callbacks)
+                           ret = p.installJavaFX(platform.javafx);
+                           setTimeout(function() {
+                               //ret will be boolean here
+                               setTimeout(function() {handleResultFX(ret ? 1:0)}, 0);
+                           }, 0);
+                    }
+                }
+                if (s.jre != "ok" || canJavaFXCoBundleSatisfy(platform)) {
+                    //TODO: hook install progress callback once installer support it
+                    //NB: we use setTimeout here to make sure main thread
+                    //    will get control before we stuck in the call to launch installer
+                    //    This way UI can be updated.
+                    setTimeout(function() {
+                        var handleResultJRE = function(cc) {
+                            if (cc == 10000+1) { //skip start notification
+                              return;
+                            }
+                            if (cc > 19900) {
+                               //we got process exit code (20000 + code) and it is not good
+                               //for now treat everything as same error
+                               //TODO: separate user cancel event
+                               status = "error:generic";
+                            } else if (cc == -1) {
+                               status = "error:generic";
+                            } else if (cc > 10000) { //DT error
+                               status = "error:generic";
+                            } else if (cc == 0) {
+                                status = "success";
+                            } else {
+                                status = "error:generic"; //just in case
+                            }
+                            if (isDef(cb.onInstallFinished)) {
+                               cb.onInstallFinished(placeholder, "jre",
+                                               status, s.isRelaunchNeeded());
+                            }
+                            //may also need to launch FX install but only on success!
+                            if (cc == 0) {
+                                //revalidate, if it was cobundle install there is a chance we are good by now
+                                s = doValidate(platform);
+                                if (s != null && s.jre == "ok" && !noFXAutoInstall && s.fx != "ok" ) {
+                                    setTimeout(installFX, 0);
+                                } else {
+                                    //nothing more to install => call postInstallFunction
+                                    if (postInstallFunc != null) {
+                                        postInstallFunc();
+                                    }
+                                }
+                            }
+                        }
+                        if (isDef(cb.onInstallStarted)) {
+                            cb.onInstallStarted(placeholder, "Java",
+                                                true, true);
+                        }
+
+                        var ret = 0;
+
+                        try {
+                           // pass in javafx requirement and see if we can
+                           // install a co-bundle that satisfy the application
+                           // requirement
+                           ret = p.installJRE(platform.jvm, platform.javafx, 
+                                    handleResultJRE);
+                        } catch (ee) { //in IE it will throw exception,
+                                       //in FF/Chrome will return 0
+                            ret = 0;
+                        }
+
+                        if (ret == 0) {
+                                       
+                            var jvm_req = platform.jvm;
+
+                            if (s.fx != "ok" && canJavaFXCoBundleSatisfy(platform)) {
+                                // We would like to avoid standalone JavaFX
+                                // Runtime install if possible (unless app
+                                // requires JRE 6*)
+                                // 
+                                // Starting in 7u6 - JavaFX runtime is co-bundle
+                                // inside JRE.
+                                // So if we need to install JavaFX, and the
+                                // application platform requirement can allow
+                                // JRE 7u6+ and FX 2.2+, we will try to increase
+                                // the minimum platform requirement to 7u6
+                                // to install co-bundle JRE, which should
+                                // satisfy the application requirement and avoid
+                                // standalone JavaFX install
+                                // 
+                                // override java and javafx version requirement to latest
+                                // co-bundle
+                                jvm_req = minJRECobundleVersion;
+                                if (platform.jvm.indexOf('*') != -1) {
+                                    jvm_req += "*";
+                                } else if (platform.jvm.indexOf('+') != -1) {
+                                    jvm_req += "+";
+                                }
+                            }          
+                            
+                            try {
+                                //since 7-client/FX2.0 installJRE may take additional
+                                // callback argument.
+                                ret = p.installJRE(jvm_req, handleResultJRE);
+                            } catch (ee) { //in IE it will throw exception,
+                                //in FF/Chrome will return 0
+                                ret = 0;
+                            }
+
+                            if (ret == 0) {
+                               // //failed to call installRE
+                               // or we called it but it did nothing (returned -1)
+                               // => will try to use old API (one arg and no callbacks)
+                               try {
+                                  ret = p.installJRE(jvm_req);
+                               } catch (ee) {
+                                   ret = 0; //just in case we got exception
+                               }
+                               setTimeout(function() {
+                                   setTimeout(function() {handleResultJRE(ret)}, 0);
+                               }, 0);
+                            }
+                        }
+                    }, 0);
+                } else if (!noFXAutoInstall && s.fx != "ok") {
+                    setTimeout(installFX, 0);
+                }
+            } else {
+                //auto install not possible => can only do manual install
+                //
+                //Start from JRE install first, even if it is JavaFX case but cobundle can help
+                if (s.jre != "ok" || canJavaFXCoBundleSatisfy(platform)) {
+                    if (isDef(cb.onInstallStarted)) {
+                        cb.onInstallStarted(placeholder, "Java",
+                                            false, getPlugin() != null);
+                    }
+                    startManualJREInstall();
+                } else if (s.fx != "ok") {
+                    if (isDef(cb.onInstallStarted)) {
+                        cb.onInstallStarted(placeholder, "JavaFX",
+                                            false, getPlugin() != null);
+                    }
+                    startManualFXInstall();
+                } else { //what it could be??
+                  reportPlatformError(app, s, cb);
+                }
+            }
+        } else {
+            //nothing to install
+            if (postInstallFunc != null) {
+                postInstallFunc();
+            }
+            return true;
+        }
+        //no install initiated
+        return false;
+    }
+
+    //just open download URL in new window
+    function startManualJREInstall() {
+        w.open(getJreUrl());
+    }
+
+    //just open download URL in new window
+    function startManualFXInstall() {
+        w.open(javafxURL);
+    }
+
+    function defaultGetSplashHandler(ld) {
+        if (ld.placeholder != null) {
+            var _w = ld.width, _h = ld.height;
+            //prepare image
+            //if width and height are relative then comparison with int will be false
+            //  and we will end up using large image. This is on purpose
+            //  as it is unlikely that relative dimensions are used for tiny applet areas
+            var isBig = !(_w < 100 && _h < 100);
+            var iU = isBig ? 'javafx-loading-100x100.gif' : 'javafx-loading-25x25.gif';
+            var iW = isBig ? 80 : 25;
+            var iH = isBig ? 80 : 25;
+
+            var img = d.createElement("img");
+            img.src = jscodebase + iU;
+            img.alt = "";
+            //position in the center of the container
+            img.style.position = "relative";
+            img.style.top = "50%";
+            img.style.left = "50%";
+            img.style.marginTop =  normalizeDimension(-iH/2);
+            img.style.marginLeft = normalizeDimension(-iW/2);
+
+            return img;
+        } else {
+            //webstart or install case
+            //TODO: show some html splash for webstart? how to hide it?
+            return null;
+        }
+    }
+
+    function defaultGetNoPluginMessageHandler(app) {
+        if (app.placeholder != null) {
+            var p = d.createElement("p");
+            p.appendChild(d.createTextNode("FIXME - add real message!"));
+            return p;
+        } //no op if not embedded content
+        return null;
+    }
+
+    //remove all child elements for given node
+    function wipe(c) {
+        while(c.hasChildNodes()) c.removeChild(c.firstChild);
+    }
+
+    function defaultInstallStartedHandler(placeholder, component, isAuto, restartNeeded) {
+        if (placeholder != null) {
+            var code = null;
+            if (isAuto) {
+                code = (component == "JavaFX") ?
+                    "install:inprogress:javafx": "install:inprogress:jre";
+            } else {
+                code = (component == "JavaFX") ?
+                    "install:inprogress:javafx:manual" : "install:inprogress:jre:manual";
+            }
+
+            appletInfoMsg(code);
+        }
+    }
+
+    function defaultInstallFinishedHandler(placeholder, component, status, relaunch) {
+        var t;
+        if (status != "success") {
+            var msg = null;
+            if (component == "javafx") {
+                if (!doublecheckJrePresence()) { //guess if we failed due to no JRE
+                    //need to request to install JRE first
+                    msg = "install:fx:error:nojre";
+                } else {
+                    msg = "install:fx:"+status;
+                }
+            } else { //must be JRE error
+                msg = "install:jre:"+status;
+            }
+            if (placeholder != null) {
+                t = appletErrorMsg(msg, null);
+
+                //Instead of hiding splash and applet we simply clear the container
+                //We are not going to show neither splash nor applet anyways ...
+                wipe(placeholder);
+                placeholder.appendChild(t);
+            } else {
+                w.alert(webstartErrorMsg(msg));
+            }
+        } else { //success
+            if (relaunch) {
+                t = appletInfoMsg("install:fx:restart");
+
+                //Instead of hiding splash and applet we simply clear the container
+                //We are not going to show neither splash nor applet anyways ...
+                wipe(placeholder);
+                placeholder.appendChild(t);
+            }
+        }
+    }
+
+    function defaultDeployErrorHandler(app, r) {
+        if (r == null) {
+            code = "success";
+        } else if (r.isUnsupportedBrowser()) {
+            code = "browser";
+        } else if (r.jreStatus() != "ok") {
+            code = "jre:" + r.jreStatus();
+        } else if (r.javafxStatus() != "ok") {
+            code = "javafx:" + r.javafxStatus();
+        } else if (r.isRelaunchNeeded()) {
+            code = "relaunch";
+        } else {
+            code = "unknown " + r.toString();
+        }
+
+        if (app.placeholder != null) {//embedded app
+            showAppletError(app.id, code, null);
+        } else { //webstart or install case
+            w.alert(webstartErrorMsg(code));
+        }
+    }
+
+    function defaultRuntimeErrorHandler(id) {
+        var el_applet = findAppletDiv(id);
+
+        if (getErrorDiv(id) != null) {
+            showAppletError(id, "launch:fx:generic:embedded",
+                function() {showHideApplet(findAppletDiv(id), false); return false;});
+        } else {
+            w.alert(webstartErrorMsg("launch:fx:generic"));
+        }
+    }
+
+    //TODO: Does availability of object mean initialization is completed (or even started?)
+    //Can we expect that any subsequent call to this object will actually work?
+    //Perhaps it is false alarm
+    function getPlugin() {
+        navigator.plugins.refresh(false);
+        return document.getElementById('dtjavaPlugin');
+    }
+
+    function installNativePlugin() {
+        //already installed?
+        if (getPlugin() != null) return;
+
+        //can not install plugin now as page has no body yet, postpone
+        //NB: use cbDone here to avoid infinite recursion (corner case)
+        if (!notNull(d.body) && !cbDone) {
+            addOnDomReady(function() {
+                installNativePlugin();
+            });
+            return;
+        }
+
+        var p = null;
+        if (ua.ie) {
+            p = d.createElement('object');
+            //TODO: zero size does not work?? How we can make it less intrusive for layout?
+            p.width  = '1px';
+            p.height = '1px';
+            //new CLSID, one with 0000-0000 had been kill bit
+            p.classid = 'clsid:CAFEEFAC-DEC7-0000-0001-ABCDEFFEDCBA';
+        } else {
+            // Safari and Opera browsers find the plugin but it
+            // doesn't work, so until we can get it to work - don't use it.
+            if (!ua.wk && !ua.op && navigator.mimeTypes != null) {
+                // mime-type of the DeployToolkit plugin object
+                // (do not care about old DT plugin anymore)
+                var mimeType = 'application/java-deployment-toolkit';
+                var newDT = false;
+                for (var i = 0; i < navigator.mimeTypes.length; i++) {
+                    var mt = navigator.mimeTypes[i];
+                    newDT = newDT || ((mt.type == mimeType) && mt.enabledPlugin);
+                }
+                if (newDT) {
+                    p = d.createElement('embed');
+                    p.setAttribute('type', newDT ? mimeType : oldMimeType);
+                    p.setAttribute('hidden', 'true');
+                }
+            }
+        }
+        if (p != null) {
+            p.setAttribute('id', 'dtjavaPlugin');
+            d.body.appendChild(p);
+        }
+    }
+
+    var appletCounter = 0;
+
+    function prepareAppletID(ld) {
+        if (notNull(ld.id)) {
+            return ld.id;
+        } else {
+            appletCounter++;
+            return ("dtjava-app-" + appletCounter);
+        }
+    }
+
+    //returns object that represents an applet/object tag
+    function getAppletSnippet(ld, platform, cb) {
+        //we use wrapper div here as changing style on applet tag
+        // cause liveconnect to be initialized and slows down startup
+        var wrapper = d.createElement("div");
+        wrapper.width = normalizeDimension(ld.width);
+        wrapper.height = normalizeDimension(ld.height);
+        wrapper.id = ld.id + "-app";
+        //without this it splash will not work in Chrome
+        wrapper.style.position = "relative";
+
+        var r = d.createElement("applet"); //TODO: use object!
+
+        r.code = "dummy.class";
+        r.id = ld.id;
+        r.width = normalizeDimension(ld.width);
+        r.height = normalizeDimension(ld.height);
+
+        //things added unconditionally
+        var sparams = {"jnlp_href" : ld.url,
+            "java_status_events" : true,
+            "type" : "application/x-java-applet"};
+
+        if (notNull(ld.jnlp_content)) {
+            sparams['jnlp_embedded'] = ld.jnlp_content;
+        }
+        if (notNull(platform.javafx)) {
+            //for swing applications embedding FX we do not want this property as it will 
+            // trigger FX toolkit and lead to app failure!
+            if (!notNull(ld.toolkit) || ld.toolkit == "fx") {
+               sparams["javafx_version"] = ((platform.javafx == "*") ? "2.0+" : platform.javafx);
+            }
+            //FX requires new VM per applet, do it unconditionally
+            sparams["separate_jvm"] = true;
+            sparams["javafx_applet_id"] = r.id;
+            //enable scripting for FX unconditionally for now
+            sparams["scriptable"] = true;
+        } else {
+            if (ld.scriptable) {
+                sparams["scriptable"] = true;
+            }
+            if (ld.sharedjvm) {
+                sparams["separate_jvm"] = true;
+            }
+        }
+        if (notNull(platform.jvmargs)) {
+            sparams["java_arguments"] = platform.jvmargs;
+        }
+
+        //prepare parameters first
+        var key, p;
+        for (key in ld.params) {
+            //do not let to override system parameters
+            if (!notNull(sparams[key])) {
+                p = d.createElement("param");
+                p.name = key;
+                p.value = ld.params[key];
+                r.appendChild(p);
+            }
+        }
+        for (key in sparams) {
+            p = d.createElement("param");
+            p.name = key;
+            p.value = sparams[key];
+            r.appendChild(p);
+        }
+
+        if (isDef(cb.onGetNoPluginMessage)) {
+            p = d.createElement("noapplet");
+            var t = cb.onGetNoPluginMessage(ld);
+            p.appendChild(t);
+            //TODO: FIXME: following line fails for me in IE7??
+            //r.appendChild(p);
+        }
+
+        wrapper.appendChild(r);
+        return wrapper;
+    }
+
+    function findAppletDiv(id) {
+        //TODO: FIXME: in static deployment scenario this seem to cause restart of plugin (in FF)
+        //Weird but similar code works in the deployJava.js ...
+        //TODO: reinvestigate
+        var el = d.getElementById(id + "-app");
+        if (el == null) { //wrapping div for applet is not required
+            el = d.getElementById(id);
+        }
+        return el;
+    }
+
+    //IMPORTANT: whilst we can update style on the applet element itself
+    //  this is not best idea as this may also cause wait till liveconnect
+    //  is initialized and slow startup.
+    function showHideApplet(div, hide) {
+        if (!notNull(div)) return;
+        if (hide) {
+            div.style.left = -10000;
+        } else {
+            div.style.left = "0px";
+        }
+    }
+
+    function showHideDiv(div, hide) {
+        if (!notNull(div)) return;
+        if (hide) {
+            div.style.visibility = "hidden";
+        } else {
+            div.style.visibility = "visible";
+        }
+    }
+
+    function doHideSplash(id) {
+        try {
+            var errPane = getErrorDiv(id);
+            if (errPane != null && errPane.style != null && errPane.style.visibility == "visible") {
+                //if we have error pane shown then ignore this request
+                // (could be race condition and applet is asking to hide splash to show error too)
+                return;
+            }
+
+            var el = findAppletDiv(id);
+            showHideApplet(el, false);
+
+            //show applet first and then hide splash to avoid blinking
+            showHideDiv(d.getElementById(id + "-splash"), true);
+        } catch(err) {}
+    }
+
+    var javafxURL = "http://java.com/javafx";
+
+    //TODO: validate ALL messages are shown as expected and when expected (for applet/webstart/install)
+    var errorMessages = {
+        "launch:fx:generic" : ["JavaFX application could not launch due to system configuration.",
+            " See ", "a", "http://java.com/javafx", "java.com/javafx",
+            " for troubleshooting information."],
+        "launch:fx:generic:embedded" : ["JavaFX application could not launch due to system configuration ",
+            "(", "onclick", "show error details", ").",
+            " See ", "a", "http://java.com/javafx", "java.com/javafx",
+            " for troubleshooting information."],
+        "install:fx:restart" : ["Restart your browser to complete the JavaFX installation,",
+            " then return to this page."],
+        "install:fx:error:generic" : ["JavaFX install not completed.",
+            " See ", "a", "http://java.com/javafx", "java.com/javafx",
+            " for troubleshooting information."],
+        "install:fx:error:download" : ["JavaFX install could not start because of a download error.",
+            " See ", "a", "http://java.com/javafx", "java.com/javafx",
+            " for troubleshooting information."],
+        "install:fx:error:cancelled" : ["JavaFX install was cancelled.",
+            " Reload the page and click on the download button to try again."],
+        "install:jre:error:cancelled" : ["Java install was cancelled.",
+            " Reload the page and click on the download button to try again."],
+        "install:jre:error:generic" : ["Java install not completed.",
+            " See ", "a", "http://java.com/", "java.com",
+            " for troubleshooting information."],
+        "install:jre:error:download" : ["Java install could not start because of a download error.",
+            " See ", "a", "http://java.com/", "java.com/",
+            " for troubleshooting information."],
+        "install:inprogress:jre" : ["Java install in progress."],
+        "install:inprogress:javafx" : ["JavaFX install in progress."],
+        "install:inprogress:javafx:manual" : ["Please download and run JavaFX Setup from ",
+            "a", getFxUrl(null), "java.com/javafx",
+            ". When complete, restart your browser to finish the installation,",
+            " then return to this page."],
+        "install:inprogress:jre:manual" : ["Please download and run Java Setup from ",
+            "a", getJreUrl(), "java.com/download",
+            ". When complete, reload the page."],
+        "install:fx:error:nojre" : ["b", "Installation failed.", "br",
+            "Java Runtime is required to install JavaFX and view this content. ",
+            "a", getJreUrl(), "Download Java Runtime",
+            " and run the installer. Then reload the page to install JavaFX."],
+        "browser":    [ 'Content can not be displayed using your Web browser. Please open this page using another browser.'],
+        "jre:none":    [ 'JavaFX application requires a recent Java runtime. Please download and install the latest JRE from ',
+            'a', 'http://java.com', "java.com", '.'],
+        "jre:old" :    [ 'JavaFX application requires a recent Java runtime. Please download and install the latest JRE from ',
+            'a', 'http://java.com', "java.com", '.'],
+        "jre:plugin":  ['b', "A Java plugin is required to view this content.", 'br',
+            "Make sure that ", "a", 'http://java.com', "a recent Java runtime",
+            " is installed, and the Java plugin is enabled."],
+        "jre:blocked": ["Please give Java permission to run. This will allow Java to present content provided on this page."],
+        "jre:unsupported": ["b", "Java is required to view this content but Java is currently unsupported on this platform.",
+            "br", "Please consult ", "a", "http://java.com", "the Java documentation",
+            " for list of supported platforms."],
+        "jre:browser" : ["b", "Java plugin is required to view this content but Java plugin is currently unsupported in this browser.",
+            "br", "Please try to launch this application using other browser. Please consult ",
+            "a", "http://java.com", "the Java documentation",
+            " for list of supported browsers for your OS."],
+        "javafx:unsupported" : ["b", "JavaFX 2.0 is required to view this content but JavaFX is currently unsupported on this platform.",
+            "br", "Please consult ", "a", javafxURL, "the JavaFX documentation",
+            " for list of supported platforms."],
+        "javafx:old" :    [ 'This application requires newer version of JavaFX runtime. ',
+            'Please download and install the latest JavaFX Runtime from ',
+            'a', javafxURL, "java.com/javafx", '.'],
+        "javafx:none" : ["b", "JavaFX 2.0 is required to view this content.",
+            "br", "a", javafxURL, "Get the JavaFX runtime from java.com/javafx",
+            " and run the installer. Then restart the browser."],
+        "javafx:disabled" : ["JavaFX is disabled. Please open Java Control Panel, switch to Advanced tab and enable it. ",
+            "Then restart the browser."],
+        "jre:oldplugin" : ["New generation Java plugin is required to view this content." +
+                " Please open Java Control Panel and enable New Generation Java Plugin."],
+        "jre:disabled" : ["Java plugin appear to be disabled in your browser. ",
+                " Please enable Java in the browser options."]
+    };
+
+    //assume we get list of (tag, param, text) where both param and tag are optional
+    // Supported tags:
+    //  ("a", href value, link text)
+    //  ("b", text)
+    //  ("br")
+    //  (text) //text can not be the same as any of tag names
+    function msgAsDOM(lst, extra, onClickFunc) {
+        var i = 0;
+        var root = d.createElement("p");
+
+        if (extra != null) {
+            root.appendChild(extra);
+        }
+        var el;
+        while (i < lst.length) {
+            switch (lst[i]) {
+                case "a":
+                    el = d.createElement(lst[i]);
+                    el.href = lst[i + 1];
+                    el.appendChild(d.createTextNode(lst[i + 2]));
+                    i = i + 2;
+                    break;
+                case "br":
+                    el = d.createElement(lst[i]);
+                    break;
+                case "b":
+                    el = d.createElement(lst[i]);
+                    el.appendChild(d.createTextNode(lst[i + 1]));
+                    i++;
+                    break;
+                case "onclick":
+                    el = d.createElement("a");
+                    el.href = "";
+                    if (onClickFunc == null) {
+                       onClickFunc = function() {return false;}
+                    }
+                    el.onclick = onClickFunc;
+                    el.appendChild(d.createTextNode(lst[i + 1]));
+                    i = i + 1;
+                    break;
+                default:
+                    el = d.createTextNode(lst[i]);
+                    break;
+            }
+            root.appendChild(el);
+            i++;
+        }
+        return root;
+    }
+
+    function webstartErrorMsg(code) {
+        var m = "";
+        var lst = errorMessages[code];
+        var i = 0;
+        if (notNull(lst)) {
+          while (i < lst.length) {
+              if (lst[i] != 'a' && lst[i] != 'br' && lst[i] != 'b') {
+                  m += lst[i];
+              } else if (lst[i] == 'a') { //next element is link => skip it
+                  i++;
+              }
+              i++;
+          }
+        } else {
+            m = "Unknown error: ["+code+"]";
+        }
+        return m;
+    }
+
+    function getErrorDiv(id) {
+        return d.getElementById(id + "-error");
+    }
+
+    function showAppletError(id, code, onclickFunc) {
+        var pane = getErrorDiv(id);
+
+        if (!notNull(pane)) { //should not be possible, we add error pane right a way and then add it again before we add splash/app
+            return;
+        }
+
+        //remove old content in the ERROR PANE only (if any)
+        wipe(pane);
+
+        //populate and show pane
+        pane.appendChild(appletErrorMsg(code, onclickFunc));
+        pane.style.visibility = "visible";
+
+        //hide splash and applet
+        showHideDiv(d.getElementById(id+"-splash"), true);
+        showHideApplet(findAppletDiv(id), true);
+    }
+
+    //returns DOM subtree
+    function appletErrorMsg(code, onclickFunc) {
+        var out = d.createElement("div");
+        var img = d.createElement("img");
+        img.src = jscodebase + 'error.png';
+        img.width = '16px';
+        img.height = '16px';
+        img.alt = "";
+        img.style.cssFloat = "left";
+        img.style.styleFloat = "left"; //IE way
+        img.style.margin = "0px 10px 60px 10px";
+        img.style.verticalAlign="text-top";
+
+        var m = errorMessages[code];
+        //error message is missing => show code as fallback
+        if (!notNull(m)) {
+            m = [code];
+        }
+
+        var hideFunc = null;
+
+        if (isDef(onclickFunc)) {
+            hideFunc = function() {
+                if (notNull(out.parentNode)) {
+                  out.parentNode.removeChild(out);
+                }
+                try {
+                    onclickFunc();
+                } catch (e) {}
+                return false;
+            }
+        }
+
+        out.appendChild(msgAsDOM(m, img, hideFunc));
+        return out;
+    }
+
+    //returns DOM subtree
+    function appletInfoMsg(code) {
+        var out = d.createElement("div");
+
+        var m = errorMessages[code];
+        //error message is missing => show code as fallback
+        if (!notNull(m)) {
+            m = [code];
+        }
+
+        out.appendChild(msgAsDOM(m, null, null));
+        return out;
+    }
+
+    function normalizeApp(ld, acceptString) {
+        var app = null;
+        //normalize launch descriptor
+        if (notNull(ld)) {
+            //could be either url or set of parameters
+            if (acceptString && typeof ld === 'string') {
+                app = new dtjava.App(ld, null);
+            } else if (ld instanceof dtjava.App) {
+                app = ld;
+            } else {
+                app = new dtjava.App(ld.url, ld);
+            }
+        }
+        return app;
+    }
+
+    function setupAppletCallbacks(platform, callbacks) {
+        //set default callbacks
+        var cb = new dtjava.Callbacks(callbacks);
+
+        //disable splash if it is was not requested explicitly and
+        // it is not JavaFX app
+        if (platform.javafx == null && cb.onGetSplash === defaultGetSplashHandler) {
+            cb.onGetSplash = null;
+        }
+        return cb;
+    }
+
+    //width and height in styles need to have unit type explicitly referenced
+    // or they will not conform to strict doctypes
+    //On other hand we can have relative dimensions, e.g. 100% and these are fine without units
+    //
+    //This method will add unit type to numeric dimension specifications. E.g.
+    //   400 => 400px
+    //   -10 => -10px
+    //   50% => 50%
+    function normalizeDimension(v) {
+        if (isFinite(v)) {
+            return v + 'px';
+        } else {
+            return v;
+        }
+    }
+
+    //wrap given node s in the div
+    function wrapInDiv(ld, s, suffix) {
+        var sid = ld.id + "-" + suffix;
+        var div = d.createElement("div");
+        div.id = sid;
+        div.style.width = normalizeDimension(ld.width);
+        //this does not work well for different browsers
+        //if height is relative ...
+        //For firefox it becomes better if 100% is hardcode
+        // but then image is off in Chrome and it does not work in IE too ...
+        div.style.height = normalizeDimension(ld.height);
+        div.style.position = "absolute";
+        //TODO: provide way to specify bgcolor
+        // Perhaps app.style.bgcolor, app.style.splash-image, ... ?
+        // What was the param name supported by regular applet?
+        div.style.backgroundColor = "white";
+        if (s != null) {
+            div.appendChild(s);
+        }
+        return div;
+    }
+
+    var pendingCallbacks = {};
+
+    function doInstallCallbacks(id, cb) {
+        if (cb == null) {
+            cb = pendingCallbacks[id];
+            if (notNull(cb)) {
+              pendingCallbacks[id] = null;
+            } else {
+                return;
+            }
+        }
+        var a = document.getElementById(id);
+        if (!notNull(a)) return;
+
+        if (isDef(cb.onJavascriptReady)) {
+            var onReady = cb.onJavascriptReady;
+            if (a.status < 2) { //not READY yet
+              a.onLoad = function() {
+                  onReady(id);
+                  a.onLoad = null; //workaround bug in plugin for IE in JRE7
+              }
+            }
+        }
+
+        if (isDef(cb.onRuntimeError)) {
+            if (a.status < 3) { //not ERROR or READY yet
+               a.onError = function() {
+                  cb.onRuntimeError(id);
+                  //This used to be added as
+                  //  "workaround bug in plugin for IE in JRE7"
+                  //I do not have recollection what the bug was
+                  // and can not reproduce it now
+                  //(perhaps multiple calls into callback?)
+                  //With FX 2.0 it cause restart of the applet in IE
+                  // for reason that is not completely clear
+                  //Disable it for now
+                  /*   a.onError = null; */
+              }
+            } else if (a.status == 3) { //already failed, call handler in place
+               cb.onRuntimeError(id);
+            }
+        }
+    }
+
+
+    //we can not install applet callbacks until applet is instantiated as
+    //hook entry points are not defined and we do not control when applet is
+    //instantiated as developer may not add it to the DOM tree for a while.
+    //
+    //Therefore what we do is we insert <script> element AFTER applet tag
+    //to initiate install after applet tag is parsed
+    //
+    //However, we can not
+    //
+    function getSnippetToInstallCallbacks(id, cb) {
+        if (!notNull(cb) || !(isDef(cb.onDeployError) || isDef(cb.onJavascriptReady))) {
+            return null;
+        }
+
+        var s = d.createElement("script");
+        pendingCallbacks[id] = cb;
+        s.text = "dtjava.installCallbacks('"+id+"')";
+        return s;
+    }
+
+    function getErrorPaneSnippet(app) {
+        var paneDiv = wrapInDiv(app, null, "error");
+        paneDiv.style.visibility = "hidden";
+        return paneDiv;
+    }
+
+    function doEmbed(ld, platform, callbacks) {
+        var app = normalizeApp(ld, false);
+        //required argument is missing
+        if (!(notNull(app) && notNull(app.url) &&
+              notNull(app.width) && notNull(app.height) && notNull(app.placeholder))) {
+            //deployment error, not runtime => exception is ok
+            throw "Required attributes are missing! (url, width, height and placeholder are required)";
+        }
+
+        app.id = prepareAppletID(app);
+
+        //if placeholder is passed as id => find DOM node
+        if ((typeof app.placeholder == "string")) {
+           var p = d.getElementById(app.placeholder);
+           if (p == null) {
+               throw "Application placeholder [id="+app.placeholder+"] not found.";
+           }
+            app.placeholder = p;
+        }
+
+        //we may fail before we even try to add splash. E.g. because it is unsupported platform
+        //make sure we have error pane in place to show error
+        app.placeholder.appendChild(getErrorPaneSnippet(app));
+
+        //if we got array we need to copy over!
+        platform = new dtjava.Platform(platform);
+
+        var cb = setupAppletCallbacks(platform, callbacks);
+
+        //allow family match to match next family
+        //Once we get to java layer we will deal with it there
+        var v = doValidateRelaxed(platform);
+        var launchFunction = function() {
+            var appSnippet = getAppletSnippet(app, platform, cb);
+            var splashSnippet = (cb.onGetSplash == null) ? null : cb.onGetSplash(ld);
+
+            //what we try to do:
+            // placeholder need to have relative positioning (then splash will pe position relative to it)
+            // if splash is present it needs to have position "absolute", then it will not occupy space
+            //  and can be placed on top of applet
+            app.placeholder.style.position = "relative";
+            if (splashSnippet != null) {
+                //position splash on top of applet area and hide applet temporarily
+                var ss = wrapInDiv(app, splashSnippet, "splash");
+                showHideDiv(ss, false);
+                showHideApplet(appSnippet, true);
+
+                wipe(app.placeholder);
+                app.placeholder.appendChild(getErrorPaneSnippet(app));
+                app.placeholder.appendChild(ss);
+                app.placeholder.appendChild(appSnippet);
+            } else {
+                wipe(app.placeholder);
+                app.placeholder.appendChild(getErrorPaneSnippet(app));
+                app.placeholder.appendChild(appSnippet);
+            }
+            //Note: this is not needed as we use setTimeout for the same
+            //var cbSnippet = getSnippetToInstallCallbacks(app.id, cb);
+            //if (cbSnippet != null) {
+            //    app.placeholder.appendChild(cbSnippet);
+            //}
+            setTimeout(function() {doInstallCallbacks(app.id, cb)}, 0);
+        };
+
+        //can not launch yet
+        if (v != null) {
+            resolveAndLaunch(app, platform, v, cb, launchFunction);
+        } else {
+            launchFunction();
+        }
+    }
+
+    function extractApp(e) {
+        if (notNull(e)) {
+            var w = e.width;    //TODO: do we need to extract number? e.g. if it was 400px? or 100%?
+            var h = e.height;
+            var jnlp = "dummy"; //Can find it from list of parameters but it is not really needed in
+                                //static deployment scenario
+            return new dtjava.App(jnlp, {
+                id: e.id,
+                width: w,
+                height: h,
+                placeholder: e.parentNode
+            });
+        } else {
+            throw "Can not find applet with null id";
+        }
+    }
+
+    function processStaticObject(id, platform, callbacks) {
+        var a = d.getElementById(id); //TODO: use findAppletDiv??
+        var app = extractApp(a);
+
+        var cb = setupAppletCallbacks(platform, callbacks);
+        //Ensure some platform is set
+        platform = new dtjava.Platform(platform);
+
+        var launchFunc = function() {
+            //add error pane
+            app.placeholder.insertBefore(getErrorPaneSnippet(app), a);
+
+            if (cb.onGetSplash != null) {
+                //TODO: show splash if it was not hidden yet!
+                var splashSnippet = cb.onGetSplash(app);
+                if (notNull(splashSnippet)) {
+                    var ss = wrapInDiv(app, splashSnippet, "splash");
+                    if (notNull(ss)) {
+                        app.placeholder.style.position = "relative";
+                        app.placeholder.insertBefore(ss, a);
+                        showHideApplet(a, true);
+                    }
+                }
+            }
+
+            //TODO: install applet callbacks if they are provided
+            //Note - in theory we need to check if callbacks are supported too
+            // but if detection was not possible then it is hard to do
+            //they always wotk for FX or jre 7+ but how validate this?
+            //otherwise attempt to set them will block js and then trigger exception ...
+        }
+
+        var v = doValidateRelaxed(platform);
+        if (v != null) {
+            //TODO: Problem
+            //  if FX missing and static deployment
+            // then JRE will try to autoinstall itself - this will cause popup
+            // Then DT will detect problem and also initiate install too
+            //   a) double install
+            //   b) if popup is canceled then we still offer to install again but it will not help applet to launch
+            //   c) popup is unconditional and really ugly ...
+            //But popup comes from JRE7 - can not fix it, on other hand 6 will go manual install route
+
+            resolveAndLaunch(app, platform, v, cb, launchFunc);
+        } else {
+            launchFunc();
+        }
+    }
+
+    function doRegister(id, platform, cb) {
+        //we will record static object and process it once onload is done
+        addOnDomReady(function() {
+            processStaticObject(id, platform, cb);
+        });
+    }
+
+    //perform basic (lightweight) initialization
+    init();
+
+    /**
+     The Java Deployment Toolkit is utility to deploy Java content in
+     the browser as applets or applications using right version of Java.
+     If needed it can initiate upgrade of user's system to install required
+     components of Java platform.
+     <p>
+     Note that some of Deployment Toolkit methods may not be fully operational if
+     used before web page body is loaded (because DT native plugins could not be instantiated).
+     If you intend to use it before web page DOM tree is ready then dtjava.js needs to be loaded inside the
+     body element of the page and before use of other DT APIs.
+
+     @class dtjava
+     @static */
+    return {
+        /**
+         Version of Javascript part of Deployment Toolkit.
+         Increasing lexicographically.
+
+         @property version
+         @type string
+         */
+        version: "20120720",
+
+        /**
+         Validate that platform requirements are met.
+
+         @param platform {Platform}
+         (Optional) set of platform requirements.
+         <p>
+
+         Default settings are
+         <ul>
+         <li>platform.jvm : "1.6+"
+         <li>platform.javafx : null
+         <li>platform.plugin : "*"
+         </ul>
+
+         @return {PlatformMismatchEvent}
+         Returns null if all requirements are met.
+         Return PlatformMismatchEvent describing the problem otherwise.
+         */
+        validate: function(platform) {
+            return doValidate(platform);
+        },
+
+        /**
+         Perform install of missing components based on given
+         platform requirements. By default if automated install is
+         not possible then manual install will be offered.
+
+         @method install
+         @param platform {Platform}
+         Description of platform requirements.
+         @param callbacks {Callbacks}
+         Optional set of callbacks to customize install experience.
+         @return {boolean}
+         Returns true if install was initiated.
+
+         */
+        install: function(platform, callbacks) {
+            return doInstall(null, platform, callbacks, null);
+        },
+
+        //              (TODO: AI: what are limitations on "connect back to origin host?"
+        //                   can someone provide us fake JNLP url to get access to other host?
+        //                   Perhaps we should support this for relative URLs only?)
+        /**
+         Launch application (not embedded into browser) based on given
+         application descriptor. If launch requirements are not met
+         then autoinstall may be initiated if requested and supported.
+         By default autoinstall is disabled.
+
+         @method launch
+         @param ld {App | string | array}
+         Application launch descriptor. Could be defined as one of following:
+         <ul>
+         <li>instance of App object,
+         <li>string with URL of application JNLP file
+         <li>or array (where URL attribute is required)
+         </ul>
+         At least link to JNLP file must be provided (could be full URL or relative to
+         document location).
+         <p>
+         Note that passing parameters through the Apps object is not supported by this method.
+         Any parameters specified will be ignored.
+
+         @param platform {Platform}
+         Optional platform requirements (such as JRE and JavaFX versions).
+
+         @param callbacks {Callbacks | array}
+         Optional set of callbacks. See Callbacks for details.
+         */
+            //this will not use jvargs either but we do not necessary need to document it
+        launch: function(ld, platform, callbacks) {
+            return doLaunch(ld, platform, callbacks);
+        },
+
+        /**
+         Embeds application into browser based on given application descriptor
+         (required elements: url of JNLP file, width and height, id or reference to placeholder node).
+         <p>
+         If JRE or JavaFX installation is required then default handler is to return "click to install" html snippet.
+         To enable autoinstall custom onDeployError handler need to be used.
+         <p>
+         If applet can not be launched because platform requirements are not met
+         (e.g. DT plugin is not available or mandatory parameters are missing)
+         return value will be null.
+         <p>
+         Set applet identifier in the launch descriptor if you want to name your
+         applet in the DOM tree (e.g. to use it from javascript later).
+
+         @method embed
+         @param ld {App | string | array}
+         Application launch descriptor. Could be defined as one of following:
+         <ul>
+         <li>instance of App object,
+         <li>array (where attribute names are same as in App object)
+         </ul>
+         At least link to JNLP file, width and height must be provided.
+         @param platform {Platform}
+         Optional platform requirements (such as JRE and JavaFX versions).
+         @param cb {Callbacks | array}
+         Optional set of callbacks. See Callbacks for details.
+         @return {void}
+         */
+        embed: function(ld, platform, cb) {
+            return doEmbed(ld, platform, cb);
+        },
+
+        /**
+         Registers statically deployed Java applet to customize loading experience
+         if Javascript is enabled.
+         <p>
+         Note that launch of statically deployed applet will be initiated
+         before this this function will get control. Hence platform
+         requirements listed here will NOT be validated prior to launch
+         and will be used if applet launch can not be initiated otherwise.
+
+         @method register
+         @param id
+         Identifier of application.
+         @param platform {Platform}
+         Optional platform requirements (such as JRE and JavaFX versions).
+         @param cb {Callbacks | array}
+         Optional set of callbacks. See Callbacks for details.
+         */
+        register: function(id, platform, callbacks) {
+            return doRegister(id, platform, callbacks);
+        },
+
+
+        /**
+         * Hides html splash panel for applet with given id.
+         * If splash panel does not exist this method has no effect.
+         * For JavaFX applications this method will be called automatically once application is ready.
+         * For Swing/AWT applets application code need to call into this method explicitly if they were deployed
+         * with custom splash handler.
+         *
+         * @method hideSplash
+         * @param id    Identifier of applet whose splash panel need to be hidden
+         */
+        hideSplash: function(id) {
+            return doHideSplash(id);
+        },
+
+        /**
+         Helper function: cross-browser onLoad support
+         <p>
+         This will call fn() once document is loaded.
+         If page is already loaded when this method is
+         called then fn() is called immediately.
+         <p>
+         If strictMode is true then fn() is called once page
+         and all its assets are loaded (i.e. when document
+         ready state will be 'complete').
+         Otherwise fn() is called after DOM tree is fully created
+         (but some assets may not yet be loaded).
+         <p>
+         It is ok to call this function multiple times. It will append
+         to existing chain of events (and do not replace them).
+
+         @method addOnloadCallback
+
+         @param {function} fn
+         (required) function to call
+
+         @param strictMode {boolean} Flag indicating whether page assets need to
+         be loaded before launch (default is false).
+         */
+        addOnloadCallback: function(fn, strictMode) {
+            //WORKAROUND for RT-21574
+            // avoid using onDomReady because it leads to deadlocks
+            if (strictMode || (ua.chrome && !ua.win)) {
+                addOnload(fn);
+            } else {
+                addOnDomReady(fn);
+            }
+        },
+
+        /**
+         * Add onJavascriptReady and onDeployError callbacks
+         * to the existing Java applet or JavaFX application.
+         * Application need to be alive in the browser DOM tree for this to work
+         *
+         * @param id {string} applet id
+         * @param cb {array}  Set of callbacks. If null then pending callbacks are installed (if any for this applet).
+         * @private
+         */
+        installCallbacks: function(id, cb) {
+            doInstallCallbacks(id, cb);
+        },
+
+        /** Platform requirements for application launch.
+
+         <p><br>
+         The version pattern strings are of the form #[.#[.#[_#]]][+|*],
+         which includes strings such as "1.6", * "2.0*", and "1.6.0_18+".
+         <p>
+
+         A star (*) means "any version within this family" where family is defined
+         by prefix and a plus (+) means "any version greater or equal to the specified version".
+         For example "1.6.0*" matches 1.6.0_25 but not 1.7.0_01,
+         whereas "1.6.0+" or "1.*" match both.
+         <p>
+         If the version pattern does not include all four version components
+         but does not end with a star or plus, it will be treated as if it
+         ended with a star.  "2.0" is exactly equivalent to "2.0*", and will
+         match any version number beginning with "2.0".
+         <p>
+         Null version string is treated as "there is no requirement to have it installed".
+         Validation will pass whether this component is installed or not.
+         <p>
+         Both "+" and "*" will match any installed version of component. However if component is not
+         installed then validation will fail.
+
+         @class Platform
+         @for dtjava
+         @constructor
+         @param r {array}
+         Array describing platform requirements. Element names should match
+         Platform properties.
+         */
+        Platform: function(r) {
+            //init with defaults
+
+            /**
+             JRE/JVM version.
+             @property jvm
+             @type version pattern string
+             @default "1.6+"
+             */
+            this.jvm = "1.6+";
+            /**
+             Minimum JavaFX version.
+             @property javafx
+             @type version pattern string
+             @default null
+             */
+            this.javafx = null;
+            /**
+             Java Plugin version.
+             If set to null then browser plugin support for embedded content is not validated.
+             @property plugin
+             @type version pattern string
+             @default "*"
+             */
+            this.plugin = "*";
+            /**
+             List of requested JVM arguments.
+             @property jvmargs
+             @type string
+             @default null
+             */
+            this.jvmargs = null;
+
+            //copy over
+            for (var v in r) {
+                this[v] = r[v];
+                //we expect jvmargs to come as array. if not - convert to array
+                if (this["jvmargs"] != null && typeof this.jvmargs == "string") {
+                    this["jvmargs"] = this["jvmargs"].split(" ");
+                }
+            }
+
+           /**
+             * @method toString
+             * @return {string}
+             *    Returns string replesentation of platform spec. Useful for debugging.
+             */
+            this.toString = function() {
+                return "Platform [jvm=" + this.jvm + ", javafx=" + this.javafx
+                + ", plugin=" + this.plugin + ", jvmargs=" + this.jvmargs + "]";
+            };
+        },
+
+        /**
+         Application launch descriptor.
+
+         @class App
+         @for dtjava
+         @constructor
+         @param url {string}
+         (Required) location of JNLP file. Could be full URL or partial
+         relative to document base.
+         @param details {array}
+         (Optional) set of values for other object properties.
+         Name should match documented object properties.
+         */
+        App: function(url, details) {
+            /**
+             Location of application's JNLP file.  Can not be null or undefined.
+             @property url
+             @type string
+             */
+            this.url = url;
+
+            //default behavior
+            this.scriptable = true;
+            this.sharedjvm = true;
+
+            if (details != undefined && details != null) {
+                /**
+                 Identifier of this App. Expected to be unique on this page.
+                 If null then it is autogenerated.
+                 @property id
+                 @type string
+                 */
+                this.id = details.id;
+                /**
+                 Base64 encoded content of JNLP file.
+                 @property jnlp_content
+                 @type string
+                 */
+                this.jnlp_content = details.jnlp_content;
+                /**
+                 Applet width. Could be absolute or relative (e.g. 50 or 50%)
+                 @property width
+                 @type string
+                 */
+                this.width = details.width;
+                /**
+                 Applet height. Could be absolute or relative (e.g. 50 or 50%)
+                 @property height
+                 @type int
+                 */
+                this.height = details.height;
+
+                /**
+                 Set of named parameters to pass to application.
+                 @property params
+                 @type array
+                 */
+                this.params = details.params;
+
+                /**
+                 If set to true then Javascript to Java bridge will be initialized.
+                 Note that some platform requirements imply Javascript bridge is initialized anyways.
+                 If set to false the Java to Javascript calls are still possible.
+
+                 //TODO: AI: will it affect applet callbacks?
+
+                 @property scriptable
+                 @type boolean
+                 @default true
+                 */
+                this.scriptable = details.scriptable;
+
+                /**
+                 True if application does not need JVM instance to be dedicated to this application.
+                 Some of platform requirements may imply exclusive use of JVM.
+                 <p>
+                 Note that even if sharing is enabled java plugin may choose to run applets in different JVM
+                 instances. There is no way to force java plugin to reuse same JVM.
+
+                 @property sharedjvm
+                 @type boolean
+                 @default true
+                 */
+                this.sharedjvm = details.sharedjvm;
+
+                /**
+                 Reference to DOM node to embed application into.
+                 If not provided by the user and application is embedded then will be allocated dynamically.
+                 <p>
+                 Note that element may be not inserted into the DOM tree yet.
+                 <p>
+                 User may also provide identifier of the existing DOM node to be used as placeholder.
+                 @property placeholder
+                 @type {DOM node | DOM node id}
+                 @default null
+                 */
+                this.placeholder = details.placeholder;
+                
+                /**
+                  Tookit used by the application.
+                  By default it is "fx" (and null is treated as JavaFX too).
+                  Swing applications embedding JavaFX components need to pass "swing"
+                */
+                this.toolkit = details.toolkit;
+            }
+
+            /**
+             * Returns string representation of this object.
+             *
+             * @return {string}
+             */
+            this.toString = function() {
+                var pstr = "null";
+                var first = true;
+                if (notNull(this.params)) {
+                    pstr = "{";
+                    for (p in this.params) {
+                        pstr += ((first) ? "" : ", ") + p + " => " + this.params[p];
+                        first = false;
+                    }
+                    pstr += "}";
+                }
+                return "dtjava.App: [url=" + this.url + ", id=" + this.id + ", dimensions=(" + this.width + "," + this.height + ")"
+                    + ", toolkit=" + this.toolkit 
+                    + ", embedded_jnlp=" + (notNull(this.jnlp_content) ? (this.jnlp_content.length + " bytes") : "NO")
+                    + ", params=" + pstr + "]";
+            }
+        },
+
+
+        /**
+         Set of callbacks to be used to customize user experience.
+
+         @class Callbacks
+         @for dtjava
+         @constructor
+         @param cb {list of callbacks}
+         set of callbacks to set
+         */
+        Callbacks: function(cb) {
+            /**
+             Callback to be called to obtain content of the splash panel. Gets application
+             launch descriptor as an input. If null is returned then splash is disabled.
+             Non-null return value is expected to be html snippet to be added into splash overlay.
+             Only applicable to embed().
+             <p>
+             Note that autohiding splash is not supported by all platforms. Splash will be hidden by default
+             for JavaFX application but not for Swing/AWT applets. In later case if use of splash is desirable
+             then app need to call dtjava.hideSplash() explicitly to initiate hiding splash.
+
+             @property onGetSplash
+             @type function(app)
+             @default Default splash panel for JavaFX applications embedded into web page, null otherwise.
+             */
+            this.onGetSplash = defaultGetSplashHandler;
+
+            /**
+             Called if embedding or launching application need
+             additional components to be installed. This callback is
+             responsible for handling such situation, e.g. reporting
+             need to install something to the user,
+             initiating installation using install() and
+             hiding splash panel for embedded apps (if needed).
+             After installation is complete callback implementation may
+             retry attempt to launch application using provided launch function.
+             <p>
+             This method is NOT called if platform requirement could not be met
+             (e.g. if platfrom is not supported or if installation
+             is not possible).
+             <p>Default handler provides "click to install" solution for
+             embedded application and attempt to perform installation without
+             additional questions for apps started using launch().
+             <p>
+             If handler is null then it is treated as no op handler.
+             <p>
+             Parameters:
+             <ul>
+             <li> <b>app</b> - application launch descriptor.
+                 For embedded applications app.placeholder will refer to
+                 the root of the applet area in the DOM tree (to be used for
+                 visual feedback)
+             <li> <b>platform</b> - application platform requirements
+             <li> <b>cb</b> - set of callbacks to be used during
+                   installation process
+             <li> <b>isAutoinstall</b> - true if install can be launched
+                 automatically
+             <li> <b>needRestart</b> - true if browser restart will be required
+                 once installation is complete
+             <li> <b>launchFunction</b> - function to be executed to
+                 retry launching the application once installation is finished
+             </ul>
+
+             @property onInstallNeeded
+             @type function(app, platform, cb, isAutoinstall, needRelaunch, launchFunc)
+             @default Default implementation shows "click to install" banner
+               for embedded applications or initiates installation immediately
+               for applications launched from web page.
+             */
+            this.onInstallNeeded = defaultInstallHandler;
+
+            /**
+             Called before installation of required component is triggered.
+             For manual install scenario it is called before installation
+             page is opened.
+             <p>
+             This method can be used to provide visual feedback to the user
+             during the installation. Placeholder
+             points to the area that can be used for visualization,
+             for embedded applications it will be applet area.
+             If null then callee need to find place for visualization on its own.
+             <p>
+             In case of automatic launch of installation onInstallFinished will be called
+             once installation is complete (succesfully or not).
+             <p>
+             If handler is null then it is treated as no-op handler.
+
+             Parameters:
+             <ul>
+             <li> <b>placeholder</b> - DOM element to insert visual feedback into.
+                  If null then callee need to add visual feedback to the document on its own
+                  (e.g. placeholder will be null if installation is not happening in context of embedding application into
+                  web page).
+             <li> <b>component</b> - String "Java", "JavaFX" or "Java bundle"
+             <li> <b>isAutoInstall</b> - true if installer will be launched
+                  automatically
+             <li> <b>restartNeeded</b> - boolean to specify whether browser restart will be required
+             </ul>
+
+             @property onInstallStarted
+             @type function(placeholder, component, isAuto, restartNeeded)
+             @default No-op
+             */
+            this.onInstallStarted = defaultInstallStartedHandler;
+
+            /**
+             Called once installation of required component
+             is completed. This method will NOT be called if installation is
+             performed in manual mode.
+
+             Parameters:
+             <ul>
+             <li> <b>placeholder</b> - DOM element that was passed to
+                 onInstallStarted to insert visual feedback into.
+             <li> <b>component</b> - String "jre" or "javafx"
+             <li> <b>status</b> - status code is string categorizing the status of install.
+             ("success", "error:generic", "error:download" or "error:canceled")
+             <li> <b>relaunchNeeded</b> - boolean to specify
+             whether browser restart is required to complete the installation
+             </ul>
+
+             @property onInstallFinished
+             @type function(placeholder, component, status, relaunchNeeded)
+             @default no op
+             */
+            this.onInstallFinished = defaultInstallFinishedHandler;
+
+            /**
+             This function is called if application can not be deployed because
+             current platform does not match given platform requirements.
+             It is also called if request to install missing components can not be
+             completed due to platform.
+             <p>
+             Problem can be fatal error or transient issue (e.g. relaunch needed). Further
+             details can be extracted from provided mismatchEvent. Here are some typical combinations:
+
+             <ul>
+             <li><em>Current browser is not supported by Java</em> - (r.isUnsupportedBrowser())
+             <li><em>Browser need to be restarted before application can be launched</em> - (r.isRelaunchNeeded())
+             <li>JRE specific codes
+             <ul>
+             <li><em>JRE is not supported on this platform</em> - (r.jreStatus() == "unsupported")
+             <li><em>JRE is not detected and need to be installed</em> - (r.jreStatus() == "none")
+             <li><em>Installed version of JRE does not match requirements</em> - (r.jreStatus() == "old")
+             <li><em>Matching JRE is detected but deprecated Java plugin is used and
+                     it does not support JNLP applets</em> - (r.jreStatus() == "oldplugin")
+             </ul>
+             <li> JavaFX specific codes
+             <ul>
+             <li><em>JavaFX is not supported on this platform</em> - (r.javafxStatus() == "unsupported")
+             <li><em>JavaFX Runtime is missing and need to be installed manually</em> - (r.javafxStatus() == "none")
+             <li><em>Installed version of JavaFX Runtime does not match requirements</em> - (r.javafxStatus() == "old")
+             <li><em>JavaFX Runtime is installed but currently disabled</em> - (r.javafxStatus() == "disabled")
+             </ul>
+             </ul>
+
+             Default error handler handles both application launch errors and embedded content.
+
+             @property onDeployError
+             @type function(app, mismatchEvent)
+             */
+            this.onDeployError = defaultDeployErrorHandler;
+
+            /**
+             * Called to get content to be shown in the applet area if Java plugin is not installed
+             * and none of callbacks helped to resolve this.
+             *
+             * @property onGetNoPluginMessage
+             * @type function(app)
+             * @return DOM Element object representing content to be shown in the applet area if
+             *         java plugin is not detected by browser.
+             */
+            this.onGetNoPluginMessage = defaultGetNoPluginMessageHandler;
+
+            /**
+             Called once applet is ready to accept Javascript calls.
+             Only supported for plugin version 10.0.0 or later
+             @property onJavascriptReady
+             @type function(id)
+             @default null
+             */
+            this.onJavascriptReady = null;
+
+            /**
+             Called if application failed to launch.
+             Only supported for plugin version 10.0.0 or later.
+
+             @property onRuntimeError
+             @type function(id)
+             @default no op
+             */
+            this.onRuntimeError = defaultRuntimeErrorHandler;
+
+            //overwrite with provided parameters
+            for (c in cb) {
+                this[c] = cb[c];
+            }
+        }
+    };
+}();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/javafx-launcher/build.xml	Wed Dec 19 17:04:18 2012 -0500
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+-->
+
+<project name="javafx-launcher" default="default" basedir=".">
+    <description>Builds, tests, and runs the project javafx-launcher.</description>
+    <import file="nbproject/build-impl.xml"/>
+    <!--
+
+    There exist several targets which are by default empty and which can be
+    used for execution of your tasks. These targets are usually executed
+    before and after some main targets. They are:
+
+      -pre-init:                 called before initialization of project properties
+      -post-init:                called after initialization of project properties
+      -pre-compile:              called before javac compilation
+      -post-compile:             called after javac compilation
+      -pre-compile-single:       called before javac compilation of single file
+      -post-compile-single:      called after javac compilation of single file
+      -pre-compile-test:         called before javac compilation of JUnit tests
+      -post-compile-test:        called after javac compilation of JUnit tests
+      -pre-compile-test-single:  called before javac compilation of single JUnit test
+      -post-compile-test-single: called after javac compilation of single JUunit test
+      -pre-jar:                  called before JAR building
+      -post-jar:                 called after JAR building
+      -post-clean:               called after cleaning build products
+
+    (Targets beginning with '-' are not intended to be called on their own.)
+
+    Example of inserting an obfuscator after compilation could look like this:
+
+        <target name="-post-compile">
+            <obfuscate>
+                <fileset dir="${build.classes.dir}"/>
+            </obfuscate>
+        </target>
+
+    For list of available properties check the imported
+    nbproject/build-impl.xml file.
+
+
+    Another way to customize the build is by overriding existing main targets.
+    The targets of interest are:
+
+      -init-macrodef-javac:     defines macro for javac compilation
+      -init-macrodef-junit:     defines macro for junit execution
+      -init-macrodef-debug:     defines macro for class debugging
+      -init-macrodef-java:      defines macro for class execution
+      -do-jar-with-manifest:    JAR building (if you are using a manifest)
+      -do-jar-without-manifest: JAR building (if you are not using a manifest)
+      run:                      execution of project
+      -javadoc-build:           Javadoc generation
+      test-report:              JUnit report generation
+
+    An example of overriding the target for project execution could look like this:
+
+        <target name="run" depends="javafx-launcher-impl.jar">
+            <exec dir="bin" executable="launcher.exe">
+                <arg file="${dist.jar}"/>
+            </exec>
+        </target>
+
+    Notice that the overridden target depends on the jar target and not only on
+    the compile target as the regular run target does. Again, for a list of available
+    properties which you can use, check the target you are overriding in the
+    nbproject/build-impl.xml file.
+
+    -->
+</project>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/javafx-launcher/manifest.mf	Wed Dec 19 17:04:18 2012 -0500
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+X-COMMENT: Main-Class will be added automatically by build
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/javafx-launcher/nbproject/build-impl.xml	Wed Dec 19 17:04:18 2012 -0500
@@ -0,0 +1,1030 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+*** GENERATED FROM project.xml - DO NOT EDIT  ***
+***         EDIT ../build.xml INSTEAD         ***
+
+For the purpose of easier reading the script
+is divided into following sections:
+
+  - initialization
+  - compilation
+  - jar
+  - execution
+  - debugging
+  - javadoc
+  - junit compilation
+  - junit execution
+  - junit debugging
+  - applet
+  - cleanup
+
+        -->
+<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="javafx-launcher-impl">
+    <fail message="Please build using Ant 1.7.1 or higher.">
+        <condition>
+            <not>
+                <antversion atleast="1.7.1"/>
+            </not>
+        </condition>
+    </fail>
+    <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
+    <!-- 
+                ======================
+                INITIALIZATION SECTION 
+                ======================
+            -->
+    <target name="-pre-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="-pre-init" name="-init-private">
+        <property file="nbproject/private/config.properties"/>
+        <property file="nbproject/private/configs/${config}.properties"/>
+        <property file="nbproject/private/private.properties"/>
+    </target>
+    <target depends="-pre-init,-init-private" name="-init-user">
+        <property file="${user.properties.file}"/>
+        <!-- The two properties below are usually overridden -->
+        <!-- by the active platform. Just a fallback. -->
+        <property name="default.javac.source" value="1.4"/>
+        <property name="default.javac.target" value="1.4"/>
+    </target>
+    <target depends="-pre-init,-init-private,-init-user" name="-init-project">
+        <property file="nbproject/configs/${config}.properties"/>
+        <property file="nbproject/project.properties"/>
+    </target>
+    <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
+        <available file="${manifest.file}" property="manifest.available"/>
+        <condition property="splashscreen.available">
+            <and>
+                <not>
+                    <equals arg1="${application.splash}" arg2="" trim="true"/>
+                </not>
+                <available file="${application.splash}"/>
+            </and>
+        </condition>
+        <condition property="main.class.available">
+            <and>
+                <isset property="main.class"/>
+                <not>
+                    <equals arg1="${main.class}" arg2="" trim="true"/>
+                </not>
+            </and>
+        </condition>
+        <condition property="manifest.available+main.class">
+            <and>
+                <isset property="manifest.available"/>
+                <isset property="main.class.available"/>
+            </and>
+        </condition>
+        <condition property="do.archive">
+            <not>
+                <istrue value="${jar.archive.disabled}"/>
+            </not>
+        </condition>
+        <condition property="do.mkdist">
+            <and>
+                <isset property="do.archive"/>
+                <isset property="libs.CopyLibs.classpath"/>
+                <not>
+                    <istrue value="${mkdist.disabled}"/>
+                </not>
+            </and>
+        </condition>
+        <condition property="manifest.available+main.class+mkdist.available">
+            <and>
+                <istrue value="${manifest.available+main.class}"/>
+                <isset property="do.mkdist"/>
+            </and>
+        </condition>
+        <condition property="do.archive+manifest.available">
+            <and>
+                <isset property="manifest.available"/>
+                <istrue value="${do.archive}"/>
+            </and>
+        </condition>
+        <condition property="do.archive+main.class.available">
+            <and>
+                <isset property="main.class.available"/>
+                <istrue value="${do.archive}"/>
+            </and>
+        </condition>
+        <condition property="do.archive+splashscreen.available">
+            <and>
+                <isset property="splashscreen.available"/>
+                <istrue value="${do.archive}"/>
+            </and>
+        </condition>
+        <condition property="do.archive+manifest.available+main.class">
+            <and>
+                <istrue value="${manifest.available+main.class}"/>
+                <istrue value="${do.archive}"/>
+            </and>
+        </condition>
+        <condition property="manifest.available-mkdist.available">
+            <or>
+                <istrue value="${manifest.available}"/>
+                <isset property="do.mkdist"/>
+            </or>
+        </condition>
+        <condition property="manifest.available+main.class-mkdist.available">
+            <or>
+                <istrue value="${manifest.available+main.class}"/>
+                <isset property="do.mkdist"/>
+            </or>
+        </condition>
+        <condition property="have.tests">
+            <or/>
+        </condition>
+        <condition property="have.sources">
+            <or>
+                <available file="${src.src.dir}"/>
+            </or>
+        </condition>
+        <condition property="netbeans.home+have.tests">
+            <and>
+                <isset property="netbeans.home"/>
+                <isset property="have.tests"/>
+            </and>
+        </condition>
+        <condition property="no.javadoc.preview">
+            <and>
+                <isset property="javadoc.preview"/>
+                <isfalse value="${javadoc.preview}"/>
+            </and>
+        </condition>
+        <property name="run.jvmargs" value=""/>
+        <property name="javac.compilerargs" value=""/>
+        <property name="work.dir" value="${basedir}"/>
+        <condition property="no.deps">
+            <and>
+                <istrue value="${no.dependencies}"/>
+            </and>
+        </condition>
+        <property name="javac.debug" value="true"/>
+        <property name="javadoc.preview" value="true"/>
+        <property name="application.args" value=""/>
+        <property name="source.encoding" value="${file.encoding}"/>
+        <property name="runtime.encoding" value="${source.encoding}"/>
+        <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
+            <and>
+                <isset property="javadoc.encoding"/>
+                <not>
+                    <equals arg1="${javadoc.encoding}" arg2=""/>
+                </not>
+            </and>
+        </condition>
+        <property name="javadoc.encoding.used" value="${source.encoding}"/>
+        <property name="includes" value="**"/>
+        <property name="excludes" value=""/>
+        <property name="do.depend" value="false"/>
+        <condition property="do.depend.true">
+            <istrue value="${do.depend}"/>
+        </condition>
+        <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
+        <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
+            <length length="0" string="${endorsed.classpath}" when="greater"/>
+        </condition>
+        <condition else="false" property="jdkBug6558476">
+            <and>
+                <matches pattern="1\.[56]" string="${java.specification.version}"/>
+                <not>
+                    <os family="unix"/>
+                </not>
+            </and>
+        </condition>
+        <property name="javac.fork" value="${jdkBug6558476}"/>
+        <property name="jar.index" value="false"/>
+        <property name="jar.index.metainf" value="${jar.index}"/>
+        <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
+    </target>
+    <target name="-post-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
+        <fail unless="src.src.dir">Must set src.src.dir</fail>
+        <fail unless="build.dir">Must set build.dir</fail>
+        <fail unless="dist.dir">Must set dist.dir</fail>
+        <fail unless="build.classes.dir">Must set build.classes.dir</fail>
+        <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
+        <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
+        <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
+        <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
+        <fail unless="dist.jar">Must set dist.jar</fail>
+    </target>
+    <target name="-init-macrodef-property">
+        <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <attribute name="name"/>
+            <attribute name="value"/>
+            <sequential>
+                <property name="@{name}" value="${@{value}}"/>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
+        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${src.src.dir}" name="srcdir"/>
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <attribute default="${javac.classpath}" name="classpath"/>
+            <attribute default="${javac.processorpath}" name="processorpath"/>
+            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="${javac.debug}" name="debug"/>
+            <attribute default="${empty.dir}" name="sourcepath"/>
+            <attribute default="${empty.dir}" name="gensrcdir"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property location="${build.dir}/empty" name="empty.dir"/>
+                <mkdir dir="${empty.dir}"/>
+                <mkdir dir="@{apgeneratedsrcdir}"/>
+                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
+                    <src>
+                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
+                            <include name="*"/>
+                        </dirset>
+                    </src>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <compilerarg line="${javac.compilerargs}"/>
+                    <compilerarg value="-processorpath"/>
+                    <compilerarg path="@{processorpath}:${empty.dir}"/>
+                    <compilerarg line="${ap.processors.internal}"/>
+                    <compilerarg line="${annotation.processing.processor.options}"/>
+                    <compilerarg value="-s"/>
+                    <compilerarg path="@{apgeneratedsrcdir}"/>
+                    <compilerarg line="${ap.proc.none.internal}"/>
+                    <customize/>
+                </javac>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
+        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${src.src.dir}" name="srcdir"/>
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <attribute default="${javac.classpath}" name="classpath"/>
+            <attribute default="${javac.processorpath}" name="processorpath"/>
+            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="${javac.debug}" name="debug"/>
+            <attribute default="${empty.dir}" name="sourcepath"/>
+            <attribute default="${empty.dir}" name="gensrcdir"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property location="${build.dir}/empty" name="empty.dir"/>
+                <mkdir dir="${empty.dir}"/>
+                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
+                    <src>
+                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
+                            <include name="*"/>
+                        </dirset>
+                    </src>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <compilerarg line="${javac.compilerargs}"/>
+                    <customize/>
+                </javac>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
+        <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${src.src.dir}" name="srcdir"/>
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <attribute default="${javac.classpath}" name="classpath"/>
+            <sequential>
+                <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                </depend>
+            </sequential>
+        </macrodef>
+        <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <sequential>
+                <fail unless="javac.includes">Must set javac.includes</fail>
+                <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
+                    <path>
+                        <filelist dir="@{destdir}" files="${javac.includes}"/>
+                    </path>
+                    <globmapper from="*.java" to="*.class"/>
+                </pathconvert>
+                <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
+                <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
+                <delete>
+                    <files includesfile="${javac.includesfile.binary}"/>
+                </delete>
+                <delete>
+                    <fileset file="${javac.includesfile.binary}"/>
+                </delete>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-macrodef-junit">
+        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <sequential>
+                <property name="junit.forkmode" value="perTest"/>
+                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
+                    <batchtest todir="${build.test.results.dir}"/>
+                    <classpath>
+                        <path path="${run.test.classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="test-sys-prop."/>
+                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <formatter type="brief" usefile="false"/>
+                    <formatter type="xml"/>
+                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <jvmarg value="-ea"/>
+                    <jvmarg line="${run.jvmargs}"/>
+                </junit>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" name="profile-init"/>
+    <target name="-profile-pre-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target name="-profile-post-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target name="-profile-init-macrodef-profile">
+        <macrodef name="resolve">
+            <attribute name="name"/>
+            <attribute name="value"/>
+            <sequential>
+                <property name="@{name}" value="${env.@{value}}"/>
+            </sequential>
+        </macrodef>
+        <macrodef name="profile">
+            <attribute default="${main.class}" name="classname"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property environment="env"/>
+                <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
+                <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
+                    <jvmarg value="${profiler.info.jvmargs.agent}"/>
+                    <jvmarg line="${profiler.info.jvmargs}"/>
+                    <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
+                    <arg line="${application.args}"/>
+                    <classpath>
+                        <path path="${run.classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="run-sys-prop."/>
+                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <customize/>
+                </java>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" name="-profile-init-check">
+        <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
+        <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
+    </target>
+    <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
+        <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <attribute default="${main.class}" name="name"/>
+            <attribute default="${debug.classpath}" name="classpath"/>
+            <attribute default="" name="stopclassname"/>
+            <sequential>
+                <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                </nbjpdastart>
+            </sequential>
+        </macrodef>
+        <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <attribute default="${build.classes.dir}" name="dir"/>
+            <sequential>
+                <nbjpdareload>
+                    <fileset dir="@{dir}" includes="${fix.classes}">
+                        <include name="${fix.includes}*.class"/>
+                    </fileset>
+                </nbjpdareload>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-debug-args">
+        <property name="version-output" value="java version &quot;${ant.java.version}"/>
+        <condition property="have-jdk-older-than-1.4">
+            <or>
+                <contains string="${version-output}" substring="java version &quot;1.0"/>
+                <contains string="${version-output}" substring="java version &quot;1.1"/>
+                <contains string="${version-output}" substring="java version &quot;1.2"/>
+                <contains string="${version-output}" substring="java version &quot;1.3"/>
+            </or>
+        </condition>
+        <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
+            <istrue value="${have-jdk-older-than-1.4}"/>
+        </condition>
+        <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
+            <os family="windows"/>
+        </condition>
+        <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
+            <isset property="debug.transport"/>
+        </condition>
+    </target>
+    <target depends="-init-debug-args" name="-init-macrodef-debug">
+        <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${main.class}" name="classname"/>
+            <attribute default="${debug.classpath}" name="classpath"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <java classname="@{classname}" dir="${work.dir}" fork="true">
+                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <jvmarg line="${debug-args-line}"/>
+                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
+                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
+                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
+                    <jvmarg line="${run.jvmargs}"/>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="run-sys-prop."/>
+                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <customize/>
+                </java>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-macrodef-java">
+        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <attribute default="${main.class}" name="classname"/>
+            <attribute default="${run.classpath}" name="classpath"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <java classname="@{classname}" dir="${work.dir}" fork="true">
+                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
+                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
+                    <jvmarg line="${run.jvmargs}"/>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="run-sys-prop."/>
+                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <customize/>
+                </java>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-macrodef-copylibs">
+        <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${manifest.file}" name="manifest"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
+                <pathconvert property="run.classpath.without.build.classes.dir">
+                    <path path="${run.classpath}"/>
+                    <map from="${build.classes.dir.resolved}" to=""/>
+                </pathconvert>
+                <pathconvert pathsep=" " property="jar.classpath">
+                    <path path="${run.classpath.without.build.classes.dir}"/>
+                    <chainedmapper>
+                        <flattenmapper/>
+                        <globmapper from="*" to="lib/*"/>
+                    </chainedmapper>
+                </pathconvert>
+                <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
+                <copylibs compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}" manifest="@{manifest}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
+                    <fileset dir="${build.classes.dir}"/>
+                    <manifest>
+                        <attribute name="Class-Path" value="${jar.classpath}"/>
+                        <customize/>
+                    </manifest>
+                </copylibs>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-presetdef-jar">
+        <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
+                <j2seproject1:fileset dir="${build.classes.dir}"/>
+            </jar>
+        </presetdef>
+    </target>
+    <target name="-init-ap-cmdline-properties">
+        <property name="annotation.processing.enabled" value="true"/>
+        <property name="annotation.processing.processors.list" value=""/>
+        <property name="annotation.processing.processor.options" value=""/>
+        <property name="annotation.processing.run.all.processors" value="true"/>
+        <property name="javac.processorpath" value="${javac.classpath}"/>
+        <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
+        <condition property="ap.supported.internal" value="true">
+            <not>
+                <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
+            </not>
+        </condition>
+    </target>
+    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
+        <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
+            <isfalse value="${annotation.processing.run.all.processors}"/>
+        </condition>
+        <condition else="" property="ap.proc.none.internal" value="-proc:none">
+            <isfalse value="${annotation.processing.enabled}"/>
+        </condition>
+    </target>
+    <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
+        <property name="ap.cmd.line.internal" value=""/>
+    </target>
+    <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/>
+    <!--
+                ===================
+                COMPILATION SECTION
+                ===================
+            -->
+    <target name="-deps-jar-init" unless="built-jar.properties">
+        <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
+        <delete file="${built-jar.properties}" quiet="true"/>
+    </target>
+    <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
+        <echo level="warn" message="Cycle detected: javafx-launcher was already built"/>
+    </target>
+    <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
+        <mkdir dir="${build.dir}"/>
+        <touch file="${built-jar.properties}" verbose="false"/>
+        <property file="${built-jar.properties}" prefix="already.built.jar."/>
+        <antcall target="-warn-already-built-jar"/>
+        <propertyfile file="${built-jar.properties}">
+            <entry key="${basedir}" value=""/>
+        </propertyfile>
+    </target>
+    <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
+    <target depends="init" name="-check-automatic-build">
+        <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
+    </target>
+    <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
+        <antcall target="clean"/>
+    </target>
+    <target depends="init,deps-jar" name="-pre-pre-compile">
+        <mkdir dir="${build.classes.dir}"/>
+    </target>
+    <target name="-pre-compile">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target if="do.depend.true" name="-compile-depend">
+        <pathconvert property="build.generated.subdirs">
+            <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
+                <include name="*"/>
+            </dirset>
+        </pathconvert>
+        <j2seproject3:depend srcdir="${src.src.dir}:${build.generated.subdirs}"/>
+    </target>
+    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
+        <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
+        <copy todir="${build.classes.dir}">
+            <fileset dir="${src.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+    </target>
+    <target if="has.persistence.xml" name="-copy-persistence-xml">
+        <mkdir dir="${build.classes.dir}/META-INF"/>
+        <copy todir="${build.classes.dir}/META-INF">
+            <fileset dir="${meta.inf.dir}" includes="persistence.xml"/>
+        </copy>
+    </target>
+    <target name="-post-compile">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
+    <target name="-pre-compile-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
+        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
+        <j2seproject3:force-recompile/>
+        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.src.dir}"/>
+    </target>
+    <target name="-post-compile-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
+    <!--
+                ====================
+                JAR BUILDING SECTION
+                ====================
+            -->
+    <target depends="init" name="-pre-pre-jar">
+        <dirname file="${dist.jar}" property="dist.jar.dir"/>
+        <mkdir dir="${dist.jar.dir}"/>
+    </target>
+    <target name="-pre-jar">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
+        <j2seproject1:jar/>
+    </target>
+    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class-mkdist.available">
+        <j2seproject1:jar manifest="${manifest.file}"/>
+    </target>
+    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
+        <j2seproject1:jar manifest="${manifest.file}">
+            <j2seproject1:manifest>
+                <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
+            </j2seproject1:manifest>
+        </j2seproject1:jar>
+        <echo level="info">To run this application from the command line without Ant, try:</echo>
+        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
+        <property location="${dist.jar}" name="dist.jar.resolved"/>
+        <pathconvert property="run.classpath.with.dist.jar">
+            <path path="${run.classpath}"/>
+            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
+        </pathconvert>
+        <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
+    </target>
+    <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
+        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
+        <touch file="${tmp.manifest.file}" verbose="false"/>
+    </target>
+    <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
+        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
+        <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
+    </target>
+    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+main.class.available" name="-do-jar-with-libraries-set-main">
+        <manifest file="${tmp.manifest.file}" mode="update">
+            <attribute name="Main-Class" value="${main.class}"/>
+        </manifest>
+    </target>
+    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-with-libraries-set-splashscreen">
+        <basename file="${application.splash}" property="splashscreen.basename"/>
+        <mkdir dir="${build.classes.dir}/META-INF"/>
+        <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
+        <manifest file="${tmp.manifest.file}" mode="update">
+            <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
+        </manifest>
+    </target>
+    <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen" if="do.mkdist" name="-do-jar-with-libraries-pack">
+        <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
+        <echo level="info">To run this application from the command line without Ant, try:</echo>
+        <property location="${dist.jar}" name="dist.jar.resolved"/>
+        <echo level="info">java -jar "${dist.jar.resolved}"</echo>
+    </target>
+    <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
+        <delete>
+            <fileset file="${tmp.manifest.file}"/>
+        </delete>
+    </target>
+    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen,-do-jar-with-libraries-pack,-do-jar-with-libraries-delete-manifest" name="-do-jar-with-libraries"/>
+    <target name="-post-jar">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>
+    <!--
+                =================
+                EXECUTION SECTION
+                =================
+            -->
+    <target depends="init,compile" description="Run a main class." name="run">
+        <j2seproject1:java>
+            <customize>
+                <arg line="${application.args}"/>
+            </customize>
+        </j2seproject1:java>
+    </target>
+    <target name="-do-not-recompile">
+        <property name="javac.includes.binary" value=""/>
+    </target>
+    <target depends="init,compile-single" name="run-single">
+        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
+        <j2seproject1:java classname="${run.class}"/>
+    </target>
+    <target depends="init,compile-test-single" name="run-test-with-main">
+        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
+        <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
+    </target>
+    <!--
+                =================
+                DEBUGGING SECTION
+                =================
+            -->
+    <target depends="init" if="netbeans.home" name="-debug-start-debugger">
+        <j2seproject1:nbjpdastart name="${debug.class}"/>
+    </target>
+    <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
+        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
+    </target>
+    <target depends="init,compile" name="-debug-start-debuggee">
+        <j2seproject3:debug>
+            <customize>
+                <arg line="${application.args}"/>
+            </customize>
+        </j2seproject3:debug>
+    </target>
+    <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
+    <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
+        <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
+    </target>
+    <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
+    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
+        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
+        <j2seproject3:debug classname="${debug.class}"/>
+    </target>
+    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
+    <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
+        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
+        <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
+    </target>
+    <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
+    <target depends="init" name="-pre-debug-fix">
+        <fail unless="fix.includes">Must set fix.includes</fail>
+        <property name="javac.includes" value="${fix.includes}.java"/>
+    </target>
+    <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
+        <j2seproject1:nbjpdareload/>
+    </target>
+    <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
+    <!--
+                =================
+                PROFILING SECTION
+                =================
+            -->
+    <target depends="profile-init,compile" description="Profile a project in the IDE." if="netbeans.home" name="profile">
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <profile/>
+    </target>
+    <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="netbeans.home" name="profile-single">
+        <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <profile classname="${profile.class}"/>
+    </target>
+    <!--
+                =========================
+                APPLET PROFILING  SECTION
+                =========================
+            -->
+    <target depends="profile-init,compile-single" if="netbeans.home" name="profile-applet">
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <profile classname="sun.applet.AppletViewer">
+            <customize>
+                <arg value="${applet.url}"/>
+            </customize>
+        </profile>
+    </target>
+    <!--
+                =========================
+                TESTS PROFILING  SECTION
+                =========================
+            -->
+    <target depends="profile-init,compile-test-single" if="netbeans.home" name="profile-test-single">
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.test.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
+            <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
+            <jvmarg value="${profiler.info.jvmargs.agent}"/>
+            <jvmarg line="${profiler.info.jvmargs}"/>
+            <test name="${profile.class}"/>
+            <classpath>
+                <path path="${run.test.classpath}"/>
+            </classpath>
+            <syspropertyset>
+                <propertyref prefix="test-sys-prop."/>
+                <mapper from="test-sys-prop.*" to="*" type="glob"/>
+            </syspropertyset>
+            <formatter type="brief" usefile="false"/>
+            <formatter type="xml"/>
+        </junit>
+    </target>
+    <!--
+                ===============
+                JAVADOC SECTION
+                ===============
+            -->
+    <target depends="init" if="have.sources" name="-javadoc-build">
+        <mkdir dir="${dist.javadoc.dir}"/>
+        <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
+            <classpath>
+                <path path="${javac.classpath}"/>
+            </classpath>
+            <fileset dir="${src.src.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
+                <include name="**/*.java"/>
+            </fileset>
+        </javadoc>
+        <copy todir="${dist.javadoc.dir}">
+            <fileset dir="${src.src.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
+                <include name="**/doc-files/**"/>
+            </fileset>
+        </copy>
+    </target>
+    <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
+        <nbbrowse file="${dist.javadoc.dir}/index.html"/>
+    </target>
+    <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
+    <!--
+                =========================
+                JUNIT COMPILATION SECTION
+                =========================
+            -->
+    <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
+        <mkdir dir="${build.test.classes.dir}"/>
+    </target>
+    <target name="-pre-compile-test">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target if="do.depend.true" name="-compile-test-depend">
+        <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir=""/>
+    </target>
+    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
+        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir=""/>
+        <copy todir="${build.test.classes.dir}"/>
+    </target>
+    <target name="-post-compile-test">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
+    <target name="-pre-compile-test-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
+        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
+        <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
+        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="" srcdir=""/>
+        <copy todir="${build.test.classes.dir}"/>
+    </target>
+    <target name="-post-compile-test-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
+    <!--
+                =======================
+                JUNIT EXECUTION SECTION
+                =======================
+            -->
+    <target depends="init" if="have.tests" name="-pre-test-run">
+        <mkdir dir="${build.test.results.dir}"/>
+    </target>
+    <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
+        <j2seproject3:junit testincludes="**/*Test.java"/>
+    </target>
+    <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
+        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
+    </target>
+    <target depends="init" if="have.tests" name="test-report"/>
+    <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
+    <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
+    <target depends="init" if="have.tests" name="-pre-test-run-single">
+        <mkdir dir="${build.test.results.dir}"/>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
+        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
+        <j2seproject3:junit excludes="" includes="${test.includes}"/>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
+        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
+    <!--
+                =======================
+                JUNIT DEBUGGING SECTION
+                =======================
+            -->
+    <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
+        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
+        <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
+        <delete file="${test.report.file}"/>
+        <mkdir dir="${build.test.results.dir}"/>
+        <j2seproject3:debug classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}">
+            <customize>
+                <syspropertyset>
+                    <propertyref prefix="test-sys-prop."/>
+                    <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                </syspropertyset>
+                <arg value="${test.class}"/>
+                <arg value="showoutput=true"/>
+                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
+                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
+            </customize>
+        </j2seproject3:debug>
+    </target>
+    <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
+        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
+    </target>
+    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
+    <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
+        <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
+    </target>
+    <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
+    <!--
+                =========================
+                APPLET EXECUTION SECTION
+                =========================
+            -->
+    <target depends="init,compile-single" name="run-applet">
+        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
+        <j2seproject1:java classname="sun.applet.AppletViewer">
+            <customize>
+                <arg value="${applet.url}"/>
+            </customize>
+        </j2seproject1:java>
+    </target>
+    <!--
+                =========================
+                APPLET DEBUGGING  SECTION
+                =========================
+            -->
+    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
+        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
+        <j2seproject3:debug classname="sun.applet.AppletViewer">
+            <customize>
+                <arg value="${applet.url}"/>
+            </customize>
+        </j2seproject3:debug>
+    </target>
+    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
+    <!--
+                ===============
+                CLEANUP SECTION
+                ===============
+            -->
+    <target name="-deps-clean-init" unless="built-clean.properties">
+        <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
+        <delete file="${built-clean.properties}" quiet="true"/>
+    </target>
+    <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
+        <echo level="warn" message="Cycle detected: javafx-launcher was already built"/>
+    </target>
+    <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
+        <mkdir dir="${build.dir}"/>
+        <touch file="${built-clean.properties}" verbose="false"/>
+        <property file="${built-clean.properties}" prefix="already.built.clean."/>
+        <antcall target="-warn-already-built-clean"/>
+        <propertyfile file="${built-clean.properties}">
+            <entry key="${basedir}" value=""/>
+        </propertyfile>
+    </target>
+    <target depends="init" name="-do-clean">
+        <delete dir="${build.dir}"/>
+        <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
+    </target>
+    <target name="-post-clean">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
+    <target name="-check-call-dep">
+        <property file="${call.built.properties}" prefix="already.built."/>
+        <condition property="should.call.dep">
+            <not>
+                <isset property="already.built.${call.subproject}"/>
+            </not>
+        </condition>
+    </target>
+    <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
+        <ant antfile="${call.script}" inheritall="false" target="${call.target}">
+            <propertyset>
+                <propertyref prefix="transfer."/>
+                <mapper from="transfer.*" to="*" type="glob"/>
+            </propertyset>
+        </ant>
+    </target>
+</project>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/javafx-launcher/nbproject/genfiles.properties	Wed Dec 19 17:04:18 2012 -0500
@@ -0,0 +1,8 @@
+build.xml.data.CRC32=4e1067f2
+build.xml.script.CRC32=19e7135e
+build.xml.stylesheet.CRC32=28e38971@1.38.2.45
+# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
+# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
+nbproject/build-impl.xml.data.CRC32=4e1067f2
+nbproject/build-impl.xml.script.CRC32=3213ccf6
+nbproject/build-impl.xml.stylesheet.CRC32=0c01fd8e@1.43.1.45
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/javafx-launcher/nbproject/project.properties	Wed Dec 19 17:04:18 2012 -0500
@@ -0,0 +1,68 @@
+annotation.processing.enabled=true
+annotation.processing.enabled.in.editor=false
+annotation.processing.run.all.processors=true
+annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
+application.title=javafx-launcher
+application.vendor=Oracle
+build.classes.dir=${build.dir}/classes
+build.classes.excludes=**/*.java,**/*.form
+# This directory is removed when the project is cleaned:
+build.dir=build
+build.generated.dir=${build.dir}/generated
+build.generated.sources.dir=${build.dir}/generated-sources
+# Only compile against the classpath explicitly listed here:
+build.sysclasspath=ignore
+build.test.classes.dir=${build.dir}/test/classes
+build.test.results.dir=${build.dir}/test/results
+# Uncomment to specify the preferred debugger connection transport:
+#debug.transport=dt_socket
+debug.classpath=\
+    ${run.classpath}
+debug.test.classpath=\
+    ${run.test.classpath}
+# This directory is removed when the project is cleaned:
+dist.dir=dist
+dist.jar=${dist.dir}/javafx-launcher.jar
+dist.javadoc.dir=${dist.dir}/javadoc
+endorsed.classpath=
+excludes=
+includes=**
+jar.compress=false
+javac.classpath=
+# Space-separated list of extra javac options
+javac.compilerargs=
+javac.deprecation=false
+javac.processorpath=\
+    ${javac.classpath}
+javac.source=1.4
+javac.target=1.4
+javac.test.classpath=\
+    ${javac.classpath}:\
+    ${build.classes.dir}:\
+    ${libs.junit.classpath}:\
+    ${libs.junit_4.classpath}
+javac.test.processorpath=\
+    ${javac.test.classpath}
+javadoc.additionalparam=
+javadoc.author=false
+javadoc.encoding=${source.encoding}
+javadoc.noindex=false
+javadoc.nonavbar=false
+javadoc.notree=false
+javadoc.private=false
+javadoc.splitindex=true
+javadoc.use=true
+javadoc.version=false
+javadoc.windowtitle=
+manifest.file=manifest.mf
+meta.inf.dir=${src.dir}/META-INF
+no.dependencies=true
+platform.active=default_platform
+run.classpath=\
+    ${javac.classpath}:\
+    ${build.classes.dir}
+run.test.classpath=\
+    ${javac.test.classpath}:\
+    ${build.test.classes.dir}
+source.encoding=UTF-8
+src.src.dir=src
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/javafx-launcher/nbproject/project.xml	Wed Dec 19 17:04:18 2012 -0500
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+    <type>org.netbeans.modules.java.j2seproject</type>
+    <configuration>
+        <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
+            <name>javafx-launcher</name>
+            <source-roots>
+                <root id="src.src.dir"/>
+            </source-roots>
+            <test-roots/>
+        </data>
+    </configuration>
+</project>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/javafx-launcher/src/com/javafx/main/Main.java	Wed Dec 19 17:04:18 2012 -0500
@@ -0,0 +1,993 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.javafx.main;
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URI;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.net.URLDecoder;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.jar.Attributes;
+import java.util.jar.JarFile;
+import java.util.jar.Manifest;
+import javax.swing.JApplet;
+import javax.swing.JFrame;
+import javax.swing.SwingUtilities;
+import sun.misc.BASE64Decoder;
+
+/**
+ * This class loads com.sun.javafx.application.LauncherImpl and calls the
+ * launchApplication method.
+ *
+ * It is used by packager to include it as part of the application jar file
+ * so that we can run and locate the JavaFX runtime. Note that we cannot
+ * assume that JavaFX is on the classpath so we must use reflection and not
+ * have any direct reference to any JavaFX runtime class.
+ *
+ * We will do the following:
+ *
+ * 1. Verify the version of Java and produce error message if not JDK6+
+ *
+ * 2. Locate the jar file from which the Main class was launched. Read the
+ *    jar manifest and extract
+ *    the application class using the JavaFX-Application-Class manifest entry.
+ *    Alternatively, we will read the application class from a system property.
+ *
+ * 3. Try to locate the JavaFX runtime by loading the
+ * com.sun.javafx.application.LauncherImpl class using the following mechanisms
+ * in order:
+ *
+ *     A. Try loading it directly in case it is on the classpath.
+ *     B. If the javafx.runtime.path System Property is set, try
+ *        loading it from ${javafx.runtime.path}/lib/jfxrt.jar
+ *     C. If on Windows, read the registry key associated with the JavaFX
+ *        runtime (if running in a 64-bit JVM, use the 64-bit path)
+ *     D. Try a few hard-coded relative paths which will allow applications
+ *        to be run from the SDK without first having to install the runtime.
+ *
+ * 4. Create a custom URLClassLoader from the appropriate jar files, and then
+ *    call the launchApplication method. If the application class is not a
+ *    subclass of javafx.application.Application then we will call the main
+ *    method in the application class instead.
+ *
+ * 5. If the LauncherImpl class cannot be found, then show a Swing dialog
+ *    (again, using reflection).
+ */
+
+public class Main {
+    private static boolean verbose = false;
+    private static final String fxApplicationClassName = "javafx.application.Application";
+    private static final String fxLaunchClassName = "com.sun.javafx.application.LauncherImpl";
+    private static final String manifestAppClass = "JavaFX-Application-Class";
+    private static final String manifestPreloaderClass = "JavaFX-Preloader-Class";
+    private static final String manifestFallbackClass = "JavaFX-Fallback-Class";
+    private static final String manifestClassPath = "JavaFX-Class-Path";
+
+    //Manifest entry to explicitly disable autoproxy config
+    //  Unless it has "Auto" value it will disable proxy
+    private static final String manifestAutoProxy = "JavaFX-Feature-Proxy";
+
+    //Experimental hook to simplify adding "au" logic to native bundles
+    private static final String manifestUpdateHook = "X-JavaFX-Update-Hook";
+
+    // JavaFX family version that this Launcher is compatible with
+    private static final String JAVAFX_FAMILY_VERSION = "2.";
+
+    // Minimum JavaFX version required to run the app
+    // (keep separate from JAVAFX_FAMILY_VERSION check as
+    //   we want 2.2.1 SDK to be ok to run app that needs 2.1.0
+    //   and prefix based match is not enough)
+    // NOTE: This should be refactored so that the version gets supplied
+    //   from the build environment, but we do NOT want another class or
+    //   property file in the app bundle! Are there any other options
+    //   besides java source code preprocessing?)
+    private static final String JAVAFX_REQUIRED_VERSION = "2.1.0";
+
+    private static final String ZERO_VERSION = "0.0.0";
+
+    //application jar attributes
+    private static Attributes attrs = null;
+
+    private static URL fileToURL(File file) throws IOException {
+        return file.getCanonicalFile().toURI().toURL();
+    }
+
+    private static Method findLaunchMethod(File jfxRtPath, String fxClassPath) {
+        final Class[] argTypes =
+                new Class[] { Class.class, Class.class, (new String[0]).getClass() };
+
+        try {
+            ArrayList urlList = new ArrayList();
+
+            // Add in the elements of the classpath
+            String cp = System.getProperty("java.class.path");
+            if (cp != null) {
+                while (cp.length() > 0) {
+                    int pathSepIdx = cp.indexOf(File.pathSeparatorChar);
+                    if (pathSepIdx < 0) {
+                        String pathElem = cp;
+                        urlList.add(fileToURL(new File(pathElem)));
+                        break;
+                    } else if (pathSepIdx > 0) {
+                        String pathElem = cp.substring(0, pathSepIdx);
+                        urlList.add(fileToURL(new File(pathElem)));
+                    }
+                    cp = cp.substring(pathSepIdx + 1);
+                }
+            }
+
+            // Add in the jars from the JavaFX-Class-Path entry
+            cp = fxClassPath;
+            if (cp != null) {
+                //these are relative paths. if app is not in the current dir
+                // we may resolve them incorrectly ...
+                // try to find main jar and build absolute paths
+                File baseDir = null;
+                try {
+                    String path = Main.class.getProtectionDomain().getCodeSource().getLocation().getPath();
+                    //path will have encoded spaces, etc. => need to restore
+                    String decodedPath = URLDecoder.decode(path, "UTF-8");
+                    baseDir = new File(decodedPath).getParentFile();
+                    if (!baseDir.exists()) {
+                        baseDir = null;
+                    }
+                } catch (Exception e) {}
+                while (cp.length() > 0) {
+                    int pathSepIdx = cp.indexOf(" ");
+                    if (pathSepIdx < 0) {
+                        String pathElem = cp;
+                        File f = (baseDir == null) ?
+                                new File(pathElem) : new File(baseDir, pathElem);
+                        urlList.add(fileToURL(f));
+                        break;
+                    } else if (pathSepIdx > 0) {
+                        String pathElem = cp.substring(0, pathSepIdx);
+                        File f = (baseDir == null) ?
+                                new File(pathElem) : new File(baseDir, pathElem);
+                        urlList.add(fileToURL(f));
+                    }
+                    cp = cp.substring(pathSepIdx + 1);
+                }
+            }
+
+            // Add JavaFX runtime jar and deployment jars
+            if (jfxRtPath != null) {
+                File jfxRtLibPath = new File(jfxRtPath, "lib");
+                urlList.add(fileToURL(new File(jfxRtLibPath, "jfxrt.jar")));
+                File deployJar = new File(jfxRtLibPath, "deploy.jar");
+                //in the dev environment deploy.jars will not be part of
+                // built SDK unless it is windows
+                //However, hopefully java is used from relatively new java
+                // and we can add deploy jars from there?
+                //If no deploy jars are found we will treat it as runtime error
+                if (!deployJar.exists()) {
+                    deployJar = getDeployJarFromJRE();
+                }
+                if (deployJar != null) {
+                    URL deployJarURL = fileToURL(deployJar);
+                    urlList.add(deployJarURL);
+                    urlList.add(new URL(deployJarURL, "plugin.jar"));
+                    urlList.add(new URL(deployJarURL, "javaws.jar"));
+                } else {
+                    if (verbose) {
+                        System.err.println("Skip JavaFX Runtime at "
+                                + jfxRtPath + " as no deploy jars found.");
+                    }
+                    return null;
+                }
+            }
+
+            URL[] urls = (URL[])urlList.toArray(new URL[0]);
+            if (verbose) {
+                System.err.println("===== URL list");
+                for (int i = 0; i < urls.length; i++) {
+                    System.err.println("" + urls[i]);
+                }
+                System.err.println("=====");
+            }
+
+            ClassLoader urlClassLoader = new URLClassLoader(urls, null);
+            Class launchClass = Class.forName(fxLaunchClassName, true,
+                    urlClassLoader);
+            Method m = launchClass.getMethod("launchApplication", argTypes);
+            if (m != null) {
+                Thread.currentThread().setContextClassLoader(urlClassLoader);
+                return m;
+            }
+        } catch (Exception ex) {
+            if (jfxRtPath != null) {
+                ex.printStackTrace();
+            }
+        }
+
+        return null;
+    }
+
+    private static Method findLaunchMethodInClasspath(String fxClassPath) {
+        return findLaunchMethod(null, fxClassPath);
+    }
+
+    private static Method findLaunchMethodInJar(String jfxRtPathName, String fxClassPath) {
+        File jfxRtPath = new File(jfxRtPathName);
+
+        // Verify that we can read <jfxRtPathName>/lib/jfxrt.jar
+        File jfxRtLibPath = new File(jfxRtPath, "lib");
+        File jfxRtJar = new File(jfxRtLibPath, "jfxrt.jar");
+        if (!jfxRtJar.canRead()) {
+            if (verbose) {
+                System.err.println("Unable to read " + jfxRtJar.toString());
+            }
+            return null;
+        }
+
+        return findLaunchMethod(jfxRtPath, fxClassPath);
+    }
+
+    // convert version string in the form of x.y.z into int array of (x,y.z)
+    // return the array if version string can be converted.
+    // otherwise retun null
+    private static int[] convertVersionStringtoArray(String version) {
+        int[] v = new int[3];
+        if (version == null) {
+            return null;
+        }
+
+        String s[] = version.split("\\.");
+        if (s.length == 3) {
+            v[0] = Integer.parseInt(s[0]);
+            v[1] = Integer.parseInt(s[1]);
+            v[2] = Integer.parseInt(s[2]);
+            return v;
+        }
+        // version string passed in is bad
+        return null;
+    }
+
+    // compare the two version array a1 and a2
+    // return 0 if the two array contains the same version information
+    // (or both are invalid version specs)
+    // return 1 if a2 is greater than a1
+    // return -1 if a2 is less than a1
+    private static int compareVersionArray(int[] a1, int[] a2) {
+        boolean isValid1 = (a1 != null) && (a1.length == 3);
+        boolean isValid2 = (a2 != null) && (a2.length == 3);
+
+        // both bad
+        if (!isValid1 && !isValid2) {
+            return 0;
+        }
+
+        // a2 < a1
+        if (!isValid2) {
+            return -1;
+        }
+
+        // a2 > a1
+        if (!isValid1) {
+            return 1;
+        }
+
+        for (int i = 0; i < a1.length; i++) {
+            if (a2[i] > a1[i]) {
+                return 1;
+            }
+            if (a2[i] < a1[i]) {
+                return -1;
+            }
+        }
+
+        return 0;
+    }
+
+    private static File getDeployJarFromJRE() {
+        final String javaHome = System.getProperty("java.home");
+        if (verbose) {
+            System.err.println("java.home = " + javaHome);
+        }
+        if (javaHome == null || javaHome.equals("")) {
+            return null;
+        }
+
+        File jreLibPath = new File(javaHome, "lib");
+        File deployJar = new File(jreLibPath, "deploy.jar");
+
+        if (deployJar.exists()) {
+            return deployJar;
+        }
+        return null;
+    }
+
+    /**
+     * If we are on Windows, look in the system registry for the
+     * installed JavaFX runtime.
+     *
+     * @return the path to the JavaFX Runtime or null
+     */
+    private static String lookupRegistry() {
+        if (!System.getProperty("os.name").startsWith("Win")) {
+            return null;
+        }
+
+        try {
+            // Load deploy.jar, get a Config instance and load the native
+            // libraries; then load the windows registry class and lookup
+            // the method to get the windows registry entry
+
+            File deployJar = getDeployJarFromJRE();
+            if (deployJar == null) {
+                return null;
+            }
+
+            URL[] urls = new URL[]{fileToURL(deployJar)};
+            if (verbose) {
+                System.err.println(">>>> URL to deploy.jar = " + urls[0]);
+            }
+
+            ClassLoader deployClassLoader = new URLClassLoader(urls, null);
+
+            try {
+                // Load and initialize the native deploy library, ignore exception
+                String configClassName = "com.sun.deploy.config.Config";
+                Class configClass = Class.forName(configClassName, true,
+                        deployClassLoader);
+                Method m = configClass.getMethod("getInstance", null);
+                Object config = m.invoke(null, null);
+                m = configClass.getMethod("loadDeployNativeLib", null);
+                m.invoke(config, null);
+            } catch (Exception ex) {
+                // Ignore any exception, since JDK7 no longer has this method
+            }
+
+            String winRegistryWrapperClassName =
+                    "com.sun.deploy.association.utility.WinRegistryWrapper";
+
+            Class winRegistryWrapperClass = Class.forName(
+                    winRegistryWrapperClassName, true, deployClassLoader);
+
+            Method mGetSubKeys = winRegistryWrapperClass.getMethod(
+                    "WinRegGetSubKeys", new Class[]{
+                        Integer.TYPE,
+                        String.class,
+                        Integer.TYPE
+                    });
+
+            Field HKEY_LOCAL_MACHINE_Field2 =
+                    winRegistryWrapperClass.getField("HKEY_LOCAL_MACHINE");
+            final int HKEY_LOCAL_MACHINE2 = HKEY_LOCAL_MACHINE_Field2.getInt(null);
+            final String registryKey = "Software\\Oracle\\JavaFX\\";
+
+            // Read the registry and find all installed JavaFX runtime versions
+            // under HKLM\Software\Oracle\JavaFX\
+            String[] fxVersions = (String[]) mGetSubKeys.invoke(null, new Object[]{
+                        new Integer(HKEY_LOCAL_MACHINE2),
+                        registryKey,
+                        new Integer(255)
+                    });
+
+            if (fxVersions == null) {
+                // No JavaFX runtime installed in the system
+                return null;
+            }
+            String version = ZERO_VERSION;
+            // Iterate thru all installed JavaFX runtime verions in the system
+            for (int i = 0; i < fxVersions.length; i++) {
+                // get the latest version that is compatibible with the
+                // launcher JavaFX family version and meets minimum version requirement
+                if (fxVersions[i].startsWith(JAVAFX_FAMILY_VERSION)
+                        && fxVersions[i].compareTo(JAVAFX_REQUIRED_VERSION) >= 0) {
+                    int[] v1Array = convertVersionStringtoArray(version);
+                    int[] v2Array = convertVersionStringtoArray(fxVersions[i]);
+                    if (compareVersionArray(v1Array, v2Array) > 0) {
+                        version = fxVersions[i];
+                    }
+                } else {
+                    if (verbose) {
+                        System.err.println("  Skip version " + fxVersions[i]
+                                + " (required=" + JAVAFX_REQUIRED_VERSION + ")");
+                    }
+                }
+            }
+
+            if (version.equals(ZERO_VERSION)) {
+                // No installed JavaFX runtime compatible with this Launcher
+                return null;
+            }
+
+            // Read the registry entry for: Software\Oracle\JavaFX\<version>
+            String winRegistryClassName = "com.sun.deploy.util.WinRegistry";
+            Class winRegistryClass = Class.forName(winRegistryClassName, true,
+                    deployClassLoader);
+            Method mGet = winRegistryClass.getMethod("getString", new Class[]{
+                        Integer.TYPE,
+                        String.class,
+                        String.class
+                    });
+            Field HKEY_LOCAL_MACHINE_Field = winRegistryClass.getField("HKEY_LOCAL_MACHINE");
+            final int HKEY_LOCAL_MACHINE = HKEY_LOCAL_MACHINE_Field.getInt(null);
+            String path = (String) mGet.invoke(null, new Object[]{
+                        new Integer(HKEY_LOCAL_MACHINE),
+                        registryKey + version,
+                        "Path"
+                    });
+            if (verbose) {
+                System.err.println("FOUND KEY: " + registryKey + version + " = " + path);
+            }
+            return path;
+        } catch (Exception ex) {
+            ex.printStackTrace();
+        }
+
+        return null;
+    }
+
+    private static Attributes getJarAttributes() throws Exception {
+        String theClassFile = "Main.class";
+        Class theClass = Main.class;
+        String classUrlString = theClass.getResource(theClassFile).toString();
+        if (!classUrlString.startsWith("jar:file:") || classUrlString.indexOf("!") == -1){
+            return null;
+        }
+        // Strip out the "jar:" and everything after and including the "!"
+        String urlString = classUrlString.substring(4, classUrlString.lastIndexOf("!"));
+        File jarFile = new File(new URI(urlString).getPath());
+        String jarName = jarFile.getCanonicalPath();
+
+        Attributes attr;
+        JarFile jf = null;
+        try {
+            jf = new JarFile(jarName);
+            Manifest mf = jf.getManifest();
+            attr = mf.getMainAttributes();
+        } finally {
+            if (jf != null) {
+                try {
+                    jf.close();
+                } catch (Exception ex) {
+                    /* swallow the exception */
+                }
+            }
+        }
+        return attr;
+    }
+
+    private static String decodeBase64(String inp) throws IOException {
+        BASE64Decoder decoder = new BASE64Decoder();
+        byte[] decodedBytes = decoder.decodeBuffer(inp);
+        return new String(decodedBytes);
+    }
+
+    private static String[] getAppArguments(Attributes attrs) {
+        List args = new LinkedList();
+
+        try {
+            int idx = 1;
+            String argNamePrefix = "JavaFX-Argument-";
+            while (attrs.getValue(argNamePrefix + idx) != null) {
+                args.add(decodeBase64(attrs.getValue(argNamePrefix + idx)));
+                idx++;
+            }
+
+            String paramNamePrefix = "JavaFX-Parameter-Name-";
+            String paramValuePrefix = "JavaFX-Parameter-Value-";
+            idx = 1;
+            while (attrs.getValue(paramNamePrefix + idx) != null) {
+                String k = decodeBase64(attrs.getValue(paramNamePrefix + idx));
+                String v = null;
+                if (attrs.getValue(paramValuePrefix + idx) != null) {
+                    v = decodeBase64(attrs.getValue(paramValuePrefix + idx));
+                }
+                args.add("--" + k + "=" + (v != null ? v : ""));
+                idx++;
+            }
+        } catch (IOException ioe) {
+            System.err.println("Failed to extract application parameters");
+            ioe.printStackTrace();
+        }
+
+
+        return (String[]) args.toArray(new String[0]);
+    }
+
+    // Return the application class name, either from the property or from the
+    // jar file
+    private static String getAppName(Attributes attrs, boolean preloader) {
+        String propName = preloader
+                ? "javafx.preloader.class"
+                : "javafx.application.class";
+
+        String className = System.getProperty(propName);
+        if (className != null && className.length() != 0) {
+            return className;
+        }
+
+        String appName;
+
+        //this only true in the dev environment if run out of jar
+        if (attrs == null) {
+            return "TEST";
+        }
+
+        if (preloader) {
+            appName = (String)attrs.getValue(manifestPreloaderClass);
+            if (appName == null || appName.length() == 0) {
+                if (verbose) {
+                    System.err.println("Unable to find preloader class name");
+                }
+                return null;
+            }
+            return appName;
+        } else {
+            appName = (String)attrs.getValue(manifestAppClass);
+            if (appName == null || appName.length() == 0) {
+                System.err.println("Unable to find application class name");
+                return null;
+            }
+            return appName;
+        }
+    }
+
+    private static Class getAppClass(String appName) {
+        try {
+            // load the user's JavaFX class but do *not* initialize!
+            if (verbose) {
+                System.err.println("Try calling Class.forName(" + appName
+                        + ") using classLoader = "
+                        + Thread.currentThread().getContextClassLoader());
+            }
+            Class appClass = Class.forName(appName, false,
+                    Thread.currentThread().getContextClassLoader());
+            if (verbose) {
+                System.err.println("found class: " + appClass);
+            }
+            return appClass;
+        } catch (NoClassDefFoundError ncdfe) {
+            ncdfe.printStackTrace();
+            errorExit("Unable to find class: " + appName);
+        } catch (ClassNotFoundException cnfe) {
+            cnfe.printStackTrace();
+            errorExit("Unable to find class: " + appName);
+        }
+
+        return null;
+    }
+
+    //try to install webstart proxy to avoid asking user for proxy info
+    private static void tryToSetProxy() {
+        try {
+            if (attrs != null) {
+                String proxySetting = attrs.getValue(manifestAutoProxy);
+                if (proxySetting != null && !"auto".equals(proxySetting.toLowerCase())) {
+                   if (verbose) {
+                       System.out.println("Auto proxy detection is disabled in manifest.");
+                   }
+                   return;
+                }
+            }
+
+            //if explicit proxy settings are proxided we will skip autoproxy
+            //Note: we only check few most popular settings.
+            if (System.getProperty("http.proxyHost") != null
+                 || System.getProperty("https.proxyHost") != null
+                 || System.getProperty("ftp.proxyHost") != null
+                 || System.getProperty("socksProxyHost") != null) {
+               if (verbose) {
+                   System.out.println("Explicit proxy settings detected. Skip autoconfig.");
+                   System.out.println("  http.proxyHost=" + System.getProperty("http.proxyHost"));
+                   System.out.println("  https.proxyHost=" + System.getProperty("https.proxyHost"));
+                   System.out.println("  ftp.proxyHost=" + System.getProperty("ftp.proxyHost"));
+                   System.out.println("  socksProxyHost=" + System.getProperty("socksProxyHost"));
+               }
+               return;
+            }
+            if (System.getProperty("javafx.autoproxy.disable") != null) {
+                if (verbose) {
+                    System.out.println("Disable autoproxy on request.");
+                }
+                return;
+            }
+
+            Class sm = Class.forName("com.sun.deploy.services.ServiceManager",
+                    true,
+                    Thread.currentThread().getContextClassLoader());
+            Class params[] = {Integer.TYPE};
+            Method setservice = sm.getDeclaredMethod("setService", params);
+            String osname = System.getProperty("os.name");
+
+            String servicename = null;
+            if (osname.startsWith("Win")) {
+                servicename = "STANDALONE_TIGER_WIN32";
+
+            } else if (osname.contains("Mac")) {
+                servicename = "STANDALONE_TIGER_MACOSX";
+            } else {
+                servicename = "STANDALONE_TIGER_UNIX";
+            }
+            Object values[] = new Object[1];
+            Class pt = Class.forName("com.sun.deploy.services.PlatformType",
+                    true,
+                    Thread.currentThread().getContextClassLoader());
+            values[0] = pt.getField(servicename).get(null);
+            setservice.invoke(null, values);
+
+            Class dps = Class.forName(
+                    "com.sun.deploy.net.proxy.DeployProxySelector",
+                    true,
+                    Thread.currentThread().getContextClassLoader());
+            Method m = dps.getDeclaredMethod("reset", new Class[0]);
+            m.invoke(null, new Object[0]);
+            if (verbose) {
+                System.out.println("Autoconfig of proxy is completed.");
+            }
+        } catch (Exception e) {
+            if (verbose) {
+                System.out.println("Failed to autoconfig proxy due to "+e);
+            }
+        }
+    }
+
+    private static void processUpdateHook(String updateHookName) {
+        if (updateHookName == null) {
+            return;
+        }
+
+        try {
+            // load UpdateHook class
+            if (verbose) {
+                System.err.println("Try calling Class.forName(" + updateHookName
+                        + ") using classLoader = "
+                        + Thread.currentThread().getContextClassLoader());
+            }
+            Class hookClass = Class.forName(updateHookName, false,
+                    Thread.currentThread().getContextClassLoader());
+            if (verbose) {
+                System.err.println("found class: " + hookClass.getCanonicalName());
+            }
+
+            Method mainMethod = hookClass.getMethod("main",
+                        new Class[] { (new String[0]).getClass() });
+            String args[] = null;
+            mainMethod.invoke(null, new Object[] {args});
+
+        } catch (Exception ex) {
+            if (verbose) {
+                System.err.println("Failed to run update hook: "+ex.getMessage());
+                ex.printStackTrace();
+            }
+        }
+    }
+
+    private static void launchApp(Method launchMethod,
+            String appName,
+            String preloaderName,
+            String updateHookName,
+            String[] args) {
+
+        Class preloaderClass = null;
+        if (preloaderName != null) {
+            preloaderClass = getAppClass(preloaderName);
+        }
+        Class appClass = getAppClass(appName);
+        Class fxApplicationClass = null;
+        try {
+            fxApplicationClass = Class.forName(fxApplicationClassName,
+                true, Thread.currentThread().getContextClassLoader());
+        } catch (NoClassDefFoundError ex) {
+            errorExit("Cannot find " + fxApplicationClassName);
+        } catch (ClassNotFoundException ex) {
+            errorExit("Cannot find " + fxApplicationClassName);
+        }
+
+        if (fxApplicationClass.isAssignableFrom(appClass)) {
+            try {
+                if (verbose) {
+                    System.err.println("launchApp: Try calling "
+                            + launchMethod.getDeclaringClass().getName() + "."
+                            + launchMethod.getName());
+                }
+                tryToSetProxy();
+                processUpdateHook(updateHookName);
+                launchMethod.invoke(null, new Object[] { appClass, preloaderClass, args });
+            } catch (InvocationTargetException ex) {
+                ex.printStackTrace();
+                errorExit("Exception while running Application");
+            } catch (Exception ex) {
+                ex.printStackTrace();
+                errorExit("Unable to invoke launch method");
+            }
+        } else {
+            try {
+                if (verbose) {
+                    System.err.println("Try calling " + appClass.getName()
+                            + ".main(String[])");
+                }
+                Method mainMethod = appClass.getMethod("main",
+                        new Class[] { (new String[0]).getClass() });
+                mainMethod.invoke(null, new Object[] { args });
+            } catch (Exception ex) {
+                ex.printStackTrace();
+                errorExit("Unable to invoke main method");
+            }
+        }
+    }
+
+    // Check the JRE version. Exit with error if < 1.6
+    private static void checkJre() {
+        String javaVersion = System.getProperty("java.version");
+        if (verbose) {
+            System.err.println("java.version = " + javaVersion);
+            System.err.println("java.runtime.version = "
+                    + System.getProperty("java.runtime.version"));
+        }
+
+        // NOTE: This could be better, but should last until Java 9.
+        if (!javaVersion.startsWith("1.6")
+                && !javaVersion.startsWith("1.7")
+                && !javaVersion.startsWith("1.8")
+                && !javaVersion.startsWith("1.9")) {
+            showFallback(true);
+        }
+    }
+
+    private static Method findLaunchMethod(String fxClassPath) {
+        Method launchMethod;
+
+        // Try to find JavaFX LauncherImpl class on classpath
+        if (verbose) {
+            System.err.println("1) Try existing classpath...");
+        }
+        launchMethod = findLaunchMethodInClasspath(fxClassPath);
+        if (launchMethod != null) {
+            return launchMethod;
+        }
+
+        // Check for javafx.runtime.path variable; if set, look for the
+        // JavaFX LauncherImpl class there.
+        if (verbose) {
+            System.err.println("2) Try javafx.runtime.path property...");
+        }
+        String javafxRuntimePath = System.getProperty("javafx.runtime.path");
+        if (javafxRuntimePath != null) {
+            if (verbose) {
+                System.err.println("    javafx.runtime.path = " + javafxRuntimePath);
+            }
+            launchMethod = findLaunchMethodInJar(javafxRuntimePath, fxClassPath);
+        }
+        if (launchMethod != null) {
+            return launchMethod;
+        }
+
+        if (verbose) {
+            System.err.println("3) Look for cobundled JavaFX ... " +
+                    "[java.home="+System.getProperty("java.home"));
+        }
+        launchMethod = findLaunchMethodInJar(
+                System.getProperty("java.home"), fxClassPath);
+        if (launchMethod != null) {
+            return launchMethod;
+        }
+
+        // Check the platform registry for this architecture.
+        if (verbose) {
+            System.err.println("4) Look in the OS platform registry...");
+        }
+        javafxRuntimePath = lookupRegistry();
+        if (javafxRuntimePath != null) {
+            if (verbose) {
+                System.err.println("    Installed JavaFX runtime found in: "
+                        + javafxRuntimePath);
+            }
+            launchMethod = findLaunchMethodInJar(javafxRuntimePath, fxClassPath);
+            if (launchMethod != null) {
+                return launchMethod;
+            }
+        }
+
+// TODO: remove the following hard-coded paths; they are there so that the
+// apps/experiments will work without having JavaFX pre-installed (or on
+// the Mac)
+
+        // Check the platform registry for this architecture.
+        if (verbose) {
+            System.err.println("5) Look in hardcoded paths");
+        }
+        String[] hardCodedPaths = {
+            "../rt",
+            "../../../../rt", /* this is for sample code in the sdk/apps/src/BrickBreaker/dist */
+            "../../sdk/rt",
+            "../../../artifacts/sdk/rt"
+        };
+
+        for (int i = 0; i < hardCodedPaths.length; i++) {
+            javafxRuntimePath = hardCodedPaths[i];
+            launchMethod = findLaunchMethodInJar(javafxRuntimePath, fxClassPath);
+            if (launchMethod != null) {
+                return launchMethod;
+            }
+        }
+
+        return launchMethod;
+    }
+
+    public static void main(String [] args) {
+        // Set verbose flag
+        verbose = Boolean.getBoolean("javafx.verbose");
+
+        // First check the minimum JRE
+        checkJre();
+
+        // Load the main jar manifest attributes
+        try {
+            attrs = getJarAttributes();
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            errorExit("Unable to load jar manifest");
+        }
+
+        // Next get the application name
+        String appName = getAppName(attrs, false);
+        if (verbose) {
+            System.err.println("appName = " + appName);
+        }
+        if (appName == null) {
+            errorExit("Unable to find application class name");
+        }
+
+        // Next get the preloader name
+        String preloaderName = getAppName(attrs, true);
+        if (verbose) {
+            System.err.println("preloaderName = " + preloaderName);
+        }
+
+        String embeddedArgs[] = getAppArguments(attrs);
+        if (verbose) {
+            System.err.println("embeddedArgs = " + Arrays.toString(embeddedArgs));
+            System.err.println("commandLineArgs = " + Arrays.toString(args));
+        }
+
+        String updateHook = (String) attrs.getValue(manifestUpdateHook);
+        if (verbose && updateHook != null) {
+             System.err.println("updateHook = " + updateHook);
+        }
+
+        // Get JavaFX-Class-Path entry
+        String fxClassPath;
+        if (attrs != null) {
+           fxClassPath = (String)attrs.getValue(manifestClassPath);
+        } else {
+           fxClassPath = "";
+        }
+
+        Method launchMethod = findLaunchMethod(fxClassPath);
+        if (launchMethod != null) {
+            launchApp(launchMethod, appName, preloaderName, updateHook,
+                    args.length > 0 ? args: embeddedArgs);
+            return;
+        }
+
+        showFallback(false);
+    }
+
+    private static void showFallback(final boolean jreError) {
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                JFrame f = new JFrame("JavaFX Launcher");
+                f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+                JApplet japp = null;
+
+                //try to use custom fallback if available
+                if (attrs.getValue(manifestFallbackClass) != null) {
+                    Class customFallback = null;
+                    try {
+                        customFallback = Class.forName(
+                                attrs.getValue(manifestFallbackClass), false,
+                                Thread.currentThread().getContextClassLoader());
+                    } catch (ClassNotFoundException ce) {
+                        System.err.println("Custom fallback class is not found: "
+                                + attrs.getValue(manifestFallbackClass));
+                    }
+
+                    //If custom fallback attribute actually points to the
+                    // default JavaFX fallback we want to use other way to launch it
+                    if (customFallback != null
+                            && !NoJavaFXFallback.class.getName().equals(
+                                   customFallback.getName())) {
+                        try {
+                            japp = (JApplet) customFallback.newInstance();
+                        } catch (Exception e) {
+                            System.err.println("Failed to instantiate custom fallback "
+                                    + customFallback.getName() + " due to " + e);
+                        }
+                    }
+                }
+
+                //custom fallback missing or we fail to init it
+                if (japp == null) {
+                    //custom fallback will need to figure reason of error
+                    //on its own. Generic fallback gets extra input.
+                    japp = new NoJavaFXFallback(
+                            jreError, !jreError, JAVAFX_REQUIRED_VERSION);
+                    f.getContentPane().add(japp); //could be old JRE! use content pane
+                    f.pack();
+                    f.setVisible(true);
+                } else {
+                    japp.init();
+                    f.getContentPane().add(japp); //could be old JRE! use content pane
+                    japp.start();
+                    f.pack();
+                    f.setVisible(true);
+                }
+
+            }
+        });
+    }
+
+    private static void errorExit(final String string) {
+        try {
+            Runnable runnable = new Runnable() {
+                public void run() {
+                    try {
+                        Class componentClass = Class.forName("java.awt.Component");
+                        Class jOptionPaneClass = Class.forName("javax.swing.JOptionPane");
+                        Field ERROR_MESSAGE_Field = jOptionPaneClass.getField("ERROR_MESSAGE");
+                        final int ERROR_MESSAGE = ERROR_MESSAGE_Field.getInt(null);
+                        Method showMessageDialogMethod = jOptionPaneClass.getMethod(
+                                "showMessageDialog",
+                                new Class[] { componentClass,
+                                              Object.class,
+                                              String.class,
+                                              Integer.TYPE });
+                        showMessageDialogMethod.invoke(null, new Object[] {
+                                    null, string, "JavaFX Launcher Error",
+                                    new Integer(ERROR_MESSAGE) });
+                    } catch (Exception ex) {
+                        ex.printStackTrace();
+                    }
+                }
+            };
+
+            Class swingUtilsClass = Class.forName("javax.swing.SwingUtilities");
+            Method invokeAndWaitMethod = swingUtilsClass.getMethod("invokeAndWait",
+                    new Class[] { Runnable.class });
+            invokeAndWaitMethod.invoke(null, new Object[] { runnable });
+            if (verbose) {
+                System.err.println("Done with invoke and wait");
+            }
+        } catch (Exception ex) {
+            ex.printStackTrace();
+        }
+
+        System.exit(1);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/javafx-launcher/src/com/javafx/main/NoJavaFXFallback.java	Wed Dec 19 17:04:18 2012 -0500
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.javafx.main;
+
+import java.applet.Applet;
+import java.awt.BorderLayout;
+import java.awt.Container;
+import java.awt.Desktop;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.lang.reflect.Method;
+import java.net.URL;
+import javax.swing.JApplet;
+import javax.swing.JButton;
+import javax.swing.JTextPane;
+
+public class NoJavaFXFallback extends JApplet implements ActionListener {
+    boolean isInBrowser = false;
+    boolean oldJRE = true;
+    String requiredJavaFXVersion = null;
+    boolean oldJavaFX = false;
+    boolean doNotUseJNLPAPI = false;
+
+    public NoJavaFXFallback() {
+    }
+
+    //used by standalone launcher
+    public NoJavaFXFallback(boolean needJREUpgrade, boolean needFXUpgrade, String requiredJavaFX) {
+        this.isInBrowser = false;
+        this.oldJavaFX = needFXUpgrade;
+        this.requiredJavaFXVersion = requiredJavaFX;
+        this.oldJRE = needJREUpgrade;
+        this.doNotUseJNLPAPI = true;
+
+        populate();
+    }
+
+    private static float getJavaVersionAsFloat() {
+        String versionString = System.getProperty("java.version", "1.5.0");
+
+        StringBuffer sb = new StringBuffer();
+
+        int firstDot = versionString.indexOf(".");
+        sb.append(versionString.substring(0,firstDot));
+
+        int secondDot = versionString.indexOf(".", firstDot+1);
+        sb.append(versionString.substring(firstDot+1, secondDot));
+
+        int underscore = versionString.indexOf("_", secondDot+1);
+        if (underscore >= 0) {
+            int dash = versionString.indexOf("-", underscore+1);
+            if (dash < 0) {
+                dash = versionString.length();
+            }
+            sb.append(versionString.substring(secondDot+1, underscore)).
+                append(".").
+                append(versionString.substring(underscore+1, dash));
+        } else {
+            int dash = versionString.indexOf("-", secondDot+1);
+            if (dash < 0) {
+                dash = versionString.length();
+            }
+            sb.append(versionString.substring(secondDot+1, dash));
+        }
+
+        float version = 150.0f;
+        try {
+            version = Float.parseFloat(sb.toString());
+        } catch (NumberFormatException e) {}
+
+        return version;
+    }
+
+    private void test() {
+        oldJRE = getJavaVersionAsFloat() < 160.18f; //< 6u18
+        try {
+           // if run in browser then should be able to get JSObject
+           Class jclass = Class.forName("netscape.javascript.JSObject");
+           Method m = jclass.getMethod("getWindow", new Class[] {Applet.class});
+           isInBrowser = (m.invoke(null, new Object[] {this}) != null);
+        } catch (Exception e) {}
+    }
+
+    String getText() {
+        String text = "This application requires a newer version "
+                    + "of the Java runtime. Please download and install the "
+                    + "latest Java runtime from java.com.";
+        if (isInBrowser) {
+            text = text + " Then restart the browser.";
+        } else {
+            text = text + " Then restart the application.";
+        }
+        return text;
+    }
+
+    public void init() {
+        //do not get here in the standalone more
+        requiredJavaFXVersion = getParameter("requiredFXVersion");
+        test();
+        populate();
+    }
+
+    private void populate() {
+        Container pane = this.getContentPane();
+        pane.setLayout(new BorderLayout());
+        JTextPane l = new JTextPane();
+        l.setText(getText());
+        l.setEditable(false);
+
+        pane.add(l, BorderLayout.CENTER);
+
+        if (getJavaVersionAsFloat() > 160f || //can use AWT APIs
+                (getJavaVersionAsFloat() > 150f && !doNotUseJNLPAPI)) { //do not have JNLP API in 1.4?
+            JButton installButton = new JButton("Install Now");
+            installButton.addActionListener(this);
+            pane.add(installButton, BorderLayout.SOUTH);
+        }
+    }
+
+    public void actionPerformed(ActionEvent ae) {
+        try {
+            URL u = new URL("http://java.com/");
+            if (isInBrowser) {
+                getAppletContext().showDocument(u);
+            } else {
+                if (!doNotUseJNLPAPI) {
+                    Class sm = Class.forName("javax.jnlp.ServiceManager");
+                    Class bs = Class.forName("javax.jnlp.BasicService");
+                    Method lookup = sm.getMethod(
+                            "lookup", new Class[]{String.class});
+                    Method showDoc = bs.getMethod(
+                            "showDocument", new Class[]{java.net.URL.class});
+                    Object s = lookup.invoke(
+                            null, new Object[]{"javax.jnlp.BasicService"});
+                    showDoc.invoke(s, new Object[]{u});
+                } else { //running standalone app?
+                    //use awt.Desktop. if we got here then it must be available
+                    Desktop d = Desktop.getDesktop();
+                    if (d != null) {
+                        d.browse(u.toURI());
+                    }
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}
Binary file deploy/lib/error.png has changed
Binary file deploy/lib/get_java.png has changed
Binary file deploy/lib/get_javafx.png has changed
Binary file deploy/lib/java-coffee-cup-23x20.png has changed
Binary file deploy/lib/javafx-chrome.png has changed
Binary file deploy/lib/javafx-loading-100x100.gif has changed
Binary file deploy/lib/javafx-loading-25x25.gif has changed
Binary file deploy/lib/splash.gif has changed
Binary file deploy/lib/upgrade_java.png has changed
Binary file deploy/lib/upgrade_javafx.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/man/build.xml	Wed Dec 19 17:04:18 2012 -0500
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="JavaFX Man Pages" default="default" basedir=".">
+    <!-- Import common properties and definitions -->
+    <import file="../../build-defs.xml"/>
+
+    <property name="ja.suffix" value="JP.UTF-8"/>
+
+    <target name="default" depends="copy-man-pages"/>
+
+    <target name="copy-man-pages"
+            depends="-copy-man-pages-linux,-copy-man-pages-macosx">
+    </target>
+
+    <target name="-copy-man-pages-linux" if="isLinux">
+        <antcall target="-copy-man-pages-common"/>
+
+        <mkdir dir="${jfx.sdk.man.dir}/ja_${ja.suffix}/man1"/>
+        <copy todir="${jfx.sdk.man.dir}/ja_${ja.suffix}/man1">
+            <fileset dir="${basedir}/ja/man1" includes="*.1"/>
+        </copy>
+    </target>
+
+    <target name="-copy-man-pages-macosx" if="isMacOSX">
+        <antcall target="-copy-man-pages-common"/>
+    </target>
+
+    <target name="-copy-man-pages-common" unless="isWindows">
+        <delete dir="${jfx.sdk.man.dir}"/>
+        <mkdir dir="${jfx.sdk.man.dir}/man1"/>
+        <copy todir="${jfx.sdk.man.dir}/man1">
+            <fileset dir="${basedir}/man1" includes="*.1"/>
+        </copy>
+    </target>
+
+    <target name="clean">
+        <delete dir="${jfx.sdk.man.dir}"/>
+    </target>
+</project>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/man/html/javafxpackager.1.html	Wed Dec 19 17:04:18 2012 -0500
@@ -0,0 +1,201 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html lang="en-US" xmlns="http://www.w3.org/1999/xhtml" xml:lang=
+"en-US">
+<head>
+<title>javafxpackager Command Line</title>
+<meta http-equiv="Content-Type" content=
+"text/html; charset=utf-8" />
+<meta name="collection" content="reference" />
+<meta name="copyright" content="2008, 2012"/>
+</head>
+
+<body>
+<h1>javafxpackager Command Line
+</h1>
+<h2>NAME</h2>
+<p><code>javafxpackager</code> - A tool with commands that perform tasks related to
+  packaging and signing JavaFX applications.</p>
+<h2>SYNOPSIS</h2>
+<p><code>javafxpackager -taskcommand [-options]</code></p>
+<p>where <code>-taskcommand</code> is one of the following:</p>
+<p><code>-createjar</code></p>
+<p>Produces a JAR archive according to other parameters.</p>
+<p><code>-deploy</code></p>
+<p>Generates the JNLP and HTML files according to other parameters.</p>
+<p><code>-createbss</code></p>
+<p>Converts CSS files into binary form.</p>
+<p><code>-signJar</code></p>
+<p>Signs JAR file(s) with a provided certificate.</p>
+<p><code>-makeall</code></p>
+<p>Performs compilation, createjar, and deploy steps as one call, with
+  most arguments predefined. The source files must be located in a
+  folder called src, and the resulting files (JAR, JNLP, HTML) are
+  put in a folder called dist. This command can only be configured in
+  a minimal way and is as automated as possible.</p>
+<h2>OPTIONS FOR THE CREATEJAR COMMAND</h2>
+<p><code>-appclass &lt;application class&gt;</code></p>
+<p>Qualified name of the application class to be executed.</p>
+<p><code>-preloader &lt;preloader class&gt;</code></p>
+<p>Qualified name of the preloader class to be executed.</p>
+<p><code>-paramfile &lt;file&gt;</code></p>
+<p>A properties file with default named application parameters.</p>
+<p><code>-argument arg</code></p>
+<p>An unnamed argument to be inserted into the JNLP file as an
+<code>&lt;fx:argument&gt;</code> element.</p>
+<p><code>-classpath &lt;files&gt;</code></p>
+<p>List of dependent JAR file names.</p>
+<p><code>-manifestAttrs &lt;manifest attributes&gt;</code></p>
+<p>List of additional manifest attributes. Syntax:</p>
+<p><code>&quot;name1=value1,name2=value2,name3=value3&quot;</code></p>
+<p><code>-noembedlauncher</code></p>
+<p>If present, the packager will not add the JavaFX launcher classes
+  to the JAR file.</p>
+<p><code>-nocss2bin</code></p>
+<p>The packager will not convert CSS files to binary form before
+  copying to JAR.</p>
+<p><code>-runtimeversion &lt;version&gt;</code></p>
+<p>Version of the required JavaFX Runtime.</p>
+<p><code>-outdir &lt;dir&gt;</code></p>
+<p>Name of the directory that will receive generated output files.</p>
+<p><code>-outfile &lt;filename&gt;</code></p>
+<p>Name (without the extension) of the file that will be generated.</p>
+<p><code>-srcdir &lt;dir&gt;</code></p>
+<p>Base directory of the files to package.</p>
+<p><code>-srcfiles &lt;files&gt;</code></p>
+<p>List of files in srcdir. If omitted, all files in <code>srcdir</code> (which is a mandatory 
+argument in this case) will be used.</p>
+<h2>OPTIONS FOR THE DEPLOY COMMAND</h2>
+<p><code>-title &lt;title&gt;</code></p>
+<p>Title of the application.</p>
+<p><code>-vendor &lt;vendor&gt;</code></p>
+<p>Vendor of the application.</p>
+<p><code>-description &lt;description&gt;</code></p>
+<p>Description of the application.</p>
+<p><code>-appclass &lt;application class&gt;</code></p>
+<p>Qualified name of the application class to be executed.</p>
+<p><code>-preloader &lt;preloader class&gt;</code></p>
+<p>Qualified name of the preloader class to be executed.</p>
+<p><code>-paramfile &lt;file&gt;</code></p>
+<p>Properties file with default named application parameters.</p>
+<p><code>-htmlparamfile &lt;file&gt;</code></p>
+<p>Properties file with parameters for the resulting application when
+  it is run in the browser.</p>
+<p><code>-width &lt;width&gt;</code></p>
+<p>Width of the application.</p>
+<p><code>-height &lt;height&gt;</code></p>
+<p>Height of the application.</p>
+<p><code>-native &lt;type&gt;</code></p>
+<p>Generate self-contained application bundles (if possible). If type
+           is specified, then only a bundle of this type is created. List of
+           supported types includes: installer, image, exe, msi, dmg, rpm,
+           deb.</p>
+<p><code>-name &lt;name&gt;</code></p>
+<p>Name of the application.</p>
+<p><code>-embedjnlp</code></p>
+<p>If present, the JNLP file will be embedded in the HTML document.</p>
+<p><code>-embedCertificates</code></p>
+<p>If present, the certificates will be embedded in the JNLP file.</p>
+<p><code>-allpermissions</code></p>
+<p>If present, the application will require all security permissions
+  in the JNLP file.</p>
+<p><code>-updatemode &lt;updatemode&gt;</code></p>
+<p>Sets the update mode for the JNLP file.</p>
+<p><code>-isExtension</code></p>
+<p>If present, the srcfiles are treated as extensions.</p>
+<p><code>-callbacks</code></p>
+<p>Specifies user callback methods in generated HTML. The format is
+  the following:</p>
+<p><code>&quot;name1:value1,name2:value2,...&quot;</code></p>
+<p><code>-templateInFilename</code></p>
+<p>Name of the HTML template file. Placeholders are in the following
+  form:<br />
+<code>#XXXX.YYYY(APPID)#</code></p>
+<p><code>-templateOutFilename</code></p>
+<p>Name of the HTML file that will be generated from the template.</p>
+<p><code>-templateId</code></p>
+<p>Application ID of the application for template processing.</p>
+<p><code>-argument arg</code></p>
+<p>An unnamed argument to be inserted into an &lt;fx:argument&gt; element in
+  the JNLP file.</p>
+<p><code>-outdir &lt;dir&gt;</code></p>
+<p>Name of the directory that will receive generated output files.</p>
+<p><code>-outfile &lt;filename&gt;</code></p>
+<p>Name (without the extension) of the file that will be generated.</p>
+<p><code>-srcdir &lt;dir&gt;</code></p>
+<p>Base directory of the files to package.</p>
+<p><code>-srcfiles &lt;files&gt;</code></p>
+<p>List of files in srcdir. If omitted, all files in <code>srcdir</code> (which is a mandatory argument in this case) will be used.</p>
+<h2>OPTIONS FOR THE CREATEBSS COMMAND</h2>
+<p><code>-outdir &lt;dir&gt;</code></p>
+<p>Name of the directory that will receive generated output files.</p>
+<p><code>-srcdir &lt;dir&gt;</code></p>
+<p>Base directory of the files to package.</p>
+<p><code>-srcfiles &lt;files&gt;</code></p>
+<p>List of files in srcdir. If omitted, all files in <code>srcdir</code> (which is a mandatory argument in this case) will be used.</p>
+<h2>OPTIONS FOR THE SIGNJAR COMMAND</h2>
+<p><code>-keyStore &lt;file&gt;</code></p>
+<p>Keystore file name.</p>
+<p><code>-alias</code></p>
+<p>Alias for the key.</p>
+<p><code>-storePass</code></p>
+<p>Password to check integrity of the keystore or unlock the keystore</p>
+<p><code>-keyPass</code></p>
+<p>Password for recovering the key.</p>
+<p><code>-storeType</code></p>
+<p>Keystore type. The default value is &quot;jks&quot;.</p>
+<p><code>-outdir &lt;dir&gt;</code></p>
+<p>Name of the directory that will receive generated output files.</p>
+<p><code>-srcdir &lt;dir&gt;</code></p>
+<p>Base directory of the files to be signed.</p>
+<p><code>-srcfiles &lt;files&gt;</code></p>
+<p>List of files in srcdir. If omitted, all files in <code>srcdir</code> (which is a mandatory argument in this case) will be used.</p>
+<h2>OPTIONS FOR THE MAKEALL COMMAND</h2>
+<p><code>-appclass &lt;application class&gt;</code></p>
+<p>Qualified name of the application class to be executed.</p>
+<p><code>-preloader &lt;preloader class&gt;</code></p>
+<p>Qualified name of the preloader class to be executed.</p>
+<p><code>-classpath &lt;files&gt;</code></p>
+<p>List of dependent JAR file names.</p>
+<p><code>-name &lt;name&gt;</code></p>
+<p>Name of the application.</p>
+<p><code>-width &lt;width&gt;</code></p>
+<p>Width of the application.</p>
+<p><code>-height &lt;height&gt;</code></p>
+<p>Height of the application.</p>
+<h2>NOTES</h2>
+<p>A <code>-v</code> option can be used with any task command to enable verbose
+  output.</p>
+<p>When the <code>-srcdir</code> option is allowed in a command, it can be used
+  more than once. If the <code>-srcfiles</code> option is specified, the files
+  named in the argument will be looked for in the location specified
+  in the preceding srcdir option. In case there is no <code>-srcdir</code>  preceding <code>-srcfiles</code>, the directory where the javafxpackager command
+  is executed will be used.</p>
+<h2>EXAMPLES</h2>
+<p>Example 1, -createjar Command Usage</p>
+<p><code>javafxpackager -createjar -appclass package.ClassName<br />
+  -srcdir classes -outdir out -outfile outjar -v</code></p>
+<p>Packages the contents of the classes directory to outjar.jar, sets
+  the application class to package.ClassName.<br /></p>
+<p> Example 2, -deploy Command Usage</p>
+<p><code>javafxpackager -deploy -outdir outdir -outfile outfile -width 34 -height 43<br />
+  -name AppName -appclass package.ClassName -v -srcdir compiled</code></p>
+<p>Generates outfile.jnlp and the corresponding outfile.html files in
+  outdir for application AppName, which is started by package.ClassName
+  and has dimensions of 34 x 43.<br /></p>
+<p>Example 3, -makeall command Usage</p>
+<p><code>javafxpackager -makeall -appclass brickbreaker.Main -name BrickBreaker<br />
+  -width 600 -height 600</code></p>
+<p>Does all the packaging work including compilation: compile,
+  createjar, deploy.<br /></p>
+<p>Example 4, -signJar Command Usage</p>
+<p><code>javafxpackager -signJar --outdir dist -keyStore sampleKeystore.jks<br />
+-storePass **** -alias javafx -keypass **** -srcdir dist</code></p>
+<p>Signs all of the JAR files in the dist directory, attaches a
+  certificate with the specified alias, keyStore and storePass, and
+  puts the signed JAR files back into the dist directory.</p>
+
+
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/man/ja/html/javafxpackager.html	Wed Dec 19 17:04:18 2012 -0500
@@ -0,0 +1,29 @@
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
+<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>javafxpackager</title>
+<meta name="copyright" content="2008, 2012"/>
+<style type="text/css">
+h1, h2, h3, h4, h5, h6 { font-family: sans-serif; }
+.CodeInline { font-family: monospace; }
+</style>
+</head>
+<body>
+<div class="refentry" title="javafxpackager"><a id="id2747777"></a><div class="titlepage"></div><div class="refnamediv"><h2>名前</h2><p>javafxpackager — JavaFXアプリケーションのパッケージ化と署名に関連するタスクを実行するコマンドを備えたツール。</p></div><div class="refsection" title="形式"><a id="id2747782"></a><h2>形式</h2>
+<div class="informalexample"><pre class="programlisting">javafxpackager <span class="emphasis"><em>-taskcommand</em></span> <span class="emphasis"><em>[-options]</em></span>
+</pre></div>
+<p>ここで、<span class="emphasis"><em>-taskcommand</em></span>には、次のいずれかを指定します。 </p>
+<div class="variablelist"><dl><dt><span class="term">-createjar</span></dt><dd><p>他のパラメータに従ってJARアーカイブを作成します。</p></dd><dt><span class="term">-deploy</span></dt><dd><p>他のパラメータに従ってJNLPおよびHTMLファイルを生成します。</p></dd><dt><span class="term">-createbss</span></dt><dd><p>CSSファイルをバイナリ形式に変換します。 </p></dd><dt><span class="term">-signJar</span></dt><dd><p>指定した証明書でJARファイルに署名します。</p></dd><dt><span class="term">-makeall</span></dt><dd><p>事前定義された引数の大半を使用して、コンパイル、<span class="CodeInline">createjar</span>、<span class="CodeInline">deploy</span>のステップを1つの呼出しで実行します。ソース・ファイルはsrcというフォルダに配置する必要があり、生成されるファイル(JAR、JNLP、HTML)はdistというフォルダに出力されます。このコマンドでは最小限の構成のみが可能で、可能な限り自動化されています。</p></dd></dl></div></div><div class="refsection" title="createjarコマンドのオプション"><a id="id2748018"></a><h2>createjarコマンドのオプション</h2>
+<div class="variablelist"><dl><dt><span class="term">-appclass <span class="emphasis"><em>&lt;application class></em></span></span></dt><dd><p>実行するアプリケーション・クラスの修飾名。</p></dd><dt><span class="term">-preloader <span class="emphasis"><em>&lt;preloader class></em></span></span></dt><dd><p>実行するプリローダー・クラスの修飾名。</p></dd><dt><span class="term">-paramfile &lt;file></span></dt><dd><p>デフォルトの名前付きアプリケーション・パラメータが含まれるプロパティ・ファイル。</p></dd><dt><span class="term">-argument arg</span></dt><dd><p><span class="CodeInline">&lt;fx:argument></span>要素としてJNLPファイルに挿入される名前なし引数。</p></dd><dt><span class="term">-classpath <span class="emphasis"><em>&lt;files></em></span></span></dt><dd><p>依存するJARファイル名のリスト。</p></dd><dt><span class="term"> -manifestAttrs <span class="emphasis"><em>&lt;manifest attributes></em></span></span></dt><dd><p>追加のマニフェスト属性のリスト。構文: </p><div class="informalexample"><pre class="programlisting">"name1=value1,name2=value2,name3=value3"</pre></div></dd><dt><span class="term">-noembedlauncher</span></dt><dd><p>指定した場合、パッケージャはJARファイルにJavaFX起動クラスを追加しません。</p></dd><dt><span class="term">-nocss2bin</span></dt><dd><p>パッケージャはJARにコピーする前にCSSファイルをバイナリ形式に変換しません。</p></dd><dt><span class="term">-runtimeversion <span class="emphasis"><em>&lt;version></em></span></span></dt><dd><p>必要なJavaFXランタイムのバージョン。</p></dd><dt><span class="term">-outdir <span class="emphasis"><em>&lt;dir></em></span></span></dt><dd><p>生成された出力ファイルを受け取るディレクトリの名前。</p></dd><dt><span class="term">-outfile <span class="emphasis"><em>&lt;filename></em></span></span></dt><dd><p>生成されるファイルの名前(拡張子なし)。</p></dd><dt><span class="term"> -srcdir <span class="emphasis"><em>&lt;dir></em></span></span></dt><dd><p>パッケージ化するファイルのベース・ディレクトリ。</p></dd><dt><span class="term">-srcfiles <span class="emphasis"><em>&lt;files></em></span></span></dt><dd><p><span class="CodeInline">srcdir</span>内のファイルのリスト。省略すると、<span class="CodeInline">srcdir</span>内のすべてのファイルがパッケージ化されます。</p></dd></dl></div></div><div class="refsection" title="deployコマンドのオプション"><a id="BABBIGDB"></a><h2>deployコマンドのオプション</h2><div class="variablelist"><dl><dt><span class="term">-title <span class="emphasis"><em>&lt;title></em></span></span></dt><dd><p>アプリケーションのタイトル。</p></dd><dt><span class="term">-vendor <span class="emphasis"><em>&lt;vendor></em></span></span></dt><dd><p>アプリケーションのベンダー。</p></dd><dt><span class="term">-description <span class="emphasis"><em>&lt;description></em></span></span></dt><dd><p>アプリケーションの説明。</p></dd><dt><span class="term">-appclass <span class="emphasis"><em>&lt;application class></em></span></span></dt><dd><p>実行するアプリケーション・クラスの修飾名。</p></dd><dt><span class="term">-preloader <span class="emphasis"><em>&lt;preloader class></em></span></span></dt><dd><p>実行するプリローダー・クラスの修飾名。</p></dd><dt><span class="term">-paramfile <span class="emphasis"><em>&lt;file></em></span></span></dt><dd><p>デフォルトの名前付きアプリケーション・パラメータが含まれるプロパティ・ファイル。</p></dd><dt><span class="term">-htmlparamfile <span class="emphasis"><em>&lt;file></em></span></span></dt><dd><p>生成されるアプリケーションをブラウザで実行する場合のパラメータが含まれるプロパティ・ファイル。</p></dd><dt><span class="term">-width <span class="emphasis"><em>&lt;width></em></span></span></dt><dd><p>アプリケーションの幅。</p></dd><dt><span class="term">-height <span class="emphasis"><em>&lt;height></em></span></span></dt><dd><p>アプリケーションの高さ。</p></dd><dt><span class="term">-native &lt;name></span></dt><dd><p>プラットフォーム固有のネイティブ・バンドルを生成します(可能な場合)。</p></dd><dt><span class="term">-name <span class="emphasis"><em>&lt;name></em></span></span></dt><dd><p>アプリケーションの名前。</p></dd><dt><span class="term">-embedjnlp</span></dt><dd><p>指定した場合、JNLPファイルがHTMLドキュメントに埋め込まれます。</p></dd><dt><span class="term">-embedCertificates</span></dt><dd><p>指定した場合、証明書がJNLPファイルに埋め込まれます。</p></dd><dt><span class="term">-allpermissions</span></dt><dd><p>指定した場合、JNLPファイル内のすべてのセキュリティ権限がアプリケーションに必要になります。</p></dd><dt><span class="term"> -updatemode <span class="emphasis"><em>&lt;updatemode></em></span></span></dt><dd><p>JNLPファイルの更新モードを設定します。</p></dd><dt><span class="term">-isExtension</span></dt><dd><p>指定した場合、srcfilesは拡張ファイルとして処理されます。</p></dd><dt><span class="term">-callbacks</span></dt><dd><p>生成後のHTMLでのユーザー・コールバック方式を指定します。形式は次のとおりです。</p><div class="informalexample"><pre class="programlisting">"name1:value1,name2:value2,..."</pre></div></dd><dt><span class="term">-templateInFilename</span></dt><dd><p>HTMLテンプレート・ファイルの名前。プレースホルダの形式は次のとおりです。</p><div class="informalexample"><pre class="programlisting">#XXXX.YYYY(APPID)#</pre></div></dd><dt><span class="term">-templateOutFilename</span></dt><dd><p>テンプレートから生成されるHTMLファイルの名前。</p></dd><dt><span class="term"> -templateId</span></dt><dd><p>テンプレート処理を行うアプリケーションのアプリケーションID。</p></dd><dt><span class="term">-argument arg</span></dt><dd><p>JNLPファイルの<span class="CodeInline">&lt;fx:argument></span>要素に挿入される名前なし引数。</p></dd><dt><span class="term">-outdir <span class="emphasis"><em>&lt;dir></em></span></span></dt><dd><p>生成された出力ファイルを受け取るディレクトリの名前。</p></dd><dt><span class="term">-outfile <span class="emphasis"><em>&lt;filename></em></span></span></dt><dd><p>生成されるファイルの名前(拡張子なし)。</p></dd><dt><span class="term">-srcdir <span class="emphasis"><em>&lt;dir></em></span></span></dt><dd><p>パッケージ化するファイルのベース・ディレクトリ。</p></dd><dt><span class="term">-srcfiles <span class="emphasis"><em>&lt;files></em></span></span></dt><dd><p><span class="CodeInline">srcdir</span>内のファイルのリスト。省略すると、<span class="CodeInline">srcdir</span>内のすべてのファイルがパッケージ化されます。</p></dd></dl></div></div><div class="refsection" title="createbssコマンドのオプション"><a id="BABBBDJG"></a><h2>createbssコマンドのオプション</h2>
+<div class="variablelist"><dl><dt><span class="term">-outdir <span class="emphasis"><em>&lt;dir></em></span></span></dt><dd><p>生成された出力ファイルを受け取るディレクトリの名前。</p></dd><dt><span class="term">-srcdir <span class="emphasis"><em>&lt;dir></em></span></span></dt><dd><p>パッケージ化するファイルのベース・ディレクトリ。</p></dd><dt><span class="term">-srcfiles <span class="emphasis"><em>&lt;files></em></span></span></dt><dd><p><span class="CodeInline">srcdir</span>内のファイルのリスト。省略すると、<span class="CodeInline">srcdir</span>内のすべてのファイルがパッケージ化されます。</p></dd></dl></div></div><div class="refsection" title="signJarコマンドのオプション"><a id="id2748645"></a><h2>signJarコマンドのオプション</h2>
+<div class="variablelist"><dl><dt><span class="term">-keyStore <span class="emphasis"><em>&lt;file></em></span></span></dt><dd><p>キーストア・ファイル名。</p></dd><dt><span class="term">-alias</span></dt><dd><p>キーの別名。</p></dd><dt><span class="term">-storePass</span></dt><dd><p>キーストアの整合性を確認したり、ロックを解除するためのパスワード。</p></dd><dt><span class="term"> -keyPass</span></dt><dd><p>キーを復元するためのパスワード。</p></dd><dt><span class="term">-storeType</span></dt><dd><p>キーストアのタイプ。デフォルト値は"jks"です。</p></dd><dt><span class="term">-outdir <span class="emphasis"><em>&lt;dir></em></span></span></dt><dd><p>生成された出力ファイルを受け取るディレクトリの名前。</p></dd><dt><span class="term">-srcdir <span class="emphasis"><em>&lt;dir></em></span></span></dt><dd><p>署名するファイルのベース・ディレクトリ。</p></dd><dt><span class="term">-srcfiles <span class="emphasis"><em>&lt;files></em></span></span></dt><dd><p><span class="CodeInline">srcdir</span>内のファイルのリスト。省略すると、<span class="CodeInline">srcdir</span>内のすべてのファイルが署名されます。</p></dd></dl></div></div><div class="refsection" title="makeAllコマンドのオプション"><a id="id2748661"></a><h2>makeAllコマンドのオプション</h2>
+<div class="variablelist"><dl><dt><span class="term">-appclass <span class="emphasis"><em>&lt;application class></em></span></span></dt><dd><p>実行するアプリケーション・クラスの修飾名。</p></dd><dt><span class="term">-preloader <span class="emphasis"><em>&lt;preloader class></em></span></span></dt><dd><p>実行するプリローダー・クラスの修飾名。</p></dd><dt><span class="term">-classpath <span class="emphasis"><em>&lt;files></em></span></span></dt><dd><p>依存するJARファイル名のリスト。</p></dd><dt><span class="term">-name <span class="emphasis"><em>&lt;name></em></span></span></dt><dd><p>アプリケーションの名前。</p></dd><dt><span class="term">-width <span class="emphasis"><em>&lt;width></em></span></span></dt><dd><p>アプリケーションの幅。</p></dd><dt><span class="term">-height <span class="emphasis"><em>&lt;height></em></span></span></dt><dd><p>アプリケーションの高さ。</p></dd></dl></div></div><div class="refsection" title="注意"><a id="id2748766"></a><h2>注意</h2>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>タスク・コマンドとともに<span class="CodeInline">-v </span>オプションを使用すれば、詳細な出力が有効になります。</p></li><li class="listitem"><p><span class="CodeInline">-srcdir</span>オプションをコマンドで使用できる場合は、複数回使用できます。<span class="CodeInline">-srcfiles</span>オプションを指定すると、引数に指定されたファイル名が、その前に指定されている<span class="CodeInline">srcdir</span>オプションで指定された場所で検索されます。<span class="CodeInline">-srcdir</span>が<span class="CodeInline">-srcfiles</span>の前に指定されていない場合は、javafxpackagerコマンドが実行されるディレクトリが使用されます。 </p></li></ul></div></div><div class="refsection" title="例"><a id="id2748878"></a><h2>例</h2>
+<div class="variablelist"><dl><dt><span class="term"><span class="bold"><strong>例1</strong></span>: </span><span class="term"><a id="BABEJIGE"></a>-createjarコマンドの使用方法</span></dt><dd><div class="informalexample"><pre class="programlisting">javafxpackager -createjar -appclass package.class  
+  -srcdir classes -outdir out -outfile outjar -v
+</pre></div><p>classesディレクトリの内容をoutjar.jarにパッケージ化して、アプリケーション・クラスをpackage.classに設定します。</p></dd><dt><span class="term"><span class="bold"><strong>例2</strong></span>: </span><span class="term"><a id="BABGJHHJ"></a>-deployコマンドの使用方法</span></dt><dd><div class="informalexample"><pre class="programlisting">javafxpackager -deploy -outdir outdir -outfile outfile -width 34 -height 43 
+  -name AppName -appclass package.class -v -srcdir compiled
+</pre></div><p>outfile.jnlpファイルおよび対応するoutfile.htmlファイルを、アプリケーションAppNameのoutdirに生成します。これは、package.classクラスで始まり、34 x 43の配列を持ちます。</p></dd><dt><span class="term"><span class="bold"><strong>例</strong></span>: </span><span class="term">-makeallコマンドの使用方法</span></dt><dd><div class="informalexample"><pre class="programlisting">javafxpackager -makeall -appclass brickbreaker.Main -name BrickBreaker
+  -width 600 -height 600
+</pre></div><p>コンパイルを含むすべてのパッケージ化作業(コンパイル、Jarの作成、デプロイ)を実行します。</p></dd><dt><span class="term"><span class="bold"><strong>例4</strong></span>: </span><span class="term"><a id="BABFFICA"></a>-signJarコマンドの使用方法</span></dt><dd><div class="informalexample"><pre class="synopsis">javafxpackager -signJar --outdir dist -keyStore sampleKeystore.jks </pre><pre class="synopsis">    -storePass **** -alias javafx -keypass **** -srcdir dist</pre></div><p>distディレクトリにあるすべてのファイルに署名し、指定したalias、keyStoreおよびstorePassを指定して証明書を添付し、署名されたJARファイルをdistディレクトリに戻します。</p></dd></dl></div></div></div></body></html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/man/ja/man1/javafxpackager.1	Wed Dec 19 17:04:18 2012 -0500
@@ -0,0 +1,370 @@
+." Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+."
+.TH javafxpackager 1 "02 Jul 2012"
+
+.LP
+.SH "名前" 
+.LP
+javafxpackager — JavaFXアプリケーションのパッケージ化と署名に関連するタスクを実行するコマンドを備えたツール。   
+.SH "形式"  
+.nf
+\f3
+.fl
+javafxpackager \fP\f4\-taskcommand\fP\f3 \fP\f4[\-options]\fP\f3
+.fl
+\fP
+.fi
+.LP
+ここで、\f2\-taskcommand\fPには、次のいずれかを指定します。  
+.RS 3
+.TP 3
+\-createjar 
+.LP
+他のパラメータに従ってJARアーカイブを作成します。  
+.TP 3
+\-deploy 
+.LP
+他のパラメータに従ってJNLPおよびHTMLファイルを生成します。  
+.TP 3
+\-createbss 
+.LP
+CSSファイルをバイナリ形式に変換します。  
+.TP 3
+\-signJar 
+.LP
+指定した証明書でJARファイルに署名します。  
+.TP 3
+\-makeall 
+.LP
+事前定義された引数の大半を使用して、コンパイル、createjar、deployのステップを1つの呼出しで実行します。ソース・ファイルはsrcというフォルダに配置する必要があり、生成されるファイル(JAR、JNLP、HTML)はdistというフォルダに出力されます。このコマンドでは最小限の構成のみが可能で、可能な限り自動化されています。  
+.RE
+.SH "createjarコマンドのオプション"  
+.RS 3
+.TP 3
+\-appclass <application class> 
+.LP
+実行するアプリケーション・クラスの修飾名。  
+.TP 3
+\-preloader <preloader class> 
+.LP
+実行するプリローダー・クラスの修飾名。  
+.TP 3
+\-paramfile <file> 
+.LP
+デフォルトの名前付きアプリケーション・パラメータが含まれるプロパティ・ファイル。  
+.TP 3
+\-argument arg 
+.LP
+<fx:argument>要素としてJNLPファイルに挿入される名前なし引数。  
+.TP 3
+\-classpath <files> 
+.LP
+依存するJARファイル名のリスト。  
+.TP 3
+\-manifestAttrs <manifest attributes> 
+.LP
+追加のマニフェスト属性のリスト。構文:  
+.nf
+\f3
+.fl
+"name1=value1,name2=value2,name3=value3"
+.fl
+\fP
+.fi
+.TP 3
+\-noembedlauncher 
+.LP
+指定した場合、パッケージャはJARファイルにJavaFX起動クラスを追加しません。  
+.TP 3
+\-nocss2bin 
+.LP
+パッケージャはJARにコピーする前にCSSファイルをバイナリ形式に変換しません。  
+.TP 3
+\-runtimeversion <version> 
+.LP
+必要なJavaFXランタイムのバージョン。  
+.TP 3
+\-outdir <dir> 
+.LP
+生成された出力ファイルを受け取るディレクトリの名前。  
+.TP 3
+\-outfile <filename> 
+.LP
+生成されるファイルの名前(拡張子なし)。  
+.TP 3
+\-srcdir <dir> 
+.LP
+パッケージ化するファイルのベース・ディレクトリ。  
+.TP 3
+\-srcfiles <files> 
+.LP
+srcdir内のファイルのリスト。省略すると、srcdir内のすべてのファイルがパッケージ化されます。  
+.RE
+.SH "deployコマンドのオプション"  
+.RS 3
+.TP 3
+\-title <title> 
+.LP
+アプリケーションのタイトル。  
+.TP 3
+\-vendor <vendor> 
+.LP
+アプリケーションのベンダー。  
+.TP 3
+\-description <description> 
+.LP
+アプリケーションの説明。  
+.TP 3
+\-appclass <application class> 
+.LP
+実行するアプリケーション・クラスの修飾名。  
+.TP 3
+\-preloader <preloader class> 
+.LP
+実行するプリローダー・クラスの修飾名。  
+.TP 3
+\-paramfile <file> 
+.LP
+デフォルトの名前付きアプリケーション・パラメータが含まれるプロパティ・ファイル。  
+.TP 3
+\-htmlparamfile <file> 
+.LP
+生成されるアプリケーションをブラウザで実行する場合のパラメータが含まれるプロパティ・ファイル。  
+.TP 3
+\-width <width> 
+.LP
+アプリケーションの幅。  
+.TP 3
+\-height <height> 
+.LP
+アプリケーションの高さ。  
+.TP 3
+\-native <name> 
+.LP
+プラットフォーム固有のネイティブ・バンドルを生成します(可能な場合)。  
+.TP 3
+\-name <name> 
+.LP
+アプリケーションの名前。  
+.TP 3
+\-embedjnlp 
+.LP
+指定した場合、JNLPファイルがHTMLドキュメントに埋め込まれます。  
+.TP 3
+\-embedCertificates 
+.LP
+指定した場合、証明書がJNLPファイルに埋め込まれます。  
+.TP 3
+\-allpermissions 
+.LP
+指定した場合、JNLPファイル内のすべてのセキュリティ権限がアプリケーションに必要になります。  
+.TP 3
+\-updatemode <updatemode> 
+.LP
+JNLPファイルの更新モードを設定します。  
+.TP 3
+\-isExtension 
+.LP
+指定した場合、srcfilesは拡張ファイルとして処理されます。  
+.TP 3
+\-callbacks 
+.LP
+生成後のHTMLでのユーザー・コールバック方式を指定します。形式は次のとおりです。  
+.nf
+\f3
+.fl
+"name1:value1,name2:value2,..."
+.fl
+\fP
+.fi
+.TP 3
+\-templateInFilename 
+.LP
+HTMLテンプレート・ファイルの名前。プレースホルダの形式は次のとおりです。  
+.nf
+\f3
+.fl
+#XXXX.YYYY(APPID)#
+.fl
+\fP
+.fi
+.TP 3
+\-templateOutFilename 
+.LP
+テンプレートから生成されるHTMLファイルの名前。  
+.TP 3
+\-templateId 
+.LP
+テンプレート処理を行うアプリケーションのアプリケーションID。  
+.TP 3
+\-argument arg 
+.LP
+JNLPファイルの<fx:argument>要素に挿入される名前なし引数。  
+.TP 3
+\-outdir <dir> 
+.LP
+生成された出力ファイルを受け取るディレクトリの名前。  
+.TP 3
+\-outfile <filename> 
+.LP
+生成されるファイルの名前(拡張子なし)。  
+.TP 3
+\-srcdir <dir> 
+.LP
+パッケージ化するファイルのベース・ディレクトリ。  
+.TP 3
+\-srcfiles <files> 
+.LP
+srcdir内のファイルのリスト。省略すると、srcdir内のすべてのファイルがパッケージ化されます。  
+.RE
+.SH "createbssコマンドのオプション"  
+.RS 3
+.TP 3
+\-outdir <dir> 
+.LP
+生成された出力ファイルを受け取るディレクトリの名前。  
+.TP 3
+\-srcdir <dir> 
+.LP
+パッケージ化するファイルのベース・ディレクトリ。  
+.TP 3
+\-srcfiles <files> 
+.LP
+srcdir内のファイルのリスト。省略すると、srcdir内のすべてのファイルがパッケージ化されます。  
+.RE
+.SH "signJarコマンドのオプション"  
+.RS 3
+.TP 3
+\-keyStore <file> 
+.LP
+キーストア・ファイル名。  
+.TP 3
+\-alias 
+.LP
+キーの別名。  
+.TP 3
+\-storePass 
+.LP
+キーストアの整合性を確認したり、ロックを解除するためのパスワード。  
+.TP 3
+\-keyPass 
+.LP
+キーを復元するためのパスワード。  
+.TP 3
+\-storeType 
+.LP
+キーストアのタイプ。デフォルト値は"jks"です。  
+.TP 3
+\-outdir <dir> 
+.LP
+生成された出力ファイルを受け取るディレクトリの名前。  
+.TP 3
+\-srcdir <dir> 
+.LP
+署名するファイルのベース・ディレクトリ。  
+.TP 3
+\-srcfiles <files> 
+.LP
+srcdir内のファイルのリスト。省略すると、srcdir内のすべてのファイルが署名されます。  
+.RE
+.SH "makeAllコマンドのオプション"  
+.RS 3
+.TP 3
+\-appclass <application class> 
+.LP
+実行するアプリケーション・クラスの修飾名。  
+.TP 3
+\-preloader <preloader class> 
+.LP
+実行するプリローダー・クラスの修飾名。  
+.TP 3
+\-classpath <files> 
+.LP
+依存するJARファイル名のリスト。  
+.TP 3
+\-name <name> 
+.LP
+アプリケーションの名前。  
+.TP 3
+\-width <width> 
+.LP
+アプリケーションの幅。  
+.TP 3
+\-height <height> 
+.LP
+アプリケーションの高さ。  
+.RE
+.SH "注意"  
+.RS 3
+.TP 2
+o
+.LP
+タスク・コマンドとともに\-v オプションを使用すれば、詳細な出力が有効になります。  
+.TP 2
+o
+.LP
+\-srcdirオプションをコマンドで使用できる場合は、複数回使用できます。\-srcfilesオプションを指定すると、引数に指定されたファイル名が、その前に指定されているsrcdirオプションで指定された場所で検索されます。\-srcdirが\-srcfilesの前に指定されていない場合は、javafxpackagerコマンドが実行されるディレクトリが使用されます。  
+.RE
+.SH "例"  
+.RS 3
+.TP 3
+例1: \-createjarコマンドの使用方法 
+.nf
+\f3
+.fl
+javafxpackager \-createjar \-appclass package.class  
+.fl
+  \-srcdir classes \-outdir out \-outfile outjar \-v
+.fl
+\fP
+.fi
+.LP
+classesディレクトリの内容をoutjar.jarにパッケージ化して、アプリケーション・クラスをpackage.classに設定します。  
+.TP 3
+例2: \-deployコマンドの使用方法 
+.nf
+\f3
+.fl
+javafxpackager \-deploy \-outdir outdir \-outfile outfile \-width 34 \-height 43 
+.fl
+  \-name AppName \-appclass package.class \-v \-srcdir compiled
+.fl
+\fP
+.fi
+.LP
+outfile.jnlpファイルおよび対応するoutfile.htmlファイルを、アプリケーションAppNameのoutdirに生成します。これは、package.classクラスで始まり、34 x 43の配列を持ちます。  
+.TP 3
+例: \-makeallコマンドの使用方法 
+.nf
+\f3
+.fl
+javafxpackager \-makeall \-appclass brickbreaker.Main \-name BrickBreaker
+.fl
+  \-width 600 \-height 600
+.fl
+\fP
+.fi
+.LP
+コンパイルを含むすべてのパッケージ化作業(コンパイル、Jarの作成、デプロイ)を実行します。  
+.TP 3
+例4: \-signJarコマンドの使用方法 
+.nf
+\f3
+.fl
+javafxpackager \-signJar \-\-outdir dist \-keyStore sampleKeystore.jks 
+.fl
+\fP
+.fi
+.nf
+\f3
+.fl
+    \-storePass **** \-alias javafx \-keypass **** \-srcdir dist
+.fl
+\fP
+.fi
+.LP
+distディレクトリにあるすべてのファイルに署名し、指定したalias、keyStoreおよびstorePassを指定して証明書を添付し、署名されたJARファイルをdistディレクトリに戻します。  
+.RE
+
+.LP
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/man/man1/javafxpackager.1	Wed Dec 19 17:04:18 2012 -0500
@@ -0,0 +1,513 @@
+'\" t
+.\" Copyright \(co 2008, 2012, Oracle. All Rights Reserved.
+.\" Title: javafxpackager
+.\" Language: English
+.\" Date: October 2012
+.\" SectDesc: User Commands
+.\" Software: Oracle Java
+.\" Arch: Generic
+.\"
+.TH "javafxpackager" "1" "October 2012" "" ""
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+javafxpackager \- A tool with commands that perform tasks related to packaging and signing JavaFX applications\&.
+.SH "SYNOPSIS"
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+javafxpackager \fI\-taskcommand\fR \fI[\-options]\fR
+.fi
+.if n \{\
+.RE
+.\}
+.PP
+where
+\fI\-taskcommand\fR
+is one of the following:
+.PP
+\-createjar
+.RS 4
+Produces a JAR archive according to other parameters\&.
+.RE
+.PP
+\-deploy
+.RS 4
+Assembles the application package for redistribution\&. By default, the deploy task will generate the base application package, but it can also generate a self\-contained application package if requested\&.
+.RE
+.PP
+\-createbss
+.RS 4
+Converts CSS files into binary form\&.
+.RE
+.PP
+\-signJar
+.RS 4
+Signs JAR file(s) with a provided certificate\&.
+.RE
+.PP
+\-makeall
+.RS 4
+Performs compilation,
+\fIcreatejar\fR, and
+\fIdeploy\fR
+steps as one call, with most arguments predefined\&. By default, it attempts to generate all applicable self\-contained application packages\&. The source files must be located in a folder called src, and the resulting files (JAR, JNLP, HTML, and self\-contained application packages) are put in a folder called dist\&. This command can only be configured in a minimal way and is as automated as possible\&.
+.RE
+.PP
+Note that all options are case\-insensitive\&.
+.SH "OPTIONS FOR THE CREATEJAR COMMAND"
+.PP
+\-appclass \fI<application class>\fR
+.RS 4
+Qualified name of the application class to be executed\&.
+.RE
+.PP
+\-preloader \fI<preloader class>\fR
+.RS 4
+Qualified name of the preloader class to be executed\&.
+.RE
+.PP
+\-paramfile <file>
+.RS 4
+A properties file with default named application parameters\&.
+.RE
+.PP
+\-argument arg
+.RS 4
+An unnamed argument to be inserted into the JNLP file as an
+\fI<fx:argument>\fR
+element\&.
+.RE
+.PP
+\-classpath \fI<files>\fR
+.RS 4
+List of dependent JAR file names\&.
+.RE
+.PP
+\-manifestAttrs \fI<manifest attributes>\fR
+.RS 4
+List of additional manifest attributes\&. Syntax:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+"name1=value1,name2=value2,name3=value3"
+.fi
+.if n \{\
+.RE
+.\}
+.RE
+.PP
+\-noembedlauncher
+.RS 4
+If present, the packager will not add the JavaFX launcher classes to the JAR file\&.
+.RE
+.PP
+\-nocss2bin
+.RS 4
+The packager will not convert CSS files to binary form before copying to JAR\&.
+.RE
+.PP
+\-runtimeversion \fI<version>\fR
+.RS 4
+Version of the required JavaFX Runtime\&.
+.RE
+.PP
+\-outdir \fI<dir>\fR
+.RS 4
+Name of the directory that will receive generated output files\&.
+.RE
+.PP
+\-outfile \fI<filename>\fR
+.RS 4
+Name (without the extension) of the file that will be generated\&.
+.RE
+.PP
+\-srcdir \fI<dir>\fR
+.RS 4
+Base directory of the files to package\&.
+.RE
+.PP
+\-srcfiles \fI<files>\fR
+.RS 4
+List of files in
+\fIsrcdir\fR\&. If omitted, all files in
+\fIsrcdir\fR
+(which is a mandatory argument in this case) will be used\&.
+.RE
+.SH "OPTIONS FOR THE DEPLOY COMMAND"
+.PP
+\-title \fI<title>\fR
+.RS 4
+Title of the application\&.
+.RE
+.PP
+\-vendor \fI<vendor>\fR
+.RS 4
+Vendor of the application\&.
+.RE
+.PP
+\-description \fI<description>\fR
+.RS 4
+Description of the application\&.
+.RE
+.PP
+\-appclass \fI<application class>\fR
+.RS 4
+Qualified name of the application class to be executed\&.
+.RE
+.PP
+\-preloader \fI<preloader class>\fR
+.RS 4
+Qualified name of the preloader class to be executed\&.
+.RE
+.PP
+\-paramfile \fI<file>\fR
+.RS 4
+Properties file with default named application parameters\&.
+.RE
+.PP
+\-htmlparamfile \fI<file>\fR
+.RS 4
+Properties file with parameters for the resulting application when it is run in the browser\&.
+.RE
+.PP
+\-width \fI<width>\fR
+.RS 4
+Width of the application\&.
+.RE
+.PP
+\-height \fI<height>\fR
+.RS 4
+Height of the application\&.
+.RE
+.PP
+\-native \fI<type>\fR
+.RS 4
+Generate self\-contained application bundles (if possible)\&. If
+\fItype\fR
+is specified, then only a bundle of this type is created\&. List of supported types includes: installer, image, exe, msi, dmg, rpm, deb\&.
+.RE
+.PP
+\-name \fI<name>\fR
+.RS 4
+Name of the application\&.
+.RE
+.PP
+\-embedjnlp
+.RS 4
+If present, the JNLP file will be embedded in the HTML document\&.
+.RE
+.PP
+\-embedCertificates
+.RS 4
+If present, the certificates will be embedded in the JNLP file\&.
+.RE
+.PP
+\-allpermissions
+.RS 4
+If present, the application will require all security permissions in the JNLP file\&.
+.RE
+.PP
+\-updatemode \fI<updatemode>\fR
+.RS 4
+Sets the update mode for the JNLP file\&.
+.RE
+.PP
+\-isExtension
+.RS 4
+If present, the
+\fIsrcfiles\fR
+are treated as extensions\&.
+.RE
+.PP
+\-callbacks
+.RS 4
+Specifies user callback methods in generated HTML\&. The format is the following:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+"name1:value1,name2:value2,\&.\&.\&."
+.fi
+.if n \{\
+.RE
+.\}
+.RE
+.PP
+\-templateInFilename
+.RS 4
+Name of the HTML template file\&. Placeholders are in the following form:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+#XXXX\&.YYYY(APPID)#
+.fi
+.if n \{\
+.RE
+.\}
+.RE
+.PP
+\-templateOutFilename
+.RS 4
+Name of the HTML file that will be generated from the template\&.
+.RE
+.PP
+\-templateId
+.RS 4
+Application ID of the application for template processing\&.
+.RE
+.PP
+\-argument arg
+.RS 4
+An unnamed argument to be inserted into an
+\fI<fx:argument>\fR
+element in the JNLP file\&.
+.RE
+.PP
+\-outdir \fI<dir>\fR
+.RS 4
+Name of the directory that will receive generated output files\&.
+.RE
+.PP
+\-outfile \fI<filename>\fR
+.RS 4
+Name (without the extension) of the file that will be generated\&.
+.RE
+.PP
+\-srcdir \fI<dir>\fR
+.RS 4
+Base directory of the files to package\&.
+.RE
+.PP
+\-srcfiles \fI<files>\fR
+.RS 4
+List of files in
+\fIsrcdir\fR\&. If omitted, all files in
+\fIsrcdir\fR
+(which is a mandatory argument in this case) will be used\&.
+.RE
+.SH "OPTIONS FOR THE CREATEBSS COMMAND"
+.PP
+\-outdir \fI<dir>\fR
+.RS 4
+Name of the directory that will receive generated output files\&.
+.RE
+.PP
+\-srcdir \fI<dir>\fR
+.RS 4
+Base directory of the files to package\&.
+.RE
+.PP
+\-srcfiles \fI<files>\fR
+.RS 4
+List of files in
+\fIsrcdir\fR\&. If omitted, all files in
+\fIsrcdir\fR
+(which is a mandatory argument in this case) will be used\&.
+.RE
+.SH "OPTIONS FOR THE SIGNJAR COMMAND"
+.PP
+\-keyStore \fI<file>\fR
+.RS 4
+Keystore file name\&.
+.RE
+.PP
+\-alias
+.RS 4
+Alias for the key\&.
+.RE
+.PP
+\-storePass
+.RS 4
+Password to check integrity of the keystore or unlock the keystore
+.RE
+.PP
+\-keyPass
+.RS 4
+Password for recovering the key\&.
+.RE
+.PP
+\-storeType
+.RS 4
+Keystore type\&. The default value is "jks"\&.
+.RE
+.PP
+\-outdir \fI<dir>\fR
+.RS 4
+Name of the directory that will receive generated output files\&.
+.RE
+.PP
+\-srcdir \fI<dir>\fR
+.RS 4
+Base directory of the files to be signed\&.
+.RE
+.PP
+\-srcfiles \fI<files>\fR
+.RS 4
+List of files in
+\fIsrcdir\fR\&. If omitted, all files in
+\fIsrcdir\fR
+(which is a mandatory argument in this case) will be used\&.
+.RE
+.SH "OPTIONS FOR THE MAKEALL COMMAND"
+.PP
+\-appclass \fI<application class>\fR
+.RS 4
+Qualified name of the application class to be executed\&.
+.RE
+.PP
+\-preloader \fI<preloader class>\fR
+.RS 4
+Qualified name of the preloader class to be executed\&.
+.RE
+.PP
+\-classpath \fI<files>\fR
+.RS 4
+List of dependent JAR file names\&.
+.RE
+.PP
+\-name \fI<name>\fR
+.RS 4
+Name of the application\&.
+.RE
+.PP
+\-width \fI<width>\fR
+.RS 4
+Width of the application\&.
+.RE
+.PP
+\-height \fI<height>\fR
+.RS 4
+Height of the application\&.
+.RE
+.SH "NOTES"
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+A
+\fI\-v \fRoption can be used with any task command to enable verbose output\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+When the
+\fI\-srcdir\fR
+option is allowed in a command, it can be used more than once\&. If the
+\fI\-srcfiles\fR
+option is specified, the files named in the argument will be looked for in the location specified in the preceding
+\fIsrcdir\fR
+option\&. In case there is no
+\fI\-srcdir\fR
+preceding
+\fI\-srcfiles\fR, the directory where the javafxpackager command is executed will be used\&.
+.RE
+.SH "EXAMPLES"
+.PP
+\fBExample 1\fR, \-createjar Command Usage
+.RS 4
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+javafxpackager \-createjar \-appclass package\&.ClassName
+  \-srcdir classes \-outdir out \-outfile outjar \-v
+.fi
+.if n \{\
+.RE
+.\}
+Packages the contents of the classes directory to outjar\&.jar, sets the application class to package\&.ClassName\&.
+.RE
+.PP
+\fBExample 2\fR, \-deploy Command Usage
+.RS 4
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+javafxpackager \-deploy \-outdir outdir \-outfile outfile \-width 34 \-height 43 
+  \-name AppName \-appclass package\&.ClassName \-v \-srcdir compiled
+.fi
+.if n \{\
+.RE
+.\}
+Generates outfile\&.jnlp and the corresponding outfile\&.html files in outdir for application AppName, which is started by package\&.ClassName and has dimensions of 34 x 43\&.
+.RE
+.PP
+\fBExample 3\fR, \-makeall command Usage
+.RS 4
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+javafxpackager \-makeall \-appclass brickbreaker\&.Main \-name BrickBreaker
+  \-width 600 \-height 600
+.fi
+.if n \{\
+.RE
+.\}
+Does all the packaging work including compilation: compile, createjar, deploy\&.
+.RE
+.PP
+\fBExample 4\fR, \-signJar Command Usage
+.RS 4
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+javafxpackager \-signJar \-\-outdir dist \-keyStore sampleKeystore\&.jks 
+.fi
+.if n \{\
+.RE
+.\}
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+    \-storePass **** \-alias javafx \-keypass **** \-srcdir dist
+.fi
+.if n \{\
+.RE
+.\}
+Signs all of the JAR files in the dist directory, attaches a certificate with the specified alias, keyStore and storePass, and puts the signed JAR files back into the dist directory\&.
+.RE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/packager/build.xml	Wed Dec 19 17:04:18 2012 -0500
@@ -0,0 +1,369 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+-->
+
+<project name="packager" default="default" basedir=".">
+    <description>Builds, tests, and runs the project packager.</description>
+    <import file="../../../build-defs.xml"/>
+    <import file="nbproject/build-impl.xml"/>
+    <property name="jfx.build.needs.visual.studio" value="true"/>
+    <property name="jfx.build.needs.make.utility" value="true"/>
+    <property name="winlauncher.dist.dir" value="dist"/>
+    <property name="winlauncher.build.dir" value="build"/>
+    <property name="winlauncher.makefile" value="Makefile"/>
+    <!--
+
+    There exist several targets which are by default empty and which can be
+    used for execution of your tasks. These targets are usually executed
+    before and after some main targets. They are:
+
+      -pre-init:                 called before initialization of project properties
+      -post-init:                called after initialization of project properties
+      -pre-compile:              called before javac compilation
+      -post-compile:             called after javac compilation
+      -pre-compile-single:       called before javac compilation of single file
+      -post-compile-single:      called after javac compilation of single file
+      -pre-compile-test:         called before javac compilation of JUnit tests
+      -post-compile-test:        called after javac compilation of JUnit tests
+      -pre-compile-test-single:  called before javac compilation of single JUnit test
+      -post-compile-test-single: called after javac compilation of single JUunit test
+      -pre-jar:                  called before JAR building
+      -post-jar:                 called after JAR building
+      -post-clean:               called after cleaning build products
+
+    (Targets beginning with '-' are not intended to be called on their own.)
+
+    Example of inserting an obfuscator after compilation could look like this:
+
+        <target name="-post-compile">
+            <obfuscate>
+                <fileset dir="${build.classes.dir}"/>
+            </obfuscate>
+        </target>
+
+    For list of available properties check the imported
+    nbproject/build-impl.xml file.
+
+
+    Another way to customize the build is by overriding existing main targets.
+    The targets of interest are:
+
+      -init-macrodef-javac:     defines macro for javac compilation
+      -init-macrodef-junit:     defines macro for junit execution
+      -init-macrodef-debug:     defines macro for class debugging
+      -init-macrodef-java:      defines macro for class execution
+      -do-jar-with-manifest:    JAR building (if you are using a manifest)
+      -do-jar-without-manifest: JAR building (if you are not using a manifest)
+      run:                      execution of project
+      -javadoc-build:           Javadoc generation
+      test-report:              JUnit report generation
+
+    An example of overriding the target for project execution could look like this:
+
+        <target name="run" depends="packager-impl.jar">
+            <exec dir="bin" executable="launcher.exe">
+                <arg file="${dist.jar}"/>
+            </exec>
+        </target>
+
+    Notice that the overridden target depends on the jar target and not only on
+    the compile target as the regular run target does. Again, for a list of available
+    properties which you can use, check the target you are overriding in the
+    nbproject/build-impl.xml file.
+
+    -->
+
+    <!-- location of external resources to be included into packager jar -->
+    <property name="deploy.packager.resources"
+              location="${basedir}/../build/deployfx"/>
+
+
+    <!-- hooks into netbeans ant files -->
+    <target name="-post-clean"              depends="myclean"/>
+    <target name="-pre-compile"             depends="mycompilestart"/>
+    <target name="-post-compile"            depends="mycompileend"/>
+    <target name="-do-jar-with-manifest"    depends="mymanifest"/>
+    <target name="-pre-jar"                 depends="myjarstart,mymanifest"/>
+    <target name="-post-jar"
+            depends="myjarendWin, myjarendMac, myjarendLinux">
+        <mkdir dir="${jfx.sdk.dir}/lib"/>
+        <mkdir dir="${jfx.sdk.dir}/bin"/>
+        <copy tofile="${jfx.sdk.dir}/lib/ant-javafx.jar"
+              file="../dist/packager.jar"/>
+        <antcall target="copy-javafxpackager-Win"/>
+        <antcall target="copy-javafxpackager-Mac"/>
+        <antcall target="copy-javafxpackager-Linux"/>
+    </target>
+
+    <target name="copy-javafxpackager-Win" if="isWindows">
+        <copy todir="${jfx.sdk.dir}/bin">
+           <fileset file="../dist/javafxpackager.exe" />
+        </copy>
+    </target>
+
+    <target name="copy-javafxpackager-Mac" if="isMacOSX">
+        <copy todir="${jfx.sdk.dir}/bin">
+           <fileset file="../dist/javafxpackager" />
+        </copy>
+        <chmod file="${jfx.sdk.dir}/bin/javafxpackager" perm="ugo+rx"/>
+    </target>
+
+    <target name="copy-javafxpackager-Linux" if="isLinux">
+        <copy todir="${jfx.sdk.dir}/bin">
+           <fileset file="../dist/javafxpackager" />
+        </copy>
+        <chmod file="${jfx.sdk.dir}/bin/javafxpackager" perm="ugo+rx"/>
+    </target>
+
+    <target name="myclean" depends="clean-win">
+        <delete dir="build"/>
+        <delete dir="dist"/>
+        <delete file="../dist/packager.jar"/>
+        <delete file="../dist/javafxpackager.exe"/>
+        <delete dir="../dist"/>
+        <delete file="${basedir}/test.keystore"/>
+    </target>
+
+    <target name="clean-dist">
+        <delete file="${jfx.sdk.dir}/lib/ant-javafx.jar"/>
+        <delete file="${jfx.sdk.dir}/bin/javafxpackager"/>
+        <delete file="${jfx.sdk.dir}/bin/javafxpackager.exe"/>
+    </target>
+
+    <target name="dist" depends="mycompilestart,-post-compile,mycompileend"/>
+
+    <target name="mycompilestart">
+    	<echo message="ant.home=${ant.home}"/>
+    	<mkdir dir="../dist"/>
+    </target>
+
+    <target name="mycompileend" depends="winlaunch,native-launchers" >
+        <copy todir="${build.classes.dir}">
+           <fileset dir="${deploy.packager.resources}"/>
+        </copy>
+
+        <!-- prepare test setup -->
+        <delete file="${basedir}/test.keystore"/>
+        <genkey alias="TestAlias" storepass="xyz123" keystore="test.keystore"
+           dname="CN=Deploy, OU=JavaFX Dev, O=Oracle, C=US"/>
+    </target>
+
+    <target name="native-launchers"
+            depends="launcher-mac,launcher-win,launcher-linux"/>
+
+    <!-- MAcro is borrowed from installers.
+         NOTE: This should be pushed to a higher level -->
+    <condition property="vs.build.arch" value="x64" else="Win32">
+        <equals arg1="${arch}" arg2="amd64"/>
+    </condition>
+    <macrodef name="do-vs-build-custom">
+        <!-- Does a Visual Studio project build -->
+        <attribute name="proj-dir"/>
+        <attribute name="build-type"/> <!-- Release" or "Debug" -->
+        <attribute name="build-arch"/> <!-- x64" or "Win32" -->
+        <attribute name="project"/>
+        <sequential>
+            <property file="${vs.properties}"/>
+            <property name="devenv.utility"  location="${windows.vs.DEVENVCMD}"/>
+            <echo message="STARTING: ${devenv.utility} @{proj-dir}"/>
+            <echo message="${devenv.utility} /build @{build-type}|@{build-arch} @{project}"/>
+            <exec executable="${devenv.utility}" failonerror="true"
+                  dir="@{proj-dir}">
+                <env key="VCINSTALLDIR"  value="${windows.vs.VCINSTALLDIR}"/>
+                <env key="VSINSTALLDIR"  value="${windows.vs.VSINSTALLDIR}"/>
+                <env key="DEVENVDIR"     value="${windows.vs.DEVENVDIR}"/>
+                <env key="MSVCDIR"       value="${windows.vs.MSVCDIR}"/>
+                <env key="INCLUDE"       value="${windows.vs.INCLUDE}"/>
+                <env key="LIB"           value="${windows.vs.LIB}"/>
+                <env key="LIBPATH"       value="${windows.vs.LIBPATH}"/>
+                <env key="PATH"          value="${platform.home}/bin;${windows.vs.PATH}"/>
+                <env key="CONF"          value="${build.conf}"/>
+                <env key="JAVA_HOME"     value="${platform.home}"/>
+                <env key="JDK_HOME"      value="${platform.home}"/>
+                <env key="WMSDK_DIR"     value="${wmsdk.path}"/>
+                <env key="FX_VERSION_FULL" value="${fx.version.full}"/>
+                <env key="FX_VERSION_COMMA" value="${fx.version.comma}"/>
+                <env key="FX_FAMILY_VERSION" value="${fx.family.version}"/>
+                <env key="SAMPLEVAR"
+                     value="${installer.build.env.SAMPLEVAR}"/>
+                <arg value="/build"/>
+                <arg value="@{build-type}|@{build-arch}"/>
+                <arg value="@{project}"/>
+            </exec>
+            <echo message="FINISHED: proj-dir @{proj-dir}"/>
+        </sequential>
+    </macrodef>
+
+    <!-- depend on "init" to ensure project properties are loaded -->
+    <target name="launcher-win" if="isWindows" depends="init">
+        <do-vs-build-custom
+            proj-dir="native/windows"
+            build-type="Release"
+            build-arch="${vs.build.arch}"
+            project="IconSwap.vcxproj"/>
+        <copy file="native/windows/Release/IconSwap.exe"
+              todir="${build.classes.dir}/com/sun/javafx/tools/resource/windows"/>
+        <do-vs-build-custom
+            proj-dir="native/windows"
+            build-type="Release"
+            build-arch="${vs.build.arch}"
+            project="WinLauncher.vcxproj"/>
+        <copy file="native/windows/Release/WinLauncher.exe"
+              todir="${build.classes.dir}/com/sun/javafx/tools/resource/windows"/>
+    </target>
+
+    <target name="launcher-mac" if="isMacOSX" depends="init">
+        <!-- add launcher binary to classes tree
+             jar will pick it from there -->
+        <property name="macLauncherDir"
+                  location="${build.classes.dir}/com/sun/javafx/tools/resource/mac"/>
+        <mkdir dir="${macLauncherDir}"/>
+        <exec executable="gcc" failonerror="true">
+            <arg value="-o"/>
+            <arg value="${macLauncherDir}/JavaAppLauncher"/>
+            <arg value="-framework"/>
+            <arg value="Cocoa"/>
+            <arg value="-arch"/>
+            <arg value="x86_64"/>
+            <arg value="-mmacosx-version-min=10.7"/>
+            <arg value="-std=c99"/>
+            <arg value="native/macosx/main.m"/>
+        </exec>
+    </target>
+
+    <target name="launcher-linux" if="isLinux" depends="init">
+        <!-- add launcher binary to classes tree
+             jar will pick it from there -->
+        <property name="linuxLauncherDir"
+                  location="${build.classes.dir}/com/sun/javafx/tools/resource/linux"/>
+        <mkdir dir="${linuxLauncherDir}"/>
+        <exec executable="gcc" failonerror="true">
+            <arg value='-DJAVAARCH="${os.arch}"'/>
+            <arg value="-o"/>
+            <arg value="${linuxLauncherDir}/JavaAppLauncher"/>
+            <arg value="-I${platform.home}/include"/>
+            <arg value="-I${platform.home}/include/linux"/>
+            <arg value="native/linux/launcher.c"/>
+            <arg value="-ldl"/>
+        </exec>
+    </target>
+
+    <target name="myneeds-vs-properties" if="isWindows">
+        <antcall target="needs-vs-properties"/>
+    </target>
+
+    <target name="winlaunch" if="isWindows" depends="myneeds-vs-properties" >
+        <copy file="winlauncher/javafxpackager.manifest"
+          tofile="winlauncher/build/javafxpackager.manifest">
+            <filterchain id="fx_version_filter">
+                <tokenfilter>
+                    <replacestring from="FXVERSION"
+            to="${jfx.release.major.version}.${jfx.release.minor.version}.${jfx.release.micro.version}.${hudson.current.build.number}"/>
+                </tokenfilter>
+            </filterchain>
+        </copy>
+        <get-cygwin-path/>
+        <property file="${vs.properties}"/>
+        <exec executable="${cmd.utility}" dir="winlauncher" failonerror="true">
+            <env key="FX_MAJOR_VERSION" value="${jfx.release.major.version}"/>
+            <env key="FX_MINOR_VERSION" value="${jfx.release.minor.version}"/>
+            <env key="FX_UPDATE_VERSION" value="${jfx.release.micro.version}"/>
+            <env key="FX_BUILD_NUMBER" value="${hudson.current.build.number}"/>
+            <env key="INCLUDE" value="${windows.vs.INCLUDE}"/>
+            <env key="LIB" value="${windows.vs.LIB}"/>
+            <env key="LIBPATH" value="${windows.vs.LIBPATH}"/>
+            <env key="PATH" value="${windows.vs.PATH}"/>
+            <env key="JDK_HOME" value="${short.platform.home}"/>
+            <env key="CONF" value="Release"/>
+            <env key="DIST_DIR" value="${winlauncher.dist.dir}"/>
+            <env key="BUILD_DIR" value="${winlauncher.build.dir}"/>
+            <env key="CLASS_DIR" value="${winlauncher.class.dir}"/>
+            <arg value="/C"/>
+            <arg value="${make.utility}"/>
+            <arg value="-f"/>
+            <arg value="${winlauncher.makefile}"/>
+            <arg value=""/>
+        </exec>
+        <delete file="dist/javafxpackager.exe"/>
+        <copy file="winlauncher/dist/javafxpackager.exe"
+              tofile="dist/javafxpackager.exe"/>
+    </target>
+
+    <target name="clean-win" if="isWindows">
+        <!-- cleanup embedded launcher build -->
+        <delete dir="native/windows/Release"/>
+        <delete dir="native/windows/Debug"/>
+        <delete>
+            <fileset dir="native/windows">
+                <include name="*sdf"/>
+                <include name="*.sln"/>
+                <include name="*.suo"/>
+                <include name="*.user"/>
+            </fileset>
+        </delete>
+
+        <!-- cleanup javafxpackager.exe -->
+        <get-cygwin-path/>
+        <exec executable="${cmd.utility}" dir="winlauncher" failonerror="true">
+            <env key="DIST_DIR" value="${winlauncher.dist.dir}"/>
+            <env key="BUILD_DIR" value="${winlauncher.build.dir}"/>
+            <arg value="/C"/>
+            <arg value="${make.utility}"/>
+            <arg value="-f"/>
+            <arg value="${winlauncher.makefile}"/>
+            <arg value="clean"/>
+        </exec>
+
+    </target>
+    <target name="mymanifest">
+    </target>
+
+    <target name="myjarstart">
+    </target>
+
+    <target name="myjarendWin" if="isWindows">
+      <copy todir="../dist">
+        <fileset dir="dist" includes="javafxpackager.exe"/>
+        <fileset dir="dist" includes="packager.jar"/>
+      </copy>
+    </target>
+
+    <target name="myjarendMac"  if="isMacOSX">
+      <copy todir="../dist">
+        <fileset dir="scripts" includes="javafxpackager"/>
+        <fileset dir="dist"    includes="packager.jar"/>
+      </copy>
+      <chmod file="../dist/javafxpackager" perm="755"/>
+    </target>
+
+    <target name="myjarendLinux"  if="isLinux">
+      <copy todir="../dist">
+        <fileset dir="scripts" includes="javafxpackager"/>
+        <fileset dir="dist"    includes="packager.jar"/>
+      </copy>
+      <chmod file="../dist/javafxpackager" perm="755"/>
+    </target>
+</project>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/packager/manifest.mf	Wed Dec 19 17:04:18 2012 -0500
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+X-COMMENT: Main-Class will be added automatically by build
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/packager/native/linux/launcher.c	Wed Dec 19 17:04:18 2012 -0500
@@ -0,0 +1,423 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <malloc.h>
+#include <memory.h>
+#include <errno.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include <dlfcn.h>
+
+#include "jni.h"
+
+#define TRUE  1
+#define FALSE 0
+
+#define MAX_PATH 4096
+
+int fileExists(char* name) {
+  struct stat buf;
+  return (stat(name, &buf) == 0) ? TRUE : FALSE;
+}
+
+void makeFullFileName(char* basedir, char *relative_path, char *fullpath, int buffer_size) {
+    fullpath[0] = 0;
+    strcat(fullpath, basedir);
+    strcat(fullpath, relative_path);
+}
+
+//constructs full file name for file in the package
+// and check for it existance
+int getFileInPackage(char* basedir, char *relative_path, char *fullpath, int buffer_size) {
+     makeFullFileName(basedir, relative_path, fullpath, buffer_size);
+    return fileExists(fullpath);
+}
+
+#define MAINJAR_FOLDER        "/app/"
+#define CONFIG_FILE           "/app/package.cfg"
+#define CONFIG_MAINJAR_KEY    "app.mainjar"
+#define CONFIG_MAINCLASS_KEY  "app.mainclass"
+#define CONFIG_CLASSPATH_KEY  "app.classpath"
+
+//remove trailing end of line character
+//modifies buffer in place
+void strip_endofline(char *buf) {
+    size_t ln = strlen(buf);
+
+    while (ln > 0 && (buf[ln-1] == '\r' || buf[ln-1] == '\n')) {
+        buf[ln-1] = 0;
+        ln--;
+    }
+}
+
+int getSystemJRE(char*jreRoot, unsigned long buflen) {
+    char *jh = NULL;
+
+    jh = getenv("JRE_HOME");
+    if (jh != NULL) {
+        char path[MAX_PATH];
+        sprintf(path, "%s/lib/rt.jar", jh);
+        if (fileExists(path) == TRUE) {
+            strcpy(jreRoot, jh);
+            return TRUE;
+        } else {
+            printf("$JRE_HOME is set but $JRE_HOME/lib/rt.jar does not exist. Look elsewhere.\n");
+        }
+    }
+
+    jh = getenv("JAVA_HOME");
+    if (jh != NULL) {
+        char path[MAX_PATH];
+        sprintf(path, "%s/jre/lib/rt.jar", jh);
+        if (fileExists(path) == TRUE) {
+            sprintf(jreRoot, "%s/jre", jh);
+            return TRUE;
+        } else {
+            printf("$JAVA_HOME is set but $JAVA_HOME/jre/lib/rt.jar does not exist. Look elsewhere.\n");
+        }
+    }
+
+    //check redhat location
+    if (fileExists("/usr/java/latest/jre/lib/rt.jar") == TRUE) {
+        strcpy(jreRoot, "/usr/java/latest/jre");
+        return TRUE;
+    }
+
+    //check redhat location
+    if (fileExists("/usr/lib/jvm/default-java/jre/lib/rt.jar") == TRUE) {
+        strcpy(jreRoot, "/usr/lib/jvm/default-java/jre");
+        return TRUE;
+    }
+
+    return FALSE;
+}
+
+//REWRITE: this is inefficient. We better read and parse file once
+int getConfigValue(char* basedir, char* lookupKey, char* outValue, int buf_size) {
+    char config[MAX_PATH] = {0};
+    char buffer[MAX_PATH*2];
+    char *value;
+    FILE *fp;
+
+    if (!getFileInPackage(basedir, CONFIG_FILE, config, MAX_PATH)) {
+        printf("Configuration file (%s) is not found!\n", config);
+        return FALSE;
+    }
+
+    //scan file for the key
+    fp = fopen(config, "r");
+    if (fp == NULL) {
+         return FALSE;
+    }
+
+    while (fgets(buffer, MAX_PATH*2, fp)) {
+        value = strchr(buffer, '=');
+        if (value != NULL) {
+          //end key on the '=', value will point to the value string
+          *value = 0;
+          value++;
+
+          if (!strcmp(buffer, lookupKey)) { //found it
+             fclose(fp);
+             strip_endofline(value);
+             strncpy(outValue, value, buf_size);
+             return TRUE;
+          }
+        }
+
+     }
+     fclose(fp);
+
+     return FALSE;
+}
+
+//Constructs full path to the main jar file
+//return false if not found
+int getMainJar(char* basedir, char* jar, int buffer_size) {
+    char jarname[MAX_PATH] = {0};
+    char jar_relative[MAX_PATH] = {0};
+    char jar_full[MAX_PATH] = {0};
+
+    if (!getConfigValue(basedir, CONFIG_MAINJAR_KEY, jarname, MAX_PATH)) {
+        return FALSE;
+    }
+
+    strcat(jar_relative, MAINJAR_FOLDER);
+    strcat(jar_relative, jarname);
+
+    int ret = getFileInPackage(basedir, jar_relative, jar_full, MAX_PATH);
+
+    strcat(jar, jar_full);
+
+    return ret;
+}
+
+int getExecPath(char *path, size_t len) {
+    //this should work for linux
+    if (readlink("/proc/self/exe", path, len) != -1) {
+        dirname(path);
+        return TRUE;
+    }
+
+    return FALSE;
+}
+
+// Private typedef for function pointer casting
+typedef jint (JNICALL *JVM_CREATE)(JavaVM **, JNIEnv **, void *);
+
+int getJvmPath(char* basedir, char *jvmPath, int buffer_size) {
+    jvmPath[0] = 0;
+    if (!getFileInPackage(basedir, "/runtime/jre/lib/"JAVAARCH"/client/libjvm.so",
+            jvmPath, MAX_PATH)) {
+        if (!getFileInPackage(basedir, "/runtime/jre/lib/"JAVAARCH"/server/libjvm.so",
+                jvmPath, MAX_PATH)) {
+            return FALSE;
+        }
+    }
+    return TRUE;
+}
+
+int getSystemJvmPath(char *jvmPath, int buffer_size) {
+    char basedir[MAX_PATH];
+    if (!getSystemJRE(basedir, MAX_PATH)) {
+        return FALSE;
+    }
+
+    jvmPath[0] = 0;
+    if (!getFileInPackage(basedir, "/lib/"JAVAARCH"/client/libjvm.so",
+            jvmPath, MAX_PATH)) {
+        if (!getFileInPackage(basedir, "/lib/"JAVAARCH"/server/libjvm.so",
+                jvmPath, MAX_PATH)) {
+            return FALSE;
+        }
+    }
+    return TRUE;
+}
+
+
+#define MAX_OPTIONS 100
+
+int startJVM(char* basedir, char *appFolder, char* jar, int argc, const char**argv) {
+    char jvmPath[MAX_PATH+1] = {0},
+         tmpPath[MAX_PATH+1];
+    JavaVMInitArgs jvmArgs;
+    JavaVMOption options[MAX_OPTIONS];
+    JVM_CREATE createProc;
+    JNIEnv* env;
+    JavaVM* jvm = NULL;
+    char classpath[MAX_PATH*2] = {0};
+    size_t outlen = 0;
+    jclass cls;
+    jmethodID mid;
+    char argname[20];
+    char argvalue[1000];
+    char mainclass[MAX_PATH];
+
+    memset(&options, 0, sizeof(JavaVMOption)*(MAX_OPTIONS + 1));
+    memset(&jvmArgs, 0, sizeof(JavaVMInitArgs));
+
+    makeFullFileName(basedir, "/runtime", tmpPath, sizeof(tmpPath));
+    if (fileExists(tmpPath)) {
+       if (!getJvmPath(basedir, jvmPath, sizeof(jvmPath))) {
+            printf("libjvm.so is not found in the bundled runtime.\n");
+            return FALSE;
+       }
+    } else {
+        if (!getSystemJvmPath(jvmPath, sizeof(jvmPath))) {
+            printf("Failed to find system runtime.\n");
+            return FALSE;
+        }
+    }
+
+    // Dynamically load the JVM
+    void* jvmLibHandle = dlopen(jvmPath, RTLD_LAZY);
+    if (jvmLibHandle == NULL) {
+        printf("Error loading libjvm.so\n");
+        return FALSE;
+    }
+
+    strcpy(classpath, "-Djava.class.path=");
+    strcat(classpath, jar);
+
+    if (getConfigValue(basedir, CONFIG_CLASSPATH_KEY, argvalue, sizeof(argvalue))) {
+        char *in = argvalue;
+        char *out = argvalue;
+        int needSemicolon = FALSE;
+
+        //compress spaces and replaces them with :
+        while (*in != 0) {
+            if (*in == ' ') {
+                if (needSemicolon == TRUE) {
+                    *out = ':';
+                    out++;
+                    needSemicolon = FALSE;
+                }
+            } else {
+                needSemicolon = TRUE;
+                *out = *in;
+                out++;
+            }
+            in++;
+        }
+        *out = 0;
+
+        if (strlen(argvalue) > 0) {
+            strcat(classpath, ":");
+            strcat(classpath, argvalue);
+        }
+    }
+
+    // Set up the VM init args
+    jvmArgs.version = JNI_VERSION_1_2;
+
+    options[0].optionString = classpath;
+
+    //add app scecific JVM parameters
+    int cnt = 1;
+
+    //Note: should not try to quote the path. Spaces are fine here
+    sprintf(argvalue, "-Djava.library.path=%s", appFolder);
+    options[cnt].optionString = strdup(argvalue);
+    cnt++;
+
+    int found = 0;
+    int idx = 1;
+    do {
+       sprintf(argname, "jvmarg.%d", idx);
+       found = getConfigValue(basedir, argname, argvalue, sizeof(argvalue));
+       if (found) {
+          options[cnt].optionString = strdup(argvalue);
+          idx++;
+          cnt++;
+       }
+    } while (found && cnt < MAX_OPTIONS);
+
+    jvmArgs.version = 0x00010002;
+    jvmArgs.options = options;
+    jvmArgs.nOptions = cnt;
+    jvmArgs.ignoreUnrecognized = JNI_TRUE;
+
+    // Create the JVM
+    createProc = (JVM_CREATE) dlsym(jvmLibHandle, "JNI_CreateJavaVM");
+    if (createProc == NULL) {
+        printf("Failed to locate JNI_CreateJavaVM\n");
+        return FALSE;
+    }
+
+    if ((*createProc)(&jvm, &env, &jvmArgs) < 0) {
+        // Should not happen
+        printf("Failed to create JVM\n");
+        return FALSE;
+    }
+
+    if (!getConfigValue(basedir, CONFIG_MAINCLASS_KEY, mainclass, sizeof(mainclass))) {
+        printf("Packaging error: no main class specified.\n");
+        return FALSE;
+    }
+
+    cls = (*env)->FindClass(env, mainclass);
+    if (cls != NULL) {
+        mid = (*env)->GetStaticMethodID(env, cls, "main", "([Ljava/lang/String;)V");
+         if (mid != NULL) {
+            int i;
+            jclass stringClass = (*env)->FindClass(env, "java/lang/String");
+
+            //prepare app arguments if any. Skip value at index 0 - this is path to executable ...
+            //NOTE:
+            //  - what if user run in non-English/UTF-8 locale? do we need to convert args?
+            //  - extend to pass jvm args and debug args (allow them in front, use marker option to separate them?)
+            jobjectArray args = (*env)->NewObjectArray(env, argc-1, stringClass, NULL);
+            for(i=1; i<argc; i++) {
+                (*env)->SetObjectArrayElement(env, args, i-1,
+                    (*env)->NewStringUTF(env, argv[i]));
+            }
+
+            (*env)->CallStaticVoidMethod(env, cls, mid, args);
+        } else {
+            printf("Expected to find main method in %s.\n", mainclass);
+        }
+    } else {
+        printf("Expected to find launcher class: [%s]\n", mainclass);
+    }
+
+    if ((*env)->ExceptionOccurred(env)) {
+        printf("Exception thrown from main method of %s\n", mainclass);
+        (*env)->ExceptionDescribe(env);
+    }
+
+    // If application main() exits quickly but application is run on some other thread
+    //  (e.g. Swing app performs invokeLater() in main and exits)
+    // then if we return execution to tWinMain it will exit.
+    // This will cause process to exit and application will not actually run.
+    //
+    // To avoid this we are trying to detach jvm from current thread (java.exe does the same)
+    // Because we are doing this on the main JVM thread (i.e. one that was used to create JVM)
+    // this call will spawn "Destroy Java VM" java thread that will shut JVM once there are
+    // no non-daemon threads running, and then return control here.
+    // I.e. this will happen when EDT and other app thread will exit.
+    if ((*jvm)->DetachCurrentThread(jvm) != 0) {
+        printf("Failed to detach from JVM.\n");
+    }
+    (*jvm)->DestroyJavaVM(jvm);
+
+    return TRUE;
+}
+
+int getAppFolder(char* basedir, char* appFolder, int buffer_size) {
+    return getFileInPackage(basedir, MAINJAR_FOLDER, appFolder, MAX_PATH);
+}
+
+int main(int argc, const char** argv) {
+    char basedir[MAX_PATH] = {0};
+    char appFolder[MAX_PATH] = {0};
+    char jar[MAX_PATH] = {0};
+
+    if (getExecPath(basedir, MAX_PATH) == TRUE) {
+        if (!getMainJar(basedir, jar, MAX_PATH)) {
+            if (jar[0] == 0) {
+                    printf("Failed to parse package configuration file\n");
+            } else {
+                    printf("Failed to find main application jar! (%s)\n", jar);
+            }
+            return -1;
+        }
+
+        getAppFolder(basedir, appFolder, MAX_PATH);
+
+        //DO Launch
+        //this will concatenate arguments using space,
+        // we need to make sure spaces are properly escaped if we have any
+        chdir(appFolder);
+
+        if (!startJVM(basedir, appFolder, jar, argc, argv)) {
+            printf("Failed to launch JVM\n");
+            return -1;
+        }
+    }
+
+    return 1;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/packager/native/macosx/main.m	Wed Dec 19 17:04:18 2012 -0500
@@ -0,0 +1,230 @@
+/*
+ * Copyright 2012, Oracle and/or its affiliates. All rights reserved.
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#import <Cocoa/Cocoa.h>
+#include <dlfcn.h>
+#include <pthread.h>
+//#include <jni.h>
+
+//essential imports from jni.h
+#define JNICALL
+typedef unsigned char   jboolean;
+#if defined(__LP64__) && __LP64__ /* for -Wundef */
+typedef int jint;
+#else
+typedef long jint;
+#endif
+////////////////////////// end of imports from jni.h
+
+
+#define JAVA_LAUNCH_ERROR "JavaLaunchError"
+
+#define JVM_RUNTIME_KEY "JVMRuntime"
+#define JVM_MAIN_CLASS_NAME_KEY "JVMMainClassName"
+#define JVM_MAIN_JAR_NAME_KEY "JVMMainJarName"
+#define JVM_OPTIONS_KEY "JVMOptions"
+#define JVM_ARGUMENTS_KEY "JVMArguments"
+#define JVM_CLASSPATH_KEY "JVMAppClasspath"
+
+#define LIBJLI_DYLIB "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/jli/libjli.dylib"
+
+typedef int (JNICALL *JLI_Launch_t)(int argc, char ** argv,
+                                    int jargc, const char** jargv,
+                                    int appclassc, const char** appclassv,
+                                    const char* fullversion,
+                                    const char* dotversion,
+                                    const char* pname,
+                                    const char* lname,
+                                    jboolean javaargs,
+                                    jboolean cpwildcard,
+                                    jboolean javaw,
+                                    jint ergo);
+
+int launch(int appArgc, char *appArgv[]);
+
+int main(int argc, char *argv[]) {
+    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+    int result;
+    @try {
+        launch(argc, argv);
+        result = 0;
+    } @catch (NSException *exception) {
+        NSLog(@"%@: %@", exception, [exception callStackSymbols]);
+        result = 1;
+    }
+
+    [pool drain];
+
+    return result;
+}
+
+int launch(int appArgc, char *appArgv[]) {
+    // Get the main bundle
+    NSBundle *mainBundle = [NSBundle mainBundle];
+
+    char *commandName = appArgv[0];
+
+    // Set the working directory to the user's home directory
+    chdir([NSHomeDirectory() UTF8String]);
+
+    // Get the main bundle's info dictionary
+    NSDictionary *infoDictionary = [mainBundle infoDictionary];
+
+    // Locate the JLI_Launch() function
+    NSString *runtime = [infoDictionary objectForKey:@JVM_RUNTIME_KEY];
+
+    JLI_Launch_t jli_LaunchFxnPtr;
+    if ([runtime length] != 0) { //missing key or empty value
+        NSString *runtimePath = [[[NSBundle mainBundle] builtInPlugInsPath] stringByAppendingPathComponent:runtime];
+        NSString *libjliPath = [runtimePath stringByAppendingPathComponent:@"Contents/Home/jre/lib/jli/libjli.dylib"];
+
+        if ([[NSFileManager defaultManager] fileExistsAtPath:libjliPath]) {
+            const char *jliPath = [libjliPath fileSystemRepresentation];
+            void *libJLI = dlopen(jliPath, RTLD_LAZY);
+            if (libJLI != NULL) {
+                jli_LaunchFxnPtr = dlsym(libJLI, "JLI_Launch");
+        }
+        }
+    } else {
+        void *libJLI = dlopen(LIBJLI_DYLIB, RTLD_LAZY);
+        if (libJLI != NULL) {
+            jli_LaunchFxnPtr = dlsym(libJLI, "JLI_Launch");
+        }
+    }
+
+    if (jli_LaunchFxnPtr == NULL) {
+        [NSException raise:@JAVA_LAUNCH_ERROR format:@"Could not get function pointer for JLI_Launch."];
+    }
+
+    // Get the main class name
+    NSString *mainClassName = [infoDictionary objectForKey:@JVM_MAIN_CLASS_NAME_KEY];
+    if (mainClassName == nil) {
+        [NSException raise:@JAVA_LAUNCH_ERROR format:@"%@ is required.", @JVM_MAIN_CLASS_NAME_KEY];
+    }
+
+    // Get the main jar name
+    NSString *mainJarName = [infoDictionary objectForKey:@JVM_MAIN_JAR_NAME_KEY];
+    if (mainJarName == nil) {
+        [NSException raise:@JAVA_LAUNCH_ERROR format:@"%@ is required.", @JVM_MAIN_JAR_NAME_KEY];
+    }
+
+    // Set the class path
+    // Assume we are given main executable jar file that knows how to set classpath
+    //  and launch the app (i.e. it works for doubleclick on jar)
+    NSString *mainBundlePath = [mainBundle bundlePath];
+    NSString *javaPath = [mainBundlePath stringByAppendingString:@"/Contents/Java"];
+    NSMutableString *classPath = [NSMutableString stringWithFormat:@"-Djava.class.path=%@/%@",
+         javaPath, mainJarName];
+
+    NSString *extraClasspath = [infoDictionary objectForKey:@JVM_CLASSPATH_KEY];
+    if ([extraClasspath length] > 0) { //unless key missing or has empty value
+       NSArray *elements = [extraClasspath componentsSeparatedByString:@" "];
+       for (NSString *file in elements) {
+          if ([file length] > 0) {
+             [classPath appendFormat:@":%@/%@", javaPath, file];
+          }
+       }
+    }
+    // Set the library path
+    NSString *libraryPath = [NSString stringWithFormat:@"-Djava.library.path=%@/Contents/Java", mainBundlePath];
+
+    // Get the VM options
+    NSArray *options = [infoDictionary objectForKey:@JVM_OPTIONS_KEY];
+    if (options == nil) {
+        options = [NSArray array];
+    }
+
+    // Get the application arguments
+    NSArray *arguments = [infoDictionary objectForKey:@JVM_ARGUMENTS_KEY];
+    if (arguments == nil) {
+        arguments = [NSArray array];
+    }
+
+    // Initialize the arguments to JLI_Launch()
+    //
+    // On Mac OS X we spawn a new thread that actually starts the JVM. This
+    // new thread simply re-runs main(argc, argv). Therefore we do not want
+    // to add new args if we are still in the original main thread ot we
+    // will treat them as command line args provided by the user ...
+    // Only propagate original set of args first time
+    int mainThread = (pthread_main_np() == 1);
+    int argc;
+    if (!mainThread) {
+        argc = 1 + [options count] + 2 + 1 +
+               (appArgc > 1 ? (appArgc - 1) : [arguments count]);
+    } else {
+        argc = 1 + (appArgc > 1 ? (appArgc - 1) : 0);
+    }
+
+    // argv[argc] == NULL by convention, so allow one extra space
+    // for the null termination.
+    char *argv[argc + 1];
+
+    int i = 0;
+    argv[i++] = strdup(commandName);
+
+    if (!mainThread) {
+        argv[i++] = strdup([classPath UTF8String]);
+        argv[i++] = strdup([libraryPath UTF8String]);
+
+        for (NSString *option in options) {
+            argv[i++] = strdup([option UTF8String]);
+        }
+
+        argv[i++] = strdup([mainClassName UTF8String]);
+
+        //command line arguments override plist
+        if (appArgc > 1) {
+            for (int j=1; j<appArgc; j++) {
+               argv[i++] = strdup(appArgv[j]);
+            }
+        } else {
+            for (NSString *argument in arguments) {
+               argv[i++] = strdup([argument UTF8String]);
+            }
+        }
+    } else {
+        for (int j=1; j<appArgc; j++) {
+           argv[i++] = strdup(appArgv[j]);
+        }
+    }
+
+    argv[i] = NULL;
+
+    // Invoke JLI_Launch()
+    return jli_LaunchFxnPtr(argc, argv,
+                            0, NULL,
+                            0, NULL,
+                            "",
+                            "",
+                            "java",
+                            "java",
+                            FALSE,
+                            FALSE,
+                            FALSE,
+                            0);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/packager/native/windows/IconSwap.vcxproj	Wed Dec 19 17:04:18 2012 -0500
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{8535CC69-A1BD-4CE0-B916-A63FFC31F65E}</ProjectGuid>
+    <RootNamespace>IconSwap</RootNamespace>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+    <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <LinkIncremental>true</LinkIncremental>
+    <OutDir>$(SolutionDir)\$(Configuration)\</OutDir>
+    <IntDir>$(Configuration)\</IntDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+    <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <LinkIncremental>false</LinkIncremental>
+    <OutDir>$(SolutionDir)\$(Configuration)\</OutDir>
+    <IntDir>$(Configuration)\</IntDir>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PrecompiledHeaderFile>
+      </PrecompiledHeaderFile>
+      <PrecompiledHeaderOutputFile>
+      </PrecompiledHeaderOutputFile>
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PrecompiledHeaderFile>
+      </PrecompiledHeaderFile>
+      <PrecompiledHeaderOutputFile>
+      </PrecompiledHeaderOutputFile>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="iconswap.cpp" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/packager/native/windows/WinLauncher.cpp	Wed Dec 19 17:04:18 2012 -0500
@@ -0,0 +1,586 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+//Define Windows compatibility requirements
+//XP or later
+#define WINVER 0x0501
+#define _WIN32_WINNT 0x0501
+
+#include <Windows.h>
+#include <tchar.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <malloc.h>
+#include <memory.h>
+#include <direct.h>
+#include <process.h>
+
+#include "jni.h"
+
+/*
+   This is launcher program for application package on Windows.
+
+   Basic approach:
+      - we read app/package.cfg file to find out details on what and how to launch
+         (package.cfg is property file)
+      - load JVM with requested JVM settings (client JVM if availble, server otherwise)
+      - load embedded launcher class com.javafx.main.Main class and run main()
+      - wait for JVM to exit and then exit from WinMain
+      - support a way to "debug" application by setting env variable
+        or passing "/Debug" option on command line
+      - TODO: default directory is set to user's Documents and Settings
+      - TODO: application folder is added to the library path (so LoadLibrary()) works
+
+   Limitations and future work:
+      - Running Java code in primordial thread may cause problems
+        (example: can not use custom stack size).
+        Solution used by java launcher is to create a new thread to invoke JVM.
+        See CR 6316197 for more information.
+      - Reuse code between windows/linux launchers and borrow more code from
+        java.exe launcher implementation.
+*/
+
+//TODO:
+//  Ideally we should be detecting max path length in runtime and reporting error
+// if package was installed too deep in the file hierarchy.
+// We also need to rewrite code to stop using fixed size buffers as it was proven
+// we could fail to launch if buffer is small because strings are getting truncated.
+//
+// Quick fix for 2u2 is to increase buffer size.
+// This will resolve buffer capacity related issues but application
+// may still fail to launch without any feeback to the user if he installs
+// it too deep. This is rare case but in the future we should be handling it better
+#define LAUNCHER_MAXPATH  10000
+
+//debug hook to print JVM messages into console
+static bool isDebug = FALSE;
+
+static jint JNICALL vfprintfHook(FILE *fp, const char *format, va_list args) {
+   char buffer[20480];
+   int len;
+   HANDLE hConsole;
+   DWORD wasWritten;
+
+   len = _vsnprintf_s(buffer, sizeof(buffer), sizeof(buffer), format, args);
+   if (len <= 0) {
+        return len;
+   }
+
+   hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
+   if (hConsole == INVALID_HANDLE_VALUE) {
+        return false;
+   }
+
+   //JVM will always pass us ASCII
+   WriteConsoleA(hConsole, buffer, strlen(buffer), &wasWritten, NULL);
+
+   return (jint) len;
+}
+
+/* helpers to popup error message */
+static void showError(TCHAR *msg, TCHAR *msg2) {
+    MessageBox(0, msg, msg2 != NULL ? msg2 : msg, MB_ICONERROR | MB_OK);
+}
+
+bool fileExists(TCHAR* name) {
+  struct _stat buf;
+  return (_tstat(name, &buf) == 0);
+}
+
+void makeFullFileName(TCHAR* basedir, TCHAR *relative_path, TCHAR *fullpath, int buffer_size) {
+    fullpath[0] = 0;
+    _tcscat_s(fullpath, buffer_size - _tcslen(fullpath), basedir);
+    _tcscat_s(fullpath, buffer_size - _tcslen(fullpath), relative_path);
+}
+
+//constructs full file name for file in the package
+// and check for it existance
+bool getFileInPackage(TCHAR* basedir, TCHAR *relative_path, TCHAR *fullpath, int buffer_size) {
+    makeFullFileName(basedir, relative_path, fullpath, buffer_size);
+    return fileExists(fullpath);
+}
+
+#define MAINJAR_FOLDER        _T("\\app\\")
+#define CONFIG_FILE           _T("\\app\\package.cfg")
+#define CONFIG_MAINJAR_KEY    _T("app.mainjar")
+#define CONFIG_MAINCLASS_KEY  _T("app.mainclass")
+#define CONFIG_CLASSPATH_KEY  _T("app.classpath")
+
+//remove trailing end of line character
+//modifies buffer in place
+void strip_endofline(TCHAR *buf) {
+    size_t ln = _tcslen(buf);
+
+    while (ln > 0 && (buf[ln-1] == '\r' || buf[ln-1] == '\n')) {
+        buf[ln-1] = 0;
+        ln--;
+    }
+}
+
+#define JAVA_RUNTIME_SUBKEY _T("SOFTWARE\\JavaSoft\\Java Runtime Environment")
+#define BUFFER_SIZE 256
+
+// try to find current Java Home from registry
+// HKLM\Software\JavaSoft\Java Runtime Environment\CurrentVersion
+// HKLM\Software\JavaSoft\Java Runtime Environment\[CurrentVersion]\JavaHome
+// return TRUE if found, and path is set in lpszJavaHome
+// return FALSE otherwise
+bool getSystemJRE(LPTSTR szHomeBin, unsigned long buflen) {
+    HKEY hKey, vKey;
+    DWORD dwType, dwCount = BUFFER_SIZE*sizeof(TCHAR);
+    TCHAR versionString[BUFFER_SIZE], fullKey[2*BUFFER_SIZE];
+
+    if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, JAVA_RUNTIME_SUBKEY, 0, KEY_READ, &hKey) == ERROR_SUCCESS) {
+        if (RegQueryValueEx(hKey, _T("CurrentVersion"), NULL, &dwType, (LPBYTE) versionString, &dwCount) == ERROR_SUCCESS) {
+            _stprintf_s(fullKey, 2*BUFFER_SIZE, _T("%s\\%s"), JAVA_RUNTIME_SUBKEY, versionString);
+            if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, fullKey, 0, KEY_READ, &vKey) == ERROR_SUCCESS) {
+                dwCount = buflen * sizeof(TCHAR);
+                if (RegQueryValueEx(vKey, _T("JavaHome"), NULL, &dwType, (LPBYTE) szHomeBin, &dwCount) == ERROR_SUCCESS) {
+                    if (fileExists(szHomeBin)) {
+                        return true;
+                    } else {
+                        showError(szHomeBin, _T("System JRE does not exist at this location!"));
+                        return false;
+                    }
+                } else {
+                    showError(fullKey, _T("System JRE not found (registry)!"));
+                    return false;
+                }
+            } else {
+                showError(fullKey, _T("Failed to open registry key!!"));
+                return false;
+            }
+        } else {
+            showError(JAVA_RUNTIME_SUBKEY, _T("No value for CurrentVersion."));
+            return false;
+        }
+    } else {
+        showError(JAVA_RUNTIME_SUBKEY, _T("Failed to open registry key!"));
+        return false;
+    }
+
+    return false;
+}
+
+//REWRITE: this is inefficient. We better read and parse file once
+bool getConfigValue(TCHAR* basedir, TCHAR* lookupKey, TCHAR* outValue, int buf_size) {
+    TCHAR config[LAUNCHER_MAXPATH] = {0};
+    TCHAR buffer[LAUNCHER_MAXPATH*2];
+    TCHAR *value;
+    FILE *fp;
+
+    *outValue = 0;
+
+    if (!getFileInPackage(basedir, CONFIG_FILE, config, LAUNCHER_MAXPATH)) {
+        showError(config, _T("Configuration file is not found!"));
+        return false;
+    }
+
+    //scan file for the key
+    errno_t err = _tfopen_s(&fp, config, _T("r"));
+     if (err) {
+         return false;
+     }
+
+     while (_fgetts(buffer, LAUNCHER_MAXPATH*2, fp)) {
+        value = _tcschr(buffer, '=');
+        if (value != NULL) {
+          //end key on the '=', value will point to the value string
+          *value = 0;
+          value++;
+
+          if (!_tcscmp(buffer, lookupKey)) { //found it
+             fclose(fp);
+             strip_endofline(value);
+             _tcscpy_s(outValue, buf_size, value);
+             return true;
+          }
+        }
+
+     }
+     fclose(fp);
+
+     return false;
+}
+
+bool getAppFolder(TCHAR* basedir, TCHAR* appFolder, int buffer_size) {
+    return getFileInPackage(basedir, MAINJAR_FOLDER, appFolder, LAUNCHER_MAXPATH);
+}
+
+//Constructs full path to the main jar file
+//return false if not found
+bool getMainJar(TCHAR* basedir, TCHAR* jar, int buffer_size) {
+    TCHAR jarname[LAUNCHER_MAXPATH] = {0};
+    TCHAR jar_relative[LAUNCHER_MAXPATH] = {0};
+    TCHAR jar_full[LAUNCHER_MAXPATH] = {0};
+
+    if (!getConfigValue(basedir, CONFIG_MAINJAR_KEY, jarname, LAUNCHER_MAXPATH)) {
+        return false;
+    }
+
+    _tcscat_s(jar_relative, LAUNCHER_MAXPATH, MAINJAR_FOLDER);
+    _tcscat_s(jar_relative, LAUNCHER_MAXPATH - _tcslen(jar_relative), jarname);
+
+    bool ret = getFileInPackage(basedir, jar_relative, jar_full, LAUNCHER_MAXPATH);
+
+    _tcscat_s(jar, LAUNCHER_MAXPATH - _tcslen(jar), jar_full);
+
+    return ret;
+}
+
+// Private typedef for function pointer casting
+typedef jint (JNICALL *JVM_CREATE)(JavaVM **, JNIEnv **, void *);
+
+bool getJvmPath(TCHAR* basedir, TCHAR *jvmPath, int buffer_size) {
+    jvmPath[0] = 0;
+    if (!getFileInPackage(basedir, _T("\\runtime\\jre\\bin\\client\\jvm.dll"),
+            jvmPath, LAUNCHER_MAXPATH)) {
+        if (!getFileInPackage(basedir, _T("\\runtime\\jre\\bin\\server\\jvm.dll"),
+                jvmPath, LAUNCHER_MAXPATH)) {
+            return false;
+        }
+
+    }
+    return true;
+}
+
+bool getSystemJvmPath(TCHAR *jvmPath, int buffer_size) {
+    TCHAR basedir[LAUNCHER_MAXPATH];
+    if (!getSystemJRE(basedir, LAUNCHER_MAXPATH)) {
+        return false;
+    }
+
+    jvmPath[0] = 0;
+    if (!getFileInPackage(basedir, _T("\\bin\\client\\jvm.dll"),
+            jvmPath, LAUNCHER_MAXPATH)) {
+        if (!getFileInPackage(basedir, _T("\\bin\\server\\jvm.dll"),
+                jvmPath, LAUNCHER_MAXPATH)) {
+            return false;
+        }
+
+    }
+    return true;
+}
+
+//count how many args should be skipped before we get to app args
+static int countNumberOfSystemArguments(int argCount, LPTSTR *szArgList) {
+    if (szArgList && argCount > 1) {
+        //path to .exe is at 0 index
+        if (!_tcsicmp(_T("/Debug"), szArgList[1])) {
+            return 2;
+        }
+    }
+    return 1;
+}
+
+#define MAX_OPTIONS 100
+#define MAX_OPTION_NAME 50
+
+bool startJVM(TCHAR* basedir, TCHAR* appFolder, TCHAR* jar, int argCount, LPTSTR *szArgList) {
+    TCHAR jvmPath[LAUNCHER_MAXPATH+1] = {0};
+    JavaVMInitArgs jvmArgs;
+    JavaVMOption options[MAX_OPTIONS+1];
+    JVM_CREATE createProc;
+    JNIEnv* env;
+    JavaVM* jvm = NULL;
+    char jarASCII[LAUNCHER_MAXPATH] = {0};
+    char classpath[LAUNCHER_MAXPATH*2] = {0};
+    char mainclassASCII[LAUNCHER_MAXPATH] = {0},
+        appClasspath[LAUNCHER_MAXPATH] = {0};
+    size_t outlen = 0;
+    jclass cls;
+    jmethodID mid;
+	TCHAR argname[MAX_OPTION_NAME + 1] = {0};
+	TCHAR argvalue[LAUNCHER_MAXPATH] = {0},
+          mainclass[LAUNCHER_MAXPATH] = {0};
+	CHAR  argvalueASCII[LAUNCHER_MAXPATH] = {0};
+    HMODULE msvcrtdll;
+    bool runtimeBundled;
+	TCHAR tmpPath[LAUNCHER_MAXPATH] = {0};
+
+    memset(&options, 0, sizeof(JavaVMOption)*(MAX_OPTIONS + 1));
+    memset(&jvmArgs, 0, sizeof(JavaVMInitArgs));
+
+    makeFullFileName(basedir, _T("\\runtime"), tmpPath, sizeof(tmpPath)/sizeof(TCHAR));
+    runtimeBundled = fileExists(tmpPath);
+    if (runtimeBundled) {
+       if (!getJvmPath(basedir, jvmPath, LAUNCHER_MAXPATH)) {
+            showError(_T("jvm.dll is not found in bundled runtime."), jvmPath);
+            return false;
+       }
+       //make sure msvcr100 is loaded (or we may fail if copy of it is not installed into system)
+       makeFullFileName(basedir, _T("runtime\\jre\\bin\\msvcr100.dll"), tmpPath, sizeof(tmpPath)/sizeof(TCHAR));
+       msvcrtdll = ::LoadLibrary(tmpPath);
+    } else {
+        if (!getSystemJvmPath(jvmPath, LAUNCHER_MAXPATH)) {
+            showError(_T("No bundled runtime and can not find system JRE."), jvmPath);
+            return false;
+        }
+       //make sure msvcr100 is loaded (or we may fail if copy of it is not installed into system)
+       makeFullFileName(basedir, _T("\\bin\\msvcr100.dll"), tmpPath, sizeof(tmpPath)/sizeof(TCHAR));
+       msvcrtdll = ::LoadLibrary(tmpPath);
+    }
+
+    // Dynamically load the JVM
+    HMODULE jvmLibHandle = LoadLibrary(jvmPath);
+    if (jvmLibHandle == NULL) {
+        DWORD dwErr = GetLastError();
+        showError(_T("Error loading jvm.dll"), jvmPath);
+        return false;
+    }
+
+    //convert argument to ASCII string as this is what CreateJVM needs
+    wcstombs_s(&outlen, jarASCII, LAUNCHER_MAXPATH, jar, (size_t) wcslen(jar) + 1);
+    strcpy_s(classpath, LAUNCHER_MAXPATH*2, "-Djava.class.path=");
+    strcat_s(classpath, LAUNCHER_MAXPATH, jarASCII);
+
+    if (getConfigValue(basedir, CONFIG_CLASSPATH_KEY, argvalue, LAUNCHER_MAXPATH)) {
+           size_t inLen = (size_t) wcslen(argvalue);
+           //convert argument to ASCII string as this is what CreateJVM needs
+           wcstombs_s(&outlen, argvalueASCII, sizeof(argvalueASCII), argvalue, inLen + 1);
+           //compress spaces and replaces them with ;
+           {
+               char *in = argvalueASCII;
+               char *out = argvalueASCII;
+               bool needSemicolon = false;
+
+               while (*in != 0) {
+                   if (*in == ' ') {
+                       if (needSemicolon) {
+                          *out = ';';
+                          out++;
+                          needSemicolon = false;
+                       }
+                   } else {
+                       needSemicolon = true;
+                       *out = *in;
+                       out++;
+                   }
+                   in++;
+               }
+               *out = 0;
+           }
+           if (strlen(argvalueASCII) > 0) {
+               strcat_s(classpath, LAUNCHER_MAXPATH, ";");
+               strcat_s(classpath, LAUNCHER_MAXPATH, argvalueASCII);
+           }
+    }
+
+    // Set up the VM init args
+    jvmArgs.version = JNI_VERSION_1_2;
+
+    options[0].optionString = _strdup(classpath);
+
+    int cnt = 1;
+    if (isDebug) {
+       options[cnt].optionString = _strdup("vfprintf");
+       options[cnt].extraInfo    = vfprintfHook;
+       cnt++;
+    }
+
+    //Note: should not try to quote the path. Spaces are fine here
+    _stprintf_s(argvalue, _T("-Djava.library.path=%s"), appFolder);
+    wcstombs_s(&outlen, argvalueASCII, sizeof(argvalueASCII),
+               argvalue, wcslen(argvalue) + 1);
+    options[cnt].optionString = _strdup(argvalueASCII);
+    cnt++;
+
+    //add app specific JVM parameters
+    int idx = 1;
+    int found = 0;
+    do {
+       _stprintf_s(argname, MAX_OPTION_NAME, _T("jvmarg.%d"), idx);
+       found = getConfigValue(basedir, argname, argvalue, LAUNCHER_MAXPATH);
+       if (found) {
+           size_t inLen = (size_t) wcslen(argvalue);
+           //convert argument to ASCII string as this is what CreateJVM needs
+           wcstombs_s(&outlen, argvalueASCII, sizeof(argvalueASCII), argvalue, inLen + 1);
+           options[cnt].optionString = _strdup(argvalueASCII);
+           idx++;
+           cnt++;
+       }
+    } while (found && idx < MAX_OPTIONS);
+
+    jvmArgs.version = 0x00010002;
+    jvmArgs.options = options;
+    jvmArgs.nOptions = cnt;
+    jvmArgs.ignoreUnrecognized = JNI_TRUE;
+
+    // Create the JVM
+    // NB: need to use ASCII string as UNICODE is not supported
+    createProc = (JVM_CREATE) GetProcAddress(jvmLibHandle, "JNI_CreateJavaVM");
+    if (createProc == NULL) {
+        showError(_T("Failed to locate JNI_CreateJavaVM"), jvmPath);
+        return false;
+    }
+
+    if ((*createProc)(&jvm, &env, &jvmArgs) < 0) {
+        showError(_T("Failed to create JVM"), jvmPath);
+        return false;
+    }
+
+    if (!getConfigValue(basedir, CONFIG_MAINCLASS_KEY, mainclass, LAUNCHER_MAXPATH)) {
+        showError(_T("Package error"), _T("No main class specified. Nothing to launch"));
+        return false;
+    } else {
+           size_t inLen = (size_t) wcslen(mainclass);
+           //convert argument to ASCII string as this is what CreateJVM needs
+           wcstombs_s(&outlen, mainclassASCII, sizeof(mainclassASCII), mainclass, inLen + 1);
+    }
+
+    cls = env->FindClass(mainclassASCII);
+    if (cls != NULL) {
+        mid = env->GetStaticMethodID(cls, "main", "([Ljava/lang/String;)V");
+         if (mid != NULL) {
+            jclass stringClass = env->FindClass("java/lang/String");
+            //prepare app arguments if any. Skip value at index 0 - this is path to executable ...
+            //NOTE:
+            //  - what if user run in non-English/UTF-8 locale? do we need to convert args?
+            //  - extend to pass jvm args and debug args (allow them in front, use marker option to separate them?)
+            int startArgIndex = countNumberOfSystemArguments(argCount, szArgList);
+            jobjectArray args = env->NewObjectArray(argCount - startArgIndex, stringClass, NULL);
+            for(int i=startArgIndex; i<argCount; i++) {
+                size_t inLen = (size_t) wcslen(szArgList[i]);
+                //convert argument to ASCII string as this is what CreateJVM needs
+                wcstombs_s(&outlen, argvalueASCII, sizeof(argvalueASCII), szArgList[i], inLen + 1);
+                env->SetObjectArrayElement(args, i-startArgIndex, env->NewStringUTF(argvalueASCII));
+            }
+            env->CallStaticVoidMethod(cls, mid, args);
+        } else {
+            showError(_T("no main method in the main class!"), mainclass);
+            return false;
+        }
+    } else {
+        showError(_T("no main class."), mainclass);
+        return false;
+    }
+
+    if (env->ExceptionOccurred()) {
+        showError(_T("Failed due to exception from main class."), mainclass);
+        env->ExceptionDescribe();
+    }
+
+    // If application main() exits quickly but application is run on some other thread
+    //  (e.g. Swing app performs invokeLater() in main and exits)
+    // then if we return execution to tWinMain it will exit.
+    // This will cause process to exit and application will not actually run.
+    //
+    // To avoid this we are trying to detach jvm from current thread (java.exe does the same)
+    // Because we are doing this on the main JVM thread (i.e. one that was used to create JVM)
+    // this call will spawn "Destroy Java VM" java thread that will shut JVM once there are
+    // no non-daemon threads running, and then return control here.
+    // I.e. this will happen when EDT and other app thread will exit.
+    if (jvm->DetachCurrentThread() != 0) {
+        showError(_T("Detach failed."), NULL);
+    }
+    jvm->DestroyJavaVM();
+
+    return true;
+}
+
+//Ways to enable debugs output:
+//   - set env variable JAVAFX_LAUNCHER_DEBUG
+//   - pass /Debug on the command line
+static void enableDebugIfNeeded(int argCount, LPTSTR *szArgList) {
+    TCHAR* buffer = NULL;
+    size_t bufferLen = 0;
+
+    //see if first arg is /Debug
+    //Only allow system command to be in front!
+    if (szArgList && argCount > 1) {
+        if (!_tcsicmp(_T("/Debug"), szArgList[1])) {
+            isDebug = true;
+            return;
+        }
+    }
+
+    //Check if env variable is set
+    _tdupenv_s(&buffer, &bufferLen, _T("JAVAFX_LAUNCHER_DEBUG"));
+    if (buffer != NULL) { //env variable set
+        isDebug = true;
+        free(buffer);
+    }
+}
+
+int APIENTRY _tWinMain(HINSTANCE hInstance,
+                     HINSTANCE hPrevInstance,
+                     LPTSTR    lpCmdLine,
+                     int       nCmdShow)
+{
+    TCHAR basedir[LAUNCHER_MAXPATH] = {0};
+    TCHAR java[LAUNCHER_MAXPATH] = {0};
+    TCHAR appFolder[LAUNCHER_MAXPATH] = {0};
+    TCHAR java_escaped[LAUNCHER_MAXPATH] = {0};
+    TCHAR jar[LAUNCHER_MAXPATH] = {0};
+    LPTSTR *szArgList;
+    int argCount;
+
+    // Parse command line arguments to see if /Debug is there
+    szArgList = CommandLineToArgvW(GetCommandLine(), &argCount);
+
+    enableDebugIfNeeded(argCount, szArgList);
+
+    if (isDebug) {
+        AllocConsole();
+        SetConsoleOutputCP(CP_UTF8);
+    }
+
+    if (GetModuleFileNameW(NULL, basedir, LAUNCHER_MAXPATH) != 0) {
+        TCHAR *end = _tcsrchr(basedir, '\\');
+        if (end != NULL) {
+            *end = 0;
+
+            if (!getMainJar(basedir, jar, LAUNCHER_MAXPATH)) {
+                showError(
+                    (jar[0] == 0) ? _T("Failed to parse package configuration file") : jar,
+                    _T("Failed to find main application jar!"));
+                return -1;
+            }
+
+            getAppFolder(basedir, appFolder, LAUNCHER_MAXPATH);
+
+            //DO Launch
+            //this will concatenate arguments using space,
+            // we need to make sure spaces are properly escaped if we have any
+            _tchdir(appFolder);
+
+            if (!startJVM(basedir, appFolder, jar, argCount, szArgList)) {
+                showError(_T("Failed to launch JVM"), NULL);
+                return -1;
+            }
+        }
+    }
+
+    if (szArgList != NULL) {
+        LocalFree(szArgList);
+    }
+
+    if (isDebug) {
+      showError(_T("Exiting application"), NULL);
+    }
+    return 1;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/packager/native/windows/WinLauncher.vcxproj	Wed Dec 19 17:04:18 2012 -0500
@@ -0,0 +1,159 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>