changeset 7965:8335da240a33

RT-38567: Umbrella for Changes for JEP-208 - Java Packager Improvements Reviewed-By: kcr Summary: Initial implementation for JEP-208, including work for RT-35388, RT-37766, RT-37767, RT-36118, RT-28833, RT-34187, RT-23918, RT-37769 which are all subtasks of the JEP.
author shemnon
date Wed, 10 Sep 2014 11:31:04 -0600
parents 114951fd1301
children ee31427caf20
files .hgignore build.gradle buildSrc/linux.gradle buildSrc/mac.gradle buildSrc/src/main/groovy/com/sun/javafx/gradle/CCTask.groovy buildSrc/win.gradle modules/fxpackager/src/main/java/com/oracle/tools/packager/StandardBundlerParam.java modules/fxpackager/src/main/java/com/oracle/tools/packager/linux/LinuxAppBundler.java modules/fxpackager/src/main/java/com/oracle/tools/packager/linux/LinuxDebBundler.java modules/fxpackager/src/main/java/com/oracle/tools/packager/linux/LinuxRpmBundler.java modules/fxpackager/src/main/java/com/oracle/tools/packager/mac/MacAppBundler.java modules/fxpackager/src/main/java/com/oracle/tools/packager/windows/WinAppBundler.java modules/fxpackager/src/main/java/com/oracle/tools/packager/windows/WinExeBundler.java modules/fxpackager/src/main/java/com/oracle/tools/packager/windows/WinMsiBundler.java modules/fxpackager/src/main/java/com/oracle/tools/packager/windows/WindowsBundlerParam.java modules/fxpackager/src/main/java/com/sun/javafx/tools/ant/DeployFXTask.java modules/fxpackager/src/main/java/com/sun/javafx/tools/ant/FileAssociation.java modules/fxpackager/src/main/java/com/sun/javafx/tools/ant/Info.java modules/fxpackager/src/main/java/com/sun/javafx/tools/ant/SecondaryLauncher.java modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/DeployParams.java modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/bundlers/BundleParams.java modules/fxpackager/src/main/java/jdk/packager/services/UserJvmOptionsService.java modules/fxpackager/src/main/java/jdk/packager/services/userjvmoptions/LauncherUserJvmOptions.java modules/fxpackager/src/main/java/jdk/packager/services/userjvmoptions/PreferencesUserJvmOptions.java modules/fxpackager/src/main/native/javapackager/win/javapackager.cpp modules/fxpackager/src/main/native/launcher/linux/DeployPlatform.h modules/fxpackager/src/main/native/launcher/linux/launcher.c modules/fxpackager/src/main/native/launcher/linux/launcher.cpp modules/fxpackager/src/main/native/launcher/linux/test/CppApplication_1/.dep.inc modules/fxpackager/src/main/native/launcher/linux/test/CppApplication_1/Makefile modules/fxpackager/src/main/native/launcher/linux/test/CppApplication_1/nbproject/Makefile-Debug.mk modules/fxpackager/src/main/native/launcher/linux/test/CppApplication_1/nbproject/Makefile-Release.mk modules/fxpackager/src/main/native/launcher/linux/test/CppApplication_1/nbproject/Makefile-impl.mk modules/fxpackager/src/main/native/launcher/linux/test/CppApplication_1/nbproject/Makefile-variables.mk modules/fxpackager/src/main/native/launcher/linux/test/CppApplication_1/nbproject/Package-Debug.bash modules/fxpackager/src/main/native/launcher/linux/test/CppApplication_1/nbproject/Package-Release.bash modules/fxpackager/src/main/native/launcher/linux/test/CppApplication_1/nbproject/configurations.xml modules/fxpackager/src/main/native/launcher/linux/test/CppApplication_1/nbproject/project.xml modules/fxpackager/src/main/native/launcher/linux/xmlparser.c modules/fxpackager/src/main/native/launcher/linux/xmlparser.h modules/fxpackager/src/main/native/launcher/mac/main.m modules/fxpackager/src/main/native/launcher/mac/test/testlauncher/testlauncher.xcodeproj/project.pbxproj modules/fxpackager/src/main/native/launcher/mac/test/testlauncher/testlauncher.xcodeproj/project.xcworkspace/contents.xcworkspacedata modules/fxpackager/src/main/native/launcher/mac/test/testlauncher/testlauncher/AppDelegate.h modules/fxpackager/src/main/native/launcher/mac/test/testlauncher/testlauncher/AppDelegate.m modules/fxpackager/src/main/native/launcher/mac/test/testlauncher/testlauncher/Base.lproj/MainMenu.xib modules/fxpackager/src/main/native/launcher/mac/test/testlauncher/testlauncher/Images.xcassets/AppIcon.appiconset/Contents.json modules/fxpackager/src/main/native/launcher/mac/test/testlauncher/testlauncher/en.lproj/Credits.rtf modules/fxpackager/src/main/native/launcher/mac/test/testlauncher/testlauncher/en.lproj/InfoPlist.strings modules/fxpackager/src/main/native/launcher/mac/test/testlauncher/testlauncher/testlauncher-Info.plist modules/fxpackager/src/main/native/launcher/mac/test/testlauncher/testlauncher/testlauncher-Prefix.pch modules/fxpackager/src/main/native/launcher/mac/test/testlauncher/testlauncherTests/en.lproj/InfoPlist.strings modules/fxpackager/src/main/native/launcher/mac/test/testlauncher/testlauncherTests/testlauncherTests-Info.plist modules/fxpackager/src/main/native/launcher/mac/test/testlauncher/testlauncherTests/testlauncherTests.m modules/fxpackager/src/main/native/launcher/win/IconSwap.cpp modules/fxpackager/src/main/native/launcher/win/WinLauncher.cpp modules/fxpackager/src/main/native/launcher/win/WinLauncherSvc.cpp modules/fxpackager/src/main/native/library/common/Exports.cpp modules/fxpackager/src/main/native/library/common/Exports.h modules/fxpackager/src/main/native/library/common/FilePath.cpp modules/fxpackager/src/main/native/library/common/FilePath.h modules/fxpackager/src/main/native/library/common/GenericPlatform.cpp modules/fxpackager/src/main/native/library/common/GenericPlatform.h modules/fxpackager/src/main/native/library/common/Helpers.cpp modules/fxpackager/src/main/native/library/common/Helpers.h modules/fxpackager/src/main/native/library/common/Java.cpp modules/fxpackager/src/main/native/library/common/Java.h modules/fxpackager/src/main/native/library/common/JavaUserPreferences.cpp modules/fxpackager/src/main/native/library/common/JavaUserPreferences.h modules/fxpackager/src/main/native/library/common/JavaVirtualMachine.cpp modules/fxpackager/src/main/native/library/common/JavaVirtualMachine.h modules/fxpackager/src/main/native/library/common/LinuxPlatform.cpp modules/fxpackager/src/main/native/library/common/LinuxPlatform.h modules/fxpackager/src/main/native/library/common/Lock.cpp modules/fxpackager/src/main/native/library/common/Lock.h modules/fxpackager/src/main/native/library/common/MacPlatform.h modules/fxpackager/src/main/native/library/common/MacPlatform.mm modules/fxpackager/src/main/native/library/common/Macros.cpp modules/fxpackager/src/main/native/library/common/Macros.h modules/fxpackager/src/main/native/library/common/Messages.cpp modules/fxpackager/src/main/native/library/common/Messages.h modules/fxpackager/src/main/native/library/common/Package.cpp modules/fxpackager/src/main/native/library/common/Package.h modules/fxpackager/src/main/native/library/common/Platform.cpp modules/fxpackager/src/main/native/library/common/Platform.h modules/fxpackager/src/main/native/library/common/PlatformString.cpp modules/fxpackager/src/main/native/library/common/PlatformString.h modules/fxpackager/src/main/native/library/common/PlatformThread.cpp modules/fxpackager/src/main/native/library/common/PlatformThread.h modules/fxpackager/src/main/native/library/common/PosixPlatform.cpp modules/fxpackager/src/main/native/library/common/PosixPlatform.h modules/fxpackager/src/main/native/library/common/PropertyFile.cpp modules/fxpackager/src/main/native/library/common/PropertyFile.h modules/fxpackager/src/main/native/library/common/WindowsPlatform.cpp modules/fxpackager/src/main/native/library/common/WindowsPlatform.h modules/fxpackager/src/main/native/library/common/main.cpp modules/fxpackager/src/main/native/service/win/WinLauncherSvc.cpp modules/fxpackager/src/main/native/tests/linux/launcher/launcher/.dep.inc modules/fxpackager/src/main/native/tests/linux/launcher/launcher/Makefile modules/fxpackager/src/main/native/tests/linux/launcher/launcher/nbproject/Makefile-Debug.mk modules/fxpackager/src/main/native/tests/linux/launcher/launcher/nbproject/Makefile-Release.mk modules/fxpackager/src/main/native/tests/linux/launcher/launcher/nbproject/Makefile-impl.mk modules/fxpackager/src/main/native/tests/linux/launcher/launcher/nbproject/Makefile-variables.mk modules/fxpackager/src/main/native/tests/linux/launcher/launcher/nbproject/Package-Debug.bash modules/fxpackager/src/main/native/tests/linux/launcher/launcher/nbproject/Package-Release.bash modules/fxpackager/src/main/native/tests/linux/launcher/launcher/nbproject/configurations.xml modules/fxpackager/src/main/native/tests/linux/launcher/launcher/nbproject/project.xml modules/fxpackager/src/main/native/tests/linux/library/packager/.dep.inc modules/fxpackager/src/main/native/tests/linux/library/packager/Makefile modules/fxpackager/src/main/native/tests/linux/library/packager/nbproject/Makefile-Debug.mk modules/fxpackager/src/main/native/tests/linux/library/packager/nbproject/Makefile-Release.mk modules/fxpackager/src/main/native/tests/linux/library/packager/nbproject/Makefile-impl.mk modules/fxpackager/src/main/native/tests/linux/library/packager/nbproject/Makefile-variables.mk modules/fxpackager/src/main/native/tests/linux/library/packager/nbproject/Package-Debug.bash modules/fxpackager/src/main/native/tests/linux/library/packager/nbproject/Package-Release.bash modules/fxpackager/src/main/native/tests/linux/library/packager/nbproject/configurations.xml modules/fxpackager/src/main/native/tests/linux/library/packager/nbproject/project.xml modules/fxpackager/src/main/native/tests/mac/launcher/launcher.xcodeproj/project.pbxproj modules/fxpackager/src/main/native/tests/mac/launcher/launcher/launcher-Info.plist modules/fxpackager/src/main/native/tests/mac/launcher/launcher/launcher-Prefix.pch modules/fxpackager/src/main/native/tests/mac/library/packager/libpackager.xcodeproj/project.pbxproj modules/fxpackager/src/main/native/tests/mac/library/packager/packager/libpackager-Prefix.pch modules/fxpackager/src/main/native/tests/mac/library/packager/packagerTests/en.lproj/InfoPlist.strings modules/fxpackager/src/main/native/tests/mac/library/packager/packagerTests/libpackagerTests-Info.plist modules/fxpackager/src/main/native/tests/mac/library/packager/packagerTests/packagerTests.m modules/fxpackager/src/main/native/tests/win/iconswap/IconSwap.vcxproj modules/fxpackager/src/main/native/tests/win/launcher/launcher.sln modules/fxpackager/src/main/native/tests/win/launcher/launcher.vcxproj modules/fxpackager/src/main/native/tests/win/library/library.sln modules/fxpackager/src/main/native/tests/win/library/library.vcxproj modules/fxpackager/src/main/native/tests/win/library/main.def modules/fxpackager/src/main/native/tools/win/IconSwap.cpp modules/fxpackager/src/main/resources/com/oracle/tools/packager/AbstractBundler.properties modules/fxpackager/src/main/resources/com/oracle/tools/packager/StandardBundlerParam.properties modules/fxpackager/src/main/resources/com/oracle/tools/packager/linux/LinuxAppBundler.properties modules/fxpackager/src/main/resources/com/oracle/tools/packager/linux/LinuxDebBundler.properties modules/fxpackager/src/main/resources/com/oracle/tools/packager/linux/LinuxRpmBundler.properties modules/fxpackager/src/main/resources/com/oracle/tools/packager/linux/template.desktop modules/fxpackager/src/main/resources/com/oracle/tools/packager/linux/template.postinst modules/fxpackager/src/main/resources/com/oracle/tools/packager/linux/template.postrm modules/fxpackager/src/main/resources/com/oracle/tools/packager/linux/template.prerm modules/fxpackager/src/main/resources/com/oracle/tools/packager/linux/template.spec modules/fxpackager/src/main/resources/com/oracle/tools/packager/mac/Info.plist.template modules/fxpackager/src/main/resources/com/oracle/tools/packager/mac/MacAppBundler.properties modules/fxpackager/src/main/resources/com/oracle/tools/packager/mac/MacAppStoreBundler.properties modules/fxpackager/src/main/resources/com/oracle/tools/packager/windows/WinAppBundler.properties modules/fxpackager/src/main/resources/com/oracle/tools/packager/windows/WinServiceBundler.properties modules/fxpackager/src/main/resources/com/oracle/tools/packager/windows/WindowsBundlerParam.properties modules/fxpackager/src/main/resources/com/oracle/tools/packager/windows/template.iss modules/fxpackager/src/main/resources/com/oracle/tools/packager/windows/template.wxs modules/fxpackager/src/test/java/com/oracle/tools/packager/CLITest.java modules/fxpackager/src/test/java/com/oracle/tools/packager/linux/LinuxAppBundlerTest.java modules/fxpackager/src/test/java/com/oracle/tools/packager/linux/LinuxDebBundlerTest.java modules/fxpackager/src/test/java/com/oracle/tools/packager/linux/LinuxRpmBundlerTest.java modules/fxpackager/src/test/java/com/oracle/tools/packager/mac/MacAppBundlerTest.java modules/fxpackager/src/test/java/com/oracle/tools/packager/mac/MacAppStoreBundlerTest.java modules/fxpackager/src/test/java/com/oracle/tools/packager/mac/MacDmgBundlerTest.java modules/fxpackager/src/test/java/com/oracle/tools/packager/mac/MacPkgBundlerTest.java modules/fxpackager/src/test/java/com/oracle/tools/packager/windows/WinAppBundlerTest.java modules/fxpackager/src/test/java/com/oracle/tools/packager/windows/WinExeBundlerTest.java modules/fxpackager/src/test/java/com/oracle/tools/packager/windows/WinMsiBundlerTest.java modules/fxpackager/src/test/java/com/oracle/tools/packager/windows/WinServiceBundlerTest.java modules/fxpackager/src/test/java/hello/HelloRectangle.java modules/fxpackager/src/test/java/hello/SimpleBundle.java modules/fxpackager/src/test/java/hello/TestPackager.java modules/fxpackager/src/test/resources/com/sun/javafx/tools/ant/BAservicehint.xml modules/fxpackager/src/test/resources/com/sun/javafx/tools/ant/SecondaryLaunchers_1.xml modules/fxpackager/src/test/resources/com/sun/javafx/tools/ant/fileAssoc.xml modules/fxpackager/src/test/resources/hello/small.ico modules/fxpackager/src/test/resources/hello/test.icns
diffstat 170 files changed, 17998 insertions(+), 4601 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore	Wed Sep 10 20:35:23 2014 +0400
+++ b/.hgignore	Wed Sep 10 11:31:04 2014 -0600
@@ -34,3 +34,7 @@
 *~
 modules/web/src/main/native/LayoutTests
 apps/scenebuilder/SceneBuilderApp/src/com/oracle/javafx/scenebuilder/app/about/about.properties
+.git
+.gitattributes
+.gitignore
+*.sdf
--- a/build.gradle	Wed Sep 10 20:35:23 2014 +0400
+++ b/build.gradle	Wed Sep 10 11:31:04 2014 -0600
@@ -103,7 +103,7 @@
  * cygwin is installed, as I hope one day to remove the requirement to build
  * with cygwin, but at present (due to GStreamer / Webkit) cygwin is needed
  * anyway.
- * 
+ *
  * @param path the path to convert
  * @return the path converted to windows style, if on windows, otherwise it
  *         is the supplied path.
@@ -149,7 +149,7 @@
 /**
  * Iterates over each of the compile targets, passing the given closure
  * a CompileTarget instance.
- * 
+ *
  * @param c The closure to call
  */
 void compileTargets(Closure c) {
@@ -170,11 +170,11 @@
  * content for a properties file built at build time and stored in the
  * root project's $buildDir, and then loading that properties file and
  * passing it to the processor closure.
- * 
+ *
  * This is used on windows to produce a properties file containing all the
  * windows visual studio paths and environment variables, and on Linux
  * for storing the results of pkg-config calls.
- * 
+ *
  * @param name the name of the file to produce
  * @param loader a closure which is invoked, given the properties file. This
  *        closure is invoked only if the properties file needs to be created
@@ -442,7 +442,7 @@
 ext.IS_IMPORT_CROSS_TOOLS = importCrossTools
 
 // Location of the cross compile tools
-def crossToolsDir = "../crosslibs" 
+def crossToolsDir = "../crosslibs"
 if (hasProperty("CROSS_TOOLS_DIR")) {
     crossToolsDir = CROSS_TOOLS_DIR
 }
@@ -670,7 +670,7 @@
     // This value is used to under ./build/${sdkDirName} to allow for
     // a common name for the hosted build (for use when building apps)
     // and a unique name for cross builds.
-    if (rootProject.defaultHostTarget.equals(t.name)) { 
+    if (rootProject.defaultHostTarget.equals(t.name)) {
         // use a simple common default for the "host" build
         targetProperties.sdkDirName="sdk"
     } else {
@@ -846,7 +846,7 @@
  * Convenience method for creating javah, cc, link, and "native" tasks in the given project. These
  * tasks are parameterized by name, so that we can produce, for example, javahGlass, ccGlass, etc
  * named tasks.
- * 
+ *
  * @param project The project to add tasks to
  * @param name The name of the project, such as "prism-common". This name is used
  *        in the name of the generated task, such as ccPrismCommon, and also
@@ -865,7 +865,7 @@
     if (project.hasProperty("nativeAllTask")) project.nativeAllTask.dependsOn nativeTask
     project.assemble.dependsOn(nativeTask)
     if (project.hasProperty("cleanNativeAllTask")) project.cleanNativeAllTask.dependsOn cleanTask
-    
+
     // Each of the different compile targets will be placed in a sub directory
     // of these root dirs, with the name of the dir being the name of the target
     def headerRootDir = project.file("$project.buildDir/generated-src/headers/$name")
@@ -892,7 +892,7 @@
             println("Native library ${name} disabled in ${t.name} project properties");
             return
         }
-        
+
         def javahTask = project.task("javah${t.capital}${capitalName}", type: JavaHeaderTask, dependsOn: project.classes, group: "Build") {
             description = "Generates JNI Headers for ${name} for ${t.name}"
             if (properties.javahSource == null) {
@@ -1809,10 +1809,9 @@
     }
     processResources.dependsOn man
 
-    // Compile the native launchers. These are included in ant-javafx.jar
-    // TODO should teach this to know 32 / 64 bit
+    // Compile the native launchers. These are included in ant-javafx.jar.
     if (IS_WINDOWS && COMPILE_FXPACKAGER) {
-        task compileWinLauncher(type: CCTask, group: "Build") {
+        task buildWinLauncher(type: CCTask, group: "Build") {
             description = "Compiles native sources for the application co-bundle launcher";
             matches = "WinLauncher\\.cpp";
             params.addAll(WIN.launcher.ccFlags);
@@ -1824,16 +1823,39 @@
             doLast {
                 copy {
                     from "$buildDir/native/WinLauncher/WinLauncher.exe"
+                    from "$MSVCR"
+                    from "$MSVCP"
                     into "$buildDir/classes/main/com/oracle/tools/packager/windows"
                 }
             }
         }
-        task compileWinLauncherSvc(type: CCTask, group: "Build") {
+        task compileWinLibrary(type: CCTask, group: "Build") {
+            description = "Compiles native sources for the application co-bundle launcher library";
+            matches = ".*\\.cpp"
+            source(file("src/main/native/library/common"));
+            params.addAll(WIN.launcherlibrary.ccFlags)
+            output(file("$buildDir/native/WinLauncher/obj"));
+            compiler = WIN.launcherlibrary.compiler
+        }
+        task linkWinLibrary(type: LinkTask, group: "Build", dependsOn: compileWinLibrary) {
+            description = "Links native sources for the application co-bundle launcher library";
+            objectDir = file("$buildDir/native/WinLauncher/obj")
+            linkParams.addAll(WIN.launcherlibrary.linkFlags);
+            lib = file("$buildDir/native/WinLauncher/packager.dll")
+            linker = WIN.launcherlibrary.linker
+            doLast {
+                copy {
+                    from "$buildDir/native/WinLauncher/packager.dll"
+                    into "$buildDir/classes/main/com/oracle/tools/packager/windows"
+                }
+            }
+        }
+        task buildWinLauncherSvc(type: CCTask, group: "Build") {
             description = "Compiles native sources for the application co-bundle launcher";
             matches = "WinLauncherSvc\\.cpp";
             params.addAll(WIN.launcher.ccFlags);
             output(file("$buildDir/native/WinLauncherSvc"));
-            source(file("src/main/native/launcher/win"));
+            source(file("src/main/native/service/win"));
             compiler = WIN.launcher.compiler
             exe = true;
             linkerOptions.addAll(WIN.launcher.linkFlags);
@@ -1844,12 +1866,12 @@
                 }
             }
         }
-        task compileIconSwap(type: CCTask, group: "Build") {
+        task buildIconSwap(type: CCTask, group: "Build") {
             description = "Compiles native sources for the application co-bundle launcher"
             matches = "IconSwap\\.cpp"
             params.addAll(WIN.iconLauncher.ccFlags)
             output(file("$buildDir/native/IconSwap"))
-            source file("src/main/native/launcher/win")
+            source file("src/main/native/tools/win")
             compiler = WIN.launcher.compiler
             exe = true
             linkerOptions.addAll(WIN.iconLauncher.linkFlags)
@@ -1860,40 +1882,70 @@
                 }
             }
         }
-        task compileLauncher(dependsOn: [compileWinLauncher, compileWinLauncherSvc, compileIconSwap])
+        task compileLauncher(dependsOn: [buildWinLauncher, linkWinLibrary, buildWinLauncherSvc, buildIconSwap])
         jar.dependsOn compileLauncher;
-    } else if (COMPILE_FXPACKAGER) {
-        if (IS_MAC) {
-            task compileLauncher(type: CCTask, group: "Build") {
-                description = "Compiles native sources for the application co-bundle launcher"
-                matches = ".*\\.m"
-                output(file("$buildDir/classes/main/com/oracle/tools/packager/mac"))
-                params.addAll(MAC.launcher.ccFlags)
-                source file("src/main/native/launcher/mac")
-                compiler = MAC.launcher.compiler
-                eachOutputFile = { f ->
-                    return new File(f.getParent(), "JavaAppLauncher")
-                }
+    } else if (IS_MAC && COMPILE_FXPACKAGER) {
+        task buildMacLauncher(type: CCTask, group: "Build") {
+            description = "Compiles native sources for the application co-bundle launcher"
+            matches = ".*\\.m"
+            source file("src/main/native/launcher/mac")
+            params.addAll(MAC.launcher.ccFlags)
+            compiler = MAC.launcher.compiler
+            output(file("$buildDir/classes/main/com/oracle/tools/packager/mac"))
+            eachOutputFile = { f ->
+                return new File(f.getParent(), "JavaAppLauncher")
             }
-            jar.dependsOn compileLauncher;
-        } else {
-            def ccTask = project.task("compileLauncher", type: CCTask, group: "Build") {
-                description = "Compiles native sources for the application co-bundle launcher"
-                matches = ".*\\.c"
-                output(file("$buildDir/native/launcher"))
-                params.addAll(LINUX.launcher.ccFlags)
-                compiler = LINUX.launcher.compiler
-                source file("src/main/native/launcher/linux")
-            }
-            def linkTask = project.task("linkLauncher", type: LinkTask, dependsOn: ccTask, group: "Build") {
-                description = "Creates native dynamic library for the application co-bundle launcher"
-                linker = LINUX.launcher.linker
-                linkParams.addAll(LINUX.launcher.linkFlags)
-                objectDir = file("$buildDir/native/launcher")
-                lib = file("$buildDir/classes/main/com/oracle/tools/packager/linux/JavaAppLauncher")
-            }
-            jar.dependsOn linkTask;
         }
+        task compileMacLibrary(type: CCTask, group: "Build") {
+            description = "Compiles native sources for the application co-bundle launcher library"
+            matches = ".*\\.cpp|.*\\.mm"
+            source file("src/main/native/library/common");
+            params.addAll(MAC.launcherlibrary.ccFlags)
+            compiler = MAC.launcherlibrary.compiler
+            output(file("$buildDir/native/maclauncher/obj"))
+        }
+        task linkMacLibrary(type: LinkTask, group: "Build", dependsOn: compileMacLibrary) {
+            description = "Links native sources for the application co-bundle launcher library"
+            objectDir = file("$buildDir/native/maclauncher/obj")
+            linkParams.addAll(MAC.launcherlibrary.linkFlags)
+            linker = MAC.launcherlibrary.linker
+            lib = file("$buildDir/classes/main/com/oracle/tools/packager/mac/libpackager.dylib")
+        }
+        task compileLauncher(dependsOn: [buildMacLauncher, linkMacLibrary])
+        jar.dependsOn compileLauncher;
+    } else if (IS_LINUX && COMPILE_FXPACKAGER) {
+        task compileLinuxLauncher(type: CCTask, group: "Build") {
+            description = "Compiles native sources for the application co-bundle launcher"
+            matches = ".*\\.cpp"
+            source file("src/main/native/launcher/linux")
+            params.addAll(LINUX.launcher.ccFlags)
+            compiler = LINUX.launcher.compiler
+            output(file("$buildDir/native/linuxlauncher/launcherobj"))
+        }
+        task linkLinuxLauncher(type: LinkTask, dependsOn: compileLinuxLauncher, group: "Build") {
+            description = "Links native dynamic library for the application co-bundle launcher"
+            objectDir = file("$buildDir/native/linuxlauncher/launcherobj")
+            linkParams.addAll(LINUX.launcher.linkFlags)
+            linker = LINUX.launcher.linker
+            lib = file("$buildDir/classes/main/com/oracle/tools/packager/linux/JavaAppLauncher")
+        }
+        task compileLinuxLibrary(type: CCTask, group: "Build") {
+            description = "Compiles native sources for the application co-bundle launcher library"
+            matches = ".*\\.cpp"
+            source file("src/main/native/library/common")
+            params.addAll(LINUX.launcherlibrary.ccFlags)
+            compiler = LINUX.launcherlibrary.compiler
+            output(file("$buildDir/native/linuxlauncher/obj"))
+        }
+        task linkLinuxLibrary(type: LinkTask, dependsOn: compileLinuxLibrary, group: "Build") {
+            description = "Links native dynamic library for the application co-bundle launcher library"
+            objectDir = file("$buildDir/native/linuxlauncher/obj")
+            linkParams.addAll(LINUX.launcherlibrary.linkFlags)
+            linker = LINUX.launcherlibrary.linker
+            lib = file("$buildDir/classes/main/com/oracle/tools/packager/linux/libpackager.so")
+        }
+        task compileLauncher(dependsOn: [linkLinuxLauncher, linkLinuxLibrary])
+        jar.dependsOn compileLauncher;
     }
 
     // Builds the javapackager executable. For everything other than windows,
@@ -1974,7 +2026,20 @@
         }
     }
 
+    task packagerJar(type: Jar) {
+        group = "Basic"
+        description = "Creates the packager.jar"
+        archiveName = "packager.jar";
+        includeEmptyDirs = false
+        from("$buildDir/classes/main");
+        from("$buildDir/resources/main");
+        include('jdk/packager/**')
+
+        dependsOn(buildJavaPackager);
+    }
+
     jar.dependsOn buildJavaPackager
+    jar.dependsOn packagerJar
 
     classes << {
         // Copy all of the download libraries to libs directory for the sake of the IDEs
@@ -2001,7 +2066,7 @@
 
         manifest {
             attributes(
-                    "Main-Class": "hello.TestPackager",
+                    "Main-Class": "hello.HelloRectangle",
                     "Custom-Attribute": " Is it stripped?"
             )
         }
@@ -2012,7 +2077,10 @@
                 from "$projectDir/src/main/resources/com/oracle/tools/packager/mac/GenericAppHiDPI.icns"
                 from "$projectDir/src/main/resources/com/oracle/tools/packager/windows/javalogo_white_48.ico"
                 from "$projectDir/src/test/resources/hello/java-logo2.gif"
+                from "$projectDir/src/test/resources/hello/small.ico"
+                from "$projectDir/src/test/resources/hello/test.icns"
                 from "$projectDir/../../LICENSE"
+                from "$projectDir/build/libs/packager.jar"
                 into project.file("$projectDir/build/tmp/tests/appResources")
             }
             copy {
@@ -2051,6 +2119,17 @@
         systemProperty "TEST_PACKAGER_DMG", TEST_PACKAGER_DMG
         systemProperty "FULL_TEST", FULL_TEST
     }
+
+    task packagerDev(dependsOn: [jar, packagerFakeJar], type:JavaExec) {
+        workingDir = project.file("build/tmp/tests/appResources/")
+        classpath = project.files("build/libs/ant-javafx.jar", "build/classes/test", "build/resources/test")
+        main = "hello.SimpleBundle"
+        args = [
+                "-o", "$projectDir/build/dev",
+                "-all",
+                "image"
+        ]
+    }
 }
 
 project(":media") {
--- a/buildSrc/linux.gradle	Wed Sep 10 20:35:23 2014 +0400
+++ b/buildSrc/linux.gradle	Wed Sep 10 11:31:04 2014 -0600
@@ -173,6 +173,12 @@
 LINUX.launcher.linker = linker
 LINUX.launcher.linkFlags = ["-ldl"]
 
+LINUX.launcherlibrary = [:]
+LINUX.launcherlibrary.compiler = compiler
+LINUX.launcherlibrary.ccFlags = ["-DJAVAARCH=\"$OS_ARCH\"", "-I$JDK_HOME/include", "-I$JDK_HOME/include/linux", "-c", "-fPIC"]
+LINUX.launcherlibrary.linker = linker
+LINUX.launcherlibrary.linkFlags = ["-ldl", "-lpthread", "-shared"]
+
 LINUX.iio = [:]
 LINUX.iio.javahInclude = ["com/sun/javafx/iio/**/*"]
 LINUX.iio.nativeSource = [
--- a/buildSrc/mac.gradle	Wed Sep 10 20:35:23 2014 +0400
+++ b/buildSrc/mac.gradle	Wed Sep 10 11:31:04 2014 -0600
@@ -124,6 +124,18 @@
 MAC.launcher.linker = linker
 MAC.launcher.linkFlags = ["-ldl"]
 
+MAC.launcherlibrary = [:]
+MAC.launcherlibrary.compiler = compiler
+MAC.launcherlibrary.ccFlags = [
+//        "-std=c++0x",
+        "-c",
+        ccBaseFlags,
+        IS_DEBUG_NATIVE ? ["-DDEBUG", "-O0"] : ["-O3", "-DNDEBUG"]].flatten()
+MAC.launcherlibrary.linker = linker
+MAC.launcherlibrary.linkFlags = ["-ldl", "-dynamiclib",
+        "-framework", "Cocoa",
+        "-stdlib=libstdc++"]
+
 MAC.iio = [:]
 MAC.iio.javahInclude = ["com/sun/javafx/iio/**/*"]
 MAC.iio.nativeSource = [
--- a/buildSrc/src/main/groovy/com/sun/javafx/gradle/CCTask.groovy	Wed Sep 10 20:35:23 2014 +0400
+++ b/buildSrc/src/main/groovy/com/sun/javafx/gradle/CCTask.groovy	Wed Sep 10 11:31:04 2014 -0600
@@ -55,7 +55,7 @@
             // Add in any additional compilation params
             if (params != null) {
                 // A little hack. Only use the -std=c99 flag if compiling .c or .m
-                if (sourceFile.name.endsWith(".cpp") || sourceFile.name.endsWith(".cc")) {
+                if (sourceFile.name.endsWith(".cpp") || sourceFile.name.endsWith(".cc") || sourceFile.name.endsWith(".mm")) {
                     def stripped = params;
                     stripped.remove("-std=c99");
                     args(stripped)
--- a/buildSrc/win.gradle	Wed Sep 10 20:35:23 2014 +0400
+++ b/buildSrc/win.gradle	Wed Sep 10 11:31:04 2014 -0600
@@ -117,8 +117,8 @@
 def rcCompiler = cygpath("$WINDOWS_SDK_DIR/Bin/RC.Exe")
 ext.FXC = cygpath("$WINDOWS_DXSDK_DIR/utilities/bin/x86/fxc.exe")
 ext.MC = cygpath("$WINDOWS_SDK_DIR/Bin/mt.exe")
-// This next line is based on a line in the ant build scripts, but doesn't seem to point to the right place
-//ext.MSVCR = cygpath("${WINDOWS_VS_MSVCDIR}/redist/${IS_64 ? 'x64' : 'x86'}/Microsoft.VC${WINDOWS_VS_VER}.CRT/msvcr${WINDOWS_VS_VER}.dll")
+ext.MSVCR = cygpath("${WINDOWS_VS_MSVCDIR}/redist/${IS_64 ? 'x64' : 'x86'}/Microsoft.VC${WINDOWS_VS_VER}.CRT/msvcr${WINDOWS_VS_VER}.dll")
+ext.MSVCP = cygpath("${WINDOWS_VS_MSVCDIR}/redist/${IS_64 ? 'x64' : 'x86'}/Microsoft.VC${WINDOWS_VS_VER}.CRT/msvcp${WINDOWS_VS_VER}.dll")
 
 def rcFlags = [
     "/d", "\"JFX_COMPANY=${COMPANY_NAME}\"",
@@ -210,7 +210,17 @@
         "/D_LITTLE_ENDIAN", "/DWIN32_LEAN_AND_MEAN", "/I$JDK_HOME/include", "/I$JDK_HOME/include/win32",
         "/arch:SSE", "/fp:fast", "/O2", "/MD"];
 WIN.launcher.linker = linker
-WIN.launcher.linkFlags = ["/link", "/nologo", "/SUBSYSTEM:WINDOWS", "user32.lib", "shell32.lib", "advapi32.lib"]
+WIN.launcher.linkFlags = ["/link", "/nologo", "/WX", "/SUBSYSTEM:WINDOWS", "user32.lib", "shell32.lib", "advapi32.lib"]
+
+WIN.launcherlibrary = [:]
+WIN.launcherlibrary.compiler = compiler
+WIN.launcherlibrary.ccFlags = ["/nologo", "/W3",
+        // "/WX",
+        "/EHsc", "/c", "/D_WINDOWS", "/DUNICODE", "/D_UNICODE", "/DWIN32",
+        "/D_LITTLE_ENDIAN", "/DWIN32_LEAN_AND_MEAN", "/I$JDK_HOME/include", "/I$JDK_HOME/include/win32",
+        "/arch:SSE", "/fp:fast", "/O2", "/MD"];
+WIN.launcherlibrary.linker = linker
+WIN.launcherlibrary.linkFlags = ["/nologo", "/WX", "/DLL", "/SUBSYSTEM:WINDOWS", "user32.lib", "shell32.lib", "advapi32.lib", "ole32.lib"]
 
 WIN.iconLauncher = [:]
 WIN.iconLauncher.compiler = compiler
--- a/modules/fxpackager/src/main/java/com/oracle/tools/packager/StandardBundlerParam.java	Wed Sep 10 20:35:23 2014 +0400
+++ b/modules/fxpackager/src/main/java/com/oracle/tools/packager/StandardBundlerParam.java	Wed Sep 10 11:31:04 2014 -0600
@@ -219,6 +219,17 @@
             );
 
     @SuppressWarnings("unchecked")
+    public static final StandardBundlerParam<List<String>> ARGUMENTS =
+            new StandardBundlerParam<>(
+                    I18N.getString("param.arguments.name"),
+                    I18N.getString("param.arguments.description"),
+                    "arguments",
+                    (Class<List<String>>) (Object) List.class,
+                    params -> Collections.emptyList(),
+                    (s, p) -> Arrays.asList(s.split("\\s+"))
+            );
+
+    @SuppressWarnings("unchecked")
     public static final StandardBundlerParam<List<String>> JVM_OPTIONS =
             new StandardBundlerParam<>(
                     I18N.getString("param.jvm-options.name"),
@@ -451,6 +462,72 @@
                     (s, p) -> (s == null || "null".equalsIgnoreCase(s))? true : Boolean.valueOf(s)
             );
 
+    @SuppressWarnings("unchecked")
+    public static final StandardBundlerParam<List<Map<String, ? super Object>>> SECONDARY_LAUNCHERS =
+            new StandardBundlerParam<>(
+                    I18N.getString("param.secondary-launchers.name"),
+                    I18N.getString("param.secondary-launchers.description"),
+                    "secondaryLaunchers",
+                    (Class<List<Map<String, ? super Object>>>) (Object) List.class,
+                    params -> new ArrayList<>(1),
+                    // valueOf(null) is false, and we actually do want null in some cases
+                    (s, p) -> null
+            );
+
+    @SuppressWarnings("unchecked")
+    public static final StandardBundlerParam<List<Map<String, ? super Object>>> FILE_ASSOCIATIONS =
+            new StandardBundlerParam<>(
+                    I18N.getString("param.file-associations.name"),
+                    I18N.getString("param.file-associations.description"),
+                    "fileAssociations",
+                    (Class<List<Map<String, ? super Object>>>) (Object) List.class,
+                    params -> new ArrayList<>(1),
+                    // valueOf(null) is false, and we actually do want null in some cases
+                    (s, p) -> null
+            );
+
+    @SuppressWarnings("unchecked")
+    public static final StandardBundlerParam<List<String>> FA_EXTENSIONS =
+            new StandardBundlerParam<>(
+                    I18N.getString("param.fa-extension.name"),
+                    I18N.getString("param.fa-extension.description"),
+                    "fileAssociation.extension",
+                    (Class<List<String>>) (Object) List.class,
+                    params -> null, // null means not matched to an extension
+                    (s, p) -> Arrays.asList(s.split("(,\\s)+"))
+            );
+
+    @SuppressWarnings("unchecked")
+    public static final StandardBundlerParam<List<String>> FA_CONTENT_TYPE =
+            new StandardBundlerParam<>(
+                    I18N.getString("param.fa-content-type.name"),
+                    I18N.getString("param.fa-content-type.description"),
+                    "fileAssociation.contentType",
+                    (Class<List<String>>) (Object) List.class,
+                    params -> null, // null means not matched to a content/mime type
+                    (s, p) -> Arrays.asList(s.split("(,\\s)+"))
+            );
+
+    public static final StandardBundlerParam<String> FA_DESCRIPTION =
+            new StandardBundlerParam<>(
+                    I18N.getString("param.fa-description.name"),
+                    I18N.getString("param.fa-description.description"),
+                    "fileAssociation.description",
+                    String.class,
+                    params -> APP_NAME.fetchFrom(params) + " File",
+                    null
+            );
+
+    public static final StandardBundlerParam<File> FA_ICON =
+            new StandardBundlerParam<>(
+                    I18N.getString("param.fa-icon.name"),
+                    I18N.getString("param.fa-icon.description"),
+                    "fileAssociation.icon",
+                    File.class,
+                    ICON::fetchFrom,
+                    (s, p) -> new File(s)
+            );
+
     public static void extractMainClassInfoFromAppResources(Map<String, ? super Object> params) {
         boolean hasMainClass = params.containsKey(MAIN_CLASS.getID());
         boolean hasMainJar = params.containsKey(MAIN_JAR.getID());
--- a/modules/fxpackager/src/main/java/com/oracle/tools/packager/linux/LinuxAppBundler.java	Wed Sep 10 20:35:23 2014 +0400
+++ b/modules/fxpackager/src/main/java/com/oracle/tools/packager/linux/LinuxAppBundler.java	Wed Sep 10 11:31:04 2014 -0600
@@ -56,6 +56,7 @@
     protected static final String LINUX_BUNDLER_PREFIX =
             BUNDLER_PREFIX + "linux" + File.separator;
     private static final String EXECUTABLE_NAME = "JavaAppLauncher";
+    private static final String LIBRARY_NAME    = "libpackager.so";
 
     public static final BundlerParamInfo<File> ICON_PNG = new StandardBundlerParam<>(
             I18N.getString("param.icon-png.name"),
@@ -173,7 +174,16 @@
         return new File(outDir, APP_FS_NAME.fetchFrom(p));
     }
 
+    public static String getLauncherName(Map<String, ? super Object> p) {
+        return APP_FS_NAME.fetchFrom(p);
+    }
+
+    public static String getLauncherCfgName(Map<String, ? super Object> p) {
+        return "app/" + APP_FS_NAME.fetchFrom(p) +".cfg";
+    }
+
     File doBundle(Map<String, ? super Object> p, File outputDirectory, boolean dependentTask) {
+        Map<String, ? super Object> originalParams = new HashMap<>(p);
         try {
             if (!outputDirectory.isDirectory() && !outputDirectory.mkdirs()) {
                 throw new RuntimeException(MessageFormat.format(I18N.getString("error.cannot-create-output-dir"), outputDirectory.getAbsolutePath()));
@@ -183,7 +193,7 @@
             }
 
             // Create directory structure
-            File rootDirectory = new File(outputDirectory, APP_FS_NAME.fetchFrom(p));
+            File rootDirectory = getRootDir(outputDirectory, p);
             IOUtils.deleteRecursive(rootDirectory);
             rootDirectory.mkdirs();
 
@@ -196,19 +206,21 @@
             File appDirectory = new File(rootDirectory, "app");
             appDirectory.mkdirs();
 
-            // Copy executable to Linux folder
-            File executableFile = new File(getRootDir(outputDirectory, p), APP_FS_NAME.fetchFrom(p));
+            // create the primary launcher
+            createLauncherForEntryPoint(p, rootDirectory);
+
+            // Copy library to the launcher folder
             IOUtils.copyFromURL(
-                    RAW_EXECUTABLE_URL.fetchFrom(p),
-                    executableFile);
+                    LinuxResources.class.getResource(LIBRARY_NAME),
+                    new File(rootDirectory, LIBRARY_NAME));
 
-            executableFile.setExecutable(true, false);
-            executableFile.setWritable(true, true); //for str
-
-            // Generate PkgInfo
-            File pkgInfoFile = new File(appDirectory, "package.cfg");
-            pkgInfoFile.createNewFile();
-            writePkgInfo(p, pkgInfoFile);
+            // create the secondary launchers, if any
+            List<Map<String, ? super Object>> entryPoints = StandardBundlerParam.SECONDARY_LAUNCHERS.fetchFrom(p);
+            for (Map<String, ? super Object> entryPoint : entryPoints) {
+                Map<String, ? super Object> tmp = new HashMap<>(originalParams);
+                tmp.putAll(entryPoint);
+                createLauncherForEntryPoint(tmp, rootDirectory);
+            }
 
             // Copy runtime to PlugIns folder
             copyRuntime(p, runtimeDirectory);
@@ -227,6 +239,20 @@
         }
     }
 
+    private void createLauncherForEntryPoint(Map<String, ? super Object> p, File rootDir) throws IOException {
+        // Copy executable to Linux folder
+        File executableFile = new File(rootDir, getLauncherName(p));
+        IOUtils.copyFromURL(
+                RAW_EXECUTABLE_URL.fetchFrom(p),
+                executableFile);
+
+        executableFile.setExecutable(true, false);
+        executableFile.setWritable(true, true); //for str
+
+        // Generate PkgInfo
+        writePkgInfo(p, rootDir);
+    }
+
     private void copyApplication(Map<String, ? super Object> params, File appDirectory) throws IOException {
         RelativeFileSet appResources = APP_RESOURCES.fetchFrom(params);
         if (appResources == null) {
@@ -239,7 +265,9 @@
         }
     }
 
-    private void writePkgInfo(Map<String, ? super Object> params, File pkgInfoFile) throws FileNotFoundException {
+    private void writePkgInfo(Map<String, ? super Object> params, File rootDir) throws FileNotFoundException {
+        File pkgInfoFile = new File(rootDir, getLauncherCfgName(params));
+
         pkgInfoFile.delete();
         PrintStream out = new PrintStream(pkgInfoFile);
         out.println("app.mainjar=" + MAIN_JAR.fetchFrom(params).getIncludedFiles().iterator().next());
@@ -253,7 +281,15 @@
             out.println("app.mainclass=" +
                     MAIN_CLASS.fetchFrom(params).replaceAll("\\.", "/"));
         }
-        out.println("app.classpath=" + CLASSPATH.fetchFrom(params));
+
+        StringBuilder macroedPath = new StringBuilder();
+        for (String s : CLASSPATH.fetchFrom(params).split("[ ;:]+")) {
+            macroedPath.append("$PACKAGEDIR/");
+            macroedPath.append(s);
+            macroedPath.append(":");
+        }
+        macroedPath.deleteCharAt(macroedPath.length() - 1);
+        out.println("app.classpath=" + macroedPath.toString());
 
         List<String> jvmargs = JVM_OPTIONS.fetchFrom(params);
         int idx = 1;
@@ -282,6 +318,15 @@
             }
             idx++;
         }
+
+        // add command line args
+        List<String> args = ARGUMENTS.fetchFrom(params);
+        idx = 1;
+        for (String a : args) {
+            out.println("arg."+idx+"="+a);
+            idx++;
+        }
+
         out.close();
     }
 
@@ -331,6 +376,7 @@
         return Arrays.asList(
                 APP_NAME,
                 APP_RESOURCES,
+                ARGUMENTS,
                 JVM_OPTIONS,
                 JVM_PROPERTIES,
                 LINUX_RUNTIME,
--- a/modules/fxpackager/src/main/java/com/oracle/tools/packager/linux/LinuxDebBundler.java	Wed Sep 10 20:35:23 2014 +0400
+++ b/modules/fxpackager/src/main/java/com/oracle/tools/packager/linux/LinuxDebBundler.java	Wed Sep 10 11:31:04 2014 -0600
@@ -29,6 +29,8 @@
 import com.oracle.tools.packager.IOUtils;
 import com.sun.javafx.tools.packager.bundlers.BundleParams;
 
+import javax.imageio.ImageIO;
+import java.awt.image.BufferedImage;
 import java.io.*;
 import java.nio.file.Files;
 import java.nio.file.attribute.PosixFilePermission;
@@ -159,6 +161,31 @@
             },
             (s, p) -> s);
 
+    public static final BundlerParamInfo<String> XDG_FILE_PREFIX = new StandardBundlerParam<> (
+            I18N.getString("param.xdg-prefix.name"),
+            I18N.getString("param.xdg-prefix.description"),
+            "linux.xdg-prefix",
+            String.class,
+            params -> {
+                try {
+                    String vendor;
+                    if (params.containsKey(VENDOR.getID())) {
+                        vendor = VENDOR.fetchFrom(params);
+                    } else {
+                        vendor = "javapackager";
+                    }
+                    String appName = APP_FS_NAME.fetchFrom(params);
+
+                    return (vendor + "-" + appName).replaceAll("\\s", "");
+                } catch (Exception e) {
+                    if (Log.isDebug()) {
+                        e.printStackTrace();
+                    }
+                }
+                return "unknown-MimeInfo.xml";
+            },
+            (s, p) -> s);
+
     private final static String DEFAULT_ICON = "javalogo_white_32.png";
     private final static String DEFAULT_CONTROL_TEMPLATE = "template.control";
     private final static String DEFAULT_PRERM_TEMPLATE = "template.prerm";
@@ -229,6 +256,24 @@
                         MessageFormat.format(I18N.getString("error.launcher-name-too-long.advice"), BUNDLE_NAME.getID()));
             }
 
+            // only one mime type per association, at least one file extention
+            List<Map<String, ? super Object>> associations = FILE_ASSOCIATIONS.fetchFrom(p);
+            if (associations != null) {
+                for (int i = 0; i < associations.size(); i++) {
+                    Map<String, ? super Object> assoc = associations.get(i);
+                    List<String> mimes = FA_CONTENT_TYPE.fetchFrom(assoc);
+                    if (mimes == null || mimes.isEmpty()) {
+                        throw new ConfigException(
+                                MessageFormat.format(I18N.getString("error.no-content-types-for-file-association"), i),
+                                I18N.getString("error.no-content-types-for-file-association.advice"));
+                    } else if (mimes.size() > 1) {
+                        throw new ConfigException(
+                                MessageFormat.format(I18N.getString("error.too-many-content-types-for-file-association"), i),
+                                I18N.getString("error.too-many-content-types-for-file-association.advice"));
+                    }
+                }
+            }
+
             return true;
         } catch (RuntimeException re) {
             if (re.getCause() instanceof ConfigException) {
@@ -318,6 +363,7 @@
     protected void saveConfigFiles(Map<String, ? super Object> params) {
         try {
             File configRoot = CONFIG_ROOT.fetchFrom(params);
+            File rootDir = LinuxAppBundler.getRootDir(APP_IMAGE_ROOT.fetchFrom(params), params);
 
             if (getConfig_ControlFile(params).exists()) {
                 IOUtils.copyFile(getConfig_ControlFile(params),
@@ -343,13 +389,19 @@
                 IOUtils.copyFile(getConfig_PostrmFile(params),
                         new File(configRoot, getConfig_PostrmFile(params).getName()));
             }
-            if (getConfig_DesktopShortcutFile(params).exists()) {
-                IOUtils.copyFile(getConfig_DesktopShortcutFile(params),
-                        new File(configRoot, getConfig_DesktopShortcutFile(params).getName()));
+            if (getConfig_DesktopShortcutFile(rootDir, params).exists()) {
+                IOUtils.copyFile(getConfig_DesktopShortcutFile(rootDir, params),
+                        new File(configRoot, getConfig_DesktopShortcutFile(rootDir, params).getName()));
             }
-            if (getConfig_IconFile(params).exists()) {
-                IOUtils.copyFile(getConfig_IconFile(params),
-                        new File(configRoot, getConfig_IconFile(params).getName()));
+            for (Map<String, ? super Object> secondaryLauncher : SECONDARY_LAUNCHERS.fetchFrom(params)) {
+                if (getConfig_DesktopShortcutFile(rootDir, secondaryLauncher).exists()) {
+                    IOUtils.copyFile(getConfig_DesktopShortcutFile(rootDir, secondaryLauncher),
+                            new File(configRoot, getConfig_DesktopShortcutFile(rootDir, secondaryLauncher).getName()));
+                }
+            }
+            if (getConfig_IconFile(rootDir, params).exists()) {
+                IOUtils.copyFile(getConfig_IconFile(rootDir, params),
+                        new File(configRoot, getConfig_IconFile(rootDir, params).getName()));
             }
             if (SERVICE_HINT.fetchFrom(params)) {
                 if (getConfig_InitScriptFile(params).exists()) {
@@ -392,31 +444,209 @@
     }
 
     private boolean prepareProjectConfig(Map<String, ? super Object> params) throws IOException {
-        Map<String, String> data = new HashMap<>();
+        Map<String, String> data = createReplacementData(params);
+        File rootDir = LinuxAppBundler.getRootDir(APP_IMAGE_ROOT.fetchFrom(params), params);
 
-        data.put("APPLICATION_NAME", APP_NAME.fetchFrom(params));
-        data.put("APPLICATION_FS_NAME", APP_FS_NAME.fetchFrom(params));
-        data.put("APPLICATION_PACKAGE", BUNDLE_NAME.fetchFrom(params));
-        data.put("APPLICATION_VENDOR", VENDOR.fetchFrom(params));
-        data.put("APPLICATION_MAINTAINER", MAINTAINER.fetchFrom(params));
-        data.put("APPLICATION_VERSION", VERSION.fetchFrom(params));
-        data.put("APPLICATION_LAUNCHER_FILENAME", APP_FS_NAME.fetchFrom(params));
-        data.put("DEPLOY_BUNDLE_CATEGORY", CATEGORY.fetchFrom(params));
-        data.put("APPLICATION_DESCRIPTION", DESCRIPTION.fetchFrom(params));
-        data.put("APPLICATION_SUMMARY", TITLE.fetchFrom(params));
-        data.put("APPLICATION_COPYRIGHT", COPYRIGHT.fetchFrom(params));
-        data.put("APPLICATION_LICENSE_TYPE", LICENSE_TYPE.fetchFrom(params));
-        data.put("APPLICATION_LICENSE_TEXT", LICENSE_TEXT.fetchFrom(params));
-        data.put("APPLICATION_ARCH", getArch());
-        data.put("APPLICATION_INSTALLED_SIZE", Long.toString(getInstalledSizeKB(params)));
-        data.put("SERVICE_HINT", String.valueOf(SERVICE_HINT.fetchFrom(params)));
-        data.put("START_ON_INSTALL", String.valueOf(START_ON_INSTALL.fetchFrom(params)));
-        data.put("STOP_ON_UNINSTALL", String.valueOf(STOP_ON_UNINSTALL.fetchFrom(params)));
-        data.put("RUN_AT_STARTUP", String.valueOf(RUN_AT_STARTUP.fetchFrom(params)));
+        //prepare installer icon
+        File iconTarget = getConfig_IconFile(rootDir, params);
+        File icon = ICON_PNG.fetchFrom(params);
+        if (icon == null || !icon.exists()) {
+            fetchResource(LinuxAppBundler.LINUX_BUNDLER_PREFIX + iconTarget.getName(),
+                    I18N.getString("resource.menu-icon"),
+                    DEFAULT_ICON,
+                    iconTarget,
+                    VERBOSE.fetchFrom(params));
+        } else {
+            fetchResource(LinuxAppBundler.LINUX_BUNDLER_PREFIX + iconTarget.getName(),
+                    I18N.getString("resource.menu-icon"),
+                    icon,
+                    iconTarget,
+                    VERBOSE.fetchFrom(params));
+        }
+
+        StringBuilder installScripts = new StringBuilder();
+        StringBuilder removeScripts = new StringBuilder();
+        for (Map<String, ? super Object> secondaryLauncher : SECONDARY_LAUNCHERS.fetchFrom(params)) {
+            Map<String, String> secondaryLauncherData = createReplacementData(secondaryLauncher);
+            secondaryLauncherData.put("APPLICATION_FS_NAME", data.get("APPLICATION_FS_NAME"));
+            secondaryLauncherData.put("DESKTOP_MIMES", "");
+
+            //prepare desktop shortcut
+            Writer w = new BufferedWriter(new FileWriter(getConfig_DesktopShortcutFile(rootDir, secondaryLauncher)));
+            String content = preprocessTextResource(
+                    LinuxAppBundler.LINUX_BUNDLER_PREFIX + getConfig_DesktopShortcutFile(rootDir, secondaryLauncher).getName(),
+                    I18N.getString("resource.menu-shortcut-descriptor"),
+                    DEFAULT_DESKTOP_FILE_TEMPLATE,
+                    secondaryLauncherData,
+                    VERBOSE.fetchFrom(params));
+            w.write(content);
+            w.close();
+
+            //prepare installer icon
+            iconTarget = getConfig_IconFile(rootDir, secondaryLauncher);
+            icon = ICON_PNG.fetchFrom(secondaryLauncher);
+            if (icon == null || !icon.exists()) {
+                fetchResource(LinuxAppBundler.LINUX_BUNDLER_PREFIX + iconTarget.getName(),
+                        I18N.getString("resource.menu-icon"),
+                        DEFAULT_ICON,
+                        iconTarget,
+                        VERBOSE.fetchFrom(params));
+            } else {
+                fetchResource(LinuxAppBundler.LINUX_BUNDLER_PREFIX + iconTarget.getName(),
+                        I18N.getString("resource.menu-icon"),
+                        icon,
+                        iconTarget,
+                        VERBOSE.fetchFrom(params));
+            }
+
+            //postinst copying of desktop icon
+            installScripts.append("        xdg-desktop-menu install --novendor /opt/");
+            installScripts.append(data.get("APPLICATION_FS_NAME"));
+            installScripts.append("/");
+            installScripts.append(secondaryLauncherData.get("APPLICATION_LAUNCHER_FILENAME"));
+            installScripts.append(".desktop\n");
+
+            //postrm cleanup of desktop icon
+            removeScripts.append("        xdg-desktop-menu uninstall --novendor /opt/");
+            removeScripts.append(data.get("APPLICATION_FS_NAME"));
+            removeScripts.append("/");
+            removeScripts.append(secondaryLauncherData.get("APPLICATION_LAUNCHER_FILENAME"));
+            removeScripts.append(".desktop\n");
+        }
+        data.put("SECONDARY_LAUNCHERS_INSTALL", installScripts.toString());
+        data.put("SECONDARY_LAUNCHERS_REMOVE", removeScripts.toString());
+
+        List<Map<String, ? super Object>> associations = FILE_ASSOCIATIONS.fetchFrom(params);
+        data.put("FILE_ASSOCIATION_INSTALL", "");
+        data.put("FILE_ASSOCIATION_REMOVE", "");
+        data.put("DESKTOP_MIMES", "");
+        if (associations != null) {
+            String mimeInfoFile = XDG_FILE_PREFIX.fetchFrom(params) + "-MimeInfo.xml";
+            StringBuilder mimeInfo = new StringBuilder("<?xml version=\"1.0\"?>\n<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>\n");
+            StringBuilder registrations = new StringBuilder();
+            StringBuilder deregistrations = new StringBuilder();
+            StringBuilder desktopMimes = new StringBuilder("MimeType=");
+            boolean addedEntry = false;
+
+            for (Map<String, ? super Object> assoc : associations) {
+                //  <mime-type type="application/x-vnd.awesome">
+                //    <comment>Awesome document</comment>
+                //    <glob pattern="*.awesome"/>
+                //    <glob pattern="*.awe"/>
+                //  </mime-type>
+
+                if (assoc == null) {
+                    continue;
+                }
+
+                String description = FA_DESCRIPTION.fetchFrom(assoc);
+                File faIcon = FA_ICON.fetchFrom(assoc); //TODO FA_ICON_PNG
+                List<String> extensions = FA_EXTENSIONS.fetchFrom(assoc);
+                List<String> mimes = FA_CONTENT_TYPE.fetchFrom(assoc);
+                if (mimes == null || mimes.isEmpty()) {
+                    continue;
+                }
+                String thisMime = mimes.get(0);
+                String dashMime = thisMime.replace('/', '-');
+
+                mimeInfo.append("  <mime-type type='")
+                        .append(thisMime)
+                        .append("'>\n");
+                if (description != null && !description.isEmpty()) {
+                    mimeInfo.append("    <comment>")
+                            .append(description)
+                            .append("</comment>\n");
+                }
+
+                if (extensions != null) {
+                    for (String ext : extensions) {
+                        mimeInfo.append("    <glob pattern='*.")
+                                .append(ext)
+                                .append("'/>");
+                    }
+                }
+
+                mimeInfo.append("  </mime-type>\n");
+                if (!addedEntry) {
+                    registrations.append("        xdg-mime install /opt/")
+                            .append(data.get("APPLICATION_FS_NAME"))
+                            .append("/")
+                            .append(mimeInfoFile)
+                            .append("\n");
+                    registrations.append("        xdg-mime install /opt/")
+                            .append(data.get("APPLICATION_FS_NAME"))
+                            .append("/")
+                            .append(mimeInfoFile)
+                            .append("\n");
+
+                    deregistrations.append("        xdg-mime uninstall /opt/")
+                            .append(data.get("APPLICATION_FS_NAME"))
+                            .append("/")
+                            .append(mimeInfoFile)
+                            .append("\n");
+                    addedEntry = true;
+                } else {
+                    desktopMimes.append(";");
+                }
+                desktopMimes.append(thisMime);
+
+                if (faIcon != null && faIcon.exists()) {
+                    int size = getSquareSizeOfImage(faIcon);
+
+                    if (size > 0) {
+                        File target = new File(rootDir, APP_FS_NAME.fetchFrom(params) + "_fa_" + faIcon.getName());
+                        IOUtils.copyFile(faIcon, target);
+
+                        //xdg-icon-resource install --context mimetypes --size 64 awesomeapp_fa_1.png application-x.vnd-awesome
+                        registrations.append("        xdg-icon-resource install --context mimetypes --size ")
+                                .append(size)
+                                .append(" /opt/")
+                                .append(data.get("APPLICATION_FS_NAME"))
+                                .append("/")
+                                .append(target.getName())
+                                .append(" ")
+                                .append(dashMime)
+                                .append("\n");
+
+                        //xdg-icon-resource uninstall --context mimetypes --size 64 awesomeapp_fa_1.png application-x.vnd-awesome
+                        deregistrations.append("        xdg-icon-resource uninstall --context mimetypes --size ")
+                                .append(size)
+                                .append(" /opt/")
+                                .append(data.get("APPLICATION_FS_NAME"))
+                                .append("/")
+                                .append(target.getName())
+                                .append(" ")
+                                .append(dashMime)
+                                .append("\n");
+                    }
+                }
+            }
+            mimeInfo.append("</mime-info>");
+
+            if (addedEntry) {
+                Writer w = new BufferedWriter(new FileWriter(new File(rootDir, mimeInfoFile)));
+                w.write(mimeInfo.toString());
+                w.close();
+                data.put("FILE_ASSOCIATION_INSTALL", registrations.toString());
+                data.put("FILE_ASSOCIATION_REMOVE", deregistrations.toString());
+                data.put("DESKTOP_MIMES", desktopMimes.toString());
+            }
+        }
+
+        //prepare desktop shortcut
+        Writer w = new BufferedWriter(new FileWriter(getConfig_DesktopShortcutFile(rootDir, params)));
+        String content = preprocessTextResource(
+                LinuxAppBundler.LINUX_BUNDLER_PREFIX + getConfig_DesktopShortcutFile(rootDir, params).getName(),
+                I18N.getString("resource.menu-shortcut-descriptor"),
+                DEFAULT_DESKTOP_FILE_TEMPLATE,
+                data,
+                VERBOSE.fetchFrom(params));
+        w.write(content);
+        w.close();
 
         //prepare control file
-        Writer w = new BufferedWriter(new FileWriter(getConfig_ControlFile(params)));
-        String content = preprocessTextResource(
+        w = new BufferedWriter(new FileWriter(getConfig_ControlFile(params)));
+        content = preprocessTextResource(
                 LinuxAppBundler.LINUX_BUNDLER_PREFIX + getConfig_ControlFile(params).getName(),
                 I18N.getString("resource.deb-control-file"),
                 DEFAULT_CONTROL_TEMPLATE,
@@ -479,34 +709,6 @@
         w.write(content);
         w.close();
 
-        //prepare desktop shortcut
-        w = new BufferedWriter(new FileWriter(getConfig_DesktopShortcutFile(params)));
-        content = preprocessTextResource(
-                LinuxAppBundler.LINUX_BUNDLER_PREFIX + getConfig_DesktopShortcutFile(params).getName(),
-                I18N.getString("resource.menu-shortcut-descriptor"),
-                DEFAULT_DESKTOP_FILE_TEMPLATE,
-                data,
-                VERBOSE.fetchFrom(params));
-        w.write(content);
-        w.close();
-
-        //prepare installer icon
-        File iconTarget = getConfig_IconFile(params);
-        File icon = ICON_PNG.fetchFrom(params);
-        if (icon == null || !icon.exists()) {
-            fetchResource(LinuxAppBundler.LINUX_BUNDLER_PREFIX + iconTarget.getName(),
-                    I18N.getString("resource.menu-icon"),
-                    DEFAULT_ICON,
-                    iconTarget,
-                    VERBOSE.fetchFrom(params));
-        } else {
-            fetchResource(LinuxAppBundler.LINUX_BUNDLER_PREFIX + iconTarget.getName(),
-                    I18N.getString("resource.menu-icon"),
-                    icon,
-                    iconTarget,
-                    VERBOSE.fetchFrom(params));
-        }
-
         if (SERVICE_HINT.fetchFrom(params)) {
             //prepare init script
             w = new BufferedWriter(new FileWriter(getConfig_InitScriptFile(params)));
@@ -524,13 +726,39 @@
         return true;
     }
 
-    private File getConfig_DesktopShortcutFile(Map<String, ? super Object> params) {
-        return new File(LinuxAppBundler.getRootDir(APP_IMAGE_ROOT.fetchFrom(params), params),
+    private Map<String, String> createReplacementData(Map<String, ? super Object> params) {
+        Map<String, String> data = new HashMap<>();
+
+        data.put("APPLICATION_NAME", APP_NAME.fetchFrom(params));
+        data.put("APPLICATION_FS_NAME", APP_FS_NAME.fetchFrom(params));
+        data.put("APPLICATION_PACKAGE", BUNDLE_NAME.fetchFrom(params));
+        data.put("APPLICATION_VENDOR", VENDOR.fetchFrom(params));
+        data.put("APPLICATION_MAINTAINER", MAINTAINER.fetchFrom(params));
+        data.put("APPLICATION_VERSION", VERSION.fetchFrom(params));
+        data.put("APPLICATION_LAUNCHER_FILENAME", APP_FS_NAME.fetchFrom(params));
+        data.put("XDG_PREFIX", XDG_FILE_PREFIX.fetchFrom(params));
+        data.put("DEPLOY_BUNDLE_CATEGORY", CATEGORY.fetchFrom(params));
+        data.put("APPLICATION_DESCRIPTION", DESCRIPTION.fetchFrom(params));
+        data.put("APPLICATION_SUMMARY", TITLE.fetchFrom(params));
+        data.put("APPLICATION_COPYRIGHT", COPYRIGHT.fetchFrom(params));
+        data.put("APPLICATION_LICENSE_TYPE", LICENSE_TYPE.fetchFrom(params));
+        data.put("APPLICATION_LICENSE_TEXT", LICENSE_TEXT.fetchFrom(params));
+        data.put("APPLICATION_ARCH", getArch());
+        data.put("APPLICATION_INSTALLED_SIZE", Long.toString(getInstalledSizeKB(params)));
+        data.put("SERVICE_HINT", String.valueOf(SERVICE_HINT.fetchFrom(params)));
+        data.put("START_ON_INSTALL", String.valueOf(START_ON_INSTALL.fetchFrom(params)));
+        data.put("STOP_ON_UNINSTALL", String.valueOf(STOP_ON_UNINSTALL.fetchFrom(params)));
+        data.put("RUN_AT_STARTUP", String.valueOf(RUN_AT_STARTUP.fetchFrom(params)));
+        return data;
+    }
+
+    private File getConfig_DesktopShortcutFile(File rootDir, Map<String, ? super Object> params) {
+        return new File(rootDir,
                 APP_FS_NAME.fetchFrom(params) + ".desktop");
     }
 
-    private File getConfig_IconFile(Map<String, ? super Object> params) {
-        return new File(LinuxAppBundler.getRootDir(APP_IMAGE_ROOT.fetchFrom(params), params),
+    private File getConfig_IconFile(File rootDir, Map<String, ? super Object> params) {
+        return new File(rootDir,
                 APP_FS_NAME.fetchFrom(params) + ".png");
     }
 
@@ -629,4 +857,17 @@
         return bundle(params, outputParentDir);
     }
 
+    public int getSquareSizeOfImage(File f) {
+        try {
+            BufferedImage bi = ImageIO.read(f);
+            if (bi.getWidth() == bi.getHeight()) {
+                return bi.getWidth();
+            } else {
+                return 0;
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            return 0;
+        }
+    }
 }
--- a/modules/fxpackager/src/main/java/com/oracle/tools/packager/linux/LinuxRpmBundler.java	Wed Sep 10 20:35:23 2014 +0400
+++ b/modules/fxpackager/src/main/java/com/oracle/tools/packager/linux/LinuxRpmBundler.java	Wed Sep 10 11:31:04 2014 -0600
@@ -28,6 +28,8 @@
 import com.oracle.tools.packager.*;
 import com.oracle.tools.packager.IOUtils;
 
+import javax.imageio.ImageIO;
+import java.awt.image.BufferedImage;
 import java.io.*;
 import java.nio.file.Files;
 import java.nio.file.attribute.PosixFilePermission;
@@ -95,6 +97,31 @@
             },
             (s, p) -> s);
 
+    public static final BundlerParamInfo<String> XDG_FILE_PREFIX = new StandardBundlerParam<> (
+            I18N.getString("param.xdg-prefix.name"),
+            I18N.getString("param.xdg-prefix.description"),
+            "linux.xdg-prefix",
+            String.class,
+            params -> {
+                try {
+                    String vendor;
+                    if (params.containsKey(VENDOR.getID())) {
+                        vendor = VENDOR.fetchFrom(params);
+                    } else {
+                        vendor = "javapackager";
+                    }
+                    String appName = APP_FS_NAME.fetchFrom(params);
+
+                    return (vendor + "-" + appName).replaceAll("\\s", "");
+                } catch (Exception e) {
+                    if (Log.isDebug()) {
+                        e.printStackTrace();
+                    }
+                }
+                return "unknown-MimeInfo.xml";
+            },
+            (s, p) -> s);
+
     private final static String DEFAULT_ICON = "javalogo_white_32.png";
     private final static String DEFAULT_SPEC_TEMPLATE = "template.spec";
     private final static String DEFAULT_DESKTOP_FILE_TEMPLATE = "template.desktop";
@@ -164,6 +191,24 @@
                         I18N.getString(MessageFormat.format("error.cannot-find-rpmbuild.advice", TOOL_RPMBUILD_MIN_VERSION)));
             }
 
+            // only one mime type per association, at least one file extension
+            List<Map<String, ? super Object>> associations = FILE_ASSOCIATIONS.fetchFrom(p);
+            if (associations != null) {
+                for (int i = 0; i < associations.size(); i++) {
+                    Map<String, ? super Object> assoc = associations.get(i);
+                    List<String> mimes = FA_CONTENT_TYPE.fetchFrom(assoc);
+                    if (mimes == null || mimes.isEmpty()) {
+                        throw new ConfigException(
+                                MessageFormat.format(I18N.getString("error.no-content-types-for-file-association"), i),
+                                I18N.getString("error.no-content-types-for-file-association.advice"));
+                    } else if (mimes.size() > 1) {
+                        throw new ConfigException(
+                                MessageFormat.format(I18N.getString("error.too-many-content-types-for-file-association"), i),
+                                I18N.getString("error.too-many-content-types-for-file-association.advice"));
+                    }
+                }
+            }
+
             return true;
         } catch (RuntimeException re) {
             if (re.getCause() instanceof ConfigException) {
@@ -244,17 +289,19 @@
     protected void saveConfigFiles(Map<String, ? super Object> params) {
         try {
             File configRoot = CONFIG_ROOT.fetchFrom(params);
+            File rootDir = LinuxAppBundler.getRootDir(RPM_IMAGE_DIR.fetchFrom(params), params);
+
             if (getConfig_SpecFile(params).exists()) {
                 IOUtils.copyFile(getConfig_SpecFile(params),
                         new File(configRoot, getConfig_SpecFile(params).getName()));
             }
-            if (getConfig_DesktopShortcutFile(params).exists()) {
-                IOUtils.copyFile(getConfig_DesktopShortcutFile(params),
-                        new File(configRoot, getConfig_DesktopShortcutFile(params).getName()));
+            if (getConfig_DesktopShortcutFile(rootDir, params).exists()) {
+                IOUtils.copyFile(getConfig_DesktopShortcutFile(rootDir, params),
+                        new File(configRoot, getConfig_DesktopShortcutFile(rootDir, params).getName()));
             }
-            if (getConfig_IconFile(params).exists()) {
-                IOUtils.copyFile(getConfig_IconFile(params),
-                        new File(configRoot, getConfig_IconFile(params).getName()));
+            if (getConfig_IconFile(rootDir, params).exists()) {
+                IOUtils.copyFile(getConfig_IconFile(rootDir, params),
+                        new File(configRoot, getConfig_IconFile(rootDir, params).getName()));
             }
             if (SERVICE_HINT.fetchFrom(params)) {
                 if (getConfig_InitScriptFile(params).exists()) {
@@ -283,44 +330,11 @@
     }
 
     private boolean prepareProjectConfig(Map<String, ? super Object> params) throws IOException {
-        Map<String, String> data = new HashMap<>();
-
-        data.put("APPLICATION_NAME", APP_NAME.fetchFrom(params));
-        data.put("APPLICATION_FS_NAME", APP_FS_NAME.fetchFrom(params));
-        data.put("APPLICATION_PACKAGE", BUNDLE_NAME.fetchFrom(params));
-        data.put("APPLICATION_VENDOR", VENDOR.fetchFrom(params));
-        data.put("APPLICATION_VERSION", VERSION.fetchFrom(params));
-        data.put("APPLICATION_LAUNCHER_FILENAME", APP_FS_NAME.fetchFrom(params));
-        data.put("DEPLOY_BUNDLE_CATEGORY", CATEGORY.fetchFrom(params)); //TODO rpm categories
-        data.put("APPLICATION_DESCRIPTION", DESCRIPTION.fetchFrom(params));
-        data.put("APPLICATION_SUMMARY", TITLE.fetchFrom(params));
-        data.put("APPLICATION_LICENSE_TYPE", LICENSE_TYPE.fetchFrom(params));
-        data.put("APPLICATION_LICENSE_FILE", getLicenseFileString(params));
-        data.put("SERVICE_HINT", String.valueOf(SERVICE_HINT.fetchFrom(params)));
-        data.put("START_ON_INSTALL", String.valueOf(START_ON_INSTALL.fetchFrom(params)));
-        data.put("STOP_ON_UNINSTALL", String.valueOf(STOP_ON_UNINSTALL.fetchFrom(params)));
-        data.put("RUN_AT_STARTUP", String.valueOf(RUN_AT_STARTUP.fetchFrom(params)));
-
-        //prepare spec file
-        Writer w = new BufferedWriter(new FileWriter(getConfig_SpecFile(params)));
-        String content = preprocessTextResource(
-                LinuxAppBundler.LINUX_BUNDLER_PREFIX + getConfig_SpecFile(params).getName(),
-                I18N.getString("resource.rpm-spec-file"), DEFAULT_SPEC_TEMPLATE, data,
-                VERBOSE.fetchFrom(params));
-        w.write(content);
-        w.close();
-
-        //prepare desktop shortcut
-        w = new BufferedWriter(new FileWriter(getConfig_DesktopShortcutFile(params)));
-        content = preprocessTextResource(
-                LinuxAppBundler.LINUX_BUNDLER_PREFIX + getConfig_DesktopShortcutFile(params).getName(),
-                I18N.getString("resource.menu-shortcut-descriptor"), DEFAULT_DESKTOP_FILE_TEMPLATE, data,
-                VERBOSE.fetchFrom(params));
-        w.write(content);
-        w.close();
+        Map<String, String> data = createReplacementData(params);
+        File rootDir = LinuxAppBundler.getRootDir(RPM_IMAGE_DIR.fetchFrom(params), params);
 
         //prepare installer icon
-        File iconTarget = getConfig_IconFile(params);
+        File iconTarget = getConfig_IconFile(rootDir, params);
         File icon = LinuxAppBundler.ICON_PNG.fetchFrom(params);
         if (icon == null || !icon.exists()) {
             fetchResource(LinuxAppBundler.LINUX_BUNDLER_PREFIX + iconTarget.getName(),
@@ -336,6 +350,191 @@
                     VERBOSE.fetchFrom(params));
         }
 
+        StringBuilder installScripts = new StringBuilder();
+        StringBuilder removeScripts = new StringBuilder();
+        for (Map<String, ? super Object> secondaryLauncher : SECONDARY_LAUNCHERS.fetchFrom(params)) {
+            Map<String, String> secondaryLauncherData = createReplacementData(secondaryLauncher);
+            secondaryLauncherData.put("APPLICATION_FS_NAME", data.get("APPLICATION_FS_NAME"));
+            secondaryLauncherData.put("DESKTOP_MIMES", "");
+
+            //prepare desktop shortcut
+            Writer w = new BufferedWriter(new FileWriter(getConfig_DesktopShortcutFile(rootDir, secondaryLauncher)));
+            String content = preprocessTextResource(
+                    LinuxAppBundler.LINUX_BUNDLER_PREFIX + getConfig_DesktopShortcutFile(rootDir, secondaryLauncher).getName(),
+                    I18N.getString("resource.menu-shortcut-descriptor"), DEFAULT_DESKTOP_FILE_TEMPLATE, secondaryLauncherData,
+                    VERBOSE.fetchFrom(params));
+            w.write(content);
+            w.close();
+
+            //prepare installer icon
+            iconTarget = getConfig_IconFile(rootDir, secondaryLauncher);
+            icon = LinuxAppBundler.ICON_PNG.fetchFrom(secondaryLauncher);
+            if (icon == null || !icon.exists()) {
+                fetchResource(LinuxAppBundler.LINUX_BUNDLER_PREFIX + iconTarget.getName(),
+                        I18N.getString("resource.menu-icon"),
+                        DEFAULT_ICON,
+                        iconTarget,
+                        VERBOSE.fetchFrom(params));
+            } else {
+                fetchResource(LinuxAppBundler.LINUX_BUNDLER_PREFIX + iconTarget.getName(),
+                        I18N.getString("resource.menu-icon"),
+                        icon,
+                        iconTarget,
+                        VERBOSE.fetchFrom(params));
+            }
+
+            //post copying of desktop icon
+            installScripts.append("xdg-desktop-menu install --novendor /opt/");
+            installScripts.append(data.get("APPLICATION_FS_NAME"));
+            installScripts.append("/");
+            installScripts.append(secondaryLauncherData.get("APPLICATION_LAUNCHER_FILENAME"));
+            installScripts.append(".desktop\n");
+
+            //preun cleanup of desktop icon
+            removeScripts.append("xdg-desktop-menu uninstall --novendor /opt/");
+            removeScripts.append(data.get("APPLICATION_FS_NAME"));
+            removeScripts.append("/");
+            removeScripts.append(secondaryLauncherData.get("APPLICATION_LAUNCHER_FILENAME"));
+            removeScripts.append(".desktop\n");
+
+        }
+        data.put("SECONDARY_LAUNCHERS_INSTALL", installScripts.toString());
+        data.put("SECONDARY_LAUNCHERS_REMOVE", removeScripts.toString());
+
+        List<Map<String, ? super Object>> associations = FILE_ASSOCIATIONS.fetchFrom(params);
+        data.put("FILE_ASSOCIATION_INSTALL", "");
+        data.put("FILE_ASSOCIATION_REMOVE", "");
+        data.put("DESKTOP_MIMES", "");
+        if (associations != null) {
+            String mimeInfoFile = XDG_FILE_PREFIX.fetchFrom(params) + "-MimeInfo.xml";
+            StringBuilder mimeInfo = new StringBuilder("<?xml version=\"1.0\"?>\n<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>\n");
+            StringBuilder registrations = new StringBuilder();
+            StringBuilder deregistrations = new StringBuilder();
+            StringBuilder desktopMimes = new StringBuilder("MimeType=");
+            boolean addedEntry = false;
+
+            for (Map<String, ? super Object> assoc : associations) {
+                //  <mime-type type="application/x-vnd.awesome">
+                //    <comment>Awesome document</comment>
+                //    <glob pattern="*.awesome"/>
+                //    <glob pattern="*.awe"/>
+                //  </mime-type>
+
+                if (assoc == null) {
+                    continue;
+                }
+
+                String description = FA_DESCRIPTION.fetchFrom(assoc);
+                File faIcon = FA_ICON.fetchFrom(assoc); //TODO FA_ICON_PNG
+                List<String> extensions = FA_EXTENSIONS.fetchFrom(assoc);
+                List<String> mimes = FA_CONTENT_TYPE.fetchFrom(assoc);
+                if (mimes == null || mimes.isEmpty()) {
+                    continue;
+                }
+                String thisMime = mimes.get(0);
+                String dashMime = thisMime.replace('/', '-');
+
+                mimeInfo.append("  <mime-type type='")
+                        .append(thisMime)
+                        .append("'>\n");
+                if (description != null && !description.isEmpty()) {
+                    mimeInfo.append("    <comment>")
+                            .append(description)
+                            .append("</comment>\n");
+                }
+
+                if (extensions != null) {
+                    for (String ext : extensions) {
+                        mimeInfo.append("    <glob pattern='*.")
+                                .append(ext)
+                                .append("'/>");
+                    }
+                }
+
+                mimeInfo.append("  </mime-type>\n");
+                if (!addedEntry) {
+                    registrations.append("xdg-mime install /opt/")
+                            .append(data.get("APPLICATION_FS_NAME"))
+                            .append("/")
+                            .append(mimeInfoFile)
+                            .append("\n");
+                    registrations.append("xdg-mime install /opt/")
+                            .append(data.get("APPLICATION_FS_NAME"))
+                            .append("/")
+                            .append(mimeInfoFile)
+                            .append("\n");
+
+                    deregistrations.append("xdg-mime uninstall /opt/")
+                            .append(data.get("APPLICATION_FS_NAME"))
+                            .append("/")
+                            .append(mimeInfoFile)
+                            .append("\n");
+                    addedEntry = true;
+                } else {
+                    desktopMimes.append(";");
+                }
+                desktopMimes.append(thisMime);
+
+                if (faIcon != null && faIcon.exists()) {
+                    int size = getSquareSizeOfImage(faIcon);
+
+                    if (size > 0) {
+                        File target = new File(rootDir, APP_FS_NAME.fetchFrom(params) + "_fa_" + faIcon.getName());
+                        IOUtils.copyFile(faIcon, target);
+
+                        //xdg-icon-resource install --context mimetypes --size 64 awesomeapp_fa_1.png application-x.vnd-awesome
+                        registrations.append("        xdg-icon-resource install --context mimetypes --size ")
+                                .append(size)
+                                .append(" /opt/")
+                                .append(data.get("APPLICATION_FS_NAME"))
+                                .append("/")
+                                .append(target.getName())
+                                .append(" ")
+                                .append(dashMime)
+                                .append("\n");
+
+                        //xdg-icon-resource uninstall --context mimetypes --size 64 awesomeapp_fa_1.png application-x.vnd-awesome
+                        deregistrations.append("        xdg-icon-resource uninstall --context mimetypes --size ")
+                                .append(size)
+                                .append(" /opt/")
+                                .append(data.get("APPLICATION_FS_NAME"))
+                                .append("/")
+                                .append(target.getName())
+                                .append(" ")
+                                .append(dashMime)
+                                .append("\n");
+                    }
+                }
+            }
+            mimeInfo.append("</mime-info>");
+
+            if (addedEntry) {
+                Writer w = new BufferedWriter(new FileWriter(new File(rootDir, mimeInfoFile)));
+                w.write(mimeInfo.toString());
+                w.close();
+                data.put("FILE_ASSOCIATION_INSTALL", registrations.toString());
+                data.put("FILE_ASSOCIATION_REMOVE", deregistrations.toString());
+                data.put("DESKTOP_MIMES", desktopMimes.toString());
+            }
+        }
+        //prepare desktop shortcut
+        Writer w = new BufferedWriter(new FileWriter(getConfig_DesktopShortcutFile(rootDir, params)));
+        String content = preprocessTextResource(
+                LinuxAppBundler.LINUX_BUNDLER_PREFIX + getConfig_DesktopShortcutFile(rootDir, params).getName(),
+                I18N.getString("resource.menu-shortcut-descriptor"), DEFAULT_DESKTOP_FILE_TEMPLATE, data,
+                VERBOSE.fetchFrom(params));
+        w.write(content);
+        w.close();
+
+        //prepare spec file
+        w = new BufferedWriter(new FileWriter(getConfig_SpecFile(params)));
+        content = preprocessTextResource(
+                LinuxAppBundler.LINUX_BUNDLER_PREFIX + getConfig_SpecFile(params).getName(),
+                I18N.getString("resource.rpm-spec-file"), DEFAULT_SPEC_TEMPLATE, data,
+                VERBOSE.fetchFrom(params));
+        w.write(content);
+        w.close();
+
         if (SERVICE_HINT.fetchFrom(params)) {
             //prepare init script
             w = new BufferedWriter(new FileWriter(getConfig_InitScriptFile(params)));
@@ -353,13 +552,35 @@
         return true;
     }
 
-    private File getConfig_DesktopShortcutFile(Map<String, ? super Object> params) {
-        return new File(LinuxAppBundler.getRootDir(RPM_IMAGE_DIR.fetchFrom(params), params),
+    private Map<String, String> createReplacementData(Map<String, ? super Object> params) {
+        Map<String, String> data = new HashMap<>();
+
+        data.put("APPLICATION_NAME", APP_NAME.fetchFrom(params));
+        data.put("APPLICATION_FS_NAME", APP_FS_NAME.fetchFrom(params));
+        data.put("APPLICATION_PACKAGE", BUNDLE_NAME.fetchFrom(params));
+        data.put("APPLICATION_VENDOR", VENDOR.fetchFrom(params));
+        data.put("APPLICATION_VERSION", VERSION.fetchFrom(params));
+        data.put("APPLICATION_LAUNCHER_FILENAME", APP_FS_NAME.fetchFrom(params));
+        data.put("XDG_PREFIX", XDG_FILE_PREFIX.fetchFrom(params));
+        data.put("DEPLOY_BUNDLE_CATEGORY", CATEGORY.fetchFrom(params)); //TODO rpm categories
+        data.put("APPLICATION_DESCRIPTION", DESCRIPTION.fetchFrom(params));
+        data.put("APPLICATION_SUMMARY", TITLE.fetchFrom(params));
+        data.put("APPLICATION_LICENSE_TYPE", LICENSE_TYPE.fetchFrom(params));
+        data.put("APPLICATION_LICENSE_FILE", getLicenseFileString(params));
+        data.put("SERVICE_HINT", String.valueOf(SERVICE_HINT.fetchFrom(params)));
+        data.put("START_ON_INSTALL", String.valueOf(START_ON_INSTALL.fetchFrom(params)));
+        data.put("STOP_ON_UNINSTALL", String.valueOf(STOP_ON_UNINSTALL.fetchFrom(params)));
+        data.put("RUN_AT_STARTUP", String.valueOf(RUN_AT_STARTUP.fetchFrom(params)));
+        return data;
+    }
+
+    private File getConfig_DesktopShortcutFile(File rootDir, Map<String, ? super Object> params) {
+        return new File(rootDir,
                 APP_FS_NAME.fetchFrom(params) + ".desktop");
     }
 
-    private File getConfig_IconFile(Map<String, ? super Object> params) {
-        return new File(LinuxAppBundler.getRootDir(RPM_IMAGE_DIR.fetchFrom(params), params),
+    private File getConfig_IconFile(File rootDir, Map<String, ? super Object> params) {
+        return new File(rootDir,
                 APP_FS_NAME.fetchFrom(params) + ".png");
     }
 
@@ -460,4 +681,19 @@
     public File execute(Map<String, ? super Object> params, File outputParentDir) {
         return bundle(params, outputParentDir);
     }
+
+
+    public int getSquareSizeOfImage(File f) {
+        try {
+            BufferedImage bi = ImageIO.read(f);
+            if (bi.getWidth() == bi.getHeight()) {
+                return bi.getWidth();
+            } else {
+                return 0;
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            return 0;
+        }
+    }
 }
--- a/modules/fxpackager/src/main/java/com/oracle/tools/packager/mac/MacAppBundler.java	Wed Sep 10 20:35:23 2014 +0400
+++ b/modules/fxpackager/src/main/java/com/oracle/tools/packager/mac/MacAppBundler.java	Wed Sep 10 11:31:04 2014 -0600
@@ -57,6 +57,7 @@
             BUNDLER_PREFIX + "macosx" + File.separator;
 
     private static final String EXECUTABLE_NAME      = "JavaAppLauncher";
+    private final static String LIBRARY_NAME         = "libpackager.dylib";
     private static final String TEMPLATE_BUNDLE_ICON = "GenericApp.icns";
     private static final String OS_TYPE_CODE         = "APPL";
     private static final String TEMPLATE_INFO_PLIST  = "Info.plist.template";
@@ -366,7 +367,6 @@
 
         }
 
-
         return true;
     }
 
@@ -443,6 +443,11 @@
                     RAW_EXECUTABLE_URL.fetchFrom(p),
                     executableFile);
 
+            // Copy library to the MacOS folder
+            IOUtils.copyFromURL(
+                    MacResources.class.getResource(LIBRARY_NAME),
+                    new File(macOSDirectory, LIBRARY_NAME));
+
             executableFile.setExecutable(true, false);
 
             // Copy runtime to PlugIns folder
@@ -459,6 +464,17 @@
             // Copy icon to Resources folder
             IOUtils.copyFile(getConfig_Icon(p),
                     new File(resourcesDirectory, getConfig_Icon(p).getName()));
+
+            // copy file association icons
+            for (Map<String, ? super Object> fa : FILE_ASSOCIATIONS.fetchFrom(p)) {
+                File f = FA_ICON.fetchFrom(fa);
+                if (f != null && f.exists()) {
+                    IOUtils.copyFile(f,
+                            new File(resourcesDirectory, f.getName()));
+                }
+            }
+
+
             // Generate Info.plist
             IOUtils.copyFile(getConfig_InfoPlist(p),
                     new File(contentsDirectory, "Info.plist"));
@@ -623,13 +639,22 @@
 
         data.put("DEPLOY_JVM_OPTIONS", sb.toString());
 
+        sb = new StringBuilder();
+        List<String> args = ARGUMENTS.fetchFrom(params);
+        newline = ""; //So we don't add unneccessary extra line after last append
+        for (String o : args) {
+            sb.append(newline).append("    <string>").append(o).append("</string>");
+            newline = "\n";
+        }
+        data.put("DEPLOY_ARGUMENTS", sb.toString());
+
         newline = "";
         sb = new StringBuilder();
         Map<String, String> overridableJVMOptions = USER_JVM_OPTIONS.fetchFrom(params);
         for (Map.Entry<String, String> arg: overridableJVMOptions.entrySet()) {
-            sb.append(newline);
-            sb.append("      <key>").append(arg.getKey()).append("</key>\n");
-            sb.append("      <string>").append(arg.getValue()).append("</string>");
+            sb.append(newline)
+                .append("      <key>").append(arg.getKey()).append("</key>\n")
+                .append("      <string>").append(arg.getValue()).append("</string>");
             newline = "\n";
         }
         data.put("DEPLOY_JVM_USER_OPTIONS", sb.toString());
@@ -641,10 +666,132 @@
 //        } else {
         data.put("DEPLOY_LAUNCHER_CLASS", MAIN_CLASS.fetchFrom(params));
 //        }
-        data.put("DEPLOY_APP_CLASSPATH", CLASSPATH.fetchFrom(params));
+
+        StringBuilder macroedPath = new StringBuilder();
+        for (String s : CLASSPATH.fetchFrom(params).split("[ ;:]+")) {
+            macroedPath.append("$PACKAGEDIR/");
+            macroedPath.append(s);
+            macroedPath.append(":");
+        }
+        macroedPath.deleteCharAt(macroedPath.length() - 1);
+
+        data.put("DEPLOY_APP_CLASSPATH", macroedPath.toString());
 
         //TODO: Add remainder of the classpath
 
+        StringBuilder bundleDocumentTypes = new StringBuilder();
+        StringBuilder exportedTypes = new StringBuilder();
+        for (Map<String, ? super Object> fileAssociation : FILE_ASSOCIATIONS.fetchFrom(params)) {
+
+            List<String> extensions = FA_EXTENSIONS.fetchFrom(fileAssociation);
+            List<String> mimeTypes = FA_CONTENT_TYPE.fetchFrom(fileAssociation);
+            String itemContentType = MAC_CF_BUNDLE_IDENTIFIER.fetchFrom(params) + "." + ((extensions == null || extensions.isEmpty())
+                    ? "mime"
+                    : extensions.get(0));
+            String description = FA_DESCRIPTION.fetchFrom(fileAssociation);
+            File icon = FA_ICON.fetchFrom(fileAssociation); //TODO FA_ICON_ICNS
+
+            bundleDocumentTypes.append("    <dict>\n")
+                .append("      <key>LSItemContentTypes</key>\n")
+                .append("      <array>\n")
+                .append("        <string>")
+                .append(itemContentType)
+                .append("</string>\n")
+                .append("      </array>\n")
+                .append("\n")
+                .append("      <key>CFBundleTypeName</key>\n")
+                .append("      <string>")
+                .append(description)
+                .append("</string>\n")
+                .append("\n")
+                .append("      <key>LSHandlerRank</key>\n")
+                .append("      <string>Owner</string>\n") //TODO make a bundler arg
+                .append("\n")
+                .append("      <key>CFBundleTypeRole</key>\n")
+                .append("      <string>Editor</string>\n") // TODO make a bundler arg
+                .append("\n")
+                .append("      <key>LSIsAppleDefaultForType</key>\n")
+                .append("      <true/>\n") // TODO make a bundler arg
+                .append("\n");
+
+            if (icon != null && icon.exists()) {
+                //?
+                bundleDocumentTypes.append("      <key>CFBundleTypeIconFile</key>\n")
+                        .append("      <string>")
+                        .append(icon.getName())
+                        .append("</string>\n");
+            }
+            bundleDocumentTypes.append("    </dict>\n");
+
+            exportedTypes.append("    <dict>\n")
+                .append("      <key>UTTypeIdentifier</key>\n")
+                .append("      <string>")
+                .append(itemContentType)
+                .append("</string>\n")
+                .append("\n")
+                .append("      <key>UTTypeDescription</key>\n")
+                .append("      <string>")
+                .append(description)
+                .append("</string>\n")
+                .append("      <key>UTTypeConformsTo</key>\n")
+                .append("      <array>\n")
+                .append("          <string>public.data</string>\n") //TODO expose this?
+                .append("      </array>\n")
+                .append("\n");
+            
+            if (icon != null && icon.exists()) {
+                exportedTypes.append("      <key>UTTypeIconFile</key>\n")
+                    .append("      <string>")
+                    .append(icon.getName())
+                    .append("</string>\n")
+                    .append("\n");
+            }
+
+            exportedTypes.append("\n")
+                .append("      <key>UTTypeTagSpecification</key>\n")
+                .append("      <dict>\n")
+            //TODO expose via param? .append("        <key>com.apple.ostype</key>\n");
+            //TODO expose via param? .append("        <string>ABCD</string>\n")
+                .append("\n");
+
+            if (extensions != null && !extensions.isEmpty()) {
+                exportedTypes.append("        <key>public.filename-extension</key>\n")
+                    .append("        <array>\n");
+
+                for (String ext : extensions) {
+                    exportedTypes.append("          <string>")
+                        .append(ext)
+                        .append("</string>\n");
+                }
+                exportedTypes.append("        </array>\n");
+            }
+            if (mimeTypes != null && !mimeTypes.isEmpty()) {
+                exportedTypes.append("        <key>public.mime-type</key>\n")
+                    .append("        <array>\n");
+
+                for (String mime : mimeTypes) {
+                    exportedTypes.append("          <string>")
+                        .append(mime)
+                        .append("</string>\n");
+                }
+                exportedTypes.append("        </array>\n");
+            }
+            exportedTypes.append("      </dict>\n")
+                    .append("    </dict>\n");
+        }
+        String associationData;
+        if (bundleDocumentTypes.length() > 0) {
+            associationData = "\n  <key>CFBundleDocumentTypes</key>\n  <array>\n"
+                    + bundleDocumentTypes.toString()
+                    + "  </array>\n\n  <key>UTExportedTypeDeclarations</key>\n  <array>\n"
+                    + exportedTypes.toString()
+                    + "  </array>\n";
+        } else {
+            associationData = "";
+        }
+        data.put("DEPLOY_FILE_ASSOCIATIONS", associationData);
+
+
         Writer w = new BufferedWriter(new FileWriter(file));
         w.write(preprocessTextResource(
                 MAC_BUNDLER_PREFIX + getConfig_InfoPlist(params).getName(),
@@ -836,6 +983,7 @@
         return Arrays.asList(
                 APP_NAME,
                 APP_RESOURCES,
+                ARGUMENTS,
                 BUNDLE_ID_SIGNING_PREFIX,
                 DEVELOPER_ID_APP_SIGNING_KEY,
                 ICON_ICNS,
--- a/modules/fxpackager/src/main/java/com/oracle/tools/packager/windows/WinAppBundler.java	Wed Sep 10 20:35:23 2014 +0400
+++ b/modules/fxpackager/src/main/java/com/oracle/tools/packager/windows/WinAppBundler.java	Wed Sep 10 11:31:04 2014 -0600
@@ -66,6 +66,9 @@
             (s, p) -> null);
 
     private final static String EXECUTABLE_NAME = "WinLauncher.exe";
+    private final static String LIBRARY_NAME = "packager.dll";
+    private final static String REDIST_MSVCR = "msvcr100.dll";
+    private final static String REDIST_MSVCP = "msvcp100.dll";
 
     private static final String TOOL_ICON_SWAP="IconSwap.exe";
 
@@ -191,8 +194,12 @@
         return new File(outDir, APP_NAME.fetchFrom(p));
     }
 
-    public static File getLauncher(File outDir, Map<String, ? super Object> p) {
-        return new File(getRootDir(outDir, p), APP_NAME.fetchFrom(p) +".exe");
+    public static String getLauncherName(Map<String, ? super Object> p) {
+        return APP_NAME.fetchFrom(p) +".exe";
+    }
+
+    public static String getLauncherCfgName(Map<String, ? super Object> p) {
+        return "app\\" + APP_NAME.fetchFrom(p) +".cfg";
     }
 
     private File getConfig_AppIcon(Map<String, ? super Object> params) {
@@ -232,6 +239,7 @@
     }
 
     File doBundle(Map<String, ? super Object> p, File outputDirectory, boolean dependentTask) {
+        Map<String, ? super Object> originalParams = new HashMap<>(p);
         if (!outputDirectory.isDirectory() && !outputDirectory.mkdirs()) {
             throw new RuntimeException(MessageFormat.format(I18N.getString("error.cannot-create-output-dir"), outputDirectory.getAbsolutePath()));
         }
@@ -243,8 +251,6 @@
                 Log.info(MessageFormat.format(I18N.getString("message.creating-app-bundle"), APP_NAME.fetchFrom(p), outputDirectory.getAbsolutePath()));
             }
 
-            prepareConfigFiles(p);
-
             // Create directory structure
             File rootDirectory = getRootDir(outputDirectory, p);
             IOUtils.deleteRecursive(rootDirectory);
@@ -254,47 +260,32 @@
             appDirectory.mkdirs();
             copyApplication(p, appDirectory);
 
-            // Generate PkgInfo
-            File pkgInfoFile = new File(appDirectory, "package.cfg");
-            pkgInfoFile.createNewFile();
-            writePkgInfo(p, pkgInfoFile);
+            // create the .exe launchers
+            createLauncherForEntryPoint(p, rootDirectory);
 
-            // Copy executable root folder
-            File executableFile = getLauncher(outputDirectory, p);
+            // copy in the needed libraries
             IOUtils.copyFromURL(
-                    RAW_EXECUTABLE_URL.fetchFrom(p),
-                    executableFile);
-            executableFile.setExecutable(true, false);
+                    WinResources.class.getResource(LIBRARY_NAME),
+                    new File(rootDirectory, LIBRARY_NAME));
+            IOUtils.copyFromURL(
+                    WinResources.class.getResource(REDIST_MSVCR),
+                    new File(rootDirectory, REDIST_MSVCR));
+            IOUtils.copyFromURL(
+                    WinResources.class.getResource(REDIST_MSVCP),
+                    new File(rootDirectory, REDIST_MSVCP));
 
-            //Update branding of exe file
-            if (REBRAND_EXECUTABLE.fetchFrom(p) && getConfig_AppIcon(p).exists()) {
-                //extract helper tool
-                File iconSwapTool = File.createTempFile("iconswap", ".exe");
-                iconSwapTool.delete();
-                IOUtils.copyFromURL(
-                        WinResources.class.getResource(TOOL_ICON_SWAP),
-                        iconSwapTool);
-                iconSwapTool.setExecutable(true, false);
-                iconSwapTool.deleteOnExit();
-
-                //run it on launcher file
-                executableFile.setWritable(true);
-                ProcessBuilder pb = new ProcessBuilder(
-                        iconSwapTool.getAbsolutePath(),
-                        getConfig_AppIcon(p).getAbsolutePath(),
-                        executableFile.getAbsolutePath());
-                IOUtils.exec(pb, VERBOSE.fetchFrom(p));
-                executableFile.setReadOnly();
-                iconSwapTool.delete();
+            // create the secondary launchers, if any
+            List<Map<String, ? super Object>> entryPoints = StandardBundlerParam.SECONDARY_LAUNCHERS.fetchFrom(p);
+            for (Map<String, ? super Object> entryPoint : entryPoints) {
+                Map<String, ? super Object> tmp = new HashMap<>(originalParams);
+                tmp.putAll(entryPoint);
+                createLauncherForEntryPoint(tmp, rootDirectory);
             }
 
             // Copy runtime to PlugIns folder
             File runtimeDirectory = new File(rootDirectory, "runtime");
             copyRuntime(p, runtimeDirectory);
 
-            IOUtils.copyFile(getConfig_AppIcon(p),
-                    new File(getRootDir(outputDirectory, p), APP_NAME.fetchFrom(p) + ".ico"));
-
             if (!dependentTask) {
                 Log.info(MessageFormat.format(I18N.getString("message.result-dir"), outputDirectory.getAbsolutePath()));
             }
@@ -314,6 +305,44 @@
 
     }
 
+    private void createLauncherForEntryPoint(Map<String, ? super Object> p, File rootDirectory) throws IOException {
+        prepareConfigFiles(p);
+
+        writePkgInfo(p, rootDirectory);
+
+        // Copy executable root folder
+        File executableFile = new File(rootDirectory, getLauncherName(p));
+        IOUtils.copyFromURL(
+                RAW_EXECUTABLE_URL.fetchFrom(p),
+                executableFile);
+        executableFile.setExecutable(true, false);
+
+        //Update branding of exe file
+        if (REBRAND_EXECUTABLE.fetchFrom(p) && getConfig_AppIcon(p).exists()) {
+            //extract helper tool
+            File iconSwapTool = File.createTempFile("iconswap", ".exe");
+            iconSwapTool.delete();
+            IOUtils.copyFromURL(
+                    WinResources.class.getResource(TOOL_ICON_SWAP),
+                    iconSwapTool);
+            iconSwapTool.setExecutable(true, false);
+            iconSwapTool.deleteOnExit();
+
+            //run it on launcher file
+            executableFile.setWritable(true);
+            ProcessBuilder pb = new ProcessBuilder(
+                    iconSwapTool.getAbsolutePath(),
+                    getConfig_AppIcon(p).getAbsolutePath(),
+                    executableFile.getAbsolutePath());
+            IOUtils.exec(pb, VERBOSE.fetchFrom(p));
+            executableFile.setReadOnly();
+            iconSwapTool.delete();
+        }
+
+        IOUtils.copyFile(getConfig_AppIcon(p),
+                new File(rootDirectory, APP_NAME.fetchFrom(p) + ".ico"));
+    }
+
     private void copyApplication(Map<String, ? super Object> params, File appDirectory) throws IOException {
         RelativeFileSet appResource = APP_RESOURCES.fetchFrom(params);
         if (appResource == null) {
@@ -326,7 +355,9 @@
         }
     }
 
-    private void writePkgInfo(Map<String, ? super Object> params, File pkgInfoFile) throws FileNotFoundException {
+    private void writePkgInfo(Map<String, ? super Object> params, File rootDir) throws FileNotFoundException {
+        File pkgInfoFile = new File(rootDir, getLauncherCfgName(params));
+
         pkgInfoFile.delete();
 
         PrintStream out = new PrintStream(pkgInfoFile);
@@ -357,7 +388,6 @@
             idx++;
         }
 
-
         Map<String, String> overridableJVMOptions = USER_JVM_OPTIONS.fetchFrom(params);
         idx = 1;
         for (Map.Entry<String, String> arg: overridableJVMOptions.entrySet()) {
@@ -370,6 +400,15 @@
             }
             idx++;
         }
+
+        // add command line args
+        List<String> args = ARGUMENTS.fetchFrom(params);
+        idx = 1;
+        for (String a : args) {
+            out.println("arg."+idx+"="+a);
+            idx++;
+        }
+
         out.close();
     }
 
@@ -419,6 +458,7 @@
         return Arrays.asList(
                 APP_NAME,
                 APP_RESOURCES,
+                ARGUMENTS,
                 ICON_ICO,
                 JVM_OPTIONS,
                 JVM_PROPERTIES,
--- a/modules/fxpackager/src/main/java/com/oracle/tools/packager/windows/WinExeBundler.java	Wed Sep 10 20:35:23 2014 +0400
+++ b/modules/fxpackager/src/main/java/com/oracle/tools/packager/windows/WinExeBundler.java	Wed Sep 10 11:31:04 2014 -0600
@@ -35,6 +35,7 @@
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import static com.oracle.tools.packager.StandardBundlerParam.SECONDARY_LAUNCHERS;
 import static com.oracle.tools.packager.StandardBundlerParam.SERVICE_HINT;
 import static com.oracle.tools.packager.StandardBundlerParam.VERBOSE;
 import static com.oracle.tools.packager.windows.WindowsBundlerParam.*;
@@ -301,6 +302,13 @@
                 IOUtils.copyFile(lfile, new File(imageDir, lfile.getName()));
             }
         }
+
+        for (Map<String, ? super Object> fileAssociation : FILE_ASSOCIATIONS.fetchFrom(params)) {
+            File icon = FA_ICON.fetchFrom(fileAssociation); //TODO FA_ICON_ICO
+            if (icon != null && icon.exists()) {
+                IOUtils.copyFile(icon, new File(appOutputDir, icon.getName()));
+            }
+        }
         
         if (SERVICE_HINT.fetchFrom(params)) {
             // copies the service launcher to the app root folder
@@ -440,8 +448,7 @@
         validateValueAndPut(data, "APPLICATION_VERSION", VERSION, params); // TODO make our own version paraminfo?
         validateValueAndPut(data, "INSTALLER_FILE_NAME", INSTALLER_FILE_NAME, params);
 
-        data.put("APPLICATION_LAUNCHER_FILENAME",
-                innosetupEscape(WinAppBundler.getLauncher(EXE_IMAGE_DIR.fetchFrom(params), params).getName()));
+        data.put("APPLICATION_LAUNCHER_FILENAME", innosetupEscape(WinAppBundler.getLauncherName(params)));
 
         data.put("APPLICATION_DESKTOP_SHORTCUT", SHORTCUT_HINT.fetchFrom(params) ? "returnTrue" : "returnFalse");
         data.put("APPLICATION_MENU_SHORTCUT", MENU_HINT.fetchFrom(params) ? "returnTrue" : "returnFalse");
@@ -475,7 +482,91 @@
         data.put("APPLICATION_NOT_SERVICE", SERVICE_HINT.fetchFrom(params) ? "returnFalse" : "returnTrue");
         data.put("START_ON_INSTALL", START_ON_INSTALL.fetchFrom(params) ? "-startOnInstall" : "");
         data.put("STOP_ON_UNINSTALL", STOP_ON_UNINSTALL.fetchFrom(params) ? "-stopOnUninstall" : "");
-        data.put("RUN_AT_STARTUP", RUN_AT_STARTUP.fetchFrom(params) ? "-runAtStartup" : "");        
+        data.put("RUN_AT_STARTUP", RUN_AT_STARTUP.fetchFrom(params) ? "-runAtStartup" : "");
+
+        StringBuilder secondaryLaunchersCfg = new StringBuilder();
+        for (Map<String, ? super Object> launcher : SECONDARY_LAUNCHERS.fetchFrom(params)) {
+            String application_name = APP_NAME.fetchFrom(launcher);
+            if (MENU_HINT.fetchFrom(launcher)) {
+                //Name: "{group}\APPLICATION_NAME"; Filename: "{app}\APPLICATION_NAME.exe"; IconFilename: "{app}\APPLICATION_NAME.ico"
+                secondaryLaunchersCfg.append("Name: \"{group}\\");
+                secondaryLaunchersCfg.append(application_name);
+                secondaryLaunchersCfg.append("\"; Filename: \"{app}\\");
+                secondaryLaunchersCfg.append(application_name);
+                secondaryLaunchersCfg.append(".exe\"; IconFilename: \"{app}\\");
+                secondaryLaunchersCfg.append(application_name);
+                secondaryLaunchersCfg.append(".ico\"\r\n");
+            }
+            if (SHORTCUT_HINT.fetchFrom(launcher)) {
+                //Name: "{commondesktop}\APPLICATION_NAME"; Filename: "{app}\APPLICATION_NAME.exe";  IconFilename: "{app}\APPLICATION_NAME.ico"
+                secondaryLaunchersCfg.append("Name: \"{commondesktop}\\");
+                secondaryLaunchersCfg.append(application_name);
+                secondaryLaunchersCfg.append("\"; Filename: \"{app}\\");
+                secondaryLaunchersCfg.append(application_name);
+                secondaryLaunchersCfg.append(".exe\";  IconFilename: \"{app}\\");
+                secondaryLaunchersCfg.append(application_name);
+                secondaryLaunchersCfg.append(".ico\"\r\n");
+            }
+        }
+        data.put("SECONDARY_LAUNCHERS", secondaryLaunchersCfg.toString());
+
+        StringBuilder registryEntries = new StringBuilder();
+        String regName = APP_REGISTRY_NAME.fetchFrom(params);
+        for (Map<String, ? super Object> fileAssociation : FILE_ASSOCIATIONS.fetchFrom(params)) {
+            String description = FA_DESCRIPTION.fetchFrom(fileAssociation);
+            File icon = FA_ICON.fetchFrom(fileAssociation); //TODO FA_ICON_ICO
+
+            List<String> extensions = FA_EXTENSIONS.fetchFrom(fileAssociation);
+            for (String ext : extensions) {
+                // "Root: HKCR; Subkey: \".myp\"; ValueType: string; ValueName: \"\"; ValueData: \"MyProgramFile\"; Flags: uninsdeletevalue"
+                registryEntries.append("Root: HKCR; Subkey: \".")
+                    .append(ext)
+                    .append("\"; ValueType: string; ValueName: \"\"; ValueData: \"")
+                        .append(regName)
+                        .append("\"; Flags: uninsdeletevalue\r\n");
+            }
+
+            if (!extensions.isEmpty()) {
+                String ext = extensions.get(0);
+                List<String> mimeTypes = FA_CONTENT_TYPE.fetchFrom(fileAssociation);
+                for (String mime : mimeTypes) {
+                    // "Root: HKCR; Subkey: HKCR\\Mime\\Database\\Content Type\\application/chaos; ValueType: string; ValueName: Extension; ValueData: .chaos; Flags: uninsdeletevalue"
+                    registryEntries.append("Root: HKCR; Subkey: \"Mime\\Database\\Content Type\\")
+                        .append(mime)
+                        .append("\"; ValueType: string; ValueName: \"Extension\"; ValueData: \".")
+                        .append(ext)
+                        .append("\"; Flags: uninsdeletevalue\r\n");
+                }
+            }
+
+            //"Root: HKCR; Subkey: \"MyProgramFile\"; ValueType: string; ValueName: \"\"; ValueData: \"My Program File\"; Flags: uninsdeletekey"
+            registryEntries.append("Root: HKCR; Subkey: \"")
+                .append(regName)
+                .append("\"; ValueType: string; ValueName: \"\"; ValueData: \"")
+                .append(description)
+                .append("\"; Flags: uninsdeletekey\r\n");
+
+            if (icon != null && icon.exists()) {
+                // "Root: HKCR; Subkey: \"MyProgramFile\\DefaultIcon\"; ValueType: string; ValueName: \"\"; ValueData: \"{app}\\MYPROG.EXE,0\"\n" +
+                registryEntries.append("Root: HKCR; Subkey: \"")
+                        .append(regName)
+                        .append("\\DefaultIcon\"; ValueType: string; ValueName: \"\"; ValueData: \"{app}\\")
+                        .append(icon.getName())
+                        .append("\"\r\n");
+            }
+
+            //"Root: HKCR; Subkey: \"MyProgramFile\\shell\\open\\command\"; ValueType: string; ValueName: \"\"; ValueData: \"\"\"{app}\\MYPROG.EXE\"\" \"\"%1\"\"\"\n"
+            registryEntries.append("Root: HKCR; Subkey: \"")
+                    .append(regName)
+                    .append("\\shell\\open\\command\"; ValueType: string; ValueName: \"\"; ValueData: \"\"\"{app}\\")
+                    .append(APP_NAME.fetchFrom(params))
+                    .append("\"\" \"\"%1\"\"\"\r\n");
+        }
+        if (registryEntries.length() > 0) {
+            data.put("FILE_ASSOCIATIONS", "ChangesAssociations=yes\r\n\r\n[Registry]\r\n" + registryEntries.toString());
+        } else {
+            data.put("FILE_ASSOCIATIONS", "");
+        }
 
         Writer w = new BufferedWriter(new FileWriter(getConfig_ExeProjectFile(params)));
         String content = preprocessTextResource(
--- a/modules/fxpackager/src/main/java/com/oracle/tools/packager/windows/WinMsiBundler.java	Wed Sep 10 20:35:23 2014 +0400
+++ b/modules/fxpackager/src/main/java/com/oracle/tools/packager/windows/WinMsiBundler.java	Wed Sep 10 11:31:04 2014 -0600
@@ -386,7 +386,20 @@
             // just copies the service launcher to the app root folder
             appDir = SERVICE_BUNDLER.fetchFrom(p).doBundle(p, appDir, true);
         }
-        
+
+        // copy file associaiton icons
+        List<Map<String, ? super Object>> fileAssociations = FILE_ASSOCIATIONS.fetchFrom(p);
+        for (Map<String, ? super Object> fileAssociation : fileAssociations) {
+            File icon = FA_ICON.fetchFrom(fileAssociation); //TODO FA_ICON_ICO
+            File faIconFile = new File(appDir, icon.getName());
+
+            try {
+                IOUtils.copyFile(icon, faIconFile);
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+
         return appDir != null;
     }
 
@@ -511,8 +524,7 @@
 
         //WinAppBundler will add application folder again => step out
         File imageRootDir = WIN_APP_IMAGE.fetchFrom(params);
-        File launcher = WinAppBundler.getLauncher(
-                imageRootDir.getParentFile(), params);
+        File launcher = new File(imageRootDir, WinAppBundler.getLauncherName(params));
 
         String launcherPath = relativePath(imageRootDir, launcher);
         data.put("APPLICATION_LAUNCHER", launcherPath);
@@ -543,6 +555,26 @@
             data.put("WIN64", "no");
         }
 
+        List<Map<String, ? super Object>> secondaryLaunchers = SECONDARY_LAUNCHERS.fetchFrom(params);
+
+        StringBuilder secondaryLauncherIcons = new StringBuilder();
+        for (int i = 0; i < secondaryLaunchers.size(); i++) {
+            Map<String, ? super Object> sl = secondaryLaunchers.get(i);
+            //        <Icon Id="DesktopIcon.exe" SourceFile="APPLICATION_ICON" />
+            if (SHORTCUT_HINT.fetchFrom(sl) || MENU_HINT.fetchFrom(sl)) {
+                File secondaryLauncher = new File(imageRootDir, WinAppBundler.getLauncherName(sl));
+                String secondaryLauncherPath = relativePath(imageRootDir, secondaryLauncher);
+                String secondaryLauncherIconPath = secondaryLauncherPath.replace(".exe", ".ico");
+
+                secondaryLauncherIcons.append("        <Icon Id=\"Launcher");
+                secondaryLauncherIcons.append(i);
+                secondaryLauncherIcons.append(".exe\" SourceFile=\"");
+                secondaryLauncherIcons.append(secondaryLauncherIconPath);
+                secondaryLauncherIcons.append("\" />\r\n");
+            }
+        }
+        data.put("SECONDARY_LAUNCHER_ICONS", secondaryLauncherIcons.toString());
+
         Writer w = new BufferedWriter(new FileWriter(getConfig_ProjectFile(params)));
         w.write(preprocessTextResource(
                 WinAppBundler.WIN_BUNDLER_PREFIX + getConfig_ProjectFile(params).getName(),
@@ -581,14 +613,12 @@
         out.println(prefix + " <Component Id=\"comp" + (compId++) + "\" DiskId=\"1\""
                 + " Guid=\"" + UUID.randomUUID().toString() + "\""
                 + (BIT_ARCH_64.fetchFrom(params) ? " Win64=\"yes\"" : "") + ">");
-        out.println("  <CreateFolder/>");
-        out.println("  <RemoveFolder Id=\"RemoveDir" + (id++) + "\" On=\"uninstall\" />");
+        out.println(prefix + "  <CreateFolder/>");
+        out.println(prefix + "  <RemoveFolder Id=\"RemoveDir" + (id++) + "\" On=\"uninstall\" />");
 
         boolean needRegistryKey = !MSI_SYSTEM_WIDE.fetchFrom(params);
         File imageRootDir = WIN_APP_IMAGE.fetchFrom(params);
-        File launcherFile = WinAppBundler.getLauncher(
-                /* Step up as WinAppBundler will add app folder */
-                imageRootDir.getParentFile(), params);
+        File launcherFile = new File(imageRootDir, WinAppBundler.getLauncherName(params));
         File launcherSvcFile = WinServiceBundler.getLauncherSvc(
                                 imageRootDir, params);
 
@@ -617,6 +647,10 @@
 
         boolean menuShortcut = MENU_HINT.fetchFrom(params);
         boolean desktopShortcut = SHORTCUT_HINT.fetchFrom(params);
+
+        Map<String, String> idToFileMap = new TreeMap<>();
+        boolean launcherSet = false;
+
         for (File f : files) {
             boolean isLauncher = f.equals(launcherFile);
             boolean isLauncherSvc = f.equals(launcherSvcFile);
@@ -625,11 +659,15 @@
             if (isLauncherSvc) {
                 continue;
             }
+            launcherSet = launcherSet || isLauncher;
 
             boolean doShortcuts = isLauncher && (menuShortcut || desktopShortcut);
 
+            String thisFileId = isLauncher ? LAUNCHER_ID : ("FileId" + (id++));
+            idToFileMap.put(f.getName(), thisFileId);
+
             out.println(prefix + "   <File Id=\"" +
-                    (isLauncher ? LAUNCHER_ID : ("FileId" + (id++))) + "\""
+                    thisFileId + "\""
                     + " Name=\"" + f.getName() + "\" "
                     + " Source=\"" + relativePath(imageRootDir, f) + "\""
                     + (BIT_ARCH_64.fetchFrom(params) ? " ProcessorArchitecture=\"x64\"" : "") + ">");
@@ -643,8 +681,56 @@
                         + " Name=\"" + APP_NAME.fetchFrom(params)
                         + "\" Advertise=\"no\" Icon=\"StartMenuIcon.exe\" IconIndex=\"0\" />");
             }
+
+            List<Map<String, ? super Object>> secondaryLaunchers = SECONDARY_LAUNCHERS.fetchFrom(params);
+            for (int i = 0; i < secondaryLaunchers.size(); i++) {
+                Map<String, ? super Object> sl = secondaryLaunchers.get(i);
+                File secondaryLauncherFile = new File(imageRootDir, WinAppBundler.getLauncherName(sl));
+                if (f.equals(secondaryLauncherFile)) {
+                    if (SHORTCUT_HINT.fetchFrom(sl)) {
+                        out.println(prefix + "  <Shortcut Id=\"desktopShortcut" + i + "\" Directory=\"DesktopFolder\""
+                                + " Name=\"" + APP_NAME.fetchFrom(sl) + "\" WorkingDirectory=\"INSTALLDIR\""
+                                + " Advertise=\"no\" Icon=\"Launcher" + i + ".exe\" IconIndex=\"0\" />");
+                    }
+                    if (MENU_HINT.fetchFrom(sl)) {
+                        out.println(prefix + "     <Shortcut Id=\"ExeShortcut" + i + "\" Directory=\"ProgramMenuDir\""
+                                + " Name=\"" + APP_NAME.fetchFrom(sl)
+                                + "\" Advertise=\"no\" Icon=\"Launcher" + i + ".exe\" IconIndex=\"0\" />");
+                        //Should we allow different menu groups?  Not for now.
+                    }
+                }
+            }
             out.println(prefix + "   </File>");
         }
+
+        if (launcherSet) {
+            List<Map<String, ? super Object>> fileAssociations = FILE_ASSOCIATIONS.fetchFrom(params);
+            String regName = APP_REGISTRY_NAME.fetchFrom(params);
+            for (Map<String, ? super Object> fileAssociation : fileAssociations) {
+                String description = FA_DESCRIPTION.fetchFrom(fileAssociation);
+                File icon = FA_ICON.fetchFrom(fileAssociation); //TODO FA_ICON_ICO
+
+                out.println(prefix + "   <ProgId Id='" + regName + "File' Description='" + description + "' Icon='" + idToFileMap.get(icon.getName()) + "' IconIndex='0'>");
+
+                List<String> extensions = FA_EXTENSIONS.fetchFrom(fileAssociation);
+                List<String> mimeTypes = FA_CONTENT_TYPE.fetchFrom(fileAssociation);
+
+                for (String ext : extensions) {
+                    out.println(prefix + "    <Extension Id='" + ext + "' Advertise='no'>");
+                    out.println(prefix + "      <Verb Id='open' Command='Open' TargetFile='" + LAUNCHER_ID + "' Argument='\"%1\"'/>");
+                    boolean defaultSet = false;
+                    for (String mime : mimeTypes) {
+                        out.println(prefix + "      <MIME ContentType='" + mime + "'" + (defaultSet
+                                ? ">"
+                                : " Default='yes'/>"));
+                        defaultSet = true;
+                    }
+                    out.println(prefix + "    </Extension>");
+                }
+                out.println(prefix + "   </ProgId>");
+            }
+        }
+
         out.println(prefix + " </Component>");
 
         // Two components cannot share the same key path value.
--- a/modules/fxpackager/src/main/java/com/oracle/tools/packager/windows/WindowsBundlerParam.java	Wed Sep 10 20:35:23 2014 +0400
+++ b/modules/fxpackager/src/main/java/com/oracle/tools/packager/windows/WindowsBundlerParam.java	Wed Sep 10 11:31:04 2014 -0600
@@ -73,6 +73,19 @@
             },
             (s, p) -> s);
 
+    public static final BundlerParamInfo<String> APP_REGISTRY_NAME = new StandardBundlerParam<> (
+            I18N.getString("param.registry-name.name"),
+            I18N.getString("param.registry-name.description"),
+            "win.registryName",
+            String.class,
+            params -> {
+                String nm = APP_NAME.fetchFrom(params);
+                if (nm == null) return null;
+
+                return nm.replaceAll("[^-a-zA-Z\\.0-9]", "");
+            },
+            (s, p) -> s);
+
     public static final StandardBundlerParam<String> MENU_GROUP =
             new StandardBundlerParam<>(
                     I18N.getString("param.menu-group.name"),
--- a/modules/fxpackager/src/main/java/com/sun/javafx/tools/ant/DeployFXTask.java	Wed Sep 10 20:35:23 2014 +0400
+++ b/modules/fxpackager/src/main/java/com/sun/javafx/tools/ant/DeployFXTask.java	Wed Sep 10 11:31:04 2014 -0600
@@ -26,8 +26,13 @@
 package com.sun.javafx.tools.ant;
 
 import java.io.File;
+import java.util.ArrayList;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import com.oracle.tools.packager.StandardBundlerParam;
 import com.sun.javafx.tools.ant.Platform.Jvmarg;
 import com.sun.javafx.tools.ant.Platform.Property;
 import com.sun.javafx.tools.packager.DeployParams;
@@ -194,6 +199,11 @@
                         DeployParams.RunMode.WEBSTART);
                 }
             }
+
+            deployParams.addBundleArgument(StandardBundlerParam.FILE_ASSOCIATIONS.getID(),
+                    appInfo.fileAssociations.stream()
+                        .map(FileAssociation::createLauncherMap)
+                        .collect(Collectors.toList()));
         }
 
         deployParams.setUpdateMode(updateMode);
@@ -256,6 +266,15 @@
             }
         }
 
+        List<Map<String, ? super Object>> launchersAsMap = new ArrayList<>();
+        for (SecondaryLauncher sl : secondaryLaunchers) {
+            launchersAsMap.add(sl.createLauncherMap());
+        }
+
+        deployParams.addBundleArgument(
+                StandardBundlerParam.SECONDARY_LAUNCHERS.getID(),
+                launchersAsMap);
+
         deployParams.setBundleType(nativeBundles);
         deployParams.setTargetFormat(bundleFormat);
 
@@ -500,6 +519,15 @@
         return ba;
     }
 
+    private List<SecondaryLauncher> secondaryLaunchers = new ArrayList<>();
+
+    public SecondaryLauncher createSecondaryLauncher() {
+        SecondaryLauncher sl = new SecondaryLauncher();
+        secondaryLaunchers.add(sl);
+        return sl;
+    }
+
+
     @Override
     public void setDynamicAttribute(String name, String value) throws BuildException {
         //Use qName and value - can't really validate anything until we know which bundlers we have, so this has
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/fxpackager/src/main/java/com/sun/javafx/tools/ant/FileAssociation.java	Wed Sep 10 11:31:04 2014 -0600
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 2011, 2014, 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.sun.javafx.tools.ant;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.DynamicAttribute;
+import org.apache.tools.ant.types.DataType;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static com.oracle.tools.packager.StandardBundlerParam.*;
+
+/**
+ *
+ * Created by dferrin on 7/31/14.
+ */
+public class FileAssociation extends DataType implements DynamicAttribute {
+
+    String extension;
+    String mimeType;
+    String description;
+    File icon;
+
+    List<DeployFXTask.BundleArgument> bundleArgumentList = new ArrayList<>();
+
+    public DeployFXTask.BundleArgument createBundleArgument() {
+        DeployFXTask.BundleArgument ba = new DeployFXTask.BundleArgument();
+        bundleArgumentList.add(ba);
+        return ba;
+    }
+
+    @Override
+    public void setDynamicAttribute(String name, String value) throws BuildException {
+        //Use qName and value - can't really validate anything until we know which bundlers we have, so this has
+        //to done (way) downstream
+        bundleArgumentList.add(new DeployFXTask.BundleArgument(name, value));
+    }
+
+    public Map<String, ? super Object> createLauncherMap() {
+        Map<String, ? super Object> fileAssociations = new HashMap<>();
+
+        putUnlessNull(fileAssociations, FA_EXTENSIONS.getID(), extension);
+        putUnlessNull(fileAssociations, FA_CONTENT_TYPE.getID(), mimeType);
+        putUnlessNull(fileAssociations, FA_DESCRIPTION.getID(), description);
+        putUnlessNull(fileAssociations, FA_ICON.getID(), icon);
+
+        for (DeployFXTask.BundleArgument ba : bundleArgumentList) {
+            // TODO check and complain about collisions
+            putUnlessNull(fileAssociations, ba.arg, ba.value);
+        }
+
+        return fileAssociations;
+    }
+
+    public void putUnlessNull(Map<String, ? super Object> params, String param, Object value) {
+        if (value != null) {
+            params.put(param, value);
+        }
+    }
+
+    public void putUnlessNullOrEmpty(Map<String, ? super Object> params, String param, Collection value) {
+        if (value != null && !value.isEmpty()) {
+            params.put(param, value);
+        }
+    }
+
+    public void putUnlessNullOrEmpty(Map<String, ? super Object> params, String param, Map value) {
+        if (value != null && !value.isEmpty()) {
+            params.put(param, value);
+        }
+    }
+
+    /**
+     * The file extension or extensions (separated by spaces) that the application requests it be registered to handle
+     *
+     * @ant.not-required
+     */
+    public void setExtension(String extension) {
+        this.extension = extension;
+    }
+
+    /**
+     * The mime-type that the application requests it be registered to handle.
+     *
+     * @ant.not-required
+     */
+    public void setMimeType(String mimeType) {
+        this.mimeType = mimeType;
+    }
+
+    /**
+     * The description the Operation System may show for files of the associated extension and mime-type.
+     *
+     * @ant.optional
+     */
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    /**
+     * The icon the Operation System may show for files of the associated extension and mime-type.
+     *
+     * @ant.optional
+     */
+    public void setIcon(File icon) {
+        this.icon = icon;
+    }
+
+    /**
+     * Extra arguments that the bundler may interpret to provide for better
+     * integration with specific operating systems.
+     *
+     * @ant.optional
+     */
+    public DeployFXTask.BundleArgument createArg() {
+        DeployFXTask.BundleArgument ba = new DeployFXTask.BundleArgument();
+        bundleArgumentList.add(ba);
+        return ba;
+    }
+}
--- a/modules/fxpackager/src/main/java/com/sun/javafx/tools/ant/Info.java	Wed Sep 10 20:35:23 2014 +0400
+++ b/modules/fxpackager/src/main/java/com/sun/javafx/tools/ant/Info.java	Wed Sep 10 11:31:04 2014 -0600
@@ -55,7 +55,8 @@
     String licenseType;
     String copyright;
     String email;
-    List<Icon> icons = new LinkedList<Icon>();
+    List<Icon> icons = new LinkedList<>();
+    List<FileAssociation> fileAssociations = new LinkedList<>();
 
     /**
      * Application category.
@@ -277,4 +278,17 @@
         icons.add(s);
         return s;
     }
+
+    /**
+     * A hint to the packager that it wishes to be registered with the
+     * operating system as the primary handler of certain extensions and
+     * a certain mime-type.
+     *
+     * @ant.not-required
+     */
+    public FileAssociation createAssociation() {
+        FileAssociation fa = new FileAssociation();
+        fileAssociations.add(fa);
+        return fa;
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/fxpackager/src/main/java/com/sun/javafx/tools/ant/SecondaryLauncher.java	Wed Sep 10 11:31:04 2014 -0600
@@ -0,0 +1,273 @@
+/*
+ * Copyright (c) 2011, 2014, 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.sun.javafx.tools.ant;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.DynamicAttribute;
+import org.apache.tools.ant.types.DataType;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import static com.oracle.tools.packager.StandardBundlerParam.*;
+
+/**
+ *
+ * Created by dferrin on 7/31/14.
+ */
+public class SecondaryLauncher extends DataType implements DynamicAttribute {
+
+    File icon;
+    private String mainClass;
+    private String name;
+    private String version;
+    private String title;
+    private String vendor;
+    private String appDescription;
+    private String copyright;
+
+    private Boolean menu;
+    private Boolean shortcut;
+
+    List<DeployFXTask.BundleArgument> bundleArgumentList = new ArrayList<>();
+    private List<Argument> arguments = new ArrayList<>();
+    private List<Platform.Property> properties = new ArrayList<>();
+    private List<Platform.Jvmarg> jvmargs = new ArrayList<>();
+    private List<Platform.Property> jvmUserArgs = new ArrayList<>();
+
+    public DeployFXTask.BundleArgument createBundleArgument() {
+        DeployFXTask.BundleArgument ba = new DeployFXTask.BundleArgument();
+        bundleArgumentList.add(ba);
+        return ba;
+    }
+
+    @Override
+    public void setDynamicAttribute(String name, String value) throws BuildException {
+        //Use qName and value - can't really validate anything until we know which bundlers we have, so this has
+        //to done (way) downstream
+        bundleArgumentList.add(new DeployFXTask.BundleArgument(name, value));
+    }
+
+    public Map<String, ? super Object> createLauncherMap() {
+        Map<String, ? super Object> bundleParams = new HashMap<>();
+
+        putUnlessNull(bundleParams, MAIN_CLASS.getID(), mainClass);
+//??        putUnlessNull(bundleParams, Preloader, preloaderClass);
+//??        putUnlessNull(bundleParams, AppId, id);
+        putUnlessNull(bundleParams, APP_NAME.getID(), name);
+        putUnlessNull(bundleParams, VERSION.getID(), version);
+//??        putUnlessNull(bundleParams, IDENTIFIER, id);
+//??        putUnlessNull(bundleParams, ServiceHint, daemon);
+
+        putUnlessNull(bundleParams, TITLE.getID(), title);
+        putUnlessNull(bundleParams, VENDOR.getID(), vendor);
+        putUnlessNull(bundleParams, DESCRIPTION.getID(), appDescription);
+        putUnlessNull(bundleParams, COPYRIGHT.getID(), copyright);
+
+        putUnlessNull(bundleParams, ICON.getID(), icon);
+
+        putUnlessNull(bundleParams, SHORTCUT_HINT.getID(), shortcut);
+        putUnlessNull(bundleParams, MENU_HINT.getID(), menu);
+
+
+        Map<String, String> props = new HashMap<>();
+        for (Platform.Property p: properties) {
+            props.put(p.name, p.value);
+        }
+        putUnlessNullOrEmpty(bundleParams, JVM_PROPERTIES.getID(), props);
+
+        List<String> args = new ArrayList<>();
+        for (Platform.Jvmarg a: jvmargs) {
+            args.add(a.value);
+        }
+        putUnlessNullOrEmpty(bundleParams, JVM_OPTIONS.getID(), args);
+
+        Map<String, String> userArgs = new HashMap<>();
+        for (Platform.Property a: jvmUserArgs) {
+            userArgs.put(a.name, a.value);
+        }
+        putUnlessNullOrEmpty(bundleParams, USER_JVM_OPTIONS.getID(), userArgs);
+
+        List<String> clargs = new ArrayList<>();
+        for (Argument a: arguments) {
+            clargs.add(a.value);
+        }
+        putUnlessNullOrEmpty(bundleParams, ARGUMENTS.getID(), clargs);
+
+
+        for (DeployFXTask.BundleArgument ba : bundleArgumentList) {
+            // TODO check and complain about collisions
+            putUnlessNull(bundleParams, ba.arg, ba.value);
+        }
+
+        return bundleParams;
+    }
+
+    public void putUnlessNull(Map<String, ? super Object> params, String param, Object value) {
+        if (value != null) {
+            params.put(param, value);
+        }
+    }
+
+    public void putUnlessNullOrEmpty(Map<String, ? super Object> params, String param, Collection value) {
+        if (value != null && !value.isEmpty()) {
+            params.put(param, value);
+        }
+    }
+
+    public void putUnlessNullOrEmpty(Map<String, ? super Object> params, String param, Map value) {
+        if (value != null && !value.isEmpty()) {
+            params.put(param, value);
+        }
+    }
+
+    public class Argument {
+        String value;
+
+        public void addText(String v) {
+            value = getProject().replaceProperties(v);
+        }
+    }
+
+    public Argument createArgument() {
+        Argument a = new Argument();
+        arguments.add(a);
+        return a;
+    }
+
+    List<String> getArguments() {
+        List<String> lst = new LinkedList<>();
+        for(Argument a: arguments) {
+            lst.add(a.value);
+        }
+        return lst;
+    }
+
+    public Platform.Property createProperty() {
+        Platform.Property t = new Platform.Property();
+        properties.add(t);
+        return t;
+    }
+
+    public Platform.Jvmarg createJvmarg() {
+        Platform.Jvmarg t = new Platform.Jvmarg();
+        jvmargs.add(t);
+        return t;
+    }
+
+    public Platform.Property createJVMUserArg() {
+        Platform.Property t = new Platform.Property();
+        jvmUserArgs.add(t);
+        return t;
+    }
+
+
+
+    public String getMainClass() {
+        return mainClass;
+    }
+
+    public void setMainClass(String mainClass) {
+        this.mainClass = mainClass;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getVersion() {
+        return version;
+    }
+
+    public void setVersion(String version) {
+        this.version = version;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getVendor() {
+        return vendor;
+    }
+
+    public void setVendor(String vendor) {
+        this.vendor = vendor;
+    }
+
+    public String getAppDescription() {
+        return appDescription;
+    }
+
+    public void setAppDescription(String appDescription) {
+        this.appDescription = appDescription;
+    }
+
+    public String getCopyright() {
+        return copyright;
+    }
+
+    public void setCopyright(String copyright) {
+        this.copyright = copyright;
+    }
+
+    public File getIcon() {
+        return icon;
+    }
+
+    public void setIcon(File icon) {
+        this.icon = icon;
+    }
+
+    public Boolean getMenu() {
+        return menu;
+    }
+
+    public void setMenu(Boolean menu) {
+        this.menu = menu;
+    }
+
+    public Boolean getShortcut() {
+        return shortcut;
+    }
+
+    public void setShortcut(Boolean shortcut) {
+        this.shortcut = shortcut;
+    }
+}
--- a/modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/DeployParams.java	Wed Sep 10 20:35:23 2014 +0400
+++ b/modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/DeployParams.java	Wed Sep 10 11:31:04 2014 -0600
@@ -470,20 +470,21 @@
     static final Set<String> multi_args = new TreeSet<>(Arrays.asList(
             StandardBundlerParam.JVM_PROPERTIES.getID(),
             StandardBundlerParam.JVM_OPTIONS.getID(),
-            StandardBundlerParam.USER_JVM_OPTIONS.getID()
+            StandardBundlerParam.USER_JVM_OPTIONS.getID(),
+            StandardBundlerParam.ARGUMENTS.getID()
     ));
 
     @SuppressWarnings("unchecked")
-    public void addBundleArgument(String key, String value) {
+    public void addBundleArgument(String key, Object value) {
         // special hack for multi-line arguments
-        if (multi_args.contains(key)) {
+        if (multi_args.contains(key) && value instanceof String) {
             Object existingValue = bundlerArguments.get(key);
             if (existingValue instanceof String) {
                 bundlerArguments.put(key, existingValue + "\n\n" + value);
             } else if (existingValue instanceof List) {
-                ((List<String>)existingValue).add(value);
-            } else if (existingValue instanceof Map && value.contains("=")) {
-                String[] mapValues = value.split("=", 2);
+                ((List)existingValue).add(value);
+            } else if (existingValue instanceof Map && ((String)value).contains("=")) {
+                String[] mapValues = ((String)value).split("=", 2);
                 ((Map)existingValue).put(mapValues[0], mapValues[1]);
             } else {
                 bundlerArguments.put(key, value);
@@ -546,6 +547,7 @@
             bundleParams.setJvmProperties(properties);
             bundleParams.setJvmargs(jvmargs);
             bundleParams.setJvmUserArgs(jvmUserArgs);
+            bundleParams.setArguments(arguments);
 
             File appIcon = null;
             for (Icon ic: icons) {
--- a/modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/bundlers/BundleParams.java	Wed Sep 10 20:35:23 2014 +0400
+++ b/modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/bundlers/BundleParams.java	Wed Sep 10 11:31:04 2014 -0600
@@ -163,6 +163,10 @@
         putUnlessNullOrEmpty(JVM_PROPERTIES.getID(), jvmProperties);
     }
 
+    public void setArguments(List<String> arguments) {
+        putUnlessNullOrEmpty(ARGUMENTS.getID(), arguments);
+    }
+
     public String getApplicationID() {
         return fetchParam(IDENTIFIER);
     }
@@ -308,6 +312,10 @@
         return JVM_OPTIONS.fetchFrom(params);
     }
 
+    public List<String> getArguments() {
+        return ARGUMENTS.fetchFrom(params);
+    }
+
     //Validation approach:
     //  - JRE marker (rt.jar)
     //  - FX marker (jfxrt.jar)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/fxpackager/src/main/java/jdk/packager/services/UserJvmOptionsService.java	Wed Sep 10 11:31:04 2014 -0600
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2014, 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 jdk.packager.services;
+
+import jdk.packager.services.userjvmoptions.LauncherUserJvmOptions;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.ServiceLoader;
+
+/**
+ * Runtime access to the UserJVMOptions.
+ * 
+ * This class is not typically available in the Java Runtime, you must 
+ * explicitly include the 'packager.jar' file from the lib directory
+ * of the JDK as part of your application bundle. 
+ *
+ * @since 8u40
+ */
+public interface UserJvmOptionsService {
+
+    /**
+     * Get the instance of UserJvmOptionService to use.  Which one to use is 
+     * configured by the packager and the launcher.  Do not directly 
+     * instantiate any instance of this interface, use this method to get
+     * an appropriate instance.
+     * 
+     * @return the instance of UserJvmOptionsService for your application.
+     */
+    static UserJvmOptionsService getUserJVMDefaults() {
+        ServiceLoader<UserJvmOptionsService> loader = ServiceLoader.load(UserJvmOptionsService.class);
+        Iterator<UserJvmOptionsService> iter = loader.iterator();
+        if (iter.hasNext()) {
+            return iter.next();
+        } else {
+            return new LauncherUserJvmOptions();
+            //return new PreferencesUserJvmOptions();
+        }
+    }
+
+    /**
+     * The "current" set of UserJVMOptions.
+     *
+     * This will take effect on the next application start, and this may not
+     * reflect the current set of UserJVMOptions used to start this application.
+     *
+     * @return A map of the keys and values.  Alterations to this map will not
+     *         change the stored UserJVMOptions
+     */
+    Map<String, String> getUserJVMOptions();
+
+    /**
+     * Sets the passed in options as the UserJVMOptions.
+     *
+     * If the application has specified default values and those keys are not
+     * in this map, they will be replaced by the default values.
+     *
+     * No validation or error checking is performed on these values.  It is
+     * entirely possible that you may provide a set of UserJVMOptions that
+     * may prevent the normal startup of your application and may require
+     * manual intervention to resolve.
+     *
+     * @param options The UserJVMOptions to set.
+     */
+    void setUserJVMOptions(Map<String, String> options);
+
+    /**
+     * The "default" set of UserJVMOptions.
+     *
+     * This returns the default set of keys and values that the application has
+     * been configured to use.
+     *
+     * @return the keys and values of the default UserJVMOptions.
+     * @throws UnsupportedOperationException if the defaults cannot be calculated.
+     */
+    Map<String, String> getUserJVMOptionDefaults();
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/fxpackager/src/main/java/jdk/packager/services/userjvmoptions/LauncherUserJvmOptions.java	Wed Sep 10 11:31:04 2014 -0600
@@ -0,0 +1,163 @@
+/*
+ * Copyright (c) 2014, 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 jdk.packager.services.userjvmoptions;
+
+import jdk.packager.services.UserJvmOptionsService;
+
+import java.security.AllPermission;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
+/**
+ *
+ * Access the UserJVMOptions via a native library provided by the launcher.
+ * 
+ * Do not instantiate this class directly, instead use 
+ * {@see jdk.packager.services.UserJvmOptionsService#getUserJVMDefaults()}
+ * to get an instance.
+ *
+ * @since 8u40
+ */
+public class LauncherUserJvmOptions implements UserJvmOptionsService {
+
+    private static final Object semaphore = new Object();
+    
+    static {
+        try {
+            checkAllPermissions();
+            System.loadLibrary("packager");
+        } catch (SecurityException se) {
+            // fail to load, we will also throw on all public methods
+        }
+    }
+
+    private static void checkAllPermissions() {
+        final SecurityManager securityManager = System.getSecurityManager();
+        if (securityManager != null) {
+            securityManager.checkPermission(new AllPermission());
+        }
+    }
+
+    /**
+     * Access the default User JVM Option for a specific key
+     *
+     * @param option the key for the User JVM Option
+     *
+     * @return the default value of the user JVM Option.  Currently set user
+     * values are not considered, and only the default is returned.  If there
+     * is no default value then null is returned.
+     */
+    private static native String _getUserJvmOptionDefaultValue(String option);
+
+    /**
+     * This lists the keys for User JVM Options that will have a default
+     * provided by the launcher.
+     *
+     * This list will be a subset of the keys used by the launcher and only
+     * lists those values that will have a default value provided if the user
+     * does not set a value of their own.
+     *
+     * @return an array of keys in no particular order.
+     */
+    private static native String[] _getUserJvmOptionDefaultKeys();
+    /**
+     * Access the current User JVM Option for a specific key
+     *
+     * @param option the key for the User JVM Option
+     *
+     * @return the current value of the user JVM Option.  If the user has not
+     * set a value then the default value is returned, except in the case where
+     * there is no default value, where null is returned.
+     */
+    private static native String _getUserJvmOptionValue(String option);
+
+    /**
+     * Update the all User JVM Options
+     *
+     * All option/value pairs will be replaced with the values provided. The
+     * parameters options and values are paired at the same index.
+     * Example: options[3] = -Xmx and values[3] = 999m
+     * This cannot be used to adjust default values.
+     *
+     * @param options the keys for the User JVM Options
+     * @param values the values for the User JVM Options
+     */
+    private static native void _setUserJvmKeysAndValues(String[] options, String[] values);
+
+    /**
+     * This lists the keys for all User JVM Options that will be used by the
+     * launcher.
+     *
+     * This list will be a superset of the defaults as may also include user
+     * values that do not have a default.
+     *
+     * @return an array of keys in no particular order.
+     */
+    private static native String[] _getUserJvmOptionKeys();
+
+    @Override
+    public Map<String, String> getUserJVMOptions() {
+        checkAllPermissions();
+        synchronized (semaphore) {
+            Map<String, String> results = new TreeMap<>();
+            for (String s : _getUserJvmOptionKeys()) {
+                results.put(s, _getUserJvmOptionValue(s));
+            }
+            return results;
+        }
+    }
+
+    @Override
+    public synchronized void setUserJVMOptions(Map<String, String> options) {
+        checkAllPermissions();
+        synchronized (semaphore) {
+            List<String> keys = new LinkedList<>();
+            List<String> values = new LinkedList<>();
+
+            for (Map.Entry<String, String> option : options.entrySet()) {
+                keys.add(option.getKey());
+                values.add(option.getValue());
+            }
+
+            _setUserJvmKeysAndValues(keys.toArray(new String[keys.size()]),
+                    values.toArray(new String[values.size()]));
+        }
+    }
+
+    @Override
+    public synchronized Map<String, String> getUserJVMOptionDefaults() {
+        checkAllPermissions();
+        synchronized (semaphore) {
+            Map<String, String> results = new TreeMap<>();
+            for (String s : _getUserJvmOptionDefaultKeys()) {
+                results.put(s, _getUserJvmOptionDefaultValue(s));
+            }
+            return results;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/fxpackager/src/main/java/jdk/packager/services/userjvmoptions/PreferencesUserJvmOptions.java	Wed Sep 10 11:31:04 2014 -0600
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2014, 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 jdk.packager.services.userjvmoptions;
+
+import jdk.packager.services.UserJvmOptionsService;
+
+import java.util.Map;
+import java.util.TreeMap;
+import java.util.prefs.BackingStoreException;
+import java.util.prefs.Preferences;
+
+/**
+ * Access to old preferences based UserJvmOptions
+ * 
+ * Do not instantiate this class directly, instead use 
+ * {@see jdk.packager.services.UserJvmOptionsService#getUserJVMDefaults()}
+ * to get an instance.
+ *
+ * @since 8u40
+ */
+public class PreferencesUserJvmOptions implements UserJvmOptionsService {
+
+    Preferences node = Preferences.userRoot().node(System.getProperty("app.preferences.id"));
+
+    @Override
+    public Map<String, String> getUserJVMOptions() {
+        Map<String, String> result = new TreeMap<>();
+        try {
+            for (String s : node.childrenNames()) {
+                String o = node.get(s, null);
+                if (o != null) {
+                    result.put(s, o);
+                }
+            }
+        } catch (BackingStoreException ignore) {
+        }
+
+        return result;
+    }
+
+    @Override
+    public void setUserJVMOptions(Map<String, String> options) {
+        try {
+            node.clear();
+            for (Map.Entry<String, String> entry : options.entrySet()) {
+                node.put(entry.getKey(), entry.getValue());
+            }
+            node.flush();
+        } catch (BackingStoreException ignore) {
+        }
+
+    }
+
+    @Override
+    public Map<String, String> getUserJVMOptionDefaults() {
+        throw new UnsupportedOperationException("Preferences backed UserJvmOptions do not enumerate their defaults");
+    }
+}
--- a/modules/fxpackager/src/main/native/javapackager/win/javapackager.cpp	Wed Sep 10 20:35:23 2014 +0400
+++ b/modules/fxpackager/src/main/native/javapackager/win/javapackager.cpp	Wed Sep 10 11:31:04 2014 -0600
@@ -186,7 +186,7 @@
             ) {
         DWORD ot = REG_SZ;
         DWORD size = 255;
-		char data[MAX_PATH] = {0};
+        char data[MAX_PATH] = {0};
         if ((res = RegQueryValueExA(hKey, "JavaHome", NULL, &ot, (BYTE *) data, &size)) == ERROR_SUCCESS) {
             version->home = data;
             strcat_s(data, sizeof(data) - strlen(data), "\\bin\\java.exe");
--- a/modules/fxpackager/src/main/native/launcher/linux/DeployPlatform.h	Wed Sep 10 20:35:23 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,159 +0,0 @@
-/*
- * Copyright (c) 2012, 2013, 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.
- */
-
-#ifndef __UNIX_DEPLOY_PLATFORM__
-#define __UNIX_DEPLOY_PLATFORM__
-
-/** Provide an abstraction for difference in the platform APIs,
-     e.g. string manipulation functions, etc. */
-#include<stdio.h>
-#include<string.h>
-#include<strings.h>
-#include<sys/stat.h>
-
-#define TCHAR char
-
-#define _T(x) x
-
-#define DEPLOY_MULTIBYTE_SNPRINTF snprintf
-
-#define DEPLOY_SNPRINTF(buffer, sizeOfBuffer, count, format, ...) \
-    snprintf((buffer), (count), (format), __VA_ARGS__)
-
-#define DEPLOY_PRINTF(format, ...) \
-    printf((format), ##__VA_ARGS__)
-
-#define DEPLOY_FPRINTF(dest, format, ...) \
-    fprintf((dest), (format), __VA_ARGS__)
-
-#define DEPLOY_SSCANF(buf, format, ...) \
-    sscanf((buf), (format), __VA_ARGS__)
-
-#define DEPLOY_STRDUP(strSource) \
-    strdup((strSource))
-
-//return "error code" (like on Windows)
-static int DEPLOY_STRNCPY(char *strDest, size_t numberOfElements, const char *strSource, size_t count) {
-    char *s = strncpy(strDest, strSource, count);
-    // Duplicate behavior of the Windows' _tcsncpy_s() by adding a NULL
-    // terminator at the end of the string.
-    if (count < numberOfElements) {
-        s[count] = '\0';
-    } else {
-        s[numberOfElements - 1] = '\0';
-    }
-    return (s == strDest) ? 0 : 1;
-}
-
-static int DEPLOY_STRNCAT(char *strDest, size_t numberOfElements, const char *strSource, size_t count) {
-    // strncat always return null terminated string
-    char *s = strncat(strDest, strSource, count);
-    return (s == strDest) ? 0 : 1;
-}
-
-#define DEPLOY_STRICMP(x, y) \
-    strcasecmp((x), (y))
-
-#define DEPLOY_STRNICMP(x, y, cnt) \
-    strncasecmp((x), (y), (cnt))
-
-#define DEPLOY_STRNCMP(x, y, cnt) \
-    strncmp((x), (y), (cnt))
-
-#define DEPLOY_STRLEN(x) \
-    strlen((x))
-
-#define DEPLOY_STRSTR(x, y) \
-    strstr((x), (y))
-
-#define DEPLOY_STRCHR(x, y) \
-    strchr((x), (y))
-
-#define DEPLOY_STRRCHR(x, y) \
-    strrchr((x), (y))
-
-#define DEPLOY_STRPBRK(x, y) \
-    strpbrk((x), (y))
-
-#define DEPLOY_GETENV(x) \
-    getenv((x))
-
-#define DEPLOY_PUTENV(x) \
-    putenv((x))
-
-#define DEPLOY_STRCMP(x, y) \
-    strcmp((x), (y))
-
-#define DEPLOY_STRCPY(x, y) \
-    strcpy((x), (y))
-
-#define DEPLOY_STRCAT(x, y) \
-    strcat((x), (y))
-
-#define DEPLOY_ATOI(x) \
-    atoi((x))
-
-static int getFileSize(TCHAR* filename) {
-    struct stat statBuf;
-    if (stat(filename, &statBuf) == 0) {
-        return statBuf.st_size;
-    }
-    return -1;
-}
-
-#define DEPLOY_FILE_SIZE(filename) getFileSize(filename)
-
-#define DEPLOY_FOPEN(x, y) \
-    fopen((x), (y))
-
-#define DEPLOY_FGETS(x, y, z) \
-    fgets((x), (y), (z))
-
-#define DEPLOY_REMOVE(x) \
-    remove((x))
-
-#define DEPLOY_SPAWNV(mode, cmd, args) \
-    spawnv((mode), (cmd), (args))
-
-#define DEPLOY_ISDIGIT(ch) isdigit(ch)
-
-// for non-unicode, just return the input string for
-// the following 2 conversions
-#define DEPLOY_NEW_MULTIBYTE(message) message
-
-#define DEPLOY_NEW_FROM_MULTIBYTE(message) message
-
-// for non-unicode, no-op for the relase operation
-// since there is no memory allocated for the
-// string conversions
-#define DEPLOY_RELEASE_MULTIBYTE(tmpMBCS)
-
-#define DEPLOY_RELEASE_FROM_MULTIBYTE(tmpMBCS)
-
-// The size will be used for converting from 1 byte to 1 byte encoding.
-// Ensure have space for zero-terminator.
-#define DEPLOY_GET_SIZE_FOR_ENCODING(message, theLength) (theLength + 1)
-
-#endif
--- a/modules/fxpackager/src/main/native/launcher/linux/launcher.c	Wed Sep 10 20:35:23 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,735 +0,0 @@
-/*
- * Copyright (c) 2012, 2014, 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 <pwd.h>
-
-#include "jni.h"
-
-#include "xmlparser.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 existence
-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"
-#define CONFIG_APP_ID_KEY     "app.preferences.id"
-
-//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;
-}
-
-/*
- * Replace a pattern in a string (not regex, straight replace) with another
- * string.
- *
- * All strings returned can be passed to free, i.e a new string is always created
- * even if there is an error and the pattern can't be replaced
- *
- * @param str          - original string
- * @param pattern      - pattern to replace (not regex)
- * @param replaceWith  - string to replace pattern
- * @return if pattern not found strdup(str) is returned
- *         or a new str with the pattern replaced (strdup as well)
- */
-char *dupAndReplacePattern(char *str, char *pattern, char *replaceWith) {
-    static char buffer[MAX_PATH*2] = {0};
-    char *p;
-
-    //Return orig if str is not in orig.
-    if(!(p = strstr(str, pattern))) {
-      return strdup(str);
-    }
-
-    int loc = p-str;
-    if (loc >= sizeof(buffer)) {
-        printf("Failed to replace pattern \"%s\" in string \"%s\" with \"%s\" because buffer not big enough\n",
-                pattern, str, replaceWith);
-        return strdup(str);
-    }
-
-    strncpy(buffer, str, loc); // Copy characters from 'str' start to 'orig' st$
-    buffer[loc] = '\0';
-
-    int remaingBufferSize = sizeof(buffer) - loc;
-    int len = snprintf(buffer+(loc), remaingBufferSize, "%s%s", replaceWith, p+strlen(pattern));
-    if(len > remaingBufferSize ) {
-        printf("Failed to replace pattern \"%s\" in string \"%s\" with \"%s\" because buffer not big enough\n",
-                pattern, str, replaceWith);
-        return strdup(str);
-    }
-    return strdup(buffer);
-}
-
-#define MAX_OPTIONS 100
-#define MAX_ARGUMENT_LEN 1000
-
-typedef struct {
-    char* name;
-    char* value;
-} JVMUserArg;
-
-typedef struct {
-    JVMUserArg *args;
-    int maxSize;
-    int currentSize;
-    int initialElements;           
-} JVMUserArgs;
-
-/**
- * Creates an array of string pointer where each non null entry is malloced and
- * needs to be freed
- * 
- * @param basedir
- * @param keys
- * @param size
- */
-void JVMUserArgs_initializeDefaults(JVMUserArgs *this, char* basedir) {
-    char jvmArgID[40 + 1];
-    char argvalue[MAX_ARGUMENT_LEN + 1] = {0};
-    JVMUserArg* keys = this->args;
-    
-    int index = 0;
-    int found = 0;
-    do {
-        snprintf(jvmArgID, 40, "jvmuserarg.%d.name", (index+1));
-        found = getConfigValue(basedir, jvmArgID, argvalue, MAX_ARGUMENT_LEN);
-        if (found) {
-          keys->name = strdup(argvalue);
-          snprintf(jvmArgID, 40, "jvmuserarg.%d.value", (index+1));
-          found = getConfigValue(basedir, jvmArgID, argvalue, MAX_ARGUMENT_LEN);
-          if (found) {
-              //allow use to specify everything in name only
-              keys->value = strdup(argvalue);
-          }
-          else {
-              keys->value = strdup("");
-          }
-          index++;
-          keys++;
-          this->initialElements++;
-          this->currentSize++;
-       }
-    } while (found && index < this->maxSize);
-}
-
-int makeDirRecursively(char *path, mode_t mode) {
-    char parent[MAX_PATH], *p;
-
-    if (fileExists(path)) {
-        return 0;
-    }
-    
-    /* make a parent directory path */
-    strncpy(parent, path, sizeof (parent));
-    parent[sizeof (parent) - 1] = '\0';
-
-    for (p = parent + strlen(parent); *p != '/' && p != parent; p--) {
-    }
-    *p = '\0';
-
-    /* try make parent directory */
-    if (p != parent && makeDirRecursively(parent, mode) != 0) {
-        return -1;
-    }
-
-    //If we got here the parent has already been made so make this one
-    //or if it already exists that is ok as well
-    if (mkdir(path, mode) == 0 || errno == EEXIST) {
-        return 0;
-    }
-    return -1;
-}
-
-
-/*
- * Assumes that userPref can hold the size of this path 
- */
-int getUserPrefFile(char* userPref, char* appid) {
-    userPref[0] = 0;
-    struct passwd *pw = getpwuid(getuid());
-    const char *homedir = pw->pw_dir;    
-    
-    strcat(userPref, homedir);
-    strcat(userPref, "/.java/.userPrefs/");
-    strcat(userPref, appid);
-    strcat(userPref, "/JVMUserOptions");
-    if (fileExists(userPref) == FALSE) {
-        makeDirRecursively(userPref,  0777);
-    }
-    
-    strcat(userPref, "/prefs.xml");
-    return fileExists(userPref);
-}       
-
-void addModifyArgs(JVMUserArgs* this, char* name, char* value) {
-    int i;
-    
-    if (name == NULL || value == NULL) {
-        return;
-    }
-    
-    JVMUserArg* arg = this->args;
-    for (i = 0; i < this->initialElements; i++) {
-        if (strcmp(arg[i].name, name) == 0) {
-            free(arg[i].value);
-            arg[i].value = malloc((strlen(value) + 1) * sizeof (char));
-            strcpy(arg[i].value, value);
-            return; //Replaced
-        }
-    }
-    
-    //Add new jvm arg from name value 
-    int newIndex = this->currentSize;
-    arg[newIndex].name = malloc((strlen(name) + 1) * sizeof (char));
-    strcpy(arg[newIndex].name, name);
-    arg[newIndex].value = malloc((strlen(value) + 1) * sizeof (char));
-    strcpy(arg[newIndex].value, value);
-    this->currentSize++;
-}
-
-void findAndModifyNode(XMLNode* node, JVMUserArgs* args) {
-        XMLNode* keyNode = NULL;
-        char* key;
-        char* value;
-        keyNode = FindXMLChild(node->_sub, "entry");
-        
-    while (keyNode != NULL && args->currentSize < args->maxSize) {
-            key = FindXMLAttribute(keyNode->_attributes, "key");
-            value = FindXMLAttribute(keyNode->_attributes, "value");
-            addModifyArgs(args, key, value);
-            keyNode = keyNode->_next;
-        }
-}
-
-int getJvmUserArgs(JVMUserArgs* args, char* userPrefsPath) {
-    FILE *fp;
-
-    if (fileExists(userPrefsPath)) {
-        //scan file for the key
-        fp = fopen(userPrefsPath, "r");
-        if (fp == NULL) {
-             return;
-        }
-
-        fseek(fp, 0, SEEK_END);
-        long fsize = ftell(fp);
-        rewind(fp);
-        char *buf = malloc(fsize + 1);
-        fread(buf, fsize, 1, fp);
-        fclose(fp);
-        buf[fsize] = 0;
-        
-        XMLNode* node = NULL;
-        XMLNode* doc = ParseXMLDocument(buf);
-        if (doc != NULL) {
-            node = FindXMLChild(doc, "map");
-            if (node != NULL) {
-                findAndModifyNode(node, args);
-            }
-        }
-        free(buf);
-    }
-    return args->currentSize; 
-}
-
-/*
- * Converts JVMUserArg to a single jvm argument.
- * 
- * This is used to convert to the actual string passed into the jvm, so has
- * option to free memory of the sub strings 
- * 
- * Returned string can be freed
- */
-char* JVMUserArg_toString(char* basedir, JVMUserArg arg, int freeMemory) {
-    int len = strlen(arg.name);
-    len += strlen(arg.value);
-    char* newString = calloc(len + 1, sizeof (char));
-    if (newString != NULL) {
-        strcat(newString, arg.name);
-        strcat(newString, arg.value);
-        if (freeMemory == TRUE) {
-            free(arg.name);
-            free(arg.value);
-        }
-        char* jvmOption = dupAndReplacePattern(newString, "$APPDIR", basedir);
-        free(newString);
-        return jvmOption;
-    }
-    return NULL;
-}
-
-int addUserOptions(char* basedir, JavaVMOption* options, int cnt) {
-    JVMUserArg args[MAX_OPTIONS - cnt];
-    JVMUserArgs jvmUserArgs;
-    char appid[MAX_ARGUMENT_LEN + 1] = {0};
-    char userPref[MAX_ARGUMENT_LEN + 1] = {0};
-    char argvalue[MAX_ARGUMENT_LEN + 1] = {0};
-
-
-    jvmUserArgs.args = args;
-    jvmUserArgs.currentSize = 0;
-    jvmUserArgs.initialElements = 0;
-    jvmUserArgs.maxSize = MAX_OPTIONS - cnt;
-    memset(&args, 0, sizeof (JVMUserArg)*(MAX_OPTIONS - cnt + 1));
-
-    //Add property to command line for preferences id
-    if (getConfigValue(basedir, CONFIG_APP_ID_KEY, appid, MAX_ARGUMENT_LEN)) {
-        snprintf(argvalue, MAX_ARGUMENT_LEN, "-D%s=%s", CONFIG_APP_ID_KEY, appid);
-
-        if (cnt < MAX_OPTIONS) {
-            options[cnt].optionString = strdup(argvalue);
-            cnt++;
-        }
-
-        JVMUserArgs_initializeDefaults(&jvmUserArgs, basedir);
-        if (getUserPrefFile(userPref, appid)) {
-            getJvmUserArgs(&jvmUserArgs, userPref);
-        }
-        else {
-            //If file doesn't exist create it and populate with the default values
-            printf("MESSAGE: Creating user preferences file exist: %s", userPref);
-            FILE *fp = fopen(userPref, "w");
-            if (fp == NULL) {
-                printf("MESSAGE: Can not create user preferences: %s", userPref);
-            }
-            else {
-                fprintf(fp, "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n");
-                fprintf(fp, "<!DOCTYPE map SYSTEM \"http://java.sun.com/dtd/preferences.dtd\">\n");
-                fprintf(fp, "<map MAP_XML_VERSION=\"1.0\">\n");   
-                int i;
-                for (i; i < jvmUserArgs.currentSize; i++) {
-                    fprintf(fp, "    <entry key=\"%s\" value=\"%s\"/>\n", 
-                            jvmUserArgs.args[i].name,
-                            jvmUserArgs.args[i].value);
-                }
-                fprintf(fp, "</map>\n");
-            }
-            fclose(fp);
-        }
-
-        //Copy all user args to options
-        int i;
-        for (i = 0; i < jvmUserArgs.currentSize; i++) {
-            char* jvmOption = JVMUserArg_toString(basedir, args[i], TRUE);
-            if (jvmOption != NULL && cnt < MAX_OPTIONS) {
-                options[cnt].optionString = jvmOption;
-                cnt++;
-            }
-        }
-    } else {
-        printf("WARNING: %s not defined:", CONFIG_APP_ID_KEY);
-    }
-    return cnt;
-}
-
-
-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};
-    jclass cls;
-    jmethodID mid;
-    char argname[20];
-    char argvalue[MAX_ARGUMENT_LEN];
-    char mainclass[MAX_PATH];
-
-    memset(&options, 0, sizeof(JavaVMOption)*MAX_OPTIONS);
-    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 application specific 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) {
-          //jvmOption is always a new string via strdup
-          char* jvmOption = dupAndReplacePattern(argvalue, "$APPDIR", basedir);
-          if (jvmOption != NULL) {
-            options[cnt].optionString = jvmOption;
-            cnt++;
-          }
-          idx++;
-       }
-    } while (found && cnt < MAX_OPTIONS);
-    
-    cnt = addUserOptions(basedir, options, cnt);
-    
-    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/modules/fxpackager/src/main/native/launcher/linux/launcher.cpp	Wed Sep 10 11:31:04 2014 -0600
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates.
+ * All rights reserved. Use is subject to license terms.
+ *
+ * This file is available and licensed under the following license:
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the distribution.
+ *  - Neither the name of Oracle Corporation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+#include <dlfcn.h>
+#include <locale.h>
+#include <string>
+#include <libgen.h>
+#include <stdio.h>
+
+
+typedef bool (*start_launcher)(int argc, char* argv[]);
+typedef void (*stop_launcher)();
+
+int main(int argc, char *argv[]) {
+    int result = 1;
+    setlocale(LC_ALL, "en_US.utf8");
+    void* library = NULL;
+    
+    {
+        std::string libraryName = dirname(argv[0]);
+        libraryName += "/libpackager.so";
+        library = dlopen(libraryName.c_str(), RTLD_LAZY);
+        
+        if (library == NULL) {
+            printf("%s not found.\n", libraryName.c_str());
+        }
+    }
+    
+    if (library != NULL) {
+        start_launcher start = (start_launcher)dlsym(library, "start_launcher");
+        stop_launcher stop = (stop_launcher)dlsym(library, "stop_launcher");
+
+        if (start(argc, argv) == true) {
+            result = 0;
+            stop();
+        }
+
+        dlclose(library);
+    }
+
+    
+    return result;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/fxpackager/src/main/native/launcher/linux/test/CppApplication_1/.dep.inc	Wed Sep 10 11:31:04 2014 -0600
@@ -0,0 +1,5 @@
+# This code depends on make tool being used
+DEPFILES=$(wildcard $(addsuffix .d, ${OBJECTFILES}))
+ifneq (${DEPFILES},)
+include ${DEPFILES}
+endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/fxpackager/src/main/native/launcher/linux/test/CppApplication_1/Makefile	Wed Sep 10 11:31:04 2014 -0600
@@ -0,0 +1,128 @@
+#
+#  There exist several targets which are by default empty and which can be 
+#  used for execution of your targets. These targets are usually executed 
+#  before and after some main targets. They are: 
+#
+#     .build-pre:              called before 'build' target
+#     .build-post:             called after 'build' target
+#     .clean-pre:              called before 'clean' target
+#     .clean-post:             called after 'clean' target
+#     .clobber-pre:            called before 'clobber' target
+#     .clobber-post:           called after 'clobber' target
+#     .all-pre:                called before 'all' target
+#     .all-post:               called after 'all' target
+#     .help-pre:               called before 'help' target
+#     .help-post:              called after 'help' target
+#
+#  Targets beginning with '.' are not intended to be called on their own.
+#
+#  Main targets can be executed directly, and they are:
+#  
+#     build                    build a specific configuration
+#     clean                    remove built files from a configuration
+#     clobber                  remove all built files
+#     all                      build all configurations
+#     help                     print help mesage
+#  
+#  Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
+#  .help-impl are implemented in nbproject/makefile-impl.mk.
+#
+#  Available make variables:
+#
+#     CND_BASEDIR                base directory for relative paths
+#     CND_DISTDIR                default top distribution directory (build artifacts)
+#     CND_BUILDDIR               default top build directory (object files, ...)
+#     CONF                       name of current configuration
+#     CND_PLATFORM_${CONF}       platform name (current configuration)
+#     CND_ARTIFACT_DIR_${CONF}   directory of build artifact (current configuration)
+#     CND_ARTIFACT_NAME_${CONF}  name of build artifact (current configuration)
+#     CND_ARTIFACT_PATH_${CONF}  path to build artifact (current configuration)
+#     CND_PACKAGE_DIR_${CONF}    directory of package (current configuration)
+#     CND_PACKAGE_NAME_${CONF}   name of package (current configuration)
+#     CND_PACKAGE_PATH_${CONF}   path to package (current configuration)
+#
+# NOCDDL
+
+
+# Environment 
+MKDIR=mkdir
+CP=cp
+CCADMIN=CCadmin
+
+
+# build
+build: .build-post
+
+.build-pre:
+# Add your pre 'build' code here...
+
+.build-post: .build-impl
+# Add your post 'build' code here...
+
+
+# clean
+clean: .clean-post
+
+.clean-pre:
+# Add your pre 'clean' code here...
+
+.clean-post: .clean-impl
+# Add your post 'clean' code here...
+
+
+# clobber
+clobber: .clobber-post
+
+.clobber-pre:
+# Add your pre 'clobber' code here...
+
+.clobber-post: .clobber-impl
+# Add your post 'clobber' code here...
+
+
+# all
+all: .all-post
+
+.all-pre:
+# Add your pre 'all' code here...
+
+.all-post: .all-impl
+# Add your post 'all' code here...
+
+
+# build tests
+build-tests: .build-tests-post
+
+.build-tests-pre:
+# Add your pre 'build-tests' code here...
+
+.build-tests-post: .build-tests-impl
+# Add your post 'build-tests' code here...
+
+
+# run tests
+test: .test-post
+
+.test-pre: build-tests
+# Add your pre 'test' code here...
+
+.test-post: .test-impl
+# Add your post 'test' code here...
+
+
+# help
+help: .help-post
+
+.help-pre:
+# Add your pre 'help' code here...
+
+.help-post: .help-impl
+# Add your post 'help' code here...
+
+
+
+# include project implementation makefile
+include nbproject/Makefile-impl.mk
+
+# include project make variables
+include nbproject/Makefile-variables.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/fxpackager/src/main/native/launcher/linux/test/CppApplication_1/nbproject/Makefile-Debug.mk	Wed Sep 10 11:31:04 2014 -0600
@@ -0,0 +1,198 @@
+#
+# Generated Makefile - do not edit!
+#
+# Edit the Makefile in the project folder instead (../Makefile). Each target
+# has a -pre and a -post target defined where you can add customized code.
+#
+# This makefile implements configuration specific macros and targets.
+
+
+# Environment
+MKDIR=mkdir
+CP=cp
+GREP=grep
+NM=nm
+CCADMIN=CCadmin
+RANLIB=ranlib
+CC=gcc
+CCC=g++
+CXX=g++
+FC=gfortran
+AS=as
+
+# Macros
+CND_PLATFORM=GNU-Linux-x86
+CND_DLIB_EXT=so
+CND_CONF=Debug
+CND_DISTDIR=dist
+CND_BUILDDIR=build
+
+# Include project Makefile
+include Makefile
+
+# Object Directory
+OBJECTDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}
+
+# Object Files
+OBJECTFILES= \
+	${OBJECTDIR}/_ext/1944146143/Exports.o \
+	${OBJECTDIR}/_ext/1944146143/FilePath.o \
+	${OBJECTDIR}/_ext/1944146143/GenericPlatform.o \
+	${OBJECTDIR}/_ext/1944146143/Helpers.o \
+	${OBJECTDIR}/_ext/1944146143/Java.o \
+	${OBJECTDIR}/_ext/1944146143/JavaUserPreferences.o \
+	${OBJECTDIR}/_ext/1944146143/JavaVirtualMachine.o \
+	${OBJECTDIR}/_ext/1944146143/LinuxPlatform.o \
+	${OBJECTDIR}/_ext/1944146143/Lock.o \
+	${OBJECTDIR}/_ext/1944146143/Macros.o \
+	${OBJECTDIR}/_ext/1944146143/Messages.o \
+	${OBJECTDIR}/_ext/1944146143/Package.o \
+	${OBJECTDIR}/_ext/1944146143/Platform.o \
+	${OBJECTDIR}/_ext/1944146143/PlatformString.o \
+	${OBJECTDIR}/_ext/1944146143/PlatformThread.o \
+	${OBJECTDIR}/_ext/1944146143/PosixPlatform.o \
+	${OBJECTDIR}/_ext/1944146143/PropertyFile.o \
+	${OBJECTDIR}/_ext/1944146143/WinLauncher.o \
+	${OBJECTDIR}/_ext/1944146143/WindowsPlatform.o \
+	${OBJECTDIR}/main.o
+
+
+# C Compiler Flags
+CFLAGS=
+
+# CC Compiler Flags
+CCFLAGS=
+CXXFLAGS=
+
+# Fortran Compiler Flags
+FFLAGS=
+
+# Assembler Flags
+ASFLAGS=
+
+# Link Libraries and Options
+LDLIBSOPTIONS=-lpthread -ldl
+
+# Build Targets
+.build-conf: ${BUILD_SUBPROJECTS}
+	"${MAKE}"  -f nbproject/Makefile-${CND_CONF}.mk /home/cbensen/src/projects/packager/JavaFXSceneBuilder2.0/launcher
+
+/home/cbensen/src/projects/packager/JavaFXSceneBuilder2.0/launcher: ${OBJECTFILES}
+	${MKDIR} -p /home/cbensen/src/projects/packager/JavaFXSceneBuilder2.0
+	${LINK.cc} -o /home/cbensen/src/projects/packager/JavaFXSceneBuilder2.0/launcher ${OBJECTFILES} ${LDLIBSOPTIONS}
+
+${OBJECTDIR}/_ext/1944146143/Exports.o: ../../../win/windows/Exports.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -g -I/home/cbensen/java/jdk1.8.0/include -I/home/cbensen/java/jdk1.8.0/include/linux -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/Exports.o ../../../win/windows/Exports.cpp
+
+${OBJECTDIR}/_ext/1944146143/FilePath.o: ../../../win/windows/FilePath.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -g -I/home/cbensen/java/jdk1.8.0/include -I/home/cbensen/java/jdk1.8.0/include/linux -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/FilePath.o ../../../win/windows/FilePath.cpp
+
+${OBJECTDIR}/_ext/1944146143/GenericPlatform.o: ../../../win/windows/GenericPlatform.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -g -I/home/cbensen/java/jdk1.8.0/include -I/home/cbensen/java/jdk1.8.0/include/linux -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/GenericPlatform.o ../../../win/windows/GenericPlatform.cpp
+
+${OBJECTDIR}/_ext/1944146143/Helpers.o: ../../../win/windows/Helpers.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -g -I/home/cbensen/java/jdk1.8.0/include -I/home/cbensen/java/jdk1.8.0/include/linux -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/Helpers.o ../../../win/windows/Helpers.cpp
+
+${OBJECTDIR}/_ext/1944146143/Java.o: ../../../win/windows/Java.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -g -I/home/cbensen/java/jdk1.8.0/include -I/home/cbensen/java/jdk1.8.0/include/linux -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/Java.o ../../../win/windows/Java.cpp
+
+${OBJECTDIR}/_ext/1944146143/JavaUserPreferences.o: ../../../win/windows/JavaUserPreferences.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -g -I/home/cbensen/java/jdk1.8.0/include -I/home/cbensen/java/jdk1.8.0/include/linux -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/JavaUserPreferences.o ../../../win/windows/JavaUserPreferences.cpp
+
+${OBJECTDIR}/_ext/1944146143/JavaVirtualMachine.o: ../../../win/windows/JavaVirtualMachine.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -g -I/home/cbensen/java/jdk1.8.0/include -I/home/cbensen/java/jdk1.8.0/include/linux -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/JavaVirtualMachine.o ../../../win/windows/JavaVirtualMachine.cpp
+
+${OBJECTDIR}/_ext/1944146143/LinuxPlatform.o: ../../../win/windows/LinuxPlatform.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -g -I/home/cbensen/java/jdk1.8.0/include -I/home/cbensen/java/jdk1.8.0/include/linux -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/LinuxPlatform.o ../../../win/windows/LinuxPlatform.cpp
+
+${OBJECTDIR}/_ext/1944146143/Lock.o: ../../../win/windows/Lock.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -g -I/home/cbensen/java/jdk1.8.0/include -I/home/cbensen/java/jdk1.8.0/include/linux -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/Lock.o ../../../win/windows/Lock.cpp
+
+${OBJECTDIR}/_ext/1944146143/Macros.o: ../../../win/windows/Macros.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -g -I/home/cbensen/java/jdk1.8.0/include -I/home/cbensen/java/jdk1.8.0/include/linux -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/Macros.o ../../../win/windows/Macros.cpp
+
+${OBJECTDIR}/_ext/1944146143/Messages.o: ../../../win/windows/Messages.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -g -I/home/cbensen/java/jdk1.8.0/include -I/home/cbensen/java/jdk1.8.0/include/linux -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/Messages.o ../../../win/windows/Messages.cpp
+
+${OBJECTDIR}/_ext/1944146143/Package.o: ../../../win/windows/Package.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -g -I/home/cbensen/java/jdk1.8.0/include -I/home/cbensen/java/jdk1.8.0/include/linux -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/Package.o ../../../win/windows/Package.cpp
+
+${OBJECTDIR}/_ext/1944146143/Platform.o: ../../../win/windows/Platform.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -g -I/home/cbensen/java/jdk1.8.0/include -I/home/cbensen/java/jdk1.8.0/include/linux -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/Platform.o ../../../win/windows/Platform.cpp
+
+${OBJECTDIR}/_ext/1944146143/PlatformString.o: ../../../win/windows/PlatformString.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -g -I/home/cbensen/java/jdk1.8.0/include -I/home/cbensen/java/jdk1.8.0/include/linux -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/PlatformString.o ../../../win/windows/PlatformString.cpp
+
+${OBJECTDIR}/_ext/1944146143/PlatformThread.o: ../../../win/windows/PlatformThread.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -g -I/home/cbensen/java/jdk1.8.0/include -I/home/cbensen/java/jdk1.8.0/include/linux -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/PlatformThread.o ../../../win/windows/PlatformThread.cpp
+
+${OBJECTDIR}/_ext/1944146143/PosixPlatform.o: ../../../win/windows/PosixPlatform.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -g -I/home/cbensen/java/jdk1.8.0/include -I/home/cbensen/java/jdk1.8.0/include/linux -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/PosixPlatform.o ../../../win/windows/PosixPlatform.cpp
+
+${OBJECTDIR}/_ext/1944146143/PropertyFile.o: ../../../win/windows/PropertyFile.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -g -I/home/cbensen/java/jdk1.8.0/include -I/home/cbensen/java/jdk1.8.0/include/linux -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/PropertyFile.o ../../../win/windows/PropertyFile.cpp
+
+${OBJECTDIR}/_ext/1944146143/WinLauncher.o: ../../../win/windows/WinLauncher.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -g -I/home/cbensen/java/jdk1.8.0/include -I/home/cbensen/java/jdk1.8.0/include/linux -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/WinLauncher.o ../../../win/windows/WinLauncher.cpp
+
+${OBJECTDIR}/_ext/1944146143/WindowsPlatform.o: ../../../win/windows/WindowsPlatform.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -g -I/home/cbensen/java/jdk1.8.0/include -I/home/cbensen/java/jdk1.8.0/include/linux -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/WindowsPlatform.o ../../../win/windows/WindowsPlatform.cpp
+
+${OBJECTDIR}/main.o: main.cpp 
+	${MKDIR} -p ${OBJECTDIR}
+	${RM} "$@.d"
+	$(COMPILE.cc) -g -I/home/cbensen/java/jdk1.8.0/include -I/home/cbensen/java/jdk1.8.0/include/linux -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/main.o main.cpp
+
+# Subprojects
+.build-subprojects:
+
+# Clean Targets
+.clean-conf: ${CLEAN_SUBPROJECTS}
+	${RM} -r ${CND_BUILDDIR}/${CND_CONF}
+	${RM} /home/cbensen/src/projects/packager/JavaFXSceneBuilder2.0/launcher
+
+# Subprojects
+.clean-subprojects:
+
+# Enable dependency checking
+.dep.inc: .depcheck-impl
+
+include .dep.inc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/fxpackager/src/main/native/launcher/linux/test/CppApplication_1/nbproject/Makefile-Release.mk	Wed Sep 10 11:31:04 2014 -0600
@@ -0,0 +1,198 @@
+#
+# Generated Makefile - do not edit!
+#
+# Edit the Makefile in the project folder instead (../Makefile). Each target
+# has a -pre and a -post target defined where you can add customized code.
+#
+# This makefile implements configuration specific macros and targets.
+
+
+# Environment
+MKDIR=mkdir
+CP=cp
+GREP=grep
+NM=nm
+CCADMIN=CCadmin
+RANLIB=ranlib
+CC=gcc
+CCC=g++
+CXX=g++
+FC=gfortran
+AS=as
+
+# Macros
+CND_PLATFORM=GNU-Linux-x86
+CND_DLIB_EXT=so
+CND_CONF=Release
+CND_DISTDIR=dist
+CND_BUILDDIR=build
+
+# Include project Makefile
+include Makefile
+
+# Object Directory
+OBJECTDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}
+
+# Object Files
+OBJECTFILES= \
+	${OBJECTDIR}/_ext/1944146143/Exports.o \
+	${OBJECTDIR}/_ext/1944146143/FilePath.o \
+	${OBJECTDIR}/_ext/1944146143/GenericPlatform.o \
+	${OBJECTDIR}/_ext/1944146143/Helpers.o \
+	${OBJECTDIR}/_ext/1944146143/Java.o \
+	${OBJECTDIR}/_ext/1944146143/JavaUserPreferences.o \
+	${OBJECTDIR}/_ext/1944146143/JavaVirtualMachine.o \
+	${OBJECTDIR}/_ext/1944146143/LinuxPlatform.o \
+	${OBJECTDIR}/_ext/1944146143/Lock.o \
+	${OBJECTDIR}/_ext/1944146143/Macros.o \
+	${OBJECTDIR}/_ext/1944146143/Messages.o \
+	${OBJECTDIR}/_ext/1944146143/Package.o \
+	${OBJECTDIR}/_ext/1944146143/Platform.o \
+	${OBJECTDIR}/_ext/1944146143/PlatformString.o \
+	${OBJECTDIR}/_ext/1944146143/PlatformThread.o \
+	${OBJECTDIR}/_ext/1944146143/PosixPlatform.o \
+	${OBJECTDIR}/_ext/1944146143/PropertyFile.o \
+	${OBJECTDIR}/_ext/1944146143/WinLauncher.o \
+	${OBJECTDIR}/_ext/1944146143/WindowsPlatform.o \
+	${OBJECTDIR}/main.o
+
+
+# C Compiler Flags
+CFLAGS=
+
+# CC Compiler Flags
+CCFLAGS=
+CXXFLAGS=
+
+# Fortran Compiler Flags
+FFLAGS=
+
+# Assembler Flags
+ASFLAGS=
+
+# Link Libraries and Options
+LDLIBSOPTIONS=
+
+# Build Targets
+.build-conf: ${BUILD_SUBPROJECTS}
+	"${MAKE}"  -f nbproject/Makefile-${CND_CONF}.mk ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/cppapplication_1
+
+${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/cppapplication_1: ${OBJECTFILES}
+	${MKDIR} -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}
+	${LINK.cc} -o ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/cppapplication_1 ${OBJECTFILES} ${LDLIBSOPTIONS}
+
+${OBJECTDIR}/_ext/1944146143/Exports.o: ../../../win/windows/Exports.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/Exports.o ../../../win/windows/Exports.cpp
+
+${OBJECTDIR}/_ext/1944146143/FilePath.o: ../../../win/windows/FilePath.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/FilePath.o ../../../win/windows/FilePath.cpp
+
+${OBJECTDIR}/_ext/1944146143/GenericPlatform.o: ../../../win/windows/GenericPlatform.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/GenericPlatform.o ../../../win/windows/GenericPlatform.cpp
+
+${OBJECTDIR}/_ext/1944146143/Helpers.o: ../../../win/windows/Helpers.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/Helpers.o ../../../win/windows/Helpers.cpp
+
+${OBJECTDIR}/_ext/1944146143/Java.o: ../../../win/windows/Java.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/Java.o ../../../win/windows/Java.cpp
+
+${OBJECTDIR}/_ext/1944146143/JavaUserPreferences.o: ../../../win/windows/JavaUserPreferences.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/JavaUserPreferences.o ../../../win/windows/JavaUserPreferences.cpp
+
+${OBJECTDIR}/_ext/1944146143/JavaVirtualMachine.o: ../../../win/windows/JavaVirtualMachine.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/JavaVirtualMachine.o ../../../win/windows/JavaVirtualMachine.cpp
+
+${OBJECTDIR}/_ext/1944146143/LinuxPlatform.o: ../../../win/windows/LinuxPlatform.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/LinuxPlatform.o ../../../win/windows/LinuxPlatform.cpp
+
+${OBJECTDIR}/_ext/1944146143/Lock.o: ../../../win/windows/Lock.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/Lock.o ../../../win/windows/Lock.cpp
+
+${OBJECTDIR}/_ext/1944146143/Macros.o: ../../../win/windows/Macros.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/Macros.o ../../../win/windows/Macros.cpp
+
+${OBJECTDIR}/_ext/1944146143/Messages.o: ../../../win/windows/Messages.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/Messages.o ../../../win/windows/Messages.cpp
+
+${OBJECTDIR}/_ext/1944146143/Package.o: ../../../win/windows/Package.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/Package.o ../../../win/windows/Package.cpp
+
+${OBJECTDIR}/_ext/1944146143/Platform.o: ../../../win/windows/Platform.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/Platform.o ../../../win/windows/Platform.cpp
+
+${OBJECTDIR}/_ext/1944146143/PlatformString.o: ../../../win/windows/PlatformString.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/PlatformString.o ../../../win/windows/PlatformString.cpp
+
+${OBJECTDIR}/_ext/1944146143/PlatformThread.o: ../../../win/windows/PlatformThread.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/PlatformThread.o ../../../win/windows/PlatformThread.cpp
+
+${OBJECTDIR}/_ext/1944146143/PosixPlatform.o: ../../../win/windows/PosixPlatform.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/PosixPlatform.o ../../../win/windows/PosixPlatform.cpp
+
+${OBJECTDIR}/_ext/1944146143/PropertyFile.o: ../../../win/windows/PropertyFile.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/PropertyFile.o ../../../win/windows/PropertyFile.cpp
+
+${OBJECTDIR}/_ext/1944146143/WinLauncher.o: ../../../win/windows/WinLauncher.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/WinLauncher.o ../../../win/windows/WinLauncher.cpp
+
+${OBJECTDIR}/_ext/1944146143/WindowsPlatform.o: ../../../win/windows/WindowsPlatform.cpp 
+	${MKDIR} -p ${OBJECTDIR}/_ext/1944146143
+	${RM} "$@.d"
+	$(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/1944146143/WindowsPlatform.o ../../../win/windows/WindowsPlatform.cpp
+
+${OBJECTDIR}/main.o: main.cpp 
+	${MKDIR} -p ${OBJECTDIR}
+	${RM} "$@.d"
+	$(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/main.o main.cpp
+
+# Subprojects
+.build-subprojects:
+
+# Clean Targets
+.clean-conf: ${CLEAN_SUBPROJECTS}
+	${RM} -r ${CND_BUILDDIR}/${CND_CONF}
+	${RM} ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/cppapplication_1
+
+# Subprojects
+.clean-subprojects:
+
+# Enable dependency checking
+.dep.inc: .depcheck-impl
+
+include .dep.inc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/fxpackager/src/main/native/launcher/linux/test/CppApplication_1/nbproject/Makefile-impl.mk	Wed Sep 10 11:31:04 2014 -0600
@@ -0,0 +1,133 @@
+# 
+# Generated Makefile - do not edit! 
+# 
+# Edit the Makefile in the project folder instead (../Makefile). Each target
+# has a pre- and a post- target defined where you can add customization code.
+#
+# This makefile implements macros and targets common to all configurations.
+#
+# NOCDDL
+
+
+# Building and Cleaning subprojects are done by default, but can be controlled with the SUB
+# macro. If SUB=no, subprojects will not be built or cleaned. The following macro
+# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf
+# and .clean-reqprojects-conf unless SUB has the value 'no'
+SUB_no=NO
+SUBPROJECTS=${SUB_${SUB}}
+BUILD_SUBPROJECTS_=.build-subprojects
+BUILD_SUBPROJECTS_NO=
+BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}}
+CLEAN_SUBPROJECTS_=.clean-subprojects
+CLEAN_SUBPROJECTS_NO=
+CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}}
+
+
+# Project Name
+PROJECTNAME=CppApplication_1
+
+# Active Configuration
+DEFAULTCONF=Debug
+CONF=${DEFAULTCONF}
+
+# All Configurations
+ALLCONFS=Debug Release 
+
+
+# build
+.build-impl: .build-pre .validate-impl .depcheck-impl
+	@#echo "=> Running $@... Configuration=$(CONF)"
+	"${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf
+
+
+# clean
+.clean-impl: .clean-pre .validate-impl .depcheck-impl
+	@#echo "=> Running $@... Configuration=$(CONF)"
+	"${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf
+
+
+# clobber 
+.clobber-impl: .clobber-pre .depcheck-impl
+	@#echo "=> Running $@..."
+	for CONF in ${ALLCONFS}; \
+	do \
+	    "${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf; \
+	done
+
+# all 
+.all-impl: .all-pre .depcheck-impl
+	@#echo "=> Running $@..."
+	for CONF in ${ALLCONFS}; \
+	do \
+	    "${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf; \
+	done
+
+# build tests
+.build-tests-impl: .build-impl .build-tests-pre
+	@#echo "=> Running $@... Configuration=$(CONF)"
+	"${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-tests-conf
+
+# run tests
+.test-impl: .build-tests-impl .test-pre
+	@#echo "=> Running $@... Configuration=$(CONF)"
+	"${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .test-conf
+
+# dependency checking support
+.depcheck-impl:
+	@echo "# This code depends on make tool being used" >.dep.inc
+	@if [ -n "${MAKE_VERSION}" ]; then \
+	    echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES}))" >>.dep.inc; \
+	    echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \
+	    echo "include \$${DEPFILES}" >>.dep.inc; \
+	    echo "endif" >>.dep.inc; \
+	else \
+	    echo ".KEEP_STATE:" >>.dep.inc; \
+	    echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \
+	fi
+
+# configuration validation
+.validate-impl:
+	@if [ ! -f nbproject/Makefile-${CONF}.mk ]; \
+	then \
+	    echo ""; \
+	    echo "Error: can not find the makefile for configuration '${CONF}' in project ${PROJECTNAME}"; \
+	    echo "See 'make help' for details."; \
+	    echo "Current directory: " `pwd`; \
+	    echo ""; \
+	fi
+	@if [ ! -f nbproject/Makefile-${CONF}.mk ]; \
+	then \
+	    exit 1; \
+	fi
+
+
+# help
+.help-impl: .help-pre
+	@echo "This makefile supports the following configurations:"
+	@echo "    ${ALLCONFS}"
+	@echo ""
+	@echo "and the following targets:"
+	@echo "    build  (default target)"
+	@echo "    clean"
+	@echo "    clobber"
+	@echo "    all"
+	@echo "    help"
+	@echo ""
+	@echo "Makefile Usage:"
+	@echo "    make [CONF=<CONFIGURATION>] [SUB=no] build"
+	@echo "    make [CONF=<CONFIGURATION>] [SUB=no] clean"
+	@echo "    make [SUB=no] clobber"
+	@echo "    make [SUB=no] all"
+	@echo "    make help"
+	@echo ""
+	@echo "Target 'build' will build a specific configuration and, unless 'SUB=no',"
+	@echo "    also build subprojects."
+	@echo "Target 'clean' will clean a specific configuration and, unless 'SUB=no',"
+	@echo "    also clean subprojects."
+	@echo "Target 'clobber' will remove all built files from all configurations and,"
+	@echo "    unless 'SUB=no', also from subprojects."
+	@echo "Target 'all' will will build all configurations and, unless 'SUB=no',"
+	@echo "    also build subprojects."
+	@echo "Target 'help' prints this message."
+	@echo ""
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/fxpackager/src/main/native/launcher/linux/test/CppApplication_1/nbproject/Makefile-variables.mk	Wed Sep 10 11:31:04 2014 -0600
@@ -0,0 +1,35 @@
+#
+# Generated - do not edit!
+#
+# NOCDDL
+#
+CND_BASEDIR=`pwd`
+CND_BUILDDIR=build
+CND_DISTDIR=dist
+# Debug configuration
+CND_PLATFORM_Debug=GNU-Linux-x86
+CND_ARTIFACT_DIR_Debug=/home/cbensen/src/projects/packager/JavaFXSceneBuilder2.0
+CND_ARTIFACT_NAME_Debug=launcher
+CND_ARTIFACT_PATH_Debug=/home/cbensen/src/projects/packager/JavaFXSceneBuilder2.0/launcher
+CND_PACKAGE_DIR_Debug=dist/Debug/GNU-Linux-x86/package
+CND_PACKAGE_NAME_Debug=cppapplication1.tar
+CND_PACKAGE_PATH_Debug=dist/Debug/GNU-Linux-x86/package/cppapplication1.tar
+# Release configuration
+CND_PLATFORM_Release=GNU-Linux-x86
+CND_ARTIFACT_DIR_Release=dist/Release/GNU-Linux-x86
+CND_ARTIFACT_NAME_Release=cppapplication_1
+CND_ARTIFACT_PATH_Release=dist/Release/GNU-Linux-x86/cppapplication_1
+CND_PACKAGE_DIR_Release=dist/Release/GNU-Linux-x86/package
+CND_PACKAGE_NAME_Release=cppapplication1.tar
+CND_PACKAGE_PATH_Release=dist/Release/GNU-Linux-x86/package/cppapplication1.tar
+#
+# include compiler specific variables
+#
+# dmake command
+ROOT:sh = test -f nbproject/private/Makefile-variables.mk || \
+	(mkdir -p nbproject/private && touch nbproject/private/Makefile-variables.mk)
+#
+# gmake command
+.PHONY: $(shell test -f nbproject/private/Makefile-variables.mk || (mkdir -p nbproject/private && touch nbproject/private/Makefile-variables.mk))
+#
+include nbproject/private/Makefile-variables.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/fxpackager/src/main/native/launcher/linux/test/CppApplication_1/nbproject/Package-Debug.bash	Wed Sep 10 11:31:04 2014 -0600
@@ -0,0 +1,76 @@
+#!/bin/bash -x
+
+#
+# Generated - do not edit!
+#
+
+# Macros
+TOP=`pwd`
+CND_PLATFORM=GNU-Linux-x86
+CND_CONF=Debug
+CND_DISTDIR=dist
+CND_BUILDDIR=build
+CND_DLIB_EXT=so
+NBTMPDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
+TMPDIRNAME=tmp-packaging
+OUTPUT_PATH=/home/cbensen/src/projects/packager/JavaFXSceneBuilder2.0/launcher
+OUTPUT_BASENAME=launcher
+PACKAGE_TOP_DIR=cppapplication1/
+
+# Functions
+function checkReturnCode
+{
+    rc=$?
+    if [ $rc != 0 ]
+    then
+        exit $rc
+    fi
+}
+function makeDirectory
+# $1 directory path
+# $2 permission (optional)
+{
+    mkdir -p "$1"
+    checkReturnCode
+    if [ "$2" != "" ]
+    then
+      chmod $2 "$1"
+      checkReturnCode
+    fi
+}
+function copyFileToTmpDir
+# $1 from-file path
+# $2 to-file path
+# $3 permission
+{
+    cp "$1" "$2"
+    checkReturnCode
+    if [ "$3" != "" ]
+    then
+        chmod $3 "$2"
+        checkReturnCode
+    fi
+}
+
+# Setup
+cd "${TOP}"
+mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
+rm -rf ${NBTMPDIR}
+mkdir -p ${NBTMPDIR}
+
+# Copy files and create directories and links
+cd "${TOP}"
+makeDirectory "${NBTMPDIR}/cppapplication1/bin"
+copyFileToTmpDir "${OUTPUT_PATH}" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755
+
+
+# Generate tar file
+cd "${TOP}"
+rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/cppapplication1.tar
+cd ${NBTMPDIR}
+tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/cppapplication1.tar *
+checkReturnCode
+
+# Cleanup
+cd "${TOP}"
+rm -rf ${NBTMPDIR}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/fxpackager/src/main/native/launcher/linux/test/CppApplication_1/nbproject/Package-Release.bash	Wed Sep 10 11:31:04 2014 -0600
@@ -0,0 +1,76 @@
+#!/bin/bash -x
+
+#
+# Generated - do not edit!
+#
+
+# Macros
+TOP=`pwd`
+CND_PLATFORM=GNU-Linux-x86
+CND_CONF=Release
+CND_DISTDIR=dist
+CND_BUILDDIR=build
+CND_DLIB_EXT=so
+NBTMPDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
+TMPDIRNAME=tmp-packaging
+OUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/cppapplication_1
+OUTPUT_BASENAME=cppapplication_1
+PACKAGE_TOP_DIR=cppapplication1/
+
+# Functions
+function checkReturnCode
+{
+    rc=$?
+    if [ $rc != 0 ]
+    then
+        exit $rc
+    fi
+}
+function makeDirectory
+# $1 directory path
+# $2 permission (optional)
+{
+    mkdir -p "$1"
+    checkReturnCode
+    if [ "$2" != "" ]
+    then
+      chmod $2 "$1"
+      checkReturnCode
+    fi
+}
+function copyFileToTmpDir
+# $1 from-file path
+# $2 to-file path
+# $3 permission
+{
+    cp "$1" "$2"
+    checkReturnCode
+    if [ "$3" != "" ]
+    then
+        chmod $3 "$2"
+        checkReturnCode
+    fi
+}
+
+# Setup
+cd "${TOP}"
+mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
+rm -rf ${NBTMPDIR}
+mkdir -p ${NBTMPDIR}
+
+# Copy files and create directories and links
+cd "${TOP}"
+makeDirectory "${NBTMPDIR}/cppapplication1/bin"
+copyFileToTmpDir "${OUTPUT_PATH}" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755
+
+
+# Generate tar file
+cd "${TOP}"
+rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/cppapplication1.tar
+cd ${NBTMPDIR}
+tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/cppapplication1.tar *
+checkReturnCode
+
+# Cleanup
+cd "${TOP}"
+rm -rf ${NBTMPDIR}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/fxpackager/src/main/native/launcher/linux/test/CppApplication_1/nbproject/configurations.xml	Wed Sep 10 11:31:04 2014 -0600
@@ -0,0 +1,400 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configurationDescriptor version="94">
+  <logicalFolder name="root" displayName="root" projectFiles="true" kind="ROOT">
+    <logicalFolder name="HeaderFiles"
+                   displayName="Header Files"
+                   projectFiles="true">
+    </logicalFolder>
+    <logicalFolder name="ResourceFiles"
+                   displayName="Resource Files"
+                   projectFiles="true">
+    </logicalFolder>
+    <logicalFolder name="SourceFiles"
+                   displayName="Source Files"
+                   projectFiles="true">
+      <itemPath>main.cpp</itemPath>
+    </logicalFolder>
+    <logicalFolder name="TestFiles"
+                   displayName="Test Files"
+                   projectFiles="false"
+                   kind="TEST_LOGICAL_FOLDER">
+    </logicalFolder>
+    <logicalFolder name="ExternalFiles"
+                   displayName="Important Files"
+                   projectFiles="false"
+                   kind="IMPORTANT_FILES_FOLDER">
+      <itemPath>Makefile</itemPath>
+    </logicalFolder>
+    <logicalFolder name="TestFiles"
+                   displayName="Test Files"
+                   projectFiles="false"
+                   kind="TEST_LOGICAL_FOLDER">
+    </logicalFolder>
+    <logicalFolder name="ExternalFiles"
+                   displayName="Important Files"
+                   projectFiles="false"
+                   kind="IMPORTANT_FILES_FOLDER">
+      <itemPath>Makefile</itemPath>
+    </logicalFolder>
+    <itemPath>../../../win/windows/Exports.cpp</itemPath>
+    <itemPath>../../../win/windows/Exports.h</itemPath>
+    <itemPath>../../../win/windows/FilePath.cpp</itemPath>
+    <itemPath>../../../win/windows/FilePath.h</itemPath>
+    <itemPath>../../../win/windows/GenericPlatform.cpp</itemPath>
+    <itemPath>../../../win/windows/GenericPlatform.h</itemPath>
+    <itemPath>../../../win/windows/Helpers.cpp</itemPath>
+    <itemPath>../../../win/windows/Helpers.h</itemPath>
+    <itemPath>../../../win/windows/Java.cpp</itemPath>
+    <itemPath>../../../win/windows/Java.h</itemPath>
+    <itemPath>../../../win/windows/JavaUserPreferences.cpp</itemPath>
+    <itemPath>../../../win/windows/JavaUserPreferences.h</itemPath>
+    <itemPath>../../../win/windows/JavaVirtualMachine.cpp</itemPath>
+    <itemPath>../../../win/windows/JavaVirtualMachine.h</itemPath>
+    <itemPath>../../../win/windows/LinuxPlatform.cpp</itemPath>
+    <itemPath>../../../win/windows/LinuxPlatform.h</itemPath>
+    <itemPath>../../../win/windows/Lock.cpp</itemPath>
+    <itemPath>../../../win/windows/Lock.h</itemPath>
+    <itemPath>../../../win/windows/MacPlatform.h</itemPath>
+    <itemPath>../../../win/windows/MacPlatform.mm</itemPath>
+    <itemPath>../../../win/windows/Macros.cpp</itemPath>
+    <itemPath>../../../win/windows/Macros.h</itemPath>
+    <itemPath>../../../win/windows/Messages.cpp</itemPath>
+    <itemPath>../../../win/windows/Messages.h</itemPath>
+    <itemPath>../../../win/windows/Package.cpp</itemPath>
+    <itemPath>../../../win/windows/Package.h</itemPath>
+    <itemPath>../../../win/windows/Platform.cpp</itemPath>
+    <itemPath>../../../win/windows/Platform.h</itemPath>
+    <itemPath>../../../win/windows/PlatformString.cpp</itemPath>
+    <itemPath>../../../win/windows/PlatformString.h</itemPath>
+    <itemPath>../../../win/windows/PlatformThread.cpp</itemPath>
+    <itemPath>../../../win/windows/PlatformThread.h</itemPath>
+    <itemPath>../../../win/windows/PosixPlatform.cpp</itemPath>
+    <itemPath>../../../win/windows/PosixPlatform.h</itemPath>
+    <itemPath>../../../win/windows/PropertyFile.cpp</itemPath>
+    <itemPath>../../../win/windows/PropertyFile.h</itemPath>
+    <itemPath>../../../win/windows/WinLauncher.cpp</itemPath>
+    <itemPath>../../../win/windows/WindowsPlatform.cpp</itemPath>
+    <itemPath>../../../win/windows/WindowsPlatform.h</itemPath>
+    <itemPath>../../../../library/linux/xmlparser.h</itemPath>
+  </logicalFolder>
+  <sourceRootList>
+    <Elem>../../../win/windows/launcher</Elem>
+    <Elem>../../../win/windows/launcher</Elem>
+  </sourceRootList>
+  <projectmakefile>Makefile</projectmakefile>
+  <confs>
+    <conf name="Debug" type="1">
+      <toolsSet>
+        <compilerSet>default</compilerSet>
+        <dependencyChecking>true</dependencyChecking>
+        <rebuildPropChanged>false</rebuildPropChanged>
+      </toolsSet>
+      <compileType>
+        <ccTool>
+          <incDir>
+            <pElem>/home/cbensen/java/jdk1.8.0/include</pElem>
+            <pElem>/home/cbensen/java/jdk1.8.0/include/linux</pElem>
+          </incDir>
+        </ccTool>
+        <linkerTool>
+          <output>/home/cbensen/src/projects/packager/JavaFXSceneBuilder2.0/launcher</output>
+          <linkerLibItems>
+            <linkerLibStdlibItem>PosixThreads</linkerLibStdlibItem>
+            <linkerLibStdlibItem>DynamicLinking</linkerLibStdlibItem>
+          </linkerLibItems>
+        </linkerTool>
+      </compileType>
+      <item path="../../../win/windows/Exports.cpp" ex="false" tool="1" flavor2="0">
+      </item>
+      <item path="../../../win/windows/Exports.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="../../../win/windows/FilePath.cpp" ex="false" tool="1" flavor2="0">
+      </item>
+      <item path="../../../win/windows/FilePath.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="../../../win/windows/GenericPlatform.cpp"
+            ex="false"
+            tool="1"
+            flavor2="0">
+      </item>
+      <item path="../../../win/windows/GenericPlatform.h"
+            ex="false"
+            tool="3"
+            flavor2="0">
+      </item>
+      <item path="../../../win/windows/Helpers.cpp" ex="false" tool="1" flavor2="0">
+      </item>
+      <item path="../../../win/windows/Helpers.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="../../../win/windows/Java.cpp" ex="false" tool="1" flavor2="0">
+      </item>
+      <item path="../../../win/windows/Java.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="../../../win/windows/JavaUserPreferences.cpp"
+            ex="false"
+            tool="1"
+            flavor2="0">
+      </item>
+      <item path="../../../win/windows/JavaUserPreferences.h"
+            ex="false"
+            tool="3"
+            flavor2="0">
+      </item>
+      <item path="../../../win/windows/JavaVirtualMachine.cpp"
+            ex="false"
+            tool="1"
+            flavor2="0">
+      </item>
+      <item path="../../../win/windows/JavaVirtualMachine.h"
+            ex="false"
+            tool="3"
+            flavor2="0">
+      </item>
+      <item path="../../../win/windows/LinuxPlatform.cpp"
+            ex="false"
+            tool="1"
+            flavor2="0">
+      </item>
+      <item path="../../../win/windows/LinuxPlatform.h"
+            ex="false"
+            tool="3"
+            flavor2="0">
+      </item>
+      <item path="../../../win/windows/Lock.cpp" ex="false" tool="1" flavor2="0">
+      </item>
+      <item path="../../../win/windows/Lock.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="../../../win/windows/MacPlatform.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="../../../win/windows/Macros.cpp" ex="false" tool="1" flavor2="0">
+      </item>
+      <item path="../../../win/windows/Macros.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="../../../win/windows/Messages.cpp" ex="false" tool="1" flavor2="0">
+      </item>
+      <item path="../../../win/windows/Messages.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="../../../win/windows/Package.cpp" ex="false" tool="1" flavor2="0">
+      </item>
+      <item path="../../../win/windows/Package.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="../../../win/windows/Platform.cpp" ex="false" tool="1" flavor2="0">
+      </item>
+      <item path="../../../win/windows/Platform.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="../../../win/windows/PlatformString.cpp"
+            ex="false"
+            tool="1"
+            flavor2="0">
+      </item>
+      <item path="../../../win/windows/PlatformString.h"
+            ex="false"
+            tool="3"
+            flavor2="0">
+      </item>
+      <item path="../../../win/windows/PlatformThread.cpp"
+            ex="false"
+            tool="1"
+            flavor2="0">
+      </item>
+      <item path="../../../win/windows/PlatformThread.h"
+            ex="false"
+            tool="3"
+            flavor2="0">
+      </item>
+      <item path="../../../win/windows/PosixPlatform.cpp"
+            ex="false"
+            tool="1"
+            flavor2="0">
+      </item>
+      <item path="../../../win/windows/PosixPlatform.h"
+            ex="false"
+            tool="3"
+            flavor2="0">
+      </item>
+      <item path="../../../win/windows/PropertyFile.cpp"
+            ex="false"
+            tool="1"
+            flavor2="0">
+      </item>
+      <item path="../../../win/windows/PropertyFile.h"
+            ex="false"
+            tool="3"
+            flavor2="0">
+      </item>
+      <item path="../../../win/windows/WinLauncher.cpp"
+            ex="false"
+            tool="1"
+            flavor2="0">
+      </item>
+      <item path="../../../win/windows/WindowsPlatform.cpp"
+            ex="false"
+            tool="1"
+            flavor2="0">
+      </item>
+      <item path="../../../win/windows/WindowsPlatform.h"
+            ex="false"
+            tool="3"
+            flavor2="0">
+      </item>
+      <item path="main.cpp" ex="false" tool="1" flavor2="0">
+      </item>
+    </conf>
+    <conf name="Release" type="1">
+      <toolsSet>
+        <compilerSet>default</compilerSet>
+        <dependencyChecking>true</dependencyChecking>
+        <rebuildPropChanged>false</rebuildPropChanged>
+      </toolsSet>
+      <compileType>
+        <cTool>
+          <developmentMode>5</developmentMode>
+        </cTool>
+        <ccTool>
+          <developmentMode>5</developmentMode>
+        </ccTool>
+        <fortranCompilerTool>
+          <developmentMode>5</developmentMode>
+        </fortranCompilerTool>
+        <asmTool>
+          <developmentMode>5</developmentMode>
+        </asmTool>
+      </compileType>
+      <item path="../../../win/windows/Exports.cpp" ex="false" tool="1" flavor2="0">
+      </item>
+      <item path="../../../win/windows/Exports.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="../../../win/windows/FilePath.cpp" ex="false" tool="1" flavor2="0">
+      </item>
+      <item path="../../../win/windows/FilePath.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="../../../win/windows/GenericPlatform.cpp"
+            ex="false"
+            tool="1"
+            flavor2="0">
+      </item>
+      <item path="../../../win/windows/GenericPlatform.h"
+            ex="false"
+            tool="3"
+            flavor2="0">
+      </item>
+      <item path="../../../win/windows/Helpers.cpp" ex="false" tool="1" flavor2="0">
+      </item>
+      <item path="../../../win/windows/Helpers.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="../../../win/windows/Java.cpp" ex="false" tool="1" flavor2="0">
+      </item>
+      <item path="../../../win/windows/Java.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="../../../win/windows/JavaUserPreferences.cpp"
+            ex="false"
+            tool="1"
+            flavor2="0">
+      </item>
+      <item path="../../../win/windows/JavaUserPreferences.h"
+            ex="false"
+            tool="3"
+            flavor2="0">
+      </item>
+      <item path="../../../win/windows/JavaVirtualMachine.cpp"
+            ex="false"
+            tool="1"
+            flavor2="0">
+      </item>
+      <item path="../../../win/windows/JavaVirtualMachine.h"
+            ex="false"
+            tool="3"
+            flavor2="0">
+      </item>
+      <item path="../../../win/windows/LinuxPlatform.cpp"
+            ex="false"
+            tool="1"
+            flavor2="0">
+      </item>
+      <item path="../../../win/windows/LinuxPlatform.h"
+            ex="false"
+            tool="3"
+            flavor2="0">
+      </item>
+      <item path="../../../win/windows/Lock.cpp" ex="false" tool="1" flavor2="0">
+      </item>
+      <item path="../../../win/windows/Lock.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="../../../win/windows/MacPlatform.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="../../../win/windows/Macros.cpp" ex="false" tool="1" flavor2="0">
+      </item>
+      <item path="../../../win/windows/Macros.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="../../../win/windows/Messages.cpp" ex="false" tool="1" flavor2="0">
+      </item>
+      <item path="../../../win/windows/Messages.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="../../../win/windows/Package.cpp" ex="false" tool="1" flavor2="0">
+      </item>
+      <item path="../../../win/windows/Package.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="../../../win/windows/Platform.cpp" ex="false" tool="1" flavor2="0">
+      </item>
+      <item path="../../../win/windows/Platform.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="../../../win/windows/PlatformString.cpp"
+            ex="false"
+            tool="1"
+            flavor2="0">
+      </item>
+      <item path="../../../win/windows/PlatformString.h"
+            ex="false"
+            tool="3"
+            flavor2="0">
+      </item>
+      <item path="../../../win/windows/PlatformThread.cpp"
+            ex="false"
+            tool="1"
+            flavor2="0">
+      </item>
+      <item path="../../../win/windows/PlatformThread.h"
+            ex="false"
+            tool="3"
+            flavor2="0">
+      </item>
+      <item path="../../../win/windows/PosixPlatform.cpp"
+            ex="false"
+            tool="1"
+            flavor2="0">
+      </item>
+      <item path="../../../win/windows/PosixPlatform.h"
+            ex="false"
+            tool="3"
+            flavor2="0">
+      </item>
+      <item path="../../../win/windows/PropertyFile.cpp"
+            ex="false"
+            tool="1"
+            flavor2="0">
+      </item>
+      <item path="../../../win/windows/PropertyFile.h"
+            ex="false"
+            tool="3"
+            flavor2="0">
+      </item>
+      <item path="../../../win/windows/WinLauncher.cpp"
+            ex="false"
+            tool="1"
+            flavor2="0">
+      </item>
+      <item path="../../../win/windows/WindowsPlatform.cpp"
+            ex="false"
+            tool="1"
+            flavor2="0">
+      </item>
+      <item path="../../../win/windows/WindowsPlatform.h"
+            ex="false"
+            tool="3"
+            flavor2="0">
+      </item>
+      <item path="main.cpp" ex="false" tool="1" flavor2="0">
+      </item>
+    </conf>
+  </confs>
+</configurationDescriptor>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/fxpackager/src/main/native/launcher/linux/test/CppApplication_1/nbproject/project.xml	Wed Sep 10 11:31:04 2014 -0600
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+    <type>org.netbeans.modules.cnd.makeproject</type>
+    <configuration>
+        <data xmlns="http://www.netbeans.org/ns/make-project/1">
+            <name>CppApplication_1</name>
+            <c-extensions/>
+            <cpp-extensions>cpp,mm</cpp-extensions>
+            <header-extensions>h</header-extensions>
+            <sourceEncoding>UTF-8</sourceEncoding>
+            <make-dep-projects/>
+            <sourceRootList>
+                <sourceRootElem>../../../win/windows/launcher</sourceRootElem>
+                <sourceRootElem>../../../win/windows/launcher</sourceRootElem>
+            </sourceRootList>
+            <confList>
+                <confElem>
+                    <name>Debug</name>
+                    <type>1</type>
+                </confElem>
+                <confElem>
+                    <name>Release</name>
+                    <type>1</type>
+                </confElem>
+            </confList>
+            <formatting>
+                <project-formatting-style>false</project-formatting-style>
+            </formatting>
+        </data>
+    </configuration>
+</project>
--- a/modules/fxpackager/src/main/native/launcher/linux/xmlparser.c	Wed Sep 10 20:35:23 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,639 +0,0 @@
-/*
- * Copyright (c) 2006, 2013, 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 "DeployPlatform.h"
-#include "xmlparser.h"
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <ctype.h>
-#include <setjmp.h>
-#include <stdlib.h>
-
-#define JWS_assert(s, msg)      \
-    if (!(s)) { Abort(msg); }
-
-
-/* Internal declarations */
-static XMLNode*      ParseXMLElement(void);
-static XMLAttribute* ParseXMLAttribute(void);
-static TCHAR*         SkipWhiteSpace(TCHAR *p);
-static TCHAR*         SkipXMLName(TCHAR *p);
-static TCHAR*         SkipXMLComment(TCHAR *p);
-static TCHAR*         SkipXMLDocType(TCHAR *p);
-static TCHAR*         SkipXMLProlog(TCHAR *p);
-static TCHAR*         SkipPCData(TCHAR *p);
-static int           IsPCData(TCHAR *p);
-static void          ConvertBuiltInEntities(TCHAR* p);
-static void          SetToken(int type, TCHAR* start, TCHAR* end);
-static void          GetNextToken(void);
-static XMLNode*      CreateXMLNode(int type, TCHAR* name);
-static XMLAttribute* CreateXMLAttribute(TCHAR *name, TCHAR* value);
-static XMLNode*      ParseXMLElement(void);
-static XMLAttribute* ParseXMLAttribute(void);
-static void          FreeXMLAttribute(XMLAttribute* attr);
-static void          PrintXMLAttributes(XMLAttribute* attr);
-static void          indent(int indt);
-
-static jmp_buf       jmpbuf;
-static XMLNode*      root_node = NULL;
-
-/** definition of error codes for setjmp/longjmp,
- *  that can be handled in ParseXMLDocument()
- */
-#define JMP_NO_ERROR     0
-#define JMP_OUT_OF_RANGE 1
-
-#define NEXT_CHAR(p) {if (*p != 0) { p++;} else {longjmp(jmpbuf, JMP_OUT_OF_RANGE);}}
-#define NEXT_CHAR_OR_BREAK(p) {if (*p != 0) { p++;} else {break;}}
-#define NEXT_CHAR_OR_RETURN(p) {if (*p != 0) { p++;} else {return;}}
-#define SKIP_CHARS(p,n) {int i; for (i = 0; i < (n); i++) \
-                                            {if (*p != 0) { p++;} else \
-                                                {longjmp(jmpbuf, JMP_OUT_OF_RANGE);}}}
-#define SKIP_CHARS_OR_BREAK(p,n) {int i; for (i = 0; i < (n); i++) \
-                                            {if (*p != 0) { p++;} else {break;}} \
-                                            {if (i < (n)) {break;}}}
-
-/** Iterates through the null-terminated buffer (i.e., C string) and replaces all
- *  UTF-8 encoded character >255 with 255
- *
- *  UTF-8 encoding:
- *
- *   Range A:  0x0000 - 0x007F
- *                               0 | bits 0 - 7
- *   Range B : 0x0080 - 0x07FF  :
- *                               110 | bits 6 - 10
- *                               10  | bits 0 - 5
- *   Range C : 0x0800 - 0xFFFF  :
- *                               1110 | bits 12-15
- *                               10   | bits  6-11
- *                               10   | bits  0-5
- */
-static void RemoveNonAsciiUTF8FromBuffer(char *buf) {
-    char* p;
-    char* q;
-    char c;
-    p = q = buf;
-    /* We are not using NEXT_CHAR() to check if *q is NULL, as q is output location
-       and offset for q is smaller than for p. */
-    while(*p != '\0') {
-        c = *p;
-        if ( (c & 0x80) == 0) {
-            /* Range A */
-            *q++ = *p;
-            NEXT_CHAR(p);
-        } else if ((c & 0xE0) == 0xC0){
-            /* Range B */
-            *q++ = (char)0xFF;
-            NEXT_CHAR(p);
-            NEXT_CHAR_OR_BREAK(p);
-        } else {
-            /* Range C */
-            *q++ = (char)0xFF;
-            NEXT_CHAR(p);
-            SKIP_CHARS_OR_BREAK(p, 2);
-        }
-    }
-    /* Null terminate string */
-    *q = '\0';
-}
-
-/* --------------------------------------------------------------------- */
-
-static TCHAR* SkipWhiteSpace(TCHAR *p) {
-    if (p != NULL) {
-        while(iswspace(*p))
-            NEXT_CHAR_OR_BREAK(p);
-    }
-    return p;
-}
-
-static TCHAR* SkipXMLName(TCHAR *p) {
-    TCHAR c = *p;
-    /* Check if start of token */
-    if ( ('a' <= c && c <= 'z') ||
-         ('A' <= c && c <= 'Z') ||
-         c == '_' || c == ':') {
-
-        while( ('a' <= c && c <= 'z') ||
-               ('A' <= c && c <= 'Z') ||
-               ('0' <= c && c <= '9') ||
-               c == '_' || c == ':' || c == '.' || c == '-' ) {
-            NEXT_CHAR(p);
-            c = *p;
-            if (c == '\0') break;
-        }
-    }
-    return p;
-}
-
-static TCHAR* SkipXMLComment(TCHAR *p) {
-    if (p != NULL) {
-        if (DEPLOY_STRNCMP(p, _T("<!--"), 4) == 0) {
-            SKIP_CHARS(p, 4);
-            do {
-                if (DEPLOY_STRNCMP(p, _T("-->"), 3) == 0) {
-                    SKIP_CHARS(p, 3);
-                    return p;
-                }
-                NEXT_CHAR(p);
-            } while(*p != '\0');
-        }
-    }
-    return p;
-}
-
-static TCHAR* SkipXMLDocType(TCHAR *p) {
-    if (p != NULL) {
-        if (DEPLOY_STRNCMP(p, _T("<!"), 2) == 0) {
-            SKIP_CHARS(p, 2);
-            while (*p != '\0') {
-                if (*p == '>') {
-                    NEXT_CHAR(p);
-                    return p;
-                }
-                NEXT_CHAR(p);
-            }
-        }
-    }
-    return p;
-}
-
-static TCHAR* SkipXMLProlog(TCHAR *p) {
-    if (p != NULL) {
-        if (DEPLOY_STRNCMP(p, _T("<?"), 2) == 0) {
-            SKIP_CHARS(p, 2);
-            do {
-                if (DEPLOY_STRNCMP(p, _T("?>"), 2) == 0) {
-                    SKIP_CHARS(p, 2);
-                    return p;
-                }
-                NEXT_CHAR(p);
-            } while(*p != '\0');
-        }
-    }
-    return p;
-}
-
-/* Search for the built-in XML entities:
- * &amp; (&), &lt; (<), &gt; (>), &apos; ('), and &quote(")
- * and convert them to a real TCHARacter
- */
-static void ConvertBuiltInEntities(TCHAR* p) {
-    TCHAR* q;
-    q = p;
-    /* We are not using NEXT_CHAR() to check if *q is NULL, as q is output location
-       and offset for q is smaller than for p. */
-    while(*p) {
-      if (IsPCData(p)) {
-        /* dont convert &xxx values within PData */
-        TCHAR *end;
-        end = SkipPCData(p);
-        while(p < end) {
-            *q++ = *p;
-            NEXT_CHAR(p);
-        }
-      } else {
-        if (DEPLOY_STRNCMP(p, _T("&amp;"), 5) == 0) {
-            *q++ = '&';
-            SKIP_CHARS(p, 5);
-        } else if (DEPLOY_STRNCMP(p, _T("&lt;"), 4)  == 0) {
-            *q = '<';
-            SKIP_CHARS(p, 4);
-        } else if (DEPLOY_STRNCMP(p, _T("&gt;"), 4)  == 0) {
-            *q = '>';
-            SKIP_CHARS(p, 4);
-        } else if (DEPLOY_STRNCMP(p, _T("&apos;"), 6)  == 0) {
-            *q = '\'';
-            SKIP_CHARS(p, 6);
-        } else if (DEPLOY_STRNCMP(p, _T("&quote;"), 7)  == 0) {
-            *q = '\"';
-            SKIP_CHARS(p, 7);
-        } else {
-            *q++ = *p;
-            NEXT_CHAR(p);
-        }
-      }
-    }
-    *q = '\0';
-}
-
-/* ------------------------------------------------------------- */
-/* XML tokenizer */
-
-#define TOKEN_UNKNOWN             0
-#define TOKEN_BEGIN_TAG           1  /* <tag */
-#define TOKEN_END_TAG             2  /* </tag */
-#define TOKEN_CLOSE_BRACKET       3  /* >  */
-#define TOKEN_EMPTY_CLOSE_BRACKET 4  /* /> */
-#define TOKEN_PCDATA              5  /* pcdata */
-#define TOKEN_CDATA               6  /* cdata */
-#define TOKEN_EOF                 7
-
-static TCHAR* CurPos       = NULL;
-static TCHAR* CurTokenName        = NULL;
-static int   CurTokenType;
-static int   MaxTokenSize = -1;
-
-/* Copy token from buffer to Token variable */
-static void SetToken(int type, TCHAR* start, TCHAR* end) {
-    int len = end - start;
-    if (len > MaxTokenSize) {
-        if (CurTokenName != NULL) free(CurTokenName);
-        CurTokenName = (TCHAR *)malloc((len + 1) * sizeof(TCHAR));
-        if (CurTokenName == NULL ) {
-            return;
-        }
-        MaxTokenSize = len;
-    }
-
-    CurTokenType = type;
-    DEPLOY_STRNCPY(CurTokenName, len + 1, start, len);
-    CurTokenName[len] = '\0';
-}
-
-/* Skip XML comments, doctypes, and prolog tags */
-static TCHAR* SkipFilling(void) {
-    TCHAR *q = CurPos;
-
-    /* Skip white space and comment sections */
-    do {
-        q = CurPos;
-        CurPos = SkipWhiteSpace(CurPos);
-        CurPos = SkipXMLComment(CurPos); /* Must be called befor DocTypes */
-        CurPos = SkipXMLDocType(CurPos); /* <! ... > directives */
-        CurPos = SkipXMLProlog(CurPos);   /* <? ... ?> directives */
-    } while(CurPos != q);
-
-    return CurPos;
-}
-
-
-/* Parses next token and initializes the global token variables above
-   The tokennizer automatically skips comments (<!-- comment -->) and
-   <! ... > directives.
-*/
-static void GetNextToken(void) {
-    TCHAR *p, *q;
-
-    /* Skip white space and comment sections */
-    p = SkipFilling();
-
-    if (p == NULL || *p == '\0') {
-        CurTokenType = TOKEN_EOF;
-        return;
-    } else if (p[0] == '<' && p[1] == '/') {
-        /* TOKEN_END_TAG */
-        q = SkipXMLName(p + 2);
-        SetToken(TOKEN_END_TAG, p + 2, q);
-        p = q;
-    } else  if (*p == '<') {
-        /* TOKEN_BEGIN_TAG */
-        q = SkipXMLName(p + 1);
-        SetToken(TOKEN_BEGIN_TAG, p + 1, q);
-        p = q;
-    } else if (p[0] == '>') {
-        CurTokenType = TOKEN_CLOSE_BRACKET;
-        NEXT_CHAR(p);
-    } else if (p[0] == '/' && p[1] == '>') {
-        CurTokenType = TOKEN_EMPTY_CLOSE_BRACKET;
-        SKIP_CHARS(p, 2);
-    } else {
-        /* Search for end of data */
-        q = p + 1;
-        while(*q && *q != '<') {
-            if (IsPCData(q)) {
-                q = SkipPCData(q);
-            } else {
-                NEXT_CHAR(q);
-            }
-        }
-        SetToken(TOKEN_PCDATA, p, q);
-        /* Convert all entities inside token */
-        ConvertBuiltInEntities(CurTokenName);
-        p = q;
-    }
-    /* Advance pointer to beginning of next token */
-    CurPos = p;
-}
-
-
-static XMLNode* CreateXMLNode(int type, TCHAR* name) {
-    XMLNode* node;
-    node  = (XMLNode*)malloc(sizeof(XMLNode));
-    if (node == NULL) {
-        return NULL;
-    }
-    node->_type = type;
-    node->_name = name;
-    node->_next = NULL;
-    node->_sub  = NULL;
-    node->_attributes = NULL;
-    return node;
-}
-
-
-static XMLAttribute* CreateXMLAttribute(TCHAR *name, TCHAR* value) {
-    XMLAttribute* attr;
-    attr = (XMLAttribute*)malloc(sizeof(XMLAttribute));
-    if (attr == NULL) {
-        return NULL;
-    }
-    attr->_name = name;
-    attr->_value = value;
-    attr->_next =  NULL;
-    return attr;
-}
-
-
-XMLNode* ParseXMLDocument(TCHAR* buf) {
-    XMLNode* root;
-    int err_code = setjmp(jmpbuf);
-    switch (err_code)
-    {
-    case JMP_NO_ERROR:
-#ifndef _UNICODE
-        /* Remove UTF-8 encoding from buffer */
-        RemoveNonAsciiUTF8FromBuffer(buf);
-#endif
-
-        /* Get first Token */
-        CurPos = buf;
-        GetNextToken();
-
-        /* Parse document*/
-        root =  ParseXMLElement();
-    break;
-    case JMP_OUT_OF_RANGE:
-        /* cleanup: */
-        if (root_node != NULL) {
-            FreeXMLDocument(root_node);
-            root_node = NULL;
-        }
-        if (CurTokenName != NULL) free(CurTokenName);
-        fprintf(stderr,"Error during parsing jnlp file...\n");
-        exit(-1);
-    break;
-    default:
-        root = NULL;
-    break;
-    }
-
-    return root;
-}
-
-static XMLNode* ParseXMLElement(void) {
-    XMLNode*  node     = NULL;
-    XMLNode*  subnode  = NULL;
-    XMLNode*  nextnode = NULL;
-    XMLAttribute* attr = NULL;
-
-    if (CurTokenType == TOKEN_BEGIN_TAG) {
-
-        /* Create node for new element tag */
-        node = CreateXMLNode(xmlTagType, DEPLOY_STRDUP(CurTokenName));
-        /* We need to save root node pointer to be able to cleanup
-           if an error happens during parsing */
-        if(!root_node) {
-            root_node = node;
-        }
-        /* Parse attributes. This section eats a all input until
-           EOF, a > or a /> */
-        attr = ParseXMLAttribute();
-        while(attr != NULL) {
-          attr->_next = node->_attributes;
-          node->_attributes = attr;
-          attr = ParseXMLAttribute();
-        }
-
-        /* This will eihter be a TOKEN_EOF, TOKEN_CLOSE_BRACKET, or a
-         * TOKEN_EMPTY_CLOSE_BRACKET */
-        GetNextToken();
-
-        /* Skip until '>', '/>' or EOF. This should really be an error, */
-        /* but we are loose */
-//        if(CurTokenType == TOKEN_EMPTY_CLOSE_BRACKET ||
-//               CurTokenType == TOKEN_CLOSE_BRACKET ||
-//               CurTokenType  == TOKEN_EOF) {
-//            println("XML Parsing error: wrong kind of token found");
-//            return NULL;
-//        }
-
-        if (CurTokenType == TOKEN_EMPTY_CLOSE_BRACKET) {
-            GetNextToken();
-            /* We are done with the sublevel - fall through to continue */
-            /* parsing tags at the same level */
-        } else if (CurTokenType == TOKEN_CLOSE_BRACKET) {
-            GetNextToken();
-
-            /* Parse until end tag if found */
-            node->_sub  = ParseXMLElement();
-
-            if (CurTokenType == TOKEN_END_TAG) {
-                /* Find closing bracket '>' for end tag */
-                do {
-                   GetNextToken();
-                } while(CurTokenType != TOKEN_EOF && CurTokenType != TOKEN_CLOSE_BRACKET);
-                GetNextToken();
-            }
-        }
-
-        /* Continue parsing rest on same level */
-        if (CurTokenType != TOKEN_EOF) {
-                /* Parse rest of stream at same level */
-                node->_next = ParseXMLElement();
-        }
-        return node;
-
-    } else if (CurTokenType == TOKEN_PCDATA) {
-        /* Create node for pcdata */
-        node = CreateXMLNode(xmlPCDataType, DEPLOY_STRDUP(CurTokenName));
-        /* We need to save root node pointer to be able to cleanup
-           if an error happens during parsing */
-        if(!root_node) {
-            root_node = node;
-        }
-        GetNextToken();
-        return node;
-    }
-
-    /* Something went wrong. */
-    return NULL;
-}
-
-/* Parses an XML attribute. */
-static XMLAttribute* ParseXMLAttribute(void) {
-    TCHAR* q = NULL;
-    TCHAR* name = NULL;
-    TCHAR* PrevPos = NULL;
-
-    do
-    {
-        /* We need to check this condition to avoid endless loop
-           in case if an error happend during parsing. */
-        if (PrevPos == CurPos) return NULL;
-        PrevPos = CurPos;
-
-        /* Skip whitespace etc. */
-        SkipFilling();
-
-        /* Check if we are done witht this attribute section */
-        if (CurPos[0] == '\0' ||
-            CurPos[0] == '>' ||
-            CurPos[0] == '/' && CurPos[1] == '>') return NULL;
-
-        /* Find end of name */
-        q = CurPos;
-        while(*q && !iswspace(*q) && *q !='=') NEXT_CHAR(q);
-
-        SetToken(TOKEN_UNKNOWN, CurPos, q);
-        if (name) {
-            free(name);
-            name = NULL;
-        }
-        name = DEPLOY_STRDUP(CurTokenName);
-
-        /* Skip any whitespace */
-        CurPos = q;
-        CurPos = SkipFilling();
-
-        /* Next TCHARacter must be '=' for a valid attribute.
-           If it is not, this is really an error.
-           We ignore this, and just try to parse an attribute
-           out of the rest of the string.
-        */
-    } while(*CurPos != '=');
-
-    NEXT_CHAR(CurPos);
-    CurPos = SkipWhiteSpace(CurPos);
-    /* Parse CDATA part of attribute */
-    if ((*CurPos == '\"') || (*CurPos == '\'')) {
-        TCHAR quoteChar = *CurPos;
-        q = ++CurPos;
-        while(*q != '\0' && *q != quoteChar) NEXT_CHAR(q);
-        SetToken(TOKEN_CDATA, CurPos, q);
-        CurPos = q + 1;
-    } else {
-        q = CurPos;
-        while(*q != '\0' && !iswspace(*q)) NEXT_CHAR(q);
-        SetToken(TOKEN_CDATA, CurPos, q);
-        CurPos = q;
-    }
-
-    //Note: no need to free name and CurTokenName duplicate; they're assigned
-    // to an XMLAttribute structure in CreateXMLAttribute
-
-    return CreateXMLAttribute(name, DEPLOY_STRDUP(CurTokenName));
-}
-
-void FreeXMLDocument(XMLNode* root) {
-  if (root == NULL) return;
-  FreeXMLDocument(root->_sub);
-  FreeXMLDocument(root->_next);
-  FreeXMLAttribute(root->_attributes);
-  free(root->_name);
-  free(root);
-}
-
-static void FreeXMLAttribute(XMLAttribute* attr) {
-  if (attr == NULL) return;
-  free(attr->_name);
-  free(attr->_value);
-  FreeXMLAttribute(attr->_next);
-  free(attr);
-}
-
-/* Find element at current level with a given name */
-XMLNode* FindXMLChild(XMLNode* root, TCHAR* name) {
-  if (root == NULL) return NULL;
-
-  if (root->_type == xmlTagType && DEPLOY_STRCMP(root->_name, name) == 0) {
-    return root;
-  }
-
-  return FindXMLChild(root->_next, name);
-}
-
-/* Search for an attribute with the given name and returns the contents. Returns NULL if
- * attribute is not found
- */
-TCHAR* FindXMLAttribute(XMLAttribute* attr, TCHAR* name) {
-  if (attr == NULL) return NULL;
-  if (DEPLOY_STRCMP(attr->_name, name) == 0) return attr->_value;
-  return FindXMLAttribute(attr->_next, name);
-}
-
-
-void PrintXMLDocument(XMLNode* node, int indt) {
-  if (node == NULL) return;
-
-  if (node->_type == xmlTagType) {
-     DEPLOY_PRINTF(_T("\n"));
-     indent(indt);
-     DEPLOY_PRINTF(_T("<%s"), node->_name);
-     PrintXMLAttributes(node->_attributes);
-     if (node->_sub == NULL) {
-       DEPLOY_PRINTF(_T("/>\n"));
-     } else {
-       DEPLOY_PRINTF(_T(">"));
-       PrintXMLDocument(node->_sub, indt + 1);
-       indent(indt);
-       DEPLOY_PRINTF(_T("</%s>"), node->_name);
-     }
-  } else {
-    DEPLOY_PRINTF(_T("%s"), node->_name);
-  }
-  PrintXMLDocument(node->_next, indt);
-}
-
-static void PrintXMLAttributes(XMLAttribute* attr) {
-  if (attr == NULL) return;
-
-  DEPLOY_PRINTF(_T(" %s=\"%s\""), attr->_name, attr->_value);
-  PrintXMLAttributes(attr->_next);
-}
-
-static void indent(int indt) {
-    int i;
-    for(i = 0; i < indt; i++) {
-        DEPLOY_PRINTF(_T("  "));
-    }
-}
-
-TCHAR *CDStart = _T("<![CDATA[");
-TCHAR *CDEnd = _T("]]>");
-
-
-static TCHAR* SkipPCData(TCHAR *p) {
-    TCHAR *end = DEPLOY_STRSTR(p, CDEnd);
-    if (end != NULL) {
-        return end+sizeof(CDEnd);
-    }
-    return (++p);
-}
-
-static int IsPCData(TCHAR *p) {
-    return (DEPLOY_STRNCMP(CDStart, p, sizeof(CDStart)) == 0);
-}
--- a/modules/fxpackager/src/main/native/launcher/linux/xmlparser.h	Wed Sep 10 20:35:23 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 2006, 2013, 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.
- */
-
-#ifndef XMLPARSER_H
-#define XMLPARSER_H
-
-#include "DeployPlatform.h"
-
-/*
- *  Contains a simply-minded XML parser.
- *
- *  The following assumptions are made about the DTD, XML document:
- *   -  The encoding is UTF-8
- *
- *   -  The parser sets all   unicode character >255 to 255. Thus,
- *      there can be no non-acsii characters in tags, attributes, or
- *      data used by the C program.
- *
- *   -  All attributes are passed as C data
- *
- *   -  No entities are defined except for the default ones, e.g.,
- *      &amp; (&), &lt; (<), &gt; (>), &apos; ('), and &quote(")
- *
- */
-
-#define xmlTagType    0
-#define xmlPCDataType 1
-
-typedef struct _xmlNode XMLNode;
-typedef struct _xmlAttribute XMLAttribute;
-
-struct _xmlNode {
-    int           _type;        /* Type of node: tag, pcdata, cdate */
-    TCHAR*         _name;        /* Contents of node */
-    XMLNode*      _next;        /* Next node at same level */
-    XMLNode*      _sub;         /* First sub-node */
-    XMLAttribute* _attributes;  /* List of attributes */
-};
-
-struct _xmlAttribute {
-    TCHAR* _name;              /* Name of attribute */
-    TCHAR* _value;             /* Value of attribute */
-    XMLAttribute* _next;      /* Next attribute for this tag */
-};
-
-
-/* Public interface */
-static void     RemoveNonAsciiUTF8FromBuffer(char *buf);
-XMLNode* ParseXMLDocument    (TCHAR* buf);
-void     FreeXMLDocument     (XMLNode* root);
-
-/* Utility methods for parsing document */
-XMLNode* FindXMLChild        (XMLNode* root,      TCHAR* name);
-TCHAR*    FindXMLAttribute    (XMLAttribute* attr, TCHAR* name);
-
-/* Debugging */
-void PrintXMLDocument(XMLNode* node, int indt);
-
-#endif
--- a/modules/fxpackager/src/main/native/launcher/mac/main.m	Wed Sep 10 20:35:23 2014 +0400
+++ b/modules/fxpackager/src/main/native/launcher/mac/main.m	Wed Sep 10 11:31:04 2014 -0600
@@ -1,434 +1,81 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates.
+ * All rights reserved. Use is subject to license terms.
  *
- * 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 file is available and licensed under the following license:
  *
- * 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).
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
  *
- * 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.
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the distribution.
+ *  - Neither the name of Oracle Corporation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
  *
- * 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.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+
 #import <Cocoa/Cocoa.h>
 #include <dlfcn.h>
-#include <pthread.h>
-//#include <jni.h>
+#include <unistd.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_USER_OPTIONS_KEY "JVMUserOptions"
-#define JVM_CLASSPATH_KEY "JVMAppClasspath"
-#define JVM_PREFERENCES_ID "JVMPreferencesID"
-#define JVM_LAUNCHER_DEBUG_OPTIONS_KEY "JVMLauncherDebugOptions"
-#define DEFAULT_JAVA_PREFS_DOMAIN "com.apple.java.util.prefs"
-
-#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[]);
-
-NSArray *getJVMOptions(NSDictionary *infoDictionary, NSString *mainBundlePath);
-void logCommandLine(NSString *tag, int argc, char* argv[]);
+typedef bool (*start_launcher)(int argc, char* argv[]);
+typedef void (*stop_launcher)();
 
 int main(int argc, char *argv[]) {
+#if !__has_feature(objc_arc)
     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
-    int result;
+#endif
+    
+    int result = 1;
+    
     @try {
-        launch(argc, argv);
-        result = 0;
+        setlocale(LC_ALL, "en_US.utf8");
+        
+        void* library;
+        
+        {
+            NSBundle *mainBundle = [NSBundle mainBundle];
+            NSString *mainBundlePath = [mainBundle bundlePath];
+            NSString *libraryName = [mainBundlePath stringByAppendingPathComponent:@"Contents/MacOS/libpackager.dylib"];
+            
+            library = dlopen([libraryName UTF8String], RTLD_LAZY);
+        }
+        
+        start_launcher start = (start_launcher)dlsym(library, "start_launcher");
+        stop_launcher stop = (stop_launcher)dlsym(library, "stop_launcher");
+        
+        if (start(argc, argv) == true) {
+            result = 0;
+            stop();
+        }
+ 
+        dlclose(library);
+ 
     } @catch (NSException *exception) {
         NSLog(@"%@: %@", exception, [exception callStackSymbols]);
         result = 1;
     }
 
+#if !__has_feature(objc_arc)
     [pool drain];
-
+#endif
+    
     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];
-
-    logCommandLine(@"launch", appArgc, appArgv);
-
-    // Locate the JLI_Launch() function
-    NSString *runtime = [infoDictionary objectForKey:@JVM_RUNTIME_KEY];
-
-    JLI_Launch_t jli_LaunchFxnPtr = NULL;
-    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];
-
-    NSArray *options= getJVMOptions(infoDictionary, mainBundlePath);
-
-    // 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 so 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++) {
-                //PSN already filtered out on second time through
-                argv[i++] = strdup(appArgv[j]);
-            }
-        } else {
-            for (NSString *argument in arguments) {
-                argv[i++] = strdup([argument UTF8String]);
-            }
-        }
-    } else {
-        for (int j=1; j < appArgc; j++) {
-            //Mac adds a ProcessSerialNumber to args when launched from .app
-            //filter out the psn since they it's not expected in the app
-            if (strncmp("-psn_", appArgv[j], 5) != 0) {
-                argv[i++] = strdup(appArgv[j]);
-            }
-            else {
-                argc--;
-            }
-        }
-    }
-    [options release];
-
-    argv[i] = NULL;
-
-    logCommandLine(@"jli_LaunchFxnPtr", argc, argv);
-
-    // Invoke JLI_Launch()
-    return jli_LaunchFxnPtr(argc, argv,
-            0, NULL,
-            0, NULL,
-            "",
-            "",
-            "java",
-            "java",
-            FALSE,
-            FALSE,
-            FALSE,
-            0);
-}
-
-//Call every time before to get debug options
-NSSet *getDebugOptions() {
-    static NSSet *debugOptions;
-    if (debugOptions == nil) {
-        NSBundle *mainBundle = [NSBundle mainBundle];
-        // Get the main bundle's info dictionary
-        NSDictionary *infoDictionary = [mainBundle infoDictionary];
-        NSArray *options = [infoDictionary objectForKey:@JVM_LAUNCHER_DEBUG_OPTIONS_KEY];
-        if (options == nil) {
-            options = [NSArray array];
-        }
-        debugOptions = [NSSet setWithArray: options];
-    }
-    return debugOptions;
-}
-
-//Print command line args
-void logCommandLine(NSString *tag, int argc, char* argv[]) {
-    if ([getDebugOptions() containsObject:@"log.args"]) {
-        for(int i=0;i<argc;i++) {
-            NSLog(@"%@ (%i, %s)", tag, i, argv[i]);
-        }
-    }
-}
-
-
-
-/**
-* This gets the JVMOptions, both the internal developer only options and set of options the developer
-* wants a user to be able to override.
-*
-* The developer would set the options they required, for instance:
-
-            <fx:platform>
-              <fx:jvmarg value="-verbose:class"/>
-              <fx:jvmarg value="-Djava.policy.file=$APPDIR/app/whatever.policy"/>
-              <fx:jvmuserarg name="-Xmx" value="768m" />
-              <fx:jvmuserarg name="-Djava.util.logging.config.file=" value="~/logging.properties" />
-            </fx:platform>
-
-* this will result in Info.plist having (default)
-
-  <key>JVMOptions</key>
-  <array>
-    <string>-verbose:class</string>
-    <string>-Djava.policy.file=$APPDIR/app/whatever.policy</string>
-  </array>
-  <key>JVMUserOptions</key>
-    <dict>
-      <key>-Djava.util.logging.config.file=</key>
-      <string>~/logging.properties</string>
-      <key>-Xmx</key>
-      <string>768m</string>
-    </dict>
-
-* and initially set up the applications preference file in ~/Library/Preferences/..name based on bundleid..plist,
-* i.e. just the JVMUserOptions
-
-	<key>JVMUserOptions</key>
-	<dict>
-		<key>-Djava.util.logging.config.file=</key>
-		<string>~/logging.properties</string>
-		<key>-Xmx</key>
-		<string>860m</string>
-	</dict>
-
-*/
-NSArray *getJVMOptions(NSDictionary *infoDictionary, NSString *mainBundlePath) {
-    NSArray *options = [infoDictionary objectForKey:@JVM_OPTIONS_KEY];
-    NSDictionary *defaultOverrides = [infoDictionary objectForKey:@JVM_USER_OPTIONS_KEY];
-
-    if (options == nil) {
-        options = [NSArray array];
-    }
-
-
-    //Do string substitutions - for now only one is $APPDIR, if a second one is added this will
-    //be generalized and use a set of options
-    NSString *contentsPath = [mainBundlePath stringByAppendingString:@"/Contents"];
-
-    //Create some extra room for user options and preferences id
-    NSMutableArray *expandedOptions = [[NSMutableArray alloc] initWithCapacity:(
-            [options count] + [defaultOverrides count] + 5)];
-
-    //Add preferences ID
-    NSString *preferencesID = [infoDictionary objectForKey:@JVM_PREFERENCES_ID];
-    if (preferencesID != nil) {
-        [expandedOptions addObject: [@"-Dapp.preferences.id=" stringByAppendingString: preferencesID]];
-    }
-
-    for (id option in options) {
-        NSString *expandedOption =
-                [option stringByReplacingOccurrencesOfString:@"$APPDIR" withString:contentsPath];
-        [expandedOptions addObject:expandedOption];
-    }
-
-
-    // calculate a normalized path including the JVMUserOptions key
-    BOOL leadingSlash = [preferencesID hasPrefix: @"/"];
-    BOOL trailingSlash = [preferencesID hasSuffix: @"/"] || ([preferencesID length] == 0);
-    
-    NSString *fullPath = [NSString stringWithFormat:@"%@%@%@%@/", leadingSlash?@"":@"/",
-                          preferencesID, trailingSlash?@"":@"/", @JVM_USER_OPTIONS_KEY];
-    
-    // now pull out the parts...
-    NSString *strippedPath = [fullPath stringByTrimmingCharactersInSet: [NSCharacterSet
-                                                                         characterSetWithCharactersInString:@"/"]];
-    NSArray *pathParts = [strippedPath componentsSeparatedByString:@"/"];
-    
-    // calculate our persistent domain and the path of dictionaries to descend
-    NSString *persistentDomain;
-    NSMutableArray *dictPath = [NSMutableArray arrayWithArray: pathParts];
-    if ([pathParts count] > 2) {
-        // for 3 or more steps, the domain is first.second.third and the keys are "/first/second/third/", "fourth/", "fifth/"... etc
-        persistentDomain = [[NSString stringWithFormat: @"%@.%@.%@", [pathParts objectAtIndex: 0],
-                            [pathParts objectAtIndex: 1], [pathParts objectAtIndex: 2]] lowercaseString];
-
-        [dictPath replaceObjectAtIndex: 0 withObject: [NSString stringWithFormat:@"/%@/%@/%@", [pathParts objectAtIndex: 0],
-                                                       [pathParts objectAtIndex: 1], [pathParts objectAtIndex: 2]]];
-        [dictPath removeObjectAtIndex: 2];
-        [dictPath removeObjectAtIndex: 1];
-    } else {
-        // for 1 or two steps, the domain is first.second.third and the keys are "/", "first/", "second/"
-        persistentDomain = @DEFAULT_JAVA_PREFS_DOMAIN;
-        [dictPath insertObject: @"" atIndex:0];
-    }
-
-    // set up the user defaults for the appropriate persistent domain
-    NSUserDefaults *userDefaults = [[NSUserDefaults alloc] init];
-    NSDictionary *userOverrides = [userDefaults persistentDomainForName: persistentDomain];
-    
-    // walk down our path parts, making dictionaries along the way if they are missing
-    NSMutableDictionary *parentNode = NULL;
-    int pathLength = [dictPath count];
-    for (int i = 0; i < pathLength; i++) {
-        NSString *nodeKey = [[dictPath objectAtIndex: i] stringByAppendingString: @"/"];
-        parentNode = userOverrides;
-        userOverrides = [parentNode objectForKey: nodeKey];
-        if (userOverrides == Nil) {
-            userOverrides = [NSMutableDictionary dictionaryWithCapacity: 2];
-            [parentNode setValue: userOverrides forKey: nodeKey];
-        }
-    }
-    
-    //If overrides don't exist add them - the intent is to make it easier for the user to actually modify them
-    if ([userOverrides count] == 0) {
-        if (parentNode == NULL) {
-            [userDefaults setPersistentDomain: defaultOverrides forName: persistentDomain];
-            userOverrides = [userDefaults persistentDomainForName: persistentDomain];
-        } else {
-            NSString *nodeKey = [[dictPath objectAtIndex: ([dictPath count] - 1)] stringByAppendingString: @"/"];
-            [parentNode setObject: defaultOverrides forKey:nodeKey];
-            userOverrides = [parentNode objectForKey: nodeKey];
-        }
-    }
-    
-    // some writes may have occured, sync
-    [userDefaults synchronize];
-    [userDefaults release];
-    
-    // now we examine the prefs node for defaulted values and substitute user options
-    for (id key in defaultOverrides) {
-        NSString *newOption;
-        if ([userOverrides valueForKey: key] != nil &&
-            [[userOverrides valueForKey:key] isNotEqualTo:[defaultOverrides valueForKey:key]]) {
-            newOption = [key stringByAppendingString:[userOverrides valueForKey:key]];
-        }
-        else {
-            newOption = [key stringByAppendingString:[defaultOverrides valueForKey:key]];
-        }
-        NSString *expandedOption =
-                [newOption stringByReplacingOccurrencesOfString:@"$APPDIR" withString:contentsPath];
-        [expandedOptions addObject: expandedOption];
-    }
-
-    //Loop through all user override keys again looking for ones we haven't already uses
-    for (id key in userOverrides) {
-        //If the default object for key is nil, this is an option the user added so include
-        if ([defaultOverrides objectForKey: key] == nil) {
-            NSString *newOption = [key stringByAppendingString:[userOverrides valueForKey:key]];
-            NSString *expandedOption =
-                    [newOption stringByReplacingOccurrencesOfString:@"$APPDIR" withString:contentsPath];
-            [expandedOptions addObject: expandedOption];
-        }
-    }
-
-    return expandedOptions;
 }
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/fxpackager/src/main/native/launcher/mac/test/testlauncher/testlauncher.xcodeproj/project.pbxproj	Wed Sep 10 11:31:04 2014 -0600
@@ -0,0 +1,481 @@
+// !$*UTF8*$!
+{
+	archiveVersion = 1;
+	classes = {
+	};
+	objectVersion = 46;
+	objects = {
+
+/* Begin PBXBuildFile section */
+		DEFEFAFE19928C1000F5598F /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DEFEFAFD19928C1000F5598F /* Cocoa.framework */; };
+		DEFEFB0819928C1000F5598F /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = DEFEFB0619928C1000F5598F /* InfoPlist.strings */; };
+		DEFEFB0E19928C1000F5598F /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = DEFEFB0C19928C1000F5598F /* Credits.rtf */; };
+		DEFEFB1119928C1000F5598F /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = DEFEFB1019928C1000F5598F /* AppDelegate.m */; };
+		DEFEFB1419928C1000F5598F /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = DEFEFB1219928C1000F5598F /* MainMenu.xib */; };
+		DEFEFB1619928C1000F5598F /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DEFEFB1519928C1000F5598F /* Images.xcassets */; };
+		DEFEFB1D19928C1000F5598F /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DEFEFB1C19928C1000F5598F /* XCTest.framework */; };
+		DEFEFB1E19928C1000F5598F /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DEFEFAFD19928C1000F5598F /* Cocoa.framework */; };
+		DEFEFB2619928C1000F5598F /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = DEFEFB2419928C1000F5598F /* InfoPlist.strings */; };
+		DEFEFB2819928C1000F5598F /* testlauncherTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DEFEFB2719928C1000F5598F /* testlauncherTests.m */; };
+		DEFEFB3219928C2200F5598F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = DEFEFB3119928C2200F5598F /* main.m */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+		DEFEFB1F19928C1000F5598F /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = DEFEFAF219928C1000F5598F /* Project object */;
+			proxyType = 1;
+			remoteGlobalIDString = DEFEFAF919928C1000F5598F;
+			remoteInfo = testlauncher;
+		};
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXFileReference section */
+		DEFEFAFA19928C1000F5598F /* testlauncher.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testlauncher.app; sourceTree = BUILT_PRODUCTS_DIR; };
+		DEFEFAFD19928C1000F5598F /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
+		DEFEFB0019928C1000F5598F /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
+		DEFEFB0119928C1000F5598F /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
+		DEFEFB0219928C1000F5598F /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+		DEFEFB0519928C1000F5598F /* testlauncher-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "testlauncher-Info.plist"; sourceTree = "<group>"; };
+		DEFEFB0719928C1000F5598F /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+		DEFEFB0B19928C1000F5598F /* testlauncher-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "testlauncher-Prefix.pch"; sourceTree = "<group>"; };
+		DEFEFB0D19928C1000F5598F /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = "<group>"; };
+		DEFEFB0F19928C1000F5598F /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
+		DEFEFB1019928C1000F5598F /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
+		DEFEFB1319928C1000F5598F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
+		DEFEFB1519928C1000F5598F /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
+		DEFEFB1B19928C1000F5598F /* testlauncherTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = testlauncherTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
+		DEFEFB1C19928C1000F5598F /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
+		DEFEFB2319928C1000F5598F /* testlauncherTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "testlauncherTests-Info.plist"; sourceTree = "<group>"; };
+		DEFEFB2519928C1000F5598F /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+		DEFEFB2719928C1000F5598F /* testlauncherTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = testlauncherTests.m; sourceTree = "<group>"; };
+		DEFEFB3119928C2200F5598F /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = ../../../main.m; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+		DEFEFAF719928C1000F5598F /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				DEFEFAFE19928C1000F5598F /* Cocoa.framework in Frameworks */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		DEFEFB1819928C1000F5598F /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				DEFEFB1E19928C1000F5598F /* Cocoa.framework in Frameworks */,
+				DEFEFB1D19928C1000F5598F /* XCTest.framework in Frameworks */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+		DEFEFAF119928C1000F5598F = {
+			isa = PBXGroup;
+			children = (
+				DEFEFB0319928C1000F5598F /* testlauncher */,
+				DEFEFB2119928C1000F5598F /* testlauncherTests */,
+				DEFEFAFC19928C1000F5598F /* Frameworks */,
+				DEFEFAFB19928C1000F5598F /* Products */,
+			);
+			sourceTree = "<group>";
+		};
+		DEFEFAFB19928C1000F5598F /* Products */ = {
+			isa = PBXGroup;
+			children = (
+				DEFEFAFA19928C1000F5598F /* testlauncher.app */,
+				DEFEFB1B19928C1000F5598F /* testlauncherTests.xctest */,
+			);
+			name = Products;
+			sourceTree = "<group>";
+		};
+		DEFEFAFC19928C1000F5598F /* Frameworks */ = {
+			isa = PBXGroup;
+			children = (
+				DEFEFAFD19928C1000F5598F /* Cocoa.framework */,
+				DEFEFB1C19928C1000F5598F /* XCTest.framework */,
+				DEFEFAFF19928C1000F5598F /* Other Frameworks */,
+			);
+			name = Frameworks;
+			sourceTree = "<group>";
+		};
+		DEFEFAFF19928C1000F5598F /* Other Frameworks */ = {
+			isa = PBXGroup;
+			children = (
+				DEFEFB0019928C1000F5598F /* AppKit.framework */,
+				DEFEFB0119928C1000F5598F /* CoreData.framework */,
+				DEFEFB0219928C1000F5598F /* Foundation.framework */,
+			);
+			name = "Other Frameworks";
+			sourceTree = "<group>";
+		};
+		DEFEFB0319928C1000F5598F /* testlauncher */ = {
+			isa = PBXGroup;
+			children = (
+				DEFEFB0F19928C1000F5598F /* AppDelegate.h */,
+				DEFEFB1019928C1000F5598F /* AppDelegate.m */,
+				DEFEFB3119928C2200F5598F /* main.m */,
+				DEFEFB1219928C1000F5598F /* MainMenu.xib */,
+				DEFEFB1519928C1000F5598F /* Images.xcassets */,
+				DEFEFB0419928C1000F5598F /* Supporting Files */,
+			);
+			path = testlauncher;
+			sourceTree = "<group>";
+		};
+		DEFEFB0419928C1000F5598F /* Supporting Files */ = {
+			isa = PBXGroup;
+			children = (
+				DEFEFB0519928C1000F5598F /* testlauncher-Info.plist */,
+				DEFEFB0619928C1000F5598F /* InfoPlist.strings */,
+				DEFEFB0B19928C1000F5598F /* testlauncher-Prefix.pch */,
+				DEFEFB0C19928C1000F5598F /* Credits.rtf */,
+			);
+			name = "Supporting Files";
+			sourceTree = "<group>";
+		};
+		DEFEFB2119928C1000F5598F /* testlauncherTests */ = {
+			isa = PBXGroup;
+			children = (
+				DEFEFB2719928C1000F5598F /* testlauncherTests.m */,
+				DEFEFB2219928C1000F5598F /* Supporting Files */,
+			);
+			path = testlauncherTests;
+			sourceTree = "<group>";
+		};
+		DEFEFB2219928C1000F5598F /* Supporting Files */ = {
+			isa = PBXGroup;
+			children = (
+				DEFEFB2319928C1000F5598F /* testlauncherTests-Info.plist */,
+				DEFEFB2419928C1000F5598F /* InfoPlist.strings */,
+			);
+			name = "Supporting Files";
+			sourceTree = "<group>";
+		};
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+		DEFEFAF919928C1000F5598F /* testlauncher */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = DEFEFB2B19928C1000F5598F /* Build configuration list for PBXNativeTarget "testlauncher" */;
+			buildPhases = (
+				DEFEFAF619928C1000F5598F /* Sources */,
+				DEFEFAF719928C1000F5598F /* Frameworks */,
+				DEFEFAF819928C1000F5598F /* Resources */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+			);
+			name = testlauncher;
+			productName = testlauncher;
+			productReference = DEFEFAFA19928C1000F5598F /* testlauncher.app */;
+			productType = "com.apple.product-type.application";
+		};
+		DEFEFB1A19928C1000F5598F /* testlauncherTests */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = DEFEFB2E19928C1000F5598F /* Build configuration list for PBXNativeTarget "testlauncherTests" */;
+			buildPhases = (
+				DEFEFB1719928C1000F5598F /* Sources */,
+				DEFEFB1819928C1000F5598F /* Frameworks */,
+				DEFEFB1919928C1000F5598F /* Resources */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+				DEFEFB2019928C1000F5598F /* PBXTargetDependency */,
+			);
+			name = testlauncherTests;
+			productName = testlauncherTests;
+			productReference = DEFEFB1B19928C1000F5598F /* testlauncherTests.xctest */;
+			productType = "com.apple.product-type.bundle.unit-test";
+		};
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+		DEFEFAF219928C1000F5598F /* Project object */ = {
+			isa = PBXProject;
+			attributes = {
+				LastUpgradeCheck = 0510;
+				ORGANIZATIONNAME = "Chris Bensen";
+				TargetAttributes = {
+					DEFEFB1A19928C1000F5598F = {
+						TestTargetID = DEFEFAF919928C1000F5598F;
+					};
+				};
+			};
+			buildConfigurationList = DEFEFAF519928C1000F5598F /* Build configuration list for PBXProject "testlauncher" */;
+			compatibilityVersion = "Xcode 3.2";
+			developmentRegion = English;
+			hasScannedForEncodings = 0;
+			knownRegions = (
+				en,
+				Base,
+			);
+			mainGroup = DEFEFAF119928C1000F5598F;
+			productRefGroup = DEFEFAFB19928C1000F5598F /* Products */;
+			projectDirPath = "";
+			projectRoot = "";
+			targets = (
+				DEFEFAF919928C1000F5598F /* testlauncher */,
+				DEFEFB1A19928C1000F5598F /* testlauncherTests */,
+			);
+		};
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+		DEFEFAF819928C1000F5598F /* Resources */ = {
+			isa = PBXResourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				DEFEFB0819928C1000F5598F /* InfoPlist.strings in Resources */,
+				DEFEFB1619928C1000F5598F /* Images.xcassets in Resources */,
+				DEFEFB0E19928C1000F5598F /* Credits.rtf in Resources */,
+				DEFEFB1419928C1000F5598F /* MainMenu.xib in Resources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		DEFEFB1919928C1000F5598F /* Resources */ = {
+			isa = PBXResourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				DEFEFB2619928C1000F5598F /* InfoPlist.strings in Resources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+		DEFEFAF619928C1000F5598F /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				DEFEFB3219928C2200F5598F /* main.m in Sources */,
+				DEFEFB1119928C1000F5598F /* AppDelegate.m in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		DEFEFB1719928C1000F5598F /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				DEFEFB2819928C1000F5598F /* testlauncherTests.m in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+		DEFEFB2019928C1000F5598F /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			target = DEFEFAF919928C1000F5598F /* testlauncher */;
+			targetProxy = DEFEFB1F19928C1000F5598F /* PBXContainerItemProxy */;
+		};
+/* End PBXTargetDependency section */
+
+/* Begin PBXVariantGroup section */
+		DEFEFB0619928C1000F5598F /* InfoPlist.strings */ = {
+			isa = PBXVariantGroup;
+			children = (
+				DEFEFB0719928C1000F5598F /* en */,
+			);
+			name = InfoPlist.strings;
+			sourceTree = "<group>";
+		};
+		DEFEFB0C19928C1000F5598F /* Credits.rtf */ = {
+			isa = PBXVariantGroup;
+			children = (
+				DEFEFB0D19928C1000F5598F /* en */,
+			);
+			name = Credits.rtf;
+			sourceTree = "<group>";
+		};
+		DEFEFB1219928C1000F5598F /* MainMenu.xib */ = {
+			isa = PBXVariantGroup;
+			children = (
+				DEFEFB1319928C1000F5598F /* Base */,
+			);
+			name = MainMenu.xib;
+			sourceTree = "<group>";
+		};
+		DEFEFB2419928C1000F5598F /* InfoPlist.strings */ = {
+			isa = PBXVariantGroup;
+			children = (
+				DEFEFB2519928C1000F5598F /* en */,
+			);
+			name = InfoPlist.strings;
+			sourceTree = "<group>";
+		};
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+		DEFEFB2919928C1000F5598F /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+				CLANG_CXX_LIBRARY = "libc++";
+				CLANG_ENABLE_MODULES = YES;
+				CLANG_ENABLE_OBJC_ARC = YES;
+				CLANG_WARN_BOOL_CONVERSION = YES;
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+				CLANG_WARN_EMPTY_BODY = YES;
+				CLANG_WARN_ENUM_CONVERSION = YES;
+				CLANG_WARN_INT_CONVERSION = YES;
+				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+				COPY_PHASE_STRIP = NO;
+				GCC_C_LANGUAGE_STANDARD = gnu99;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				GCC_PREPROCESSOR_DEFINITIONS = (
+					"DEBUG=1",
+					"$(inherited)",
+				);
+				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+				GCC_WARN_UNUSED_FUNCTION = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				MACOSX_DEPLOYMENT_TARGET = 10.9;
+				ONLY_ACTIVE_ARCH = YES;
+				SDKROOT = macosx;
+			};
+			name = Debug;
+		};
+		DEFEFB2A19928C1000F5598F /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+				CLANG_CXX_LIBRARY = "libc++";
+				CLANG_ENABLE_MODULES = YES;
+				CLANG_ENABLE_OBJC_ARC = YES;
+				CLANG_WARN_BOOL_CONVERSION = YES;
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+				CLANG_WARN_EMPTY_BODY = YES;
+				CLANG_WARN_ENUM_CONVERSION = YES;
+				CLANG_WARN_INT_CONVERSION = YES;
+				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+				COPY_PHASE_STRIP = YES;
+				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+				ENABLE_NS_ASSERTIONS = NO;
+				GCC_C_LANGUAGE_STANDARD = gnu99;
+				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+				GCC_WARN_UNUSED_FUNCTION = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				MACOSX_DEPLOYMENT_TARGET = 10.9;
+				SDKROOT = macosx;
+			};
+			name = Release;
+		};
+		DEFEFB2C19928C1000F5598F /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+				COMBINE_HIDPI_IMAGES = YES;
+				GCC_PRECOMPILE_PREFIX_HEADER = YES;
+				GCC_PREFIX_HEADER = "testlauncher/testlauncher-Prefix.pch";
+				INFOPLIST_FILE = "testlauncher/testlauncher-Info.plist";
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				WRAPPER_EXTENSION = app;
+			};
+			name = Debug;
+		};
+		DEFEFB2D19928C1000F5598F /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+				COMBINE_HIDPI_IMAGES = YES;
+				GCC_PRECOMPILE_PREFIX_HEADER = YES;
+				GCC_PREFIX_HEADER = "testlauncher/testlauncher-Prefix.pch";
+				INFOPLIST_FILE = "testlauncher/testlauncher-Info.plist";
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				WRAPPER_EXTENSION = app;
+			};
+			name = Release;
+		};
+		DEFEFB2F19928C1000F5598F /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/testlauncher.app/Contents/MacOS/testlauncher";
+				COMBINE_HIDPI_IMAGES = YES;
+				FRAMEWORK_SEARCH_PATHS = (
+					"$(DEVELOPER_FRAMEWORKS_DIR)",
+					"$(inherited)",
+				);
+				GCC_PRECOMPILE_PREFIX_HEADER = YES;
+				GCC_PREFIX_HEADER = "testlauncher/testlauncher-Prefix.pch";
+				GCC_PREPROCESSOR_DEFINITIONS = (
+					"DEBUG=1",
+					"$(inherited)",
+				);
+				INFOPLIST_FILE = "testlauncherTests/testlauncherTests-Info.plist";
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				TEST_HOST = "$(BUNDLE_LOADER)";
+				WRAPPER_EXTENSION = xctest;
+			};
+			name = Debug;
+		};
+		DEFEFB3019928C1000F5598F /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/testlauncher.app/Contents/MacOS/testlauncher";
+				COMBINE_HIDPI_IMAGES = YES;
+				FRAMEWORK_SEARCH_PATHS = (
+					"$(DEVELOPER_FRAMEWORKS_DIR)",
+					"$(inherited)",
+				);
+				GCC_PRECOMPILE_PREFIX_HEADER = YES;
+				GCC_PREFIX_HEADER = "testlauncher/testlauncher-Prefix.pch";
+				INFOPLIST_FILE = "testlauncherTests/testlauncherTests-Info.plist";
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				TEST_HOST = "$(BUNDLE_LOADER)";
+				WRAPPER_EXTENSION = xctest;
+			};
+			name = Release;
+		};
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+		DEFEFAF519928C1000F5598F /* Build configuration list for PBXProject "testlauncher" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				DEFEFB2919928C1000F5598F /* Debug */,
+				DEFEFB2A19928C1000F5598F /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+		DEFEFB2B19928C1000F5598F /* Build configuration list for PBXNativeTarget "testlauncher" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				DEFEFB2C19928C1000F5598F /* Debug */,
+				DEFEFB2D19928C1000F5598F /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+		};
+		DEFEFB2E19928C1000F5598F /* Build configuration list for PBXNativeTarget "testlauncherTests" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				DEFEFB2F19928C1000F5598F /* Debug */,
+				DEFEFB3019928C1000F5598F /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+		};
+/* End XCConfigurationList section */
+	};
+	rootObject = DEFEFAF219928C1000F5598F /* Project object */;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/fxpackager/src/main/native/launcher/mac/test/testlauncher/testlauncher.xcodeproj/project.xcworkspace/contents.xcworkspacedata	Wed Sep 10 11:31:04 2014 -0600
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+   version = "1.0">
+   <FileRef
+      location = "self:testlauncher.xcodeproj">
+   </FileRef>
+</Workspace>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/fxpackager/src/main/native/launcher/mac/test/testlauncher/testlauncher/AppDelegate.h	Wed Sep 10 11:31:04 2014 -0600
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates.
+ * All rights reserved. Use is subject to license terms.
+ *
+ * This file is available and licensed under the following license:
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the distribution.
+ *  - Neither the name of Oracle Corporation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+#import <Cocoa/Cocoa.h>
+
+@interface AppDelegate : NSObject <NSApplicationDelegate>
+
+@property (assign) IBOutlet NSWindow *window;
+
+@end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/fxpackager/src/main/native/launcher/mac/test/testlauncher/testlauncher/AppDelegate.m	Wed Sep 10 11:31:04 2014 -0600
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates.
+ * All rights reserved. Use is subject to license terms.
+ *
+ * This file is available and licensed under the following license:
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the distribution.
+ *  - Neither the name of Oracle Corporation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+#import "AppDelegate.h"
+
+@implementation AppDelegate
+
+- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
+{
+    // Insert code here to initialize your application
+}
+
+@end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/fxpackager/src/main/native/launcher/mac/test/testlauncher/testlauncher/Base.lproj/MainMenu.xib	Wed Sep 10 11:31:04 2014 -0600
@@ -0,0 +1,680 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="5023" systemVersion="13A603" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
+    <dependencies>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="5023"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
+            <connections>
+                <outlet property="delegate" destination="Voe-Tx-rLC" id="GzC-gU-4Uq"/>
+            </connections>
+        </customObject>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application"/>
+        <customObject id="Voe-Tx-rLC" customClass="AppDelegate">
+            <connections>
+                <outlet property="window" destination="QvC-M9-y7g" id="gIp-Ho-8D9"/>
+            </connections>
+        </customObject>
+        <customObject id="YLy-65-1bz" customClass="NSFontManager"/>
+        <menu title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
+            <items>
+                <menuItem title="testlauncher" id="1Xt-HY-uBw">
+                    <modifierMask key="keyEquivalentModifierMask"/>
+                    <menu key="submenu" title="testlauncher" systemMenu="apple" id="uQy-DD-JDr">
+                        <items>
+                            <menuItem title="About testlauncher" id="5kV-Vb-QxS">
+                                <modifierMask key="keyEquivalentModifierMask"/>
+                                <connections>
+                                    <action selector="orderFrontStandardAboutPanel:" target="-1" id="Exp-CZ-Vem"/>
+                                </connections>
+                            </menuItem>
+                            <menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/>
+                            <menuItem title="Preferences…" keyEquivalent="," id="BOF-NM-1cW"/>
+                            <menuItem isSeparatorItem="YES" id="wFC-TO-SCJ"/>
+                            <menuItem title="Services" id="NMo-om-nkz">
+                                <modifierMask key="keyEquivalentModifierMask"/>
+                                <menu key="submenu" title="Services" systemMenu="services" id="hz9-B4-Xy5"/>
+                            </menuItem>
+                            <menuItem isSeparatorItem="YES" id="4je-JR-u6R"/>
+                            <menuItem title="Hide testlauncher" keyEquivalent="h" id="Olw-nP-bQN">
+                                <connections>
+                                    <action selector="hide:" target="-1" id="PnN-Uc-m68"/>
+                                </connections>
+                            </menuItem>
+                            <menuItem title="Hide Others" keyEquivalent="h" id="Vdr-fp-XzO">
+                                <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
+                                <connections>
+                                    <action selector="hideOtherApplications:" target="-1" id="VT4-aY-XCT"/>
+                                </connections>
+                            </menuItem>
+                            <menuItem title="Show All" id="Kd2-mp-pUS">
+                                <modifierMask key="keyEquivalentModifierMask"/>
+                                <connections>
+                                    <action selector="unhideAllApplications:" target="-1" id="Dhg-Le-xox"/>
+                                </connections>
+                            </menuItem>
+                            <menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/>
+                            <menuItem title="Quit testlauncher" keyEquivalent="q" id="4sb-4s-VLi">
+                                <connections>
+                                    <action selector="terminate:" target="-1" id="Te7-pn-YzF"/>
+                                </connections>
+                            </menuItem>
+                        </items>
+                    </menu>
+                </menuItem>
+                <menuItem title="File" id="dMs-cI-mzQ">
+                    <modifierMask key="keyEquivalentModifierMask"/>
+                    <menu key="submenu" title="File" id="bib-Uj-vzu">
+                        <items>
+                            <menuItem title="New" keyEquivalent="n" id="Was-JA-tGl">
+                                <connections>
+                                    <action selector="newDocument:" target="-1" id="4Si-XN-c54"/>
+                                </connections>
+                            </menuItem>
+                            <menuItem title="Open…" keyEquivalent="o" id="IAo-SY-fd9">
+                                <connections>
+                                    <action selector="openDocument:" target="-1" id="bVn-NM-KNZ"/>
+                                </connections>
+                            </menuItem>
+                            <menuItem title="Open Recent" id="tXI-mr-wws">
+                                <modifierMask key="keyEquivalentModifierMask"/>
+                                <menu key="submenu" title="Open Recent" systemMenu="recentDocuments" id="oas-Oc-fiZ">
+                                    <items>
+                                        <menuItem title="Clear Menu" id="vNY-rz-j42">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <connections>
+                                                <action selector="clearRecentDocuments:" target="-1" id="Daa-9d-B3U"/>
+                                            </connections>
+                                        </menuItem>
+                                    </items>
+                                </menu>
+                            </menuItem>
+                            <menuItem isSeparatorItem="YES" id="m54-Is-iLE"/>
+                            <menuItem title="Close" keyEquivalent="w" id="DVo-aG-piG">
+                                <connections>
+                                    <action selector="performClose:" target="-1" id="HmO-Ls-i7Q"/>
+                                </connections>
+                            </menuItem>
+                            <menuItem title="Save…" keyEquivalent="s" id="pxx-59-PXV">
+                                <connections>
+                                    <action selector="saveDocument:" target="-1" id="teZ-XB-qJY"/>
+                                </connections>
+                            </menuItem>
+                            <menuItem title="Save As…" keyEquivalent="S" id="Bw7-FT-i3A">
+                                <connections>
+                                    <action selector="saveDocumentAs:" target="-1" id="mDf-zr-I0C"/>
+                                </connections>
+                            </menuItem>
+                            <menuItem title="Revert to Saved" id="KaW-ft-85H">
+                                <modifierMask key="keyEquivalentModifierMask"/>
+                                <connections>
+                                    <action selector="revertDocumentToSaved:" target="-1" id="iJ3-Pv-kwq"/>
+                                </connections>
+                            </menuItem>
+                            <menuItem isSeparatorItem="YES" id="aJh-i4-bef"/>
+                            <menuItem title="Page Setup…" keyEquivalent="P" id="qIS-W8-SiK">
+                                <modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
+                                <connections>
+                                    <action selector="runPageLayout:" target="-1" id="Din-rz-gC5"/>
+                                </connections>
+                            </menuItem>
+                            <menuItem title="Print…" keyEquivalent="p" id="aTl-1u-JFS">
+                                <connections>
+                                    <action selector="print:" target="-1" id="qaZ-4w-aoO"/>
+                                </connections>
+                            </menuItem>
+                        </items>
+                    </menu>
+                </menuItem>
+                <menuItem title="Edit" id="5QF-Oa-p0T">
+                    <modifierMask key="keyEquivalentModifierMask"/>
+                    <menu key="submenu" title="Edit" id="W48-6f-4Dl">
+                        <items>
+                            <menuItem title="Undo" keyEquivalent="z" id="dRJ-4n-Yzg">
+                                <connections>
+                                    <action selector="undo:" target="-1" id="M6e-cu-g7V"/>
+                                </connections>
+                            </menuItem>
+                            <menuItem title="Redo" keyEquivalent="Z" id="6dh-zS-Vam">
+                                <connections>
+                                    <action selector="redo:" target="-1" id="oIA-Rs-6OD"/>
+                                </connections>
+                            </menuItem>
+                            <menuItem isSeparatorItem="YES" id="WRV-NI-Exz"/>
+                            <menuItem title="Cut" keyEquivalent="x" id="uRl-iY-unG">
+                                <connections>
+                                    <action selector="cut:" target="-1" id="YJe-68-I9s"/>
+                                </connections>
+                            </menuItem>
+                            <menuItem title="Copy" keyEquivalent="c" id="x3v-GG-iWU">
+                                <connections>
+                                    <action selector="copy:" target="-1" id="G1f-GL-Joy"/>
+                                </connections>
+                            </menuItem>
+                            <menuItem title="Paste" keyEquivalent="v" id="gVA-U4-sdL">
+                                <connections>
+                                    <action selector="paste:" target="-1" id="UvS-8e-Qdg"/>
+                                </connections>
+                            </menuItem>
+                            <menuItem title="Paste and Match Style" keyEquivalent="V" id="WeT-3V-zwk">
+                                <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
+                                <connections>
+                                    <action selector="pasteAsPlainText:" target="-1" id="cEh-KX-wJQ"/>
+                                </connections>
+                            </menuItem>
+                            <menuItem title="Delete" id="pa3-QI-u2k">
+                                <modifierMask key="keyEquivalentModifierMask"/>
+                                <connections>
+                                    <action selector="delete:" target="-1" id="0Mk-Ml-PaM"/>
+                                </connections>
+                            </menuItem>
+                            <menuItem title="Select All" keyEquivalent="a" id="Ruw-6m-B2m">
+                                <connections>
+                                    <action selector="selectAll:" target="-1" id="VNm-Mi-diN"/>
+                                </connections>
+                            </menuItem>
+                            <menuItem isSeparatorItem="YES" id="uyl-h8-XO2"/>
+                            <menuItem title="Find" id="4EN-yA-p0u">
+                                <modifierMask key="keyEquivalentModifierMask"/>
+                                <menu key="submenu" title="Find" id="1b7-l0-nxx">
+                                    <items>
+                                        <menuItem title="Find…" tag="1" keyEquivalent="f" id="Xz5-n4-O0W">
+                                            <connections>
+                                                <action selector="performFindPanelAction:" target="-1" id="cD7-Qs-BN4"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Find and Replace…" tag="12" keyEquivalent="f" id="YEy-JH-Tfz">
+                                            <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
+                                            <connections>
+                                                <action selector="performFindPanelAction:" target="-1" id="WD3-Gg-5AJ"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Find Next" tag="2" keyEquivalent="g" id="q09-fT-Sye">
+                                            <connections>
+                                                <action selector="performFindPanelAction:" target="-1" id="NDo-RZ-v9R"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Find Previous" tag="3" keyEquivalent="G" id="OwM-mh-QMV">
+                                            <connections>
+                                                <action selector="performFindPanelAction:" target="-1" id="HOh-sY-3ay"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Use Selection for Find" tag="7" keyEquivalent="e" id="buJ-ug-pKt">
+                                            <connections>
+                                                <action selector="performFindPanelAction:" target="-1" id="U76-nv-p5D"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Jump to Selection" keyEquivalent="j" id="S0p-oC-mLd">
+                                            <connections>
+                                                <action selector="centerSelectionInVisibleArea:" target="-1" id="IOG-6D-g5B"/>
+                                            </connections>
+                                        </menuItem>
+                                    </items>
+                                </menu>
+                            </menuItem>
+                            <menuItem title="Spelling and Grammar" id="Dv1-io-Yv7">
+                                <modifierMask key="keyEquivalentModifierMask"/>
+                                <menu key="submenu" title="Spelling" id="3IN-sU-3Bg">
+                                    <items>
+                                        <menuItem title="Show Spelling and Grammar" keyEquivalent=":" id="HFo-cy-zxI">
+                                            <connections>
+                                                <action selector="showGuessPanel:" target="-1" id="vFj-Ks-hy3"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Check Document Now" keyEquivalent=";" id="hz2-CU-CR7">
+                                            <connections>
+                                                <action selector="checkSpelling:" target="-1" id="fz7-VC-reM"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem isSeparatorItem="YES" id="bNw-od-mp5"/>
+                                        <menuItem title="Check Spelling While Typing" id="rbD-Rh-wIN">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <connections>
+                                                <action selector="toggleContinuousSpellChecking:" target="-1" id="7w6-Qz-0kB"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Check Grammar With Spelling" id="mK6-2p-4JG">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <connections>
+                                                <action selector="toggleGrammarChecking:" target="-1" id="muD-Qn-j4w"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Correct Spelling Automatically" id="78Y-hA-62v">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <connections>
+                                                <action selector="toggleAutomaticSpellingCorrection:" target="-1" id="2lM-Qi-WAP"/>
+                                            </connections>
+                                        </menuItem>
+                                    </items>
+                                </menu>
+                            </menuItem>
+                            <menuItem title="Substitutions" id="9ic-FL-obx">
+                                <modifierMask key="keyEquivalentModifierMask"/>
+                                <menu key="submenu" title="Substitutions" id="FeM-D8-WVr">
+                                    <items>
+                                        <menuItem title="Show Substitutions" id="z6F-FW-3nz">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <connections>
+                                                <action selector="orderFrontSubstitutionsPanel:" target="-1" id="oku-mr-iSq"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem isSeparatorItem="YES" id="gPx-C9-uUO"/>
+                                        <menuItem title="Smart Copy/Paste" id="9yt-4B-nSM">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <connections>
+                                                <action selector="toggleSmartInsertDelete:" target="-1" id="3IJ-Se-DZD"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Smart Quotes" id="hQb-2v-fYv">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <connections>
+                                                <action selector="toggleAutomaticQuoteSubstitution:" target="-1" id="ptq-xd-QOA"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Smart Dashes" id="rgM-f4-ycn">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <connections>
+                                                <action selector="toggleAutomaticDashSubstitution:" target="-1" id="oCt-pO-9gS"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Smart Links" id="cwL-P1-jid">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <connections>
+                                                <action selector="toggleAutomaticLinkDetection:" target="-1" id="Gip-E3-Fov"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Data Detectors" id="tRr-pd-1PS">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <connections>
+                                                <action selector="toggleAutomaticDataDetection:" target="-1" id="R1I-Nq-Kbl"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Text Replacement" id="HFQ-gK-NFA">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <connections>
+                                                <action selector="toggleAutomaticTextReplacement:" target="-1" id="DvP-Fe-Py6"/>
+                                            </connections>
+                                        </menuItem>
+                                    </items>
+                                </menu>
+                            </menuItem>
+                            <menuItem title="Transformations" id="2oI-Rn-ZJC">
+                                <modifierMask key="keyEquivalentModifierMask"/>
+                                <menu key="submenu" title="Transformations" id="c8a-y6-VQd">
+                                    <items>
+                                        <menuItem title="Make Upper Case" id="vmV-6d-7jI">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <connections>
+                                                <action selector="uppercaseWord:" target="-1" id="sPh-Tk-edu"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Make Lower Case" id="d9M-CD-aMd">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <connections>
+                                                <action selector="lowercaseWord:" target="-1" id="iUZ-b5-hil"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Capitalize" id="UEZ-Bs-lqG">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <connections>
+                                                <action selector="capitalizeWord:" target="-1" id="26H-TL-nsh"/>
+                                            </connections>
+                                        </menuItem>
+                                    </items>
+                                </menu>
+                            </menuItem>
+                            <menuItem title="Speech" id="xrE-MZ-jX0">
+                                <modifierMask key="keyEquivalentModifierMask"/>
+                                <menu key="submenu" title="Speech" id="3rS-ZA-NoH">
+                                    <items>
+                                        <menuItem title="Start Speaking" id="Ynk-f8-cLZ">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <connections>
+                                                <action selector="startSpeaking:" target="-1" id="654-Ng-kyl"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Stop Speaking" id="Oyz-dy-DGm">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <connections>
+                                                <action selector="stopSpeaking:" target="-1" id="dX8-6p-jy9"/>
+                                            </connections>
+                                        </menuItem>
+                                    </items>
+                                </menu>
+                            </menuItem>
+                        </items>
+                    </menu>
+                </menuItem>
+                <menuItem title="Format" id="jxT-CU-nIS">
+                    <modifierMask key="keyEquivalentModifierMask"/>
+                    <menu key="submenu" title="Format" id="GEO-Iw-cKr">
+                        <items>
+                            <menuItem title="Font" id="Gi5-1S-RQB">
+                                <modifierMask key="keyEquivalentModifierMask"/>
+                                <menu key="submenu" title="Font" systemMenu="font" id="aXa-aM-Jaq">
+                                    <items>
+                                        <menuItem title="Show Fonts" keyEquivalent="t" id="Q5e-8K-NDq">
+                                            <connections>
+                                                <action selector="orderFrontFontPanel:" target="YLy-65-1bz" id="WHr-nq-2xA"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Bold" tag="2" keyEquivalent="b" id="GB9-OM-e27">
+                                            <connections>
+                                                <action selector="addFontTrait:" target="YLy-65-1bz" id="hqk-hr-sYV"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Italic" tag="1" keyEquivalent="i" id="Vjx-xi-njq">
+                                            <connections>
+                                                <action selector="addFontTrait:" target="YLy-65-1bz" id="IHV-OB-c03"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Underline" keyEquivalent="u" id="WRG-CD-K1S">
+                                            <connections>
+                                                <action selector="underline:" target="-1" id="FYS-2b-JAY"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem isSeparatorItem="YES" id="5gT-KC-WSO"/>
+                                        <menuItem title="Bigger" tag="3" keyEquivalent="+" id="Ptp-SP-VEL">
+                                            <connections>
+                                                <action selector="modifyFont:" target="YLy-65-1bz" id="Uc7-di-UnL"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Smaller" tag="4" keyEquivalent="-" id="i1d-Er-qST">
+                                            <connections>
+                                                <action selector="modifyFont:" target="YLy-65-1bz" id="HcX-Lf-eNd"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem isSeparatorItem="YES" id="kx3-Dk-x3B"/>
+                                        <menuItem title="Kern" id="jBQ-r6-VK2">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <menu key="submenu" title="Kern" id="tlD-Oa-oAM">
+                                                <items>
+                                                    <menuItem title="Use Default" id="GUa-eO-cwY">
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <connections>
+                                                            <action selector="useStandardKerning:" target="-1" id="6dk-9l-Ckg"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem title="Use None" id="cDB-IK-hbR">
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <connections>
+                                                            <action selector="turnOffKerning:" target="-1" id="U8a-gz-Maa"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem title="Tighten" id="46P-cB-AYj">
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <connections>
+                                                            <action selector="tightenKerning:" target="-1" id="hr7-Nz-8ro"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem title="Loosen" id="ogc-rX-tC1">
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <connections>
+                                                            <action selector="loosenKerning:" target="-1" id="8i4-f9-FKE"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                </items>
+                                            </menu>
+                                        </menuItem>
+                                        <menuItem title="Ligatures" id="o6e-r0-MWq">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <menu key="submenu" title="Ligatures" id="w0m-vy-SC9">
+                                                <items>
+                                                    <menuItem title="Use Default" id="agt-UL-0e3">
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <connections>
+                                                            <action selector="useStandardLigatures:" target="-1" id="7uR-wd-Dx6"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem title="Use None" id="J7y-lM-qPV">
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <connections>
+                                                            <action selector="turnOffLigatures:" target="-1" id="iX2-gA-Ilz"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem title="Use All" id="xQD-1f-W4t">
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <connections>
+                                                            <action selector="useAllLigatures:" target="-1" id="KcB-kA-TuK"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                </items>
+                                            </menu>
+                                        </menuItem>
+                                        <menuItem title="Baseline" id="OaQ-X3-Vso">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <menu key="submenu" title="Baseline" id="ijk-EB-dga">
+                                                <items>
+                                                    <menuItem title="Use Default" id="3Om-Ey-2VK">
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <connections>
+                                                            <action selector="unscript:" target="-1" id="0vZ-95-Ywn"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem title="Superscript" id="Rqc-34-cIF">
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <connections>
+                                                            <action selector="superscript:" target="-1" id="3qV-fo-wpU"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem title="Subscript" id="I0S-gh-46l">
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <connections>
+                                                            <action selector="subscript:" target="-1" id="Q6W-4W-IGz"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem title="Raise" id="2h7-ER-AoG">
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <connections>
+                                                            <action selector="raiseBaseline:" target="-1" id="4sk-31-7Q9"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem title="Lower" id="1tx-W0-xDw">
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <connections>
+                                                            <action selector="lowerBaseline:" target="-1" id="OF1-bc-KW4"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                </items>
+                                            </menu>
+                                        </menuItem>
+                                        <menuItem isSeparatorItem="YES" id="Ndw-q3-faq"/>
+                                        <menuItem title="Show Colors" keyEquivalent="C" id="bgn-CT-cEk">
+                                            <connections>
+                                                <action selector="orderFrontColorPanel:" target="-1" id="mSX-Xz-DV3"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem isSeparatorItem="YES" id="iMs-zA-UFJ"/>
+                                        <menuItem title="Copy Style" keyEquivalent="c" id="5Vv-lz-BsD">
+                                            <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
+                                            <connections>
+                                                <action selector="copyFont:" target="-1" id="GJO-xA-L4q"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Paste Style" keyEquivalent="v" id="vKC-jM-MkH">
+                                            <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
+                                            <connections>
+                                                <action selector="pasteFont:" target="-1" id="JfD-CL-leO"/>
+                                            </connections>
+                                        </menuItem>
+                                    </items>
+                                </menu>
+                            </menuItem>
+                            <menuItem title="Text" id="Fal-I4-PZk">
+                                <modifierMask key="keyEquivalentModifierMask"/>
+                                <menu key="submenu" title="Text" id="d9c-me-L2H">
+                                    <items>
+                                        <menuItem title="Align Left" keyEquivalent="{" id="ZM1-6Q-yy1">
+                                            <connections>
+                                                <action selector="alignLeft:" target="-1" id="zUv-R1-uAa"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Center" keyEquivalent="|" id="VIY-Ag-zcb">
+                                            <connections>
+                                                <action selector="alignCenter:" target="-1" id="spX-mk-kcS"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Justify" id="J5U-5w-g23">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <connections>
+                                                <action selector="alignJustified:" target="-1" id="ljL-7U-jND"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Align Right" keyEquivalent="}" id="wb2-vD-lq4">
+                                            <connections>
+                                                <action selector="alignRight:" target="-1" id="r48-bG-YeY"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem isSeparatorItem="YES" id="4s2-GY-VfK"/>
+                                        <menuItem title="Writing Direction" id="H1b-Si-o9J">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <menu key="submenu" title="Writing Direction" id="8mr-sm-Yjd">
+                                                <items>
+                                                    <menuItem title="Paragraph" enabled="NO" id="ZvO-Gk-QUH">
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                    </menuItem>
+                                                    <menuItem id="YGs-j5-SAR">
+                                                        <string key="title">	Default</string>
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <connections>
+                                                            <action selector="makeBaseWritingDirectionNatural:" target="-1" id="qtV-5e-UBP"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem id="Lbh-J2-qVU">
+                                                        <string key="title">	Left to Right</string>
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <connections>
+                                                            <action selector="makeBaseWritingDirectionLeftToRight:" target="-1" id="S0X-9S-QSf"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem id="jFq-tB-4Kx">
+                                                        <string key="title">	Right to Left</string>
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <connections>
+                                                            <action selector="makeBaseWritingDirectionRightToLeft:" target="-1" id="5fk-qB-AqJ"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem isSeparatorItem="YES" id="swp-gr-a21"/>
+                                                    <menuItem title="Selection" enabled="NO" id="cqv-fj-IhA">
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                    </menuItem>
+                                                    <menuItem id="Nop-cj-93Q">
+                                                        <string key="title">	Default</string>
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <connections>
+                                                            <action selector="makeTextWritingDirectionNatural:" target="-1" id="lPI-Se-ZHp"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem id="BgM-ve-c93">
+                                                        <string key="title">	Left to Right</string>
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <connections>
+                                                            <action selector="makeTextWritingDirectionLeftToRight:" target="-1" id="caW-Bv-w94"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem id="RB4-Sm-HuC">
+                                                        <string key="title">	Right to Left</string>
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <connections>
+                                                            <action selector="makeTextWritingDirectionRightToLeft:" target="-1" id="EXD-6r-ZUu"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                </items>
+                                            </menu>
+                                        </menuItem>
+                                        <menuItem isSeparatorItem="YES" id="fKy-g9-1gm"/>
+                                        <menuItem title="Show Ruler" id="vLm-3I-IUL">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <connections>
+                                                <action selector="toggleRuler:" target="-1" id="FOx-HJ-KwY"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Copy Ruler" keyEquivalent="c" id="MkV-Pr-PK5">
+                                            <modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
+                                            <connections>
+                                                <action selector="copyRuler:" target="-1" id="71i-fW-3W2"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Paste Ruler" keyEquivalent="v" id="LVM-kO-fVI">
+                                            <modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
+                                            <connections>
+                                                <action selector="pasteRuler:" target="-1" id="cSh-wd-qM2"/>
+                                            </connections>
+                                        </menuItem>
+                                    </items>
+                                </menu>
+                            </menuItem>
+                        </items>
+                    </menu>
+                </menuItem>
+                <menuItem title="View" id="H8h-7b-M4v">
+                    <modifierMask key="keyEquivalentModifierMask"/>
+                    <menu key="submenu" title="View" id="HyV-fh-RgO">
+                        <items>
+                            <menuItem title="Show Toolbar" keyEquivalent="t" id="snW-S8-Cw5">
+                                <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
+                                <connections>
+                                    <action selector="toggleToolbarShown:" target="-1" id="BXY-wc-z0C"/>
+                                </connections>
+                            </menuItem>
+                            <menuItem title="Customize Toolbar…" id="1UK-8n-QPP">
+                                <modifierMask key="keyEquivalentModifierMask"/>
+                                <connections>
+                                    <action selector="runToolbarCustomizationPalette:" target="-1" id="pQI-g3-MTW"/>
+                                </connections>
+                            </menuItem>
+                        </items>
+                    </menu>
+                </menuItem>
+                <menuItem title="Window" id="aUF-d1-5bR">
+                    <modifierMask key="keyEquivalentModifierMask"/>
+                    <menu key="submenu" title="Window" systemMenu="window" id="Td7-aD-5lo">
+                        <items>
+                            <menuItem title="Minimize" keyEquivalent="m" id="OY7-WF-poV">
+                                <connections>
+                                    <action selector="performMiniaturize:" target="-1" id="VwT-WD-YPe"/>
+                                </connections>
+                            </menuItem>
+                            <menuItem title="Zoom" id="R4o-n2-Eq4">
+                                <modifierMask key="keyEquivalentModifierMask"/>
+                                <connections>
+                                    <action selector="performZoom:" target="-1" id="DIl-cC-cCs"/>
+                                </connections>
+                            </menuItem>
+                            <menuItem isSeparatorItem="YES" id="eu3-7i-yIM"/>
+                            <menuItem title="Bring All to Front" id="LE2-aR-0XJ">
+                                <modifierMask key="keyEquivalentModifierMask"/>
+                                <connections>
+                                    <action selector="arrangeInFront:" target="-1" id="DRN-fu-gQh"/>
+                                </connections>
+                            </menuItem>
+                        </items>
+                    </menu>
+                </menuItem>
+                <menuItem title="Help" id="wpr-3q-Mcd">
+                    <modifierMask key="keyEquivalentModifierMask"/>
+                    <menu key="submenu" title="Help" systemMenu="help" id="F2S-fz-NVQ">
+                        <items>
+                            <menuItem title="testlauncher Help" keyEquivalent="?" id="FKE-Sm-Kum">
+                                <connections>
+                                    <action selector="showHelp:" target="-1" id="y7X-2Q-9no"/>
+                                </connections>
+                            </menuItem>
+                        </items>
+                    </menu>
+                </menuItem>
+            </items>
+        </menu>
+        <window title="testlauncher" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g">
+            <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
+            <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
+            <rect key="contentRect" x="335" y="390" width="480" height="360"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="1680" height="1028"/>
+            <view key="contentView" id="EiT-Mj-1SZ">
+                <rect key="frame" x="0.0" y="0.0" width="480" height="360"/>
+                <autoresizingMask key="autoresizingMask"/>
+            </view>
+        </window>
+    </objects>
+</document>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/fxpackager/src/main/native/launcher/mac/test/testlauncher/testlauncher/Images.xcassets/AppIcon.appiconset/Contents.json	Wed Sep 10 11:31:04 2014 -0600
@@ -0,0 +1,58 @@
+{
+  "images" : [
+    {
+      "idiom" : "mac",
+      "size" : "16x16",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "mac",
+      "size" : "16x16",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "mac",
+      "size" : "32x32",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "mac",
+      "size" : "32x32",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "mac",
+      "size" : "128x128",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "mac",
+      "size" : "128x128",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "mac",
+      "size" : "256x256",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "mac",
+      "size" : "256x256",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "mac",
+      "size" : "512x512",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "mac",
+      "size" : "512x512",
+      "scale" : "2x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/fxpackager/src/main/native/launcher/mac/test/testlauncher/testlauncher/en.lproj/Credits.rtf	Wed Sep 10 11:31:04 2014 -0600
@@ -0,0 +1,29 @@
+{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\paperw9840\paperh8400
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
+
+\f0\b\fs24 \cf0 Engineering:
+\b0 \
+	Some people\
+\
+
+\b Human Interface Design:
+\b0 \
+	Some other people\
+\
+
+\b Testing:
+\b0 \
+	Hopefully not nobody\
+\
+
+\b Documentation:
+\b0 \
+	Whoever\
+\
+
+\b With special thanks to:
+\b0 \
+	Mom\
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/fxpackager/src/main/native/launcher/mac/test/testlauncher/testlauncher/en.lproj/InfoPlist.strings	Wed Sep 10 11:31:04 2014 -0600
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/fxpackager/src/main/native/launcher/mac/test/testlauncher/testlauncher/testlauncher-Info.plist	Wed Sep 10 11:31:04 2014 -0600
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>en</string>
+	<key>CFBundleExecutable</key>
+	<string>${EXECUTABLE_NAME}</string>
+	<key>CFBundleIconFile</key>
+	<string>JavaFX Scene Builder 2.0.icns</string>
+	<key>CFBundleIdentifier</key>
+	<string>com.oracle.javafx.scenebuilder</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundleName</key>
+	<string>${PRODUCT_NAME}</string>
+	<key>CFBundlePackageType</key>
+	<string>APPL</string>
+	<key>CFBundleShortVersionString</key>
+	<string>2.0</string>
+	<key>CFBundleSignature</key>
+	<string>????</string>
+	<key>LSMinimumSystemVersion</key>
+	<string>10.7.4</string>
+	<key>LSApplicationCategoryType</key>
+	<string>Unknown</string>
+	<key>CFBundleVersion</key>
+	<string>100</string>
+	<key>NSHumanReadableCopyright</key>
+	<string>Copyright (C) 2,014</string>
+	<key>JVMRuntime</key>
+	<string>jdk1.8.0.jdk</string>
+	<key>JVMMainClassName</key>
+	<string>com.oracle.javafx.scenebuilder.app.SceneBuilderApp</string>
+	<key>JVMAppClasspath</key>
+	<string>SceneBuilderKit.jar</string>
+	<key>JVMMainJarName</key>
+	<string>SceneBuilderApp.jar</string>
+	<key>JVMPreferencesID</key>
+	<string>com.oracle.javafx.scenebuilder</string>
+	<key>JVMOptions</key>
+	<array>
+		<string>-Dfile.encoding=UTF-8</string>
+	</array>
+	<key>JVMUserOptions</key>
+	<dict>
+		<key>-Xmx</key>
+		<string>400m</string>
+	</dict>
+</dict>
+</plist>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/fxpackager/src/main/native/launcher/mac/test/testlauncher/testlauncher/testlauncher-Prefix.pch	Wed Sep 10 11:31:04 2014 -0600
@@ -0,0 +1,9 @@
+//
+//  Prefix header
+//
+//  The contents of this file are implicitly included at the beginning of every source file.
+//
+
+#ifdef __OBJC__
+    #import <Cocoa/Cocoa.h>
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/fxpackager/src/main/native/launcher/mac/test/testlauncher/testlauncherTests/en.lproj/InfoPlist.strings	Wed Sep 10 11:31:04 2014 -0600
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/fxpackager/src/main/native/launcher/mac/test/testlauncher/testlauncherTests/testlauncherTests-Info.plist	Wed Sep 10 11:31:04 2014 -0600
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>en</string>
+	<key>CFBundleExecutable</key>
+	<string>${EXECUTABLE_NAME}</string>
+	<key>CFBundleIdentifier</key>
+	<string>Chris-Bensen.${PRODUCT_NAME:rfc1034identifier}</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundlePackageType</key>
+	<string>BNDL</string>
+	<key>CFBundleShortVersionString</key>
+	<string>1.0</string>
+	<key>CFBundleSignature</key>
+	<string>????</string>
+	<key>CFBundleVersion</key>
+	<string>1</string>
+</dict>
+</plist>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/fxpackager/src/main/native/launcher/mac/test/testlauncher/testlauncherTests/testlauncherTests.m	Wed Sep 10 11:31:04 2014 -0600
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates.
+ * All rights reserved. Use is subject to license terms.
+ *
+ * This file is available and licensed under the following license:
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the distribution.
+ *  - Neither the name of Oracle Corporation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+#import <XCTest/XCTest.h>
+
+@interface testlauncherTests : XCTestCase
+
+@end
+
+@implementation testlauncherTests
+
+- (void)setUp
+{
+    [super setUp];
+    // Put setup code here. This method is called before the invocation of each test method in the class.
+}
+
+- (void)tearDown
+{
+    // Put teardown code here. This method is called after the invocation of each test method in the class.
+    [super tearDown];
+}
+
+- (void)testExample
+{
+    XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__);
+}
+
+@end
--- a/modules/fxpackager/src/main/native/launcher/win/IconSwap.cpp	Wed Sep 10 20:35:23 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,213 +0,0 @@
-/*
- * Copyright (c) 2012, 2013, 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.
- */
-
-// iconswap.cpp : Defines the entry point for the console application.
-//
-
-//Define Windows compatibility requirements
-//XP or later
-#define WINVER 0x0501
-#define _WIN32_WINNT 0x0501
-
-#include <tchar.h>
-#include <stdio.h>
-#include <windows.h>
-#include <stdlib.h>
-#include <iostream>
-#include <malloc.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <io.h>
-#include <strsafe.h>
-
-// http://msdn.microsoft.com/en-us/library/ms997538.aspx
-
-typedef struct _ICONDIRENTRY {
-    BYTE bWidth;
-    BYTE bHeight;
-    BYTE bColorCount;
-    BYTE bReserved;
-    WORD wPlanes;
-    WORD wBitCount;
-    DWORD dwBytesInRes;
-    DWORD dwImageOffset;
-} ICONDIRENTRY, * LPICONDIRENTRY;
-
-typedef struct _ICONDIR {
-    WORD idReserved;
-    WORD idType;
-    WORD idCount;
-    ICONDIRENTRY idEntries[1];
-} ICONDIR, * LPICONDIR;
-
-// #pragmas are used here to insure that the structure's
-// packing in memory matches the packing of the EXE or DLL.
-#pragma pack(push)
-#pragma pack(2)
-typedef struct _GRPICONDIRENTRY {
-    BYTE bWidth;
-    BYTE bHeight;
-    BYTE bColorCount;
-    BYTE bReserved;
-    WORD wPlanes;
-    WORD wBitCount;
-    DWORD dwBytesInRes;
-    WORD nID;
-} GRPICONDIRENTRY, * LPGRPICONDIRENTRY;
-#pragma pack(pop)
-
-#pragma pack(push)
-#pragma pack(2)
-typedef struct _GRPICONDIR {
-    WORD idReserved;
-    WORD idType;
-    WORD idCount;
-    GRPICONDIRENTRY idEntries[1];
-} GRPICONDIR, * LPGRPICONDIR;
-#pragma pack(pop)
-
-void PrintError()
-{
-    LPVOID message;
-    DWORD error = GetLastError();
-
-    FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
-        FORMAT_MESSAGE_IGNORE_INSERTS, NULL, error,
-        MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
-        (LPTSTR) &message, 0, NULL);
-
-    wprintf(L"%s\n", message);
-    LocalFree(message);
-}
-
-bool ChangeIcon(_TCHAR* iconFileName, _TCHAR* executableFileName)
-{
-    bool result = false;
-
-    DWORD dwData = 1;
-    WORD language = MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT);
-
-    _TCHAR* iconExtension = wcsrchr(iconFileName, '.');
-    if (iconExtension == NULL || wcscmp(iconExtension, L".ico") != 0) {
-        wprintf(L"Unknown icon format - please provide .ICO file.\n");
-        return result;
-    }
-
-    HANDLE icon = CreateFile(iconFileName, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
-    if (icon == INVALID_HANDLE_VALUE) {
-        PrintError();
-        return result;
-    }
-
-    // Reading .ICO file
-    LPICONDIR lpid = (LPICONDIR)malloc(sizeof(ICONDIR));
-
-    DWORD dwBytesRead;
-    ReadFile(icon, &lpid->idReserved, sizeof(WORD), &dwBytesRead, NULL);
-    ReadFile(icon, &lpid->idType, sizeof(WORD), &dwBytesRead, NULL);
-    ReadFile(icon, &lpid->idCount, sizeof(WORD), &dwBytesRead, NULL);
-
-    lpid = (LPICONDIR)realloc(lpid, (sizeof(WORD) * 3) + (sizeof(ICONDIRENTRY) * lpid->idCount));
-
-    ReadFile(icon, &lpid->idEntries[0], sizeof(ICONDIRENTRY) * lpid->idCount, &dwBytesRead, NULL);
-    LPGRPICONDIR lpgid;
-    lpgid = (LPGRPICONDIR)malloc(sizeof(GRPICONDIR));
-
-    lpgid->idReserved = lpid->idReserved;
-    lpgid->idType = lpid->idType;
-    lpgid->idCount = lpid->idCount;
-    lpgid = (LPGRPICONDIR)realloc(lpgid, (sizeof(WORD) * 3) + (sizeof(GRPICONDIRENTRY) * lpgid->idCount));
-
-    for(int i = 0; i < lpgid->idCount; i++)
-    {
-        lpgid->idEntries[i].bWidth = lpid->idEntries[i].bWidth;
-        lpgid->idEntries[i].bHeight = lpid->idEntries[i].bHeight;
-        lpgid->idEntries[i].bColorCount = lpid->idEntries[i].bColorCount;
-        lpgid->idEntries[i].bReserved = lpid->idEntries[i].bReserved;
-        lpgid->idEntries[i].wPlanes = lpid->idEntries[i].wPlanes;
-        lpgid->idEntries[i].wBitCount = lpid->idEntries[i].wBitCount;
-        lpgid->idEntries[i].dwBytesInRes = lpid->idEntries[i].dwBytesInRes;
-        lpgid->idEntries[i].nID = i + 1;
-    }
-
-    // Store images in .EXE
-    HANDLE update = BeginUpdateResource( executableFileName, FALSE );
-    if (update == NULL) {
-        PrintError();
-        return result;
-    }
-
-    for(int i = 0; i < lpid->idCount; i++)
-    {
-        LPBYTE lpBuffer = (LPBYTE)malloc(lpid->idEntries[i].dwBytesInRes);
-        SetFilePointer(icon, lpid->idEntries[i].dwImageOffset, NULL, FILE_BEGIN);
-        ReadFile(icon, lpBuffer, lpid->idEntries[i].dwBytesInRes, &dwBytesRead, NULL);
-        if (!UpdateResource(update, RT_ICON, MAKEINTRESOURCE(lpgid->idEntries[i].nID),
-                           language, &lpBuffer[0], lpid->idEntries[i].dwBytesInRes))
-        {
-            PrintError();
-            return result;
-        }
-        free(lpBuffer);
-    }
-    CloseHandle(icon);
-    if (!UpdateResource(update, RT_GROUP_ICON,  MAKEINTRESOURCE(1), language,
-                        &lpgid[0], (sizeof(WORD) * 3) + (sizeof(GRPICONDIRENTRY) * lpgid->idCount)))
-    {
-        PrintError();
-        return result;
-    }
-
-    if (EndUpdateResource(update, FALSE) == FALSE) {
-        PrintError();
-        return result;
-    }
-
-    result = true;
-    return result;
-}
-
-int _tmain(int argc, _TCHAR* argv[])
-{
-	bool printUsage = true;
-
-	if (argc == 3)
-	{
-		wprintf(L"Icon File Name: %s\n", argv[1]);
-		wprintf(L"Executable File Name: %s\n", argv[2]);
-
-		if (ChangeIcon(argv[1], argv[2]) == true)
-			printUsage = false;
-		else
-			printf("failed\n");
-	}
-
-	if (printUsage == true)
-	{
-		printf("Usage: iconswap.exe [Icon File Name] [Executable File Name]\n");
-	}
-
-	return 0;
-}
--- a/modules/fxpackager/src/main/native/launcher/win/WinLauncher.cpp	Wed Sep 10 20:35:23 2014 +0400
+++ b/modules/fxpackager/src/main/native/launcher/win/WinLauncher.cpp	Wed Sep 10 11:31:04 2014 -0600
@@ -1,887 +1,73 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates.
+ * All rights reserved. Use is subject to license terms.
  *
- * 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 file is available and licensed under the following license:
  *
- * 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).
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
  *
- * 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.
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the distribution.
+ *  - Neither the name of Oracle Corporation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
  *
- * 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.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-//Define Windows compatibility requirements
-//XP or later
-#define WINVER 0x0501
-#define _WIN32_WINNT 0x0501
 
 #include <Windows.h>
-#include <shellapi.h> //DO NOT REMOVE, necessary for Gradle builds
+#include <Shellapi.h>
+#include <locale.h>
 #include <tchar.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <malloc.h>
-#include <memory.h>
-#include <direct.h>
-#include <process.h>
-#include <string>
 
-#include "jni.h"
 
+typedef bool (*start_launcher)(int argc, TCHAR* argv[]);
+typedef void (*stop_launcher)();
 
-/*
-   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
+int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
+                       LPTSTR lpCmdLine, int nCmdShow) {
+    int result = 1;
+    TCHAR **argv;
+    int argc;
 
-   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.
-*/
+    // [RT-31061] otherwise UI can be left in back of other windows.
+    ::AllowSetForegroundWindow(ASFW_ANY);
 
-using namespace std;
+    ::setlocale(LC_ALL, "en_US.utf8");
+    argv = CommandLineToArgvW(GetCommandLine(), &argc);
 
-//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
+    HMODULE library = ::LoadLibrary(TEXT("packager.dll"));
+    start_launcher start = (start_launcher)GetProcAddress(library, "start_launcher");
+    stop_launcher stop = (stop_launcher)GetProcAddress(library, "stop_launcher");
 
-//debug hook to print JVM messages into console
-static bool isDebug = FALSE;
+    if (start(argc, argv) == true) {
+        result = 0;
+        stop();