6797688: Umbrella: Merge all JDK 6u4 - 6u12 deployment code into JDK7
6845973: Update JDK7 with deployment changes in 6u13, 6u14
4802695: Support 64-bit Java Plug-in and Java webstart on Windows/Linux on AMD64
6825019: DownloadManager should not be loaded and referenced for full JRE
6738770: REGRESSION:JSException throws when use LiveConnect javascript facility
6772884: plugin2 : java.lang.OutOfMemoryError or crash
6707535: Crossing domain hole affecting multiple sites/domains using plug-in
6728071: Non-verification of Update files may allow unintended updates
6704154: Code loaded from local filesystem should not get access to localhost
6727081: Web Start security restrictions bypass using special extension jnlp
6727079: Java Web Start Socket() restriction bypass
6727071: Cache location/user name information disclosure in SingleInstanceImpl.
6716217: AppletClassLoader adds permissions based on codebase regardless of CS
6694892: Java Webstart inclusion via system properties override [CVE-2008-2086]
6704074: localhost socket access due to cache location exposed
6703909: Java webstart arbitrary file creation using nativelib
6665315: browser crashes when deployment.properties has more slashes ( / )
6660121: Encoding values in JNLP files can cause buffer overflow
6606110: URLConnection.setProxiedHost for resources that are loaded via proxy
6581221: SSV(VISTA): Redirection FAILS to work if user does a downgrade install
6609756: Buffer Overflow in Java ActiveX component
6608712: Bypassing the same origin policy in Java with crafted names
6534630: "gnumake clobber" doesn't
6849953: JDK7 - replacement of bufferoverflowU.lib on amd64 breaks build
6849029: Need some JDK7 merge clean-up after comments on the webrev
6847582: Build problem on JDK7 with isSecureProperty in merge
6827935: JDK 7 deployment merging - problem in Compiler-msvm.gmk
6823215: latest merge fixes from 6u12 -> JDK7
6816153: further mergers for JDK7 deployment integration
6807074: Fix Java Kernel and JQS in initial JDK7 builds
Summary: Initial changeset for implementing 6uX Deployment Features into JDK7
Reviewed-by: dgu, billyh
diff --git a/src/windows/bin/java_md.c b/src/windows/bin/java_md.c
index c468258..df5e698 100644
--- a/src/windows/bin/java_md.c
+++ b/src/windows/bin/java_md.c
@@ -49,6 +49,7 @@
 static jboolean GetJVMPath(const char *jrepath, const char *jvmtype,
                            char *jvmpath, jint jvmpathsize);
 static jboolean GetJREPath(char *path, jint pathsize);
+static void EnsureJreInstallation(const char *jrepath);
 
 static jboolean _isjavaw = JNI_FALSE;
 
@@ -108,6 +109,9 @@
         exit(1);
     }
 
+    /* Do this before we read jvm.cfg */
+    EnsureJreInstallation(jrepath);
+
     /* Find out where the JRE is that we will be using. */
     if (!GetJREPath(jrepath, so_jrepath)) {
         JLI_ReportErrorMessage(JRE_ERROR1);
@@ -130,6 +134,103 @@
 
 }
 
+
+static jboolean
+LoadMSVCRT()
+{
+    // Only do this once
+    static int loaded = 0;
+    char crtpath[MAXPATHLEN];
+
+    if (!loaded) {
+        /*
+         * The Microsoft C Runtime Library needs to be loaded first.  A copy is
+         * assumed to be present in the "JRE path" directory.  If it is not found
+         * there (or "JRE path" fails to resolve), skip the explicit load and let
+         * nature take its course, which is likely to be a failure to execute.
+         */
+#ifdef _MSC_VER
+#if _MSC_VER < 1400
+#define CRT_DLL "msvcr71.dll"
+#endif
+#ifdef CRT_DLL
+        if (GetJREPath(crtpath, MAXPATHLEN)) {
+            (void)JLI_StrCat(crtpath, "\\bin\\" CRT_DLL);   /* Add crt dll */
+            JLI_TraceLauncher("CRT path is %s\n", crtpath);
+            if (_access(crtpath, 0) == 0) {
+                if (LoadLibrary(crtpath) == 0) {
+                    JLI_ReportErrorMessage(DLL_ERROR4, crtpath);
+                    return JNI_FALSE;
+                }
+            }
+        }
+#endif /* CRT_DLL */
+#endif /* _MSC_VER */
+        loaded = 1;
+    }
+    return JNI_TRUE;
+}
+
+/*
+ * The preJVMStart is a function in the jkernel.dll, which
+ * performs the final step of synthesizing back the decomposed
+ * modules  (partial install) to the full JRE. Any tool which
+ * uses the  JRE must peform this step to ensure the complete synthesis.
+ * The EnsureJreInstallation function calls preJVMStart based on
+ * the conditions outlined below, noting that the operation
+ * will fail silently if any of conditions are not met.
+ * NOTE: this call must be made before jvm.dll is loaded, or jvm.cfg
+ * is read, since jvm.cfg will be modified by the preJVMStart.
+ * 1. Are we on a supported platform.
+ * 2. Find the location of the JRE or the Kernel JRE.
+ * 3. check existence of JREHOME/lib/bundles
+ * 4. check jkernel.dll and invoke the entry-point
+ */
+typedef VOID (WINAPI *PREJVMSTART)();
+
+static void
+EnsureJreInstallation(const char* jrepath)
+{
+    HINSTANCE handle;
+    char tmpbuf[MAXPATHLEN];
+    PREJVMSTART PreJVMStart;
+    struct stat s;
+
+    /* 32 bit windows only please */
+    if (strcmp(GetArch(), "i386") != 0 ) {
+        return;
+    }
+    /* Does our bundle directory exist ? */
+    strcpy(tmpbuf, jrepath);
+    strcat(tmpbuf, "\\lib\\bundles");
+    if (stat(tmpbuf, &s) != 0) {
+        return;
+    }
+    /* Does our jkernel dll exist ? */
+    strcpy(tmpbuf, jrepath);
+    strcat(tmpbuf, "\\bin\\jkernel.dll");
+    if (stat(tmpbuf, &s) != 0) {
+        return;
+    }
+    /* The Microsoft C Runtime Library needs to be loaded first. */
+    if (!LoadMSVCRT()) {
+        return;
+    }
+    /* Load the jkernel.dll */
+    if ((handle = LoadLibrary(tmpbuf)) == 0) {
+        return;
+    }
+    /* Get the function address */
+    PreJVMStart = (PREJVMSTART)GetProcAddress(handle, "preJVMStart");
+    if (PreJVMStart == NULL) {
+        FreeLibrary(handle);
+        return;
+    }
+    PreJVMStart();
+    FreeLibrary(handle);
+    return;
+}
+
 /*
  * Find path to JRE based on .exe's location or registry settings.
  */
@@ -196,7 +297,6 @@
 LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn)
 {
     HINSTANCE handle;
-    char crtpath[MAXPATHLEN];
 
     JLI_TraceLauncher("JVM path is %s\n", jvmpath);
 
@@ -206,26 +306,8 @@
      * there (or "JRE path" fails to resolve), skip the explicit load and let
      * nature take its course, which is likely to be a failure to execute.
      *
-     * (NOTE: the above statement is only true for Visual Studio 2003 and
-     *  msvcr71.dll.)
      */
-#ifdef _MSC_VER
-#if _MSC_VER < 1400
-#define CRT_DLL "msvcr71.dll"
-#endif
-#ifdef CRT_DLL
-    if (GetJREPath(crtpath, MAXPATHLEN)) {
-        (void)JLI_StrCat(crtpath, "\\bin\\" CRT_DLL);   /* Add crt dll */
-        JLI_TraceLauncher("CRT path is %s\n", crtpath);
-        if (_access(crtpath, 0) == 0) {
-            if (LoadLibrary(crtpath) == 0) {
-                JLI_ReportErrorMessage(DLL_ERROR4, crtpath);
-                return JNI_FALSE;
-            }
-        }
-    }
-#endif /* CRT_DLL */
-#endif /* _MSC_VER */
+    LoadMSVCRT();
 
     /* Load the Java VM DLL */
     if ((handle = LoadLibrary(jvmpath)) == 0) {
diff --git a/src/windows/native/common/jni_util_md.c b/src/windows/native/common/jni_util_md.c
new file mode 100644
index 0000000..b57e4ee
--- /dev/null
+++ b/src/windows/native/common/jni_util_md.c
@@ -0,0 +1,139 @@
+/*
+ * Copyright 2004 - 2009 Sun Microsystems, Inc.  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.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <windows.h>
+#include <locale.h>
+
+#include "jni.h"
+#include "jni_util.h"
+
+static void getParent(const TCHAR *path, TCHAR *dest) {
+    char* lastSlash = max(strrchr(path, '\\'), strrchr(path, '/'));
+    if (lastSlash == NULL) {
+        *dest = 0;
+        return;
+    }
+    if (path != dest)
+        strcpy(dest, path);
+    *lastSlash = 0;
+}
+
+BOOL useNativeConverter(JNIEnv *env) {
+    static BOOL initialized;
+    static BOOL useNative;
+    if (!initialized) {
+        HMODULE jvm = GetModuleHandle("jvm");
+        useNative = FALSE;
+        if (jvm != NULL) {
+            TCHAR *jvmPath = NULL;
+            int bufferSize = MAX_PATH;
+            while (jvmPath == NULL) {
+                DWORD result;
+                jvmPath = malloc(bufferSize);
+                if (jvmPath == NULL)
+                    return FALSE;
+                result = GetModuleFileName(jvm, jvmPath, bufferSize);
+                if (result == 0)
+                    return FALSE;
+                if (result == bufferSize) { // didn't fit
+                    bufferSize += MAX_PATH; // increase buffer size, try again
+                    free(jvmPath);
+                    jvmPath = NULL;
+                }
+            }
+
+            getParent(jvmPath, jvmPath);
+            useNative = (!strcmp("kernel", jvmPath + strlen(jvmPath) -
+                    strlen("kernel"))); // true if jvm.dll lives in "kernel"
+            if (useNative)
+                setlocale(LC_ALL, "");
+            free(jvmPath);
+        }
+        initialized = TRUE;
+    }
+    return useNative;
+}
+
+jstring nativeNewStringPlatform(JNIEnv *env, const char *str) {
+    static String_char_constructor = NULL;
+    if (useNativeConverter(env)) {
+        // use native Unicode conversion so Kernel isn't required during
+        // System.initProperties
+        jcharArray chars = 0;
+        wchar_t *utf16;
+        int len;
+        jstring result = NULL;
+
+        if (getFastEncoding() == NO_ENCODING_YET)
+            initializeEncoding(env);
+
+        len = mbstowcs(NULL, str, strlen(str));
+        if (len == -1)
+            return NULL;
+        utf16 = calloc(len + 1, 2);
+        if (mbstowcs(utf16, str, len) == -1)
+            return NULL;
+        chars = (*env)->NewCharArray(env, len);
+        if (chars == NULL)
+            return NULL;
+        (*env)->SetCharArrayRegion(env, chars, 0, len, utf16);
+        if (String_char_constructor == NULL)
+            String_char_constructor = (*env)->GetMethodID(env,
+                    JNU_ClassString(env), "<init>", "([C)V");
+        result = (*env)->NewObject(env, JNU_ClassString(env),
+                String_char_constructor, chars);
+        free(utf16);
+        return result;
+    }
+    else
+        return NULL;
+}
+
+
+char* nativeGetStringPlatformChars(JNIEnv *env, jstring jstr, jboolean *isCopy) {
+    if (useNativeConverter(env)) {
+        // use native Unicode conversion so Kernel isn't required during
+        // System.initProperties
+        char *result = NULL;
+        size_t len;
+        const jchar* utf16 = (*env)->GetStringChars(env, jstr, NULL);
+        len = wcstombs(NULL, utf16, (*env)->GetStringLength(env, jstr) * 4) + 1;
+        if (len == -1)
+            return NULL;
+        result = (char*) malloc(len);
+        if (result != NULL) {
+            if (wcstombs(result, utf16, len) == -1)
+                return NULL;
+            (*env)->ReleaseStringChars(env, jstr, utf16);
+            if (isCopy)
+                *isCopy = JNI_TRUE;
+        }
+        return result;
+    }
+    else
+        return NULL;
+}
diff --git a/src/windows/native/sun/jkernel/DownloadDialog.cpp b/src/windows/native/sun/jkernel/DownloadDialog.cpp
new file mode 100644
index 0000000..d56a516
--- /dev/null
+++ b/src/windows/native/sun/jkernel/DownloadDialog.cpp
@@ -0,0 +1,891 @@
+/*
+ * Copyright 2008 - 2009 Sun Microsystems, Inc.  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.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#define STRICT
+#ifndef _WIN32_WINNT
+#define _WIN32_WINNT 0x0400
+#endif
+#define _ATL_APARTMENT_THREADED
+
+#include <atlbase.h>
+//You may derive a class from CComModule and use it if you want to override
+//something, but do not change the name of _Module
+extern CComModule _Module;
+#include <atlcom.h>
+#include <atlwin.h>
+
+#include <atlhost.h>
+#include <commdlg.h>
+#include <commctrl.h>
+#include <windowsx.h>
+#include <urlmon.h>
+#include <wininet.h>
+#include <shellapi.h>
+#include <time.h>
+#include <math.h>
+#include <stdio.h>
+#include <jni.h>
+
+#include "DownloadDialog.h"
+
+#define UPDATE_INTERVAL 500
+#define INITIAL_DELAY 2000
+#define POST_DELAY 1000
+
+/////////////////////////////////////////////////////////////////////////////
+// CDownloadDialog
+
+typedef BOOL (WINAPI * InitCommonControlsType)();
+
+CDownloadDialog::CDownloadDialog()
+{
+    m_numDownloadThreadsRunning = 0;
+
+    m_destroyWindowTimerStarted = FALSE;
+    m_pszFileName = NULL;
+    m_jvm = NULL;
+
+    m_ulProgress = 0;
+    m_ulProgressMax = 0;
+    m_iProgressFactor = 0;
+    m_iMaxProgressFactor = 1;
+
+
+    m_hCancelEvent = ::CreateEvent(NULL, TRUE, FALSE, NULL);
+    m_hDownloadThreadExitEvent = ::CreateEvent(NULL, TRUE, FALSE, NULL);
+    m_hDialogInitializedEvent = ::CreateEvent(NULL, TRUE, FALSE, NULL);
+
+    // Load up commctrl.dll
+    // Loading dll dynamically we can use latest available version
+    // (i.e. latest native components and extended API)
+    HMODULE hModComCtl32 = ::LoadLibrary(TEXT("comctl32.dll"));
+    if (hModComCtl32 != NULL) {
+        /* Initialize controls to ensure proper appearance */
+        InitCommonControlsType fn_InitCommonControls = (InitCommonControlsType)
+            ::GetProcAddress(hModComCtl32, "InitCommonControls");
+        fn_InitCommonControls();
+
+        /* MessageBox replacement introduced in Vista */
+        taskDialogFn = (TaskDialogIndirectFn)
+            ::GetProcAddress(hModComCtl32, "TaskDialogIndirect");
+    }
+}
+
+
+CDownloadDialog::~CDownloadDialog()
+{
+    ::CloseHandle(m_hCancelEvent);
+    ::CloseHandle(m_hDownloadThreadExitEvent);
+    ::CloseHandle(m_hDialogInitializedEvent);
+}
+
+void CDownloadDialog::addToTotalContentLength(DWORD contentLength) {
+     __try
+    {
+        m_csDownload.Lock();
+        if (m_ulProgressMax == 0) {
+            // first download this session, initialize start time
+            time(&m_startTime);
+        }
+
+        m_ulProgressMax = m_ulProgressMax + contentLength;
+        logProgress();
+    }
+    __finally
+    {
+        m_csDownload.Unlock();
+    }
+}
+
+
+
+void CDownloadDialog::initDialogText(LPCTSTR downloadURL, LPCTSTR bundleName) {
+
+    // reset status text
+    HWND hStatusWnd = GetDlgItem(IDC_TIME_REMAINING);
+    ::SetWindowText(hStatusWnd, "");
+
+    // reset progress bar
+    HWND hProgressWnd = GetDlgItem(IDC_DOWNLOAD_PROGRESS);
+
+    ::PostMessage(hProgressWnd, PBM_SETPOS, (WPARAM) 0, NULL);
+
+    m_hMastheadFont = NULL;
+    m_hDialogFont = NULL;
+    m_hSixPointFont = NULL;
+
+    m_hMemDC = NULL;
+
+    TCHAR szDownloadText[BUFFER_SIZE];
+
+    HWND hWndDownloadText = GetDlgItem(IDC_DOWNLOAD_TEXT);
+    ::LoadString(_Module.GetModuleInstance(), IDS_DOWNLOAD_TEXT, szDownloadText, BUFFER_SIZE);
+    ::SetWindowText(hWndDownloadText, szDownloadText);
+
+    TCHAR szMasthead[BUFFER_SIZE];
+
+    HWND hWndMastheadText = GetDlgItem(IDC_MASTHEAD_TEXT);
+    ::LoadString(_Module.GetModuleInstance(), IDS_DOWNLOAD, szMasthead, BUFFER_SIZE);
+    ::SetWindowText(hWndMastheadText, szMasthead);
+
+
+}
+
+BOOL CDownloadDialog::isDownloading() {
+    return m_numDownloadThreadsRunning > 0;
+}
+
+
+void CDownloadDialog::bundleInstallStart() {
+    __try
+    {
+        m_csNumDownloadThreads.Lock();
+        m_numDownloadThreadsRunning++;
+        // another download request has came in, kill the destroyWindowTimer
+        KillTimer(destroyWindowTimerID);
+        m_destroyWindowTimerStarted = FALSE;
+    }
+    __finally
+    {
+        m_csNumDownloadThreads.Unlock();
+    }
+}
+
+void CDownloadDialog::bundleInstallComplete() {
+    __try
+    {
+        m_csNumDownloadThreads.Lock();
+        m_numDownloadThreadsRunning = max(m_numDownloadThreadsRunning - 1, 0);
+        if (m_numDownloadThreadsRunning == 0) {
+            m_ulProgress = m_ulProgressMax;
+            logProgress();
+        }
+        // Signal main thread
+        ::SetEvent(m_hDownloadThreadExitEvent);
+    }
+    __finally
+    {
+        m_csNumDownloadThreads.Unlock();
+    }
+}
+
+
+//=--------------------------------------------------------------------------=
+// CDownloadDialog::OnInitDialog
+//=--------------------------------------------------------------------------=
+// Message handler for WM_INITDIALOG
+//
+// Parameters:
+//      uMsg        Windows Message
+//      wParam      WPARAM
+//      lParam      LPARAM
+//      bHandled    FALSE if not handled
+//
+// Output:
+//      LRESULT
+//
+// Notes:
+//
+LRESULT CDownloadDialog::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+     __try
+    {
+        m_csDownload.Lock();
+    }
+    __finally
+    {
+        m_csDownload.Unlock();
+    }
+    // Set timer
+    SetTimer(iTimerID, UPDATE_INTERVAL);
+
+    m_hMastheadFont = NULL;
+    m_hDialogFont = NULL;
+    m_hSixPointFont = NULL;
+    m_feedbackOnCancel = TRUE;
+
+    m_hMemDC = NULL;
+
+    TCHAR szDownloadText[BUFFER_SIZE];
+
+    HWND hWndDownloadText = GetDlgItem(IDC_DOWNLOAD_TEXT);
+    ::LoadString(_Module.GetModuleInstance(), IDS_DOWNLOAD_TEXT, szDownloadText, BUFFER_SIZE);
+    ::SetWindowText(hWndDownloadText, szDownloadText);
+
+    TCHAR szMasthead[BUFFER_SIZE];
+
+    HWND hWndMastheadText = GetDlgItem(IDC_MASTHEAD_TEXT);
+    ::LoadString(_Module.GetModuleInstance(), IDS_DOWNLOAD, szMasthead, BUFFER_SIZE);
+    ::SetWindowText(hWndMastheadText, szMasthead);
+
+    HICON javaCupIcon = ::LoadIcon(_Module.GetModuleInstance(), MAKEINTRESOURCE(IDI_JAVA));
+    SetIcon(javaCupIcon, FALSE);
+
+    ::SetEvent(m_hDialogInitializedEvent);
+
+    return 0;  // do not set initial focus to cancel button
+}
+
+
+//=--------------------------------------------------------------------------=
+// CDownloadDialog::OnOK
+//=--------------------------------------------------------------------------=
+// Message handler for WM_COMMAND with IDOK
+//
+// Parameters:
+//      wNotifyCode Notify Code
+//      wID         ID of control
+//      hWndCtl     HWND of control
+//      bHandled    FALSE if not handled
+//
+// Output:
+//      LRESULT
+//
+// Notes:
+//
+LRESULT CDownloadDialog::OnOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
+{
+    // do nothing for now
+    return 0;
+}
+
+
+
+//=--------------------------------------------------------------------------=
+// CDownloadDialog::OnCancel
+//=--------------------------------------------------------------------------=
+// Message handler for WM_COMMAND with IDCANCEL
+//
+// Parameters:
+//      wNotifyCode Notify Code
+//      wID         ID of control
+//      hWndCtl     HWND of control
+//      bHandled    FALSE if not handled
+//
+// Output:
+//      LRESULT
+//
+// Notes:
+//
+LRESULT CDownloadDialog::OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
+{
+    // Disable window first to avoid any keyboard input
+    EnableWindow(FALSE);
+
+    if (m_feedbackOnCancel) {
+      int r = SafeMessageBox(IDS_DOWNLOAD_CANCEL_MESSAGE,
+                       IDS_DOWNLOAD_CANCEL_INSTRUCTION,
+                       IDS_DOWNLOAD_CANCEL_CAPTION,
+                       DIALOG_WARNING_CANCELOK,
+                       NULL, NULL);
+      if (!::IsWindow(hWndCtl)) {
+         /* It is possible that download was finished and download
+            window hidden by the time user close this message box.
+            If such case we should simply return. */
+         return 0;
+      }
+      if (r == IDCANCEL) {
+        EnableWindow(TRUE);
+        return 0;
+      }
+    }
+
+    __try
+    {
+        m_csDownload.Lock();
+        // if we are downloading, signal download thread to stop downloading
+        if (m_numDownloadThreadsRunning > 0) {
+            SetEvent(m_hCancelEvent);
+        }
+    }
+    __finally
+    {
+        m_csDownload.Unlock();
+    }
+
+    // Kill timer
+    KillTimer(iTimerID);
+    KillTimer(destroyWindowTimerID);
+
+    FreeGDIResources();
+
+    // Destroy dialog
+    EndDialog(wID);
+
+    return 0;
+}
+
+void CDownloadDialog::destroyDialog() {
+    m_feedbackOnCancel = FALSE;
+    ::PostMessage(m_hWnd, WM_COMMAND, IDCANCEL, NULL);
+}
+
+
+void CDownloadDialog::delayedDoModal() {
+     __try
+    {
+         __try
+        {
+            m_csMessageBox.Lock();
+            m_dialogUp = true;
+            Sleep(INITIAL_DELAY);
+        }
+        __finally
+        {
+            m_csMessageBox.Unlock();
+        }
+
+        if (isDownloading())
+            DoModal();
+    }
+    __finally
+    {
+        m_dialogUp = false;
+    }
+}
+
+
+//=--------------------------------------------------------------------------=
+// CDownloadDialog::SafeMessageBox
+//=--------------------------------------------------------------------------=
+// Helper method that uses best availble API to show native error/information
+// dialog. In particular, it uses TaskDialog if availble (Vista specific)
+// and MessageBox otherwise.
+//
+// It also ensures that the message box is always displayed on top of
+// the progress dialog instead of underneath
+//
+
+//helper structures to define XP vs Vista style differences
+static TASKDIALOG_COMMON_BUTTON_FLAGS vistaDialogButtons[] = {
+    TDCBF_RETRY_BUTTON | TDCBF_CANCEL_BUTTON,
+    TDCBF_OK_BUTTON | TDCBF_CANCEL_BUTTON
+};
+static PCWSTR vistaIcons[] = {
+    TD_ERROR_ICON,
+    TD_WARNING_ICON
+};
+
+static UINT xpStyle[] = {
+    MB_ICONERROR | MB_RETRYCANCEL,
+    MB_ICONWARNING | MB_OKCANCEL | MB_DEFBUTTON2
+};
+
+int CDownloadDialog::SafeMessageBox(UINT details, UINT mainInstruction, UINT caption, DialogType type, LPCWSTR instructionArg, LPCWSTR detailsArg) {
+    WCHAR textCaption[BUFFER_SIZE+1];
+    WCHAR textDetails[BUFFER_SIZE+1];
+    WCHAR textInstruction[BUFFER_SIZE+1];
+    WCHAR tmpBuffer[BUFFER_SIZE+1];
+
+    /* make sure buffers are terminated */
+    textCaption[BUFFER_SIZE] = textDetails[BUFFER_SIZE] = 0;
+    textInstruction[BUFFER_SIZE] = tmpBuffer[BUFFER_SIZE] = 0;
+
+    if (detailsArg != NULL) {
+        ::LoadStringW(_Module.GetResourceInstance(),
+                 details,
+                 tmpBuffer,
+                 BUFFER_SIZE);
+        _snwprintf(textDetails, BUFFER_SIZE, tmpBuffer, detailsArg);
+    } else {
+        ::LoadStringW(_Module.GetResourceInstance(),
+                 details,
+                 textDetails,
+                 BUFFER_SIZE);
+    }
+
+    if (instructionArg != NULL) {
+        ::LoadStringW(_Module.GetResourceInstance(),
+                 mainInstruction,
+                 tmpBuffer,
+                 BUFFER_SIZE);
+        _snwprintf(textInstruction, BUFFER_SIZE, tmpBuffer, instructionArg);
+     } else {
+        ::LoadStringW(_Module.GetResourceInstance(),
+                 mainInstruction,
+                 textInstruction,
+                 BUFFER_SIZE);
+     }
+
+    ::LoadStringW(_Module.GetResourceInstance(),
+                 caption,
+                 textCaption,
+                 BUFFER_SIZE);
+
+    __try
+    {
+        m_csMessageBox.Lock();
+        if (m_dialogUp) {
+            waitUntilInitialized();
+        }
+        /* If TaskDialog availble - use it! */
+        if (taskDialogFn != NULL) {
+              TASKDIALOGCONFIG tc = { 0 };
+              int nButton;
+
+              tc.cbSize = sizeof(tc);
+              tc.hwndParent = ::IsWindow(m_hWnd) ? m_hWnd : NULL;
+              tc.dwCommonButtons = vistaDialogButtons[type];
+              tc.pszWindowTitle = textCaption;
+              tc.pszMainInstruction = textInstruction;
+              tc.pszContent = textDetails;
+              tc.pszMainIcon = vistaIcons[type];
+              /* workaround: we need to make sure Cancel is default
+                             for this type of Dialog */
+              if (type == DIALOG_WARNING_CANCELOK) {
+                  tc.nDefaultButton = IDCANCEL;
+              }
+
+              taskDialogFn(&tc, &nButton, NULL, NULL);
+              return nButton;
+        } else { /* default: use MessageBox */
+            /* Note that MessageBox API expects content as single string
+               and therefore we need to concatenate instruction
+               and details as 2 paragraphs.
+
+               The only exception is empty instruction. */
+            if (wcslen(textInstruction) > 0) {
+                wcsncat(textInstruction, L"\n\n",
+                        BUFFER_SIZE - wcslen(textInstruction));
+            }
+            wcsncat(textInstruction, textDetails,
+                    BUFFER_SIZE - wcslen(textInstruction));
+
+            return ::MessageBoxW(::IsWindow(m_hWnd) ? m_hWnd : NULL,
+                textInstruction, textCaption, xpStyle[type]);
+        }
+    }
+    __finally
+    {
+        m_csMessageBox.Unlock();
+    }
+}
+
+
+//=--------------------------------------------------------------------------=
+// CDownloadDialog::OnTimer
+//=--------------------------------------------------------------------------=
+// Message handler for WM_TIMER
+//
+// Parameters:
+//      uMsg        Windows Message
+//      wParam      WPARAM
+//      lParam      LPARAM
+//      bHandled    FALSE if not handled
+//
+// Output:
+//      LRESULT
+//
+// Notes:
+//
+LRESULT CDownloadDialog::OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+    if (destroyWindowTimerID == (int)wParam) {
+        KillTimer(destroyWindowTimerID);
+        m_destroyWindowTimerStarted = FALSE;
+        m_ulProgressMax = max(0, m_ulProgressMax - m_ulProgress);
+        logProgress();
+        m_ulProgress = 0;
+        logProgress();
+        m_feedbackOnCancel = FALSE;
+        ::PostMessage(m_hWnd, WM_COMMAND, IDCANCEL, NULL);
+    }
+
+    if (iTimerID == (int)wParam)
+    {
+
+        __try
+        {
+            m_csDownload.Lock();
+
+            HWND hStatusWnd = GetDlgItem(IDC_TIME_REMAINING);
+            HWND hProgressWnd = GetDlgItem(IDC_DOWNLOAD_PROGRESS);
+
+            if (m_ulProgress && m_ulProgressMax)
+            {
+                ::PostMessage(hProgressWnd, PBM_SETPOS,
+                     (WPARAM) (m_ulProgress * 100
+                        / m_ulProgressMax), NULL);
+
+                time_t currentTime;
+                time(&currentTime);
+
+                double elapsed_time = difftime(currentTime, m_startTime);
+                double remain_time = (elapsed_time / m_ulProgress) *
+                                      (m_ulProgressMax - m_ulProgress);
+                int hr = 0, min = 0;
+
+                if (remain_time > 60 * 60)
+                {
+                    hr = int(remain_time / (60 * 60));
+                    remain_time = remain_time - hr * 60 * 60;
+                }
+
+                if (remain_time > 60)
+                {
+                    min = int(remain_time / 60);
+                    remain_time = remain_time - min * 60;
+                }
+
+                TCHAR szBuffer[BUFFER_SIZE];
+                TCHAR szTimeBuffer[BUFFER_SIZE];
+
+                if (hr > 0)
+                {
+                    if (hr > 1)
+                        LoadString(_Module.GetResourceInstance(), IDS_HOURSMINUTESECOND,
+                                   szTimeBuffer, BUFFER_SIZE);
+                    else
+                        LoadString(_Module.GetResourceInstance(), IDS_HOURMINUTESECOND,
+                                   szTimeBuffer, BUFFER_SIZE);
+
+                    sprintf(szBuffer, szTimeBuffer, hr, min, remain_time);
+                }
+                else
+                {
+                    if (min > 0)
+                    {
+                        LoadString(_Module.GetResourceInstance(), IDS_MINUTESECOND,
+                                   szTimeBuffer, BUFFER_SIZE);
+                        sprintf(szBuffer, szTimeBuffer, min, remain_time);
+
+                    }
+                    else
+                    {
+                        LoadString(_Module.GetResourceInstance(), IDS_SECOND,
+                                   szTimeBuffer, BUFFER_SIZE);
+                        sprintf(szBuffer, szTimeBuffer, remain_time);
+
+                    }
+                }
+
+                if (m_ulProgress == m_ulProgressMax) {
+                    // download is done, unpacking bundle now, and waiting
+                    // for another download to take place
+                    ::LoadString(_Module.GetResourceInstance(),
+                            IDS_DOWNLOAD_UNPACKING, szBuffer, BUFFER_SIZE);
+                    __try
+                    {
+                        m_csNumDownloadThreads.Lock();
+                        // both download and unpacking is done, start
+                        // timer to destroy the progress window in 500ms
+                        if (!m_destroyWindowTimerStarted &&
+                               m_numDownloadThreadsRunning == 0) {
+                            SetTimer(destroyWindowTimerID, POST_DELAY);
+                            m_destroyWindowTimerStarted = TRUE;
+                        }
+                    }
+                    __finally
+                    {
+                        m_csNumDownloadThreads.Unlock();
+                    }
+                }
+
+                // Update status message
+                ::SetWindowText(hStatusWnd, szBuffer);
+            }
+        }
+        __finally
+        {
+           m_csDownload.Unlock();
+        }
+    }
+
+    return 0;
+}
+
+// Message handler for WM_ONCTLCOLORSTATIC.
+// this message is sent each time a static control is drawn.
+// we get the Control ID and then set background color and font
+// as appropriate for that control.
+LRESULT CDownloadDialog::OnCtlColorStatic(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+    HDC hdc = (HDC) wParam;
+    HWND hwnd = (HWND) lParam;
+
+    int DlgCtrlID = ::GetDlgCtrlID(hwnd);
+
+    if (DlgCtrlID == IDC_DOWNLOAD_TEXT )
+    {
+        if (m_hDialogFont == NULL)
+        {
+            m_hDialogFont = CreateDialogFont(hdc, TEXT("MS Shell Dlg"), 8);
+        }
+
+        ::SelectObject(hdc, m_hDialogFont);
+        return 0;
+    }
+    else if (DlgCtrlID == IDC_TIME_REMAINING)
+    {
+        if (m_hSixPointFont == NULL)
+        {
+            m_hSixPointFont = CreateDialogFont(hdc, TEXT("MS Shell Dlg"), 8);
+        }
+
+        ::SelectObject(hdc, m_hSixPointFont);
+        return 0;
+    }
+    else if (DlgCtrlID == IDC_MASTHEAD_TEXT)
+    {
+        if (m_hMastheadFont == NULL)
+        {
+            m_hMastheadFont = CreateDialogFont(hdc, TEXT("MS Shell Dlg"), 12, 1);
+        }
+
+        ::SelectObject(hdc, m_hMastheadFont);
+        return (LRESULT) GetStockObject(WHITE_BRUSH);
+    }
+    else if (DlgCtrlID == IDC_DOWNLOAD_MASTHEAD)
+    {
+        if (m_hMemDC == NULL)
+        {
+            m_hBitmap = LoadBitmap(_Module.GetModuleInstance(),
+                                   MAKEINTRESOURCE(IDI_MASTHEAD));
+            GetObject(m_hBitmap, sizeof(BITMAP), &m_bmMasthead);
+            m_hMemDC = CreateCompatibleDC(NULL);
+            SelectObject(m_hMemDC, m_hBitmap);
+        }
+
+        RECT rect;
+        ::GetClientRect(hwnd, &rect);
+
+        StretchBlt(hdc, rect.left, rect.top, (rect.right - rect.left), (rect.bottom - rect.top),
+                   m_hMemDC, 0, 0, m_bmMasthead.bmWidth, m_bmMasthead.bmHeight, SRCCOPY);
+
+        return (LRESULT) GetStockObject(NULL_BRUSH);
+    }
+
+
+    return 0;
+}
+
+
+//=--------------------------------------------------------------------------=
+// CDownloadDialog::OnStartBinding
+//=--------------------------------------------------------------------------=
+// Called when download is started
+//
+// Parameters:
+//
+// Output:
+//      HRESULT
+//
+// Notes:
+//
+STDMETHODIMP CDownloadDialog::OnStartBinding()
+{
+    __try
+    {
+        m_csDownload.Lock();
+        time(&m_startTime);
+    }
+    __finally
+    {
+        m_csDownload.Unlock();
+    }
+
+    return S_OK;
+}
+
+
+//=--------------------------------------------------------------------------=
+// CDownloadDialog::OnProgress
+//=--------------------------------------------------------------------------=
+// Called when download is in progress
+//
+// Parameters: ULONG ulProgress
+//
+// Output:
+//      HRESULT
+//
+// Notes:
+//
+STDMETHODIMP CDownloadDialog::OnProgress(ULONG ulProgress)
+{
+    __try
+    {
+        m_csDownload.Lock();
+        m_ulProgress = m_ulProgress + ulProgress;
+        logProgress();
+
+    }
+    __finally
+    {
+        m_csDownload.Unlock();
+    }
+
+    return S_OK;
+}
+
+void CDownloadDialog::decrementProgressMax(ULONG contentLength, ULONG readSoFar) {
+    __try
+    {
+        m_csDownload.Lock();
+        m_ulProgressMax = m_ulProgressMax - contentLength;
+        m_ulProgress = m_ulProgress - readSoFar;
+        logProgress();
+    }
+    __finally
+    {
+        m_csDownload.Unlock();
+    }
+
+}
+
+void CDownloadDialog::waitUntilInitialized() {
+    // wait until download progress dialog is initialized and ready to show
+    WaitForSingleObject(m_hDialogInitializedEvent, INFINITE);
+    ResetEvent(m_hDialogInitializedEvent);
+
+}
+
+// Check if download has been cancelled
+BOOL CDownloadDialog::isDownloadCancelled() {
+    if (WAIT_OBJECT_0 == WaitForSingleObject(m_hCancelEvent, 0)) {
+        return TRUE;
+    }
+    return FALSE;
+}
+
+
+
+// Create the fonts we need for the download and
+// install UE
+HFONT CDownloadDialog::CreateDialogFont(HDC hdc, LPCTSTR lpszFaceName, int ptSize, int isBold)
+{
+    POINT pt;
+    FLOAT cxDPI, cyDPI;
+    HFONT hFont;
+    LOGFONT lf;
+
+    int iDeciPtWidth = 0;
+    int iDeciPtHeight = 10 * ptSize;
+
+    int iSavedDC = SaveDC(hdc);
+
+    SetGraphicsMode (hdc, GM_ADVANCED);
+    ModifyWorldTransform(hdc, NULL, MWT_IDENTITY);
+    SetViewportOrgEx (hdc, 0,0, NULL);
+    SetWindowOrgEx (hdc, 0,0, NULL);
+
+    cxDPI = (FLOAT) GetDeviceCaps(hdc, LOGPIXELSX);
+    cyDPI = (FLOAT) GetDeviceCaps(hdc, LOGPIXELSY);
+
+    pt.x = (int) (iDeciPtWidth * cxDPI / 72);
+    pt.y = (int) (iDeciPtHeight * cyDPI / 72);
+
+    DPtoLP(hdc, &pt, 1);
+
+    lf.lfHeight = - (int) (fabs ((double) pt.y) / 10.0 + 0.5);
+    lf.lfWidth = 0;
+    lf.lfEscapement = 0;
+    lf.lfOrientation = 0;
+    lf.lfWeight = (isBold > 0) ? FW_BOLD : 0;
+    lf.lfItalic = 0;
+    lf.lfUnderline = 0;
+    lf.lfStrikeOut = 0;
+    lf.lfCharSet = 0;
+    lf.lfOutPrecision = 0;
+    lf.lfClipPrecision = 0;
+    lf.lfQuality = 0;
+    lf.lfPitchAndFamily = 0;
+
+    TCHAR szLocaleData[BUFFER_SIZE];
+    GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_SENGCOUNTRY,
+                  szLocaleData, BUFFER_SIZE);
+
+    if (strncmp(szLocaleData, "Japan", 5) == 0) {
+        // need special font for _ja locale
+        strcpy (lf.lfFaceName, TEXT("MS UI Gothic"));
+    } else {
+        strcpy (lf.lfFaceName, lpszFaceName);
+    }
+
+    hFont = CreateFontIndirect(&lf);
+
+    RestoreDC (hdc, iSavedDC);
+    return hFont;
+}
+
+void CDownloadDialog::FreeGDIResources ()
+{
+    ::DeleteObject(m_hMastheadFont);
+    m_hMastheadFont = NULL;
+
+    ::DeleteObject(m_hDialogFont);
+    m_hDialogFont = NULL;
+
+    ::DeleteObject(m_hSixPointFont);
+    m_hSixPointFont = NULL;
+
+    ::DeleteObject(m_hBitmap);
+    m_hBitmap = NULL;
+
+    ::DeleteDC(m_hMemDC);
+    m_hMemDC = NULL;
+}
+
+
+JNIEnv* CDownloadDialog::getJNIEnv() {
+    if (m_jvm == NULL)
+        return NULL;
+    JNIEnv *env;
+    m_jvm->AttachCurrentThread((void**) &env, NULL);
+    return env;
+}
+
+
+void CDownloadDialog::log(char *msg) {
+    JNIEnv *env = getJNIEnv();
+    if (env != NULL) {
+        jclass dm = env->FindClass("sun/jkernel/DownloadManager");
+        if (dm == NULL) {
+            printf("Cound not find class sun.jkernel.DownloadManager\n");
+            return;
+        }
+        jmethodID log = env->GetStaticMethodID(dm, "log", "(Ljava/lang/String;)V");
+        if (log == NULL) {
+            printf("Could not find method sun.jkernel.DownloadManager.log(String)\n");
+            return;
+        }
+        jstring string = env->NewStringUTF(msg);
+        if (string == NULL) {
+            printf("Error creating log string\n");
+            return;
+        }
+        env->CallStaticVoidMethod(dm, log, string);
+    }
+}
+
+
+void CDownloadDialog::logProgress() {
+    char msg[256];
+    sprintf(msg, "Progress: %d / %d", m_ulProgress, m_ulProgressMax);
+    log(msg);
+}
diff --git a/src/windows/native/sun/jkernel/DownloadDialog.h b/src/windows/native/sun/jkernel/DownloadDialog.h
new file mode 100644
index 0000000..30ed9bd
--- /dev/null
+++ b/src/windows/native/sun/jkernel/DownloadDialog.h
@@ -0,0 +1,329 @@
+/*
+ * Copyright 2008 - 2009 Sun Microsystems, Inc.  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.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+//
+// DownloadDialog.h : Declaration of the CDownloadDialog
+//
+
+#ifndef __DOWNLOADDIALOG_H_
+#define __DOWNLOADDIALOG_H_
+
+#include "resource.h"       // main symbols
+#include <time.h>
+#include "jni.h"
+
+#ifndef BUFFER_SIZE
+#define BUFFER_SIZE 2048
+#endif
+
+#define iTimerID    1000
+#define destroyWindowTimerID    2000
+
+#define E_JDHELPER_TIMEOUT               12002
+#define E_JDHELPER_NAME_NOT_RESOLVED     12007
+#define E_JDHELPER_CANNOT_CONNECT        12029
+
+/* Following lines were copied from the new version of commctrl.h
+   These definitions are not available in default version of
+   this header file in VS 2003 but they are needed to use
+   new Vista task dialog API.
+*/
+#ifndef TD_ERROR_ICON
+
+/* These modifiers have sense with new VS only,
+   reset them to get code to compile */
+#define __in
+#define __in_opt
+#define __out_opt
+
+#ifdef _WIN32
+#include <pshpack1.h>
+#endif
+
+
+typedef HRESULT (CALLBACK *PFTASKDIALOGCALLBACK)(HWND hwnd, __in UINT msg, __in WPARAM wParam, __in LPARAM lParam, __in LONG_PTR lpRefData);
+
+enum _TASKDIALOG_FLAGS
+{
+    TDF_ENABLE_HYPERLINKS               = 0x0001,
+    TDF_USE_HICON_MAIN                  = 0x0002,
+    TDF_USE_HICON_FOOTER                = 0x0004,
+    TDF_ALLOW_DIALOG_CANCELLATION       = 0x0008,
+    TDF_USE_COMMAND_LINKS               = 0x0010,
+    TDF_USE_COMMAND_LINKS_NO_ICON       = 0x0020,
+    TDF_EXPAND_FOOTER_AREA              = 0x0040,
+    TDF_EXPANDED_BY_DEFAULT             = 0x0080,
+    TDF_VERIFICATION_FLAG_CHECKED       = 0x0100,
+    TDF_SHOW_PROGRESS_BAR               = 0x0200,
+    TDF_SHOW_MARQUEE_PROGRESS_BAR       = 0x0400,
+    TDF_CALLBACK_TIMER                  = 0x0800,
+    TDF_POSITION_RELATIVE_TO_WINDOW     = 0x1000,
+    TDF_RTL_LAYOUT                      = 0x2000,
+    TDF_NO_DEFAULT_RADIO_BUTTON         = 0x4000,
+    TDF_CAN_BE_MINIMIZED                = 0x8000
+};
+typedef int TASKDIALOG_FLAGS;                         // Note: _TASKDIALOG_FLAGS is an int
+
+typedef enum _TASKDIALOG_MESSAGES
+{
+    TDM_NAVIGATE_PAGE                   = WM_USER+101,
+    TDM_CLICK_BUTTON                    = WM_USER+102, // wParam = Button ID
+    TDM_SET_MARQUEE_PROGRESS_BAR        = WM_USER+103, // wParam = 0 (nonMarque) wParam != 0 (Marquee)
+    TDM_SET_PROGRESS_BAR_STATE          = WM_USER+104, // wParam = new progress state
+    TDM_SET_PROGRESS_BAR_RANGE          = WM_USER+105, // lParam = MAKELPARAM(nMinRange, nMaxRange)
+    TDM_SET_PROGRESS_BAR_POS            = WM_USER+106, // wParam = new position
+    TDM_SET_PROGRESS_BAR_MARQUEE        = WM_USER+107, // wParam = 0 (stop marquee), wParam != 0 (start marquee), lparam = speed (milliseconds between repaints)
+    TDM_SET_ELEMENT_TEXT                = WM_USER+108, // wParam = element (TASKDIALOG_ELEMENTS), lParam = new element text (LPCWSTR)
+    TDM_CLICK_RADIO_BUTTON              = WM_USER+110, // wParam = Radio Button ID
+    TDM_ENABLE_BUTTON                   = WM_USER+111, // lParam = 0 (disable), lParam != 0 (enable), wParam = Button ID
+    TDM_ENABLE_RADIO_BUTTON             = WM_USER+112, // lParam = 0 (disable), lParam != 0 (enable), wParam = Radio Button ID
+    TDM_CLICK_VERIFICATION              = WM_USER+113, // wParam = 0 (unchecked), 1 (checked), lParam = 1 (set key focus)
+    TDM_UPDATE_ELEMENT_TEXT             = WM_USER+114, // wParam = element (TASKDIALOG_ELEMENTS), lParam = new element text (LPCWSTR)
+    TDM_SET_BUTTON_ELEVATION_REQUIRED_STATE = WM_USER+115, // wParam = Button ID, lParam = 0 (elevation not required), lParam != 0 (elevation required)
+    TDM_UPDATE_ICON                     = WM_USER+116  // wParam = icon element (TASKDIALOG_ICON_ELEMENTS), lParam = new icon (hIcon if TDF_USE_HICON_* was set, PCWSTR otherwise)
+} TASKDIALOG_MESSAGES;
+
+typedef enum _TASKDIALOG_NOTIFICATIONS
+{
+    TDN_CREATED                         = 0,
+    TDN_NAVIGATED                       = 1,
+    TDN_BUTTON_CLICKED                  = 2,            // wParam = Button ID
+    TDN_HYPERLINK_CLICKED               = 3,            // lParam = (LPCWSTR)pszHREF
+    TDN_TIMER                           = 4,            // wParam = Milliseconds since dialog created or timer reset
+    TDN_DESTROYED                       = 5,
+    TDN_RADIO_BUTTON_CLICKED            = 6,            // wParam = Radio Button ID
+    TDN_DIALOG_CONSTRUCTED              = 7,
+    TDN_VERIFICATION_CLICKED            = 8,             // wParam = 1 if checkbox checked, 0 if not, lParam is unused and always 0
+    TDN_HELP                            = 9,
+    TDN_EXPANDO_BUTTON_CLICKED          = 10            // wParam = 0 (dialog is now collapsed), wParam != 0 (dialog is now expanded)
+} TASKDIALOG_NOTIFICATIONS;
+
+typedef struct _TASKDIALOG_BUTTON
+{
+    int     nButtonID;
+    PCWSTR  pszButtonText;
+} TASKDIALOG_BUTTON;
+
+typedef enum _TASKDIALOG_ELEMENTS
+{
+    TDE_CONTENT,
+    TDE_EXPANDED_INFORMATION,
+    TDE_FOOTER,
+    TDE_MAIN_INSTRUCTION
+} TASKDIALOG_ELEMENTS;
+
+typedef enum _TASKDIALOG_ICON_ELEMENTS
+{
+    TDIE_ICON_MAIN,
+    TDIE_ICON_FOOTER
+} TASKDIALOG_ICON_ELEMENTS;
+
+#define TD_WARNING_ICON         MAKEINTRESOURCEW(-1)
+#define TD_ERROR_ICON           MAKEINTRESOURCEW(-2)
+#define TD_INFORMATION_ICON     MAKEINTRESOURCEW(-3)
+#define TD_SHIELD_ICON          MAKEINTRESOURCEW(-4)
+
+
+enum _TASKDIALOG_COMMON_BUTTON_FLAGS
+{
+    TDCBF_OK_BUTTON            = 0x0001, // selected control return value IDOK
+    TDCBF_YES_BUTTON           = 0x0002, // selected control return value IDYES
+    TDCBF_NO_BUTTON            = 0x0004, // selected control return value IDNO
+    TDCBF_CANCEL_BUTTON        = 0x0008, // selected control return value IDCANCEL
+    TDCBF_RETRY_BUTTON         = 0x0010, // selected control return value IDRETRY
+    TDCBF_CLOSE_BUTTON         = 0x0020  // selected control return value IDCLOSE
+};
+typedef int TASKDIALOG_COMMON_BUTTON_FLAGS;           // Note: _TASKDIALOG_COMMON_BUTTON_FLAGS is an int
+
+typedef struct _TASKDIALOGCONFIG
+{
+    UINT        cbSize;
+    HWND        hwndParent;
+    HINSTANCE   hInstance;                              // used for MAKEINTRESOURCE() strings
+    TASKDIALOG_FLAGS                dwFlags;            // TASKDIALOG_FLAGS (TDF_XXX) flags
+    TASKDIALOG_COMMON_BUTTON_FLAGS  dwCommonButtons;    // TASKDIALOG_COMMON_BUTTON (TDCBF_XXX) flags
+    PCWSTR      pszWindowTitle;                         // string or MAKEINTRESOURCE()
+    union
+    {
+        HICON   hMainIcon;
+        PCWSTR  pszMainIcon;
+    };
+    PCWSTR      pszMainInstruction;
+    PCWSTR      pszContent;
+    UINT        cButtons;
+    const TASKDIALOG_BUTTON  *pButtons;
+    int         nDefaultButton;
+    UINT        cRadioButtons;
+    const TASKDIALOG_BUTTON  *pRadioButtons;
+    int         nDefaultRadioButton;
+    PCWSTR      pszVerificationText;
+    PCWSTR      pszExpandedInformation;
+    PCWSTR      pszExpandedControlText;
+    PCWSTR      pszCollapsedControlText;
+    union
+    {
+        HICON   hFooterIcon;
+        PCWSTR  pszFooterIcon;
+    };
+    PCWSTR      pszFooter;
+    PFTASKDIALOGCALLBACK pfCallback;
+    LONG_PTR    lpCallbackData;
+    UINT        cxWidth;                                // width of the Task Dialog's client area in DLU's. If 0, Task Dialog will calculate the ideal width.
+} TASKDIALOGCONFIG;
+
+WINCOMMCTRLAPI HRESULT WINAPI TaskDialogIndirect(const TASKDIALOGCONFIG *pTaskConfig, __out_opt int *pnButton, __out_opt int *pnRadioButton, __out_opt BOOL *pfVerificationFlagChecked);
+WINCOMMCTRLAPI HRESULT WINAPI TaskDialog(__in_opt HWND hwndParent, __in_opt HINSTANCE hInstance, __in_opt PCWSTR pszWindowTitle, __in_opt PCWSTR pszMainInstruction, __in_opt PCWSTR pszContent, TASKDIALOG_COMMON_BUTTON_FLAGS dwCommonButtons, __in_opt PCWSTR pszIcon, __out_opt int *pnButton);
+
+#ifdef _WIN32
+#include <poppack.h>
+#endif
+
+#endif /* end of copy from commctrl.h */
+
+typedef HRESULT (WINAPI *TaskDialogIndirectFn) (const TASKDIALOGCONFIG *pTaskConfig, __out_opt int *pnButton, __out_opt int *pnRadioButton, __out_opt BOOL *pfVerificationFlagChecked);
+
+typedef enum {
+    DIALOG_ERROR_RETRYCANCEL = 0,
+    DIALOG_WARNING_CANCELOK
+} DialogType;
+
+
+/////////////////////////////////////////////////////////////////////////////
+// CDownloadDialog
+class CDownloadDialog :
+        public CAxDialogImpl<CDownloadDialog>
+{
+public:
+        CDownloadDialog();
+        ~CDownloadDialog();
+
+        enum { IDD = IDD_DOWNLOAD_DIALOG };
+
+BEGIN_MSG_MAP(CDownloadDialog)
+        MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
+        MESSAGE_HANDLER(WM_TIMER, OnTimer)
+        MESSAGE_HANDLER(WM_CTLCOLORSTATIC, OnCtlColorStatic)
+        COMMAND_ID_HANDLER(IDOK, OnOK)
+        COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
+END_MSG_MAP()
+
+        LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+        LRESULT OnOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
+        LRESULT OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
+        LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+        LRESULT OnCtlColorStatic(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+        STDMETHODIMP OnStartBinding();
+
+        STDMETHODIMP OnProgress(ULONG ulProgress);
+
+        void initDialogText(LPCTSTR pszDownloadURL, LPCTSTR pszBundleName);
+
+        BOOL isDownloading();
+        BOOL isDownloadCancelled();
+
+        void addToTotalContentLength(DWORD contentLength);
+
+        void decrementProgressMax(ULONG contentLength, ULONG readSoFar);
+
+        void bundleInstallStart();
+        void bundleInstallComplete();
+
+        void waitUntilInitialized();
+
+        void log(char *msg);
+        void logProgress();
+
+        void setFile(LPCTSTR pszFileName)
+        {
+            m_pszFileName = pszFileName;
+        }
+
+        void setURL(LPCTSTR pszURL)
+        {
+            m_pszURL = pszURL;
+        }
+
+        void setNameText(LPTSTR pszNameText)
+        {
+            m_pszNameText = pszNameText;
+        }
+
+
+        JNIEnv* getJNIEnv();
+
+
+        void setJavaVM(JavaVM *jvm)
+        {
+            m_jvm = jvm;
+        }
+
+
+        HRESULT DownloadConfiguration(LPTSTR pszConfigURL, LPTSTR pszConfigFile);
+
+        void delayedDoModal();
+
+        int SafeMessageBox(UINT details, UINT mainInstruction, UINT caption,
+                           DialogType type, LPCWSTR instructionArg = NULL,
+                           LPCWSTR detailsArg = NULL);
+
+        void destroyDialog();
+
+    private:
+
+        HFONT CreateDialogFont (HDC hdc, LPCTSTR lpszFaceName, int ptSize, int isBold = 0);
+        void  FreeGDIResources ();
+
+        BOOL                    m_feedbackOnCancel;
+        TaskDialogIndirectFn    taskDialogFn;
+        LPCTSTR                 m_pszFileName;
+        LPCTSTR                 m_pszURL;
+        time_t                  m_startTime;
+        ULONG                   m_ulProgress;
+        ULONG                   m_ulProgressMax;
+        int                     m_iProgressFactor;
+        int                     m_iMaxProgressFactor;
+        int                     m_numDownloadThreadsRunning;
+        BOOL            m_destroyWindowTimerStarted;
+        volatile BOOL           m_dialogUp;
+        CComAutoCriticalSection m_csDownload;
+        CComAutoCriticalSection m_csNumDownloadThreads;
+        HANDLE                  m_hCancelEvent;
+        HANDLE                  m_hDownloadThreadExitEvent;
+        HANDLE                  m_hDialogInitializedEvent;
+        HFONT                   m_hMastheadFont;
+        HFONT                   m_hDialogFont;
+        HFONT                   m_hSixPointFont;
+        LPTSTR                  m_pszNameText;
+        BITMAP                  m_bmMasthead;
+        HBITMAP                 m_hBitmap;
+        HDC                     m_hMemDC;
+        TCHAR                   m_szUrlPath[BUFFER_SIZE];
+        TCHAR                   m_szHostName[BUFFER_SIZE];
+        JavaVM*                 m_jvm;
+        CComAutoCriticalSection m_csMessageBox;
+};
+
+#endif //__DOWNLOADDIALOG_H_
diff --git a/src/windows/native/sun/jkernel/DownloadHelper.cpp b/src/windows/native/sun/jkernel/DownloadHelper.cpp
new file mode 100644
index 0000000..ee5e5f0
--- /dev/null
+++ b/src/windows/native/sun/jkernel/DownloadHelper.cpp
@@ -0,0 +1,652 @@
+/*
+ * Copyright 2008 - 2009 Sun Microsystems, Inc.  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.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#define STRICT
+#ifndef _WIN32_WINNT
+#define _WIN32_WINNT 0x0400
+#endif
+#define _ATL_APARTMENT_THREADED
+
+
+#include <atlbase.h>
+//You may derive a class from CComModule and use it if you want to override
+//something, but do not change the name of _Module
+extern CComModule _Module;
+#include <atlcom.h>
+#include <atlwin.h>
+
+#include <atlhost.h>
+#include <commdlg.h>
+#include <commctrl.h>
+#include <windowsx.h>
+#include <urlmon.h>
+#include <wininet.h>
+#include <shellapi.h>
+#include <time.h>
+#include <math.h>
+#include <stdio.h>
+
+#include <jni.h>
+
+#include "resource.h"       // main symbols
+#include "DownloadHelper.h"
+
+DownloadHelper::DownloadHelper() {
+
+    m_showProgressDialog = TRUE;
+    m_pszURL = NULL;
+    m_pszFileName = NULL;
+    m_pszNameText = NULL;
+}
+
+DownloadHelper::~DownloadHelper() {
+
+}
+
+HRESULT DownloadHelper::doDownload() {
+    return DownloadFile(m_pszURL, m_pszFileName, FALSE, m_showProgressDialog);
+}
+
+HRESULT DownloadHelper::DownloadFile(const TCHAR* szURL,
+        const TCHAR* szLocalFile, BOOL bResumable, BOOL bUIFeedback) {
+    HINTERNET hOpen = NULL;
+    HINTERNET hConnect = NULL;
+    HINTERNET hRequest = NULL;
+    HANDLE hFile = INVALID_HANDLE_VALUE;
+    DWORD dwDownloadError = 0;
+    DWORD nContentLength = 0;
+
+    /* Some of error messages use drive letter.
+       Result is something like "(C:)".
+       NB: Parentheses are added here because in some other places
+           we same message but can not provide disk label info */
+    TCHAR drivePath[5];
+    /* assuming szLocalFile is not NULL */
+    _sntprintf(drivePath, 5, "(%c:)", szLocalFile[0]);
+    WCHAR* wName = CT2CW(drivePath);
+
+    __try {
+        m_csDownload.Lock();
+
+        time(&m_startTime);
+
+    }
+    __finally {
+        m_csDownload.Unlock();
+    }
+
+    __try {
+        // block potential security hole
+        if (strstr(szURL, TEXT("file://")) != NULL) {
+            dwDownloadError = 1;
+            __leave;
+        }
+
+        HWND hProgressInfo = NULL;
+        TCHAR szStatus[BUFFER_SIZE];
+
+        if (bUIFeedback) {
+            // init download dialg text
+            m_dlg->initDialogText(m_pszURL, m_pszNameText);
+        }
+
+        // Open Internet Call
+        hOpen = ::InternetOpen("deployHelper", INTERNET_OPEN_TYPE_PRECONFIG,
+                NULL, NULL, NULL);
+
+        if (hOpen == NULL) {
+            dwDownloadError = 1;
+            __leave;
+        }
+
+        // URL components
+        URL_COMPONENTS url_components;
+        ::ZeroMemory(&url_components, sizeof(URL_COMPONENTS));
+
+        TCHAR szHostName[BUFFER_SIZE], szUrlPath[BUFFER_SIZE],
+                szExtraInfo[BUFFER_SIZE];
+        url_components.dwStructSize = sizeof(URL_COMPONENTS);
+        url_components.lpszHostName = szHostName;
+        url_components.dwHostNameLength = BUFFER_SIZE;
+        url_components.nPort = NULL;
+        url_components.lpszUrlPath = szUrlPath;
+        url_components.dwUrlPathLength = BUFFER_SIZE;
+        url_components.lpszExtraInfo = szExtraInfo;
+        url_components.dwExtraInfoLength = BUFFER_SIZE;
+
+        // Crack the URL into pieces
+        ::InternetCrackUrl(szURL, lstrlen(szURL), NULL, &url_components);
+
+        // Open Internet Connection
+        hConnect = ::InternetConnect(hOpen, url_components.lpszHostName,
+                url_components.nPort, "", "", INTERNET_SERVICE_HTTP, NULL,
+                NULL);
+
+        if (hConnect == NULL) {
+            dwDownloadError = 1;
+            __leave;
+        }
+
+        // Determine the relative URL path by combining
+        // Path and ExtraInfo
+        char szURL[4096];
+
+        if (url_components.dwUrlPathLength !=  0)
+            lstrcpy(szURL, url_components.lpszUrlPath);
+        else
+            lstrcpy(szURL, "/");
+
+        if (url_components.dwExtraInfoLength != 0)
+            lstrcat(szURL, url_components.lpszExtraInfo);
+
+        BOOL bRetryHttpRequest = FALSE;
+        int numberOfRetry = 0;
+        long secondsToWait = 60;
+
+        do {
+            bRetryHttpRequest = FALSE;
+
+            // Make a HTTP GET request
+            hRequest = ::HttpOpenRequest(hConnect, "GET", szURL, "HTTP/1.1",
+                    "", NULL,
+                    INTERNET_FLAG_KEEP_CONNECTION | INTERNET_FLAG_DONT_CACHE,
+                    0);
+
+            if (hRequest == NULL) {
+                dwDownloadError = 1;
+                __leave;
+            }
+
+            // Create or open existing destination file
+            hFile = ::CreateFile(szLocalFile, GENERIC_WRITE, 0, NULL,
+                    OPEN_ALWAYS, FILE_ATTRIBUTE_ARCHIVE, NULL);
+
+            if (hFile == INVALID_HANDLE_VALUE) {
+                if (bUIFeedback) {
+                    if (IDRETRY == m_dlg->SafeMessageBox(
+                                            IDS_DISK_WRITE_ERROR,
+                                            IDS_DISK_WRITE_ERROR_CAPTION,
+                                            IDS_ERROR_CAPTION,
+                                            DIALOG_ERROR_RETRYCANCEL,
+                                            wName)) {
+                         bRetryHttpRequest = TRUE;
+                         continue;
+                    }
+                }
+                dwDownloadError = 1;
+                __leave;
+            }
+            DWORD fileSize = GetFileSize(hFile, NULL);
+
+            // Check if resumable download is enabled
+            if (bResumable == FALSE) {
+                // Start from scratch
+                fileSize = 0;
+            }
+
+            FILETIME tWrite;
+            BOOL rangereq = FALSE;
+            if ((fileSize != 0) && (fileSize != 0xFFFFFFFF) &&
+                    GetFileTime(hFile, NULL, NULL, &tWrite)) {
+                char szHead[100];
+                SYSTEMTIME tLocal;
+                char buf[INTERNET_RFC1123_BUFSIZE];
+
+                FileTimeToSystemTime(&tWrite, &tLocal);
+                InternetTimeFromSystemTime(&tLocal, INTERNET_RFC1123_FORMAT,
+                        buf, INTERNET_RFC1123_BUFSIZE);
+                sprintf(szHead, "Range: bytes=%d-\r\nIf-Range: %s\r\n",
+                        fileSize, buf);
+                HttpAddRequestHeaders(hRequest, szHead, lstrlen(szHead),
+                        HTTP_ADDREQ_FLAG_ADD|HTTP_ADDREQ_FLAG_REPLACE);
+                rangereq = TRUE;
+            }
+
+            // This is a loop to handle various potential error when the
+            // connection is made
+            BOOL bCont = TRUE;
+
+            while ((FALSE == ::HttpSendRequest(hRequest, NULL, NULL, NULL, NULL))
+            && bCont ) {
+                // We might have an invalid CA.
+                DWORD dwErrorCode = GetLastError();
+
+                switch(dwErrorCode) {
+                    case E_JDHELPER_TIMEOUT:
+                    case E_JDHELPER_NAME_NOT_RESOLVED:
+                    case E_JDHELPER_CANNOT_CONNECT: {
+                        bCont = FALSE;
+                        // Display the information dialog
+                        if (bUIFeedback) {
+                            // decrement download counter to prevent progress
+                            // dialog from popping up while the message box is
+                            // up
+                            m_dlg->bundleInstallComplete();
+                            if (dwErrorCode == E_JDHELPER_TIMEOUT) {
+                                bRetryHttpRequest =
+                                    (IDRETRY == m_dlg->SafeMessageBox(
+                                       IDS_HTTP_STATUS_REQUEST_TIMEOUT,
+                                       IDS_HTTP_INSTRUCTION_REQUEST_TIMEOUT,
+                                       IDS_ERROR_CAPTION,
+                                       DIALOG_ERROR_RETRYCANCEL));
+                            } else {
+                                bRetryHttpRequest =
+                                    (IDRETRY == m_dlg->SafeMessageBox(
+                                       IDS_HTTP_STATUS_SERVER_NOT_REACHABLE,
+                                       IDS_HTTP_INSTRUCTION_SERVER_NOT_REACHABLE,
+                                       IDS_ERROR_CAPTION,
+                                       DIALOG_ERROR_RETRYCANCEL));
+                            }
+                            // re-increment counter because it will be decremented
+                            // again upon return
+                            m_dlg->bundleInstallStart();
+                            bCont = bRetryHttpRequest;
+                        }
+                        break;
+                    }
+                    case ERROR_INTERNET_INVALID_CA:
+                    case ERROR_INTERNET_SEC_CERT_CN_INVALID:
+                    case ERROR_INTERNET_SEC_CERT_DATE_INVALID:
+                    case ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR:
+                    case ERROR_INTERNET_INCORRECT_PASSWORD:
+                    case ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED:
+                    default: {
+                        // Unless the user agrees to continue, we just
+                        // abandon now !
+                        bCont = FALSE;
+
+                        // Make sure to test the return code from
+                        // InternetErrorDlg user may click OK or Cancel. In
+                        // case of Cancel, request should not be resubmitted
+                        if (bUIFeedback) {
+                            if (ERROR_SUCCESS == ::InternetErrorDlg(
+                                    NULL, hRequest,
+                                    dwErrorCode,
+                                    FLAGS_ERROR_UI_FILTER_FOR_ERRORS |
+                                    FLAGS_ERROR_UI_FLAGS_GENERATE_DATA |
+                                    FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS,
+                                    NULL))
+                                bCont = TRUE;
+                        }
+                    }
+                }
+            }
+
+            if (bCont == FALSE) {
+                // User has denied the request
+                dwDownloadError = 1;
+                __leave;
+            }
+
+            //
+            // Read HTTP status code
+            //
+            DWORD dwErrorCode = GetLastError();
+            DWORD dwStatus=0;
+            DWORD dwStatusSize = sizeof(DWORD);
+
+            if (FALSE == ::HttpQueryInfo(hRequest, HTTP_QUERY_FLAG_NUMBER |
+                    HTTP_QUERY_STATUS_CODE, &dwStatus, &dwStatusSize, NULL)) {
+                dwErrorCode = GetLastError();
+            }
+
+            bCont = TRUE;
+            while ((dwStatus == HTTP_STATUS_PROXY_AUTH_REQ ||
+                    dwStatus == HTTP_STATUS_DENIED) &&
+                    bCont) {
+                int result = ::InternetErrorDlg(GetDesktopWindow(), hRequest, ERROR_INTERNET_INCORRECT_PASSWORD,
+                        FLAGS_ERROR_UI_FILTER_FOR_ERRORS |
+                        FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS |
+                        FLAGS_ERROR_UI_FLAGS_GENERATE_DATA,
+                        NULL);
+                if (ERROR_CANCELLED == result) {
+                    bCont = FALSE;
+                }
+                else {
+                    ::HttpSendRequest(hRequest, NULL, 0, NULL, 0);
+
+                    // Reset buffer length
+                    dwStatusSize = sizeof(DWORD);
+
+                    ::HttpQueryInfo(hRequest, HTTP_QUERY_FLAG_NUMBER |
+                            HTTP_QUERY_STATUS_CODE, &dwStatus, &dwStatusSize,
+                            NULL);
+                }
+            }
+
+            if (dwStatus == HTTP_STATUS_OK ||
+                    dwStatus == HTTP_STATUS_PARTIAL_CONTENT) {
+                // Determine content length, so we may show the progress bar
+                // meaningfully
+                //
+                nContentLength = 0;
+                DWORD nLengthSize = sizeof(DWORD);
+                ::HttpQueryInfo(hRequest,
+                        HTTP_QUERY_CONTENT_LENGTH | HTTP_QUERY_FLAG_NUMBER,
+                        &nContentLength, &nLengthSize, NULL);
+
+                if (nContentLength <= 0) {
+                    // If can't estimate content length, estimate it
+                    // to be 6MB
+                    nContentLength = 15000000;
+                }
+                else if (rangereq && (fileSize != 0) &&
+                        (nContentLength == fileSize)) {
+                    // If the file is already downloaded completely and then
+                    // we send a range request, the whole file is sent instead
+                    // of nothing. So avoid downloading again.
+                    // Some times return value is 206, even when whole file
+                    // is sent. So check if "Content-range:" is present in the
+                    // reply
+                    char buffer[256];
+                    DWORD length = sizeof(buffer);
+                    if(!HttpQueryInfo(hRequest, HTTP_QUERY_CONTENT_RANGE,
+                            buffer, &length, NULL)) {
+                        if(HttpQueryInfo(hRequest, HTTP_QUERY_LAST_MODIFIED,
+                                buffer, &length, NULL)) {
+                            SYSTEMTIME systime;
+                            FILETIME filtime;
+                            InternetTimeToSystemTime(buffer, &systime, NULL);
+                            SystemTimeToFileTime(&systime, &filtime);
+                            if ((CompareFileTime(&tWrite, &filtime)) == 1) {
+                                // no need to download
+                                dwDownloadError = 0;
+                                __leave;
+                            }
+                        }
+                        else {
+                            ::SetFilePointer(hFile, 0, 0, FILE_BEGIN);
+                            ::SetEndOfFile(hFile); // truncate the file
+                        }
+                    }
+
+                }
+
+                TCHAR szBuffer[8096];
+                DWORD dwBufferSize = 8096;
+
+                // Read from HTTP connection and write into
+                // destination file
+                //
+                DWORD nRead = 0;
+                DWORD dwTotalRead = 0;
+                BOOL bCancel = FALSE;
+
+                if (dwStatus == HTTP_STATUS_PARTIAL_CONTENT) {
+                    // If we are using resumable download, fake
+                    // start time so it looks like we have begun
+                    // the download several minutes again.
+                    //
+                    m_startTime = m_startTime - 100;
+
+                    ::SetFilePointer(hFile, 0, 0, FILE_END); // seek to end
+                }
+                else {
+                    ::SetFilePointer(hFile, 0, 0, FILE_BEGIN);
+                    ::SetEndOfFile(hFile); // truncate the file
+                }
+
+                do {
+                    nRead=0;
+
+                    if (::InternetReadFile(hRequest, szBuffer, dwBufferSize,
+                            &nRead)) {
+                        if (nRead) {
+                            DWORD dwNumberOfBytesWritten = NULL;
+
+                            BOOL ret = WriteFile(hFile, szBuffer, nRead,
+                                    &dwNumberOfBytesWritten, NULL);
+
+                            if (!ret) {
+                                // WriteFile failed
+                                if (bUIFeedback) {
+                                    if (GetLastError() == ERROR_DISK_FULL) {
+                                       bRetryHttpRequest =
+                                            (IDRETRY == m_dlg->SafeMessageBox(
+                                            IDS_DISK_FULL_ERROR,
+                                            IDS_DISK_FULL_ERROR_CAPTION,
+                                            IDS_ERROR_CAPTION,
+                                            DIALOG_ERROR_RETRYCANCEL,
+                                            wName));
+                                    } else {
+                                        bRetryHttpRequest =
+                                            (IDRETRY == m_dlg->SafeMessageBox(
+                                            IDS_DISK_WRITE_ERROR,
+                                            IDS_DISK_WRITE_ERROR_CAPTION,
+                                            IDS_ERROR_CAPTION,
+                                            DIALOG_ERROR_RETRYCANCEL,
+                                            wName));
+                                    }
+                                    if (!bRetryHttpRequest) {
+                                        dwDownloadError = 1;
+                                        break;
+                                    }
+                                }
+                                continue;
+                            }
+                        }
+
+                        dwTotalRead += nRead;
+
+                        // update download progress dialog
+                        m_dlg->OnProgress(nRead);
+                        // Check if download has been cancelled
+                        if (m_dlg->isDownloadCancelled()) {
+                            m_dlg->decrementProgressMax(nContentLength,
+                                    dwTotalRead);
+                            bCancel = TRUE;
+                            break;
+                        }
+
+                    }
+                    else {
+                        bCancel = TRUE;
+                        break;
+                    }
+                }
+                while (nRead);
+
+
+                if (bCancel) {
+                    // User has cancelled the operation or InternetRead failed
+                    // don't do return here, we need to cleanup
+                    dwDownloadError = 1;
+                    __leave;
+                }
+            }
+            else if (dwStatus == 416 && (fileSize != 0) &&
+                    (fileSize != 0xFFFFFFFF)) {
+                // This error could be returned, When the full file exists
+                // and a range request is sent with range beyond filessize.
+                // The best way to fix this is in future is, to send HEAD
+                // request and get filelength before sending range request.
+                dwDownloadError = 0;
+                __leave;
+            }
+            else if (dwStatus == 403) { // Forbidden from Akamai means we need to get a new download token
+                JNIEnv *env = m_dlg->getJNIEnv();
+                jclass exceptionClass = env->FindClass("java/net/HttpRetryException");
+                if (exceptionClass == NULL) {
+                    /* Unable to find the exception class, give up. */
+                    __leave;
+                }
+                jmethodID constructor;
+                constructor = env->GetMethodID(exceptionClass,
+                               "<init>", "(Ljava/lang/String;I)V");
+                if (constructor != NULL) {
+                    jobject exception = env->NewObject(exceptionClass,
+                            constructor, env->NewStringUTF("Forbidden"),
+                            403);
+                    env->Throw((jthrowable) exception);
+                }
+                __leave;
+            }
+            else if(dwStatus >= 400 && dwStatus < 600) {
+                /* NB: Following case seems to be never used!
+
+                   HTTP_STATUS_FORBIDDEN is the same as 403 and
+                   403 was specially handled few lines above! */
+                if (dwStatus == HTTP_STATUS_FORBIDDEN) {
+                    if (bUIFeedback) {
+                        bRetryHttpRequest = (IDRETRY == m_dlg->SafeMessageBox(
+                                            IDS_HTTP_STATUS_FORBIDDEN,
+                                            IDS_HTTP_INSTRUCTION_FORBIDDEN,
+                                            IDS_ERROR_CAPTION,
+                                            DIALOG_ERROR_RETRYCANCEL,
+                                            L"403"));
+                    }
+                }
+                else if (dwStatus == HTTP_STATUS_SERVER_ERROR) {
+                    if (bUIFeedback) {
+                       bRetryHttpRequest = (IDRETRY == m_dlg->SafeMessageBox(
+                                            IDS_HTTP_STATUS_SERVER_ERROR,
+                                            IDS_HTTP_INSTRUCTION_UNKNOWN_ERROR,
+                                            IDS_ERROR_CAPTION,
+                                            DIALOG_ERROR_RETRYCANCEL,
+                                            L"500"));
+                    }
+                }
+                else if (dwStatus == HTTP_STATUS_SERVICE_UNAVAIL) {
+                    if (numberOfRetry < 5) {
+                        // If the server is busy, automatically retry
+
+                        // We wait couple seconds before retry to avoid
+                        // congestion
+                        for (long i = (long) secondsToWait; i >= 0; i--) {
+                            // Update status
+                            if (bUIFeedback) {
+                                char szBuffer[BUFFER_SIZE];
+                                ::LoadString(_Module.GetResourceInstance(),
+                                        IDS_DOWNLOAD_STATUS_RETRY, szStatus,
+                                        BUFFER_SIZE);
+                                wsprintf(szBuffer, szStatus, i);
+
+                                ::SetWindowText(hProgressInfo, szBuffer);
+                            }
+
+                            // Sleep 1 second
+                            ::Sleep(1000);
+                        }
+
+                        // We use a semi-binary backoff algorithm to
+                        // determine seconds to wait
+                        numberOfRetry += 1;
+                        secondsToWait = secondsToWait + 30;
+                        bRetryHttpRequest = TRUE;
+
+                        continue;
+                    }
+                    else {
+                        if (bUIFeedback) {
+                            bRetryHttpRequest = (IDRETRY == m_dlg->SafeMessageBox(
+                                            IDS_HTTP_STATUS_SERVICE_UNAVAIL,
+                                            IDS_HTTP_INSTRUCTION_SERVICE_UNAVAIL,
+                                            IDS_ERROR_CAPTION,
+                                            DIALOG_ERROR_RETRYCANCEL,
+                                            L"503"));
+
+                            if (bRetryHttpRequest) {
+                                numberOfRetry = 0;
+                                secondsToWait = 60;
+                                continue;
+                            }
+                        }
+                    }
+                }
+                else {
+                    if (bUIFeedback) {
+                        WCHAR szBuffer[10];
+                        _snwprintf(szBuffer, 10, L"%d", dwStatus);
+                        bRetryHttpRequest = (IDRETRY == m_dlg->SafeMessageBox(
+                                            IDS_HTTP_STATUS_OTHER,
+                                            IDS_HTTP_INSTRUCTION_UNKNOWN_ERROR,
+                                            IDS_ERROR_CAPTION,
+                                            DIALOG_ERROR_RETRYCANCEL,
+                                            szBuffer));
+                    }
+                }
+                if (!bRetryHttpRequest) {
+                    dwDownloadError = 1;
+                }
+            }
+            else {
+                if (bUIFeedback) {
+                    WCHAR szBuffer[10];
+                    _snwprintf(szBuffer, 10, L"%d", dwStatus);
+                    bRetryHttpRequest = (IDRETRY == m_dlg->SafeMessageBox(
+                                            IDS_HTTP_STATUS_OTHER,
+                                            IDS_HTTP_INSTRUCTION_UNKNOWN_ERROR,
+                                            IDS_ERROR_CAPTION,
+                                            DIALOG_ERROR_RETRYCANCEL,
+                                            szBuffer));
+                }
+                if (!bRetryHttpRequest) {
+                    dwDownloadError = 1;
+                }
+            }
+
+
+
+            // Close HTTP request
+            //
+            // This is necessary if the HTTP request
+            // is retried
+            if (hRequest)
+                ::InternetCloseHandle(hRequest);
+            if (hFile != INVALID_HANDLE_VALUE) {
+                ::CloseHandle(hFile);
+                hFile = INVALID_HANDLE_VALUE;
+            }
+        }
+        while (bRetryHttpRequest);
+    }
+    __finally {
+        if (hRequest)
+            ::InternetCloseHandle(hRequest);
+
+        if (hConnect)
+            ::InternetCloseHandle(hConnect);
+
+        if (hOpen)
+            ::InternetCloseHandle(hOpen);
+
+        if (hFile != INVALID_HANDLE_VALUE)
+            ::CloseHandle(hFile);
+    }
+
+
+
+    // Exit dialog
+    if (dwDownloadError == 0) {
+        return S_OK;
+    } else {
+        DeleteFile(szLocalFile);
+        return E_FAIL;
+    }
+}
diff --git a/src/windows/native/sun/jkernel/DownloadHelper.h b/src/windows/native/sun/jkernel/DownloadHelper.h
new file mode 100644
index 0000000..2896ebd
--- /dev/null
+++ b/src/windows/native/sun/jkernel/DownloadHelper.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2008 - 2009 Sun Microsystems, Inc.  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.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+#ifndef BUFFER_SIZE
+#define BUFFER_SIZE 2048
+#endif
+
+#define E_JDHELPER_TIMEOUT               12002
+#define E_JDHELPER_NAME_NOT_RESOLVED     12007
+#define E_JDHELPER_CANNOT_CONNECT        12029
+
+#include <jni.h>
+#include "DownloadDialog.h"
+
+class DownloadHelper {
+public:
+    DownloadHelper();
+    ~DownloadHelper();
+
+    HRESULT doDownload();
+
+    void setFile(LPCTSTR pszFileName) {
+        m_pszFileName = pszFileName;
+    }
+
+    void setURL(LPCTSTR pszURL) {
+        m_pszURL = pszURL;
+    }
+
+    void setNameText(LPTSTR pszNameText) {
+        m_pszNameText = pszNameText;
+    }
+
+    void setShowProgressDialog(BOOL showProgress) {
+        m_showProgressDialog = showProgress;
+    }
+
+    void setDownloadDialog(CDownloadDialog* dialog) {
+        m_dlg = dialog;
+    }
+
+    void setJavaVM(JavaVM *jvm) {
+        m_jvm = jvm;
+    }
+
+private:
+    HRESULT DownloadFile(const TCHAR* szURL, const TCHAR* szLocalFile,
+            BOOL bResumable, BOOL bUIFeedback);
+
+    BOOL m_showProgressDialog;
+    LPCTSTR m_pszURL;
+    LPCTSTR m_pszFileName;
+    LPTSTR m_pszNameText;
+    time_t m_startTime;
+    CComAutoCriticalSection m_csDownload;
+    CDownloadDialog* m_dlg;
+    JavaVM* m_jvm;
+};
diff --git a/src/windows/native/sun/jkernel/graphics/bullet.bmp b/src/windows/native/sun/jkernel/graphics/bullet.bmp
new file mode 100644
index 0000000..f54142b
--- /dev/null
+++ b/src/windows/native/sun/jkernel/graphics/bullet.bmp
Binary files differ
diff --git a/src/windows/native/sun/jkernel/graphics/cautionshield32.bmp b/src/windows/native/sun/jkernel/graphics/cautionshield32.bmp
new file mode 100644
index 0000000..01f82f4
--- /dev/null
+++ b/src/windows/native/sun/jkernel/graphics/cautionshield32.bmp
Binary files differ
diff --git a/src/windows/native/sun/jkernel/graphics/java-icon.ico b/src/windows/native/sun/jkernel/graphics/java-icon.ico
new file mode 100644
index 0000000..f98f780
--- /dev/null
+++ b/src/windows/native/sun/jkernel/graphics/java-icon.ico
Binary files differ
diff --git a/src/windows/native/sun/jkernel/graphics/masthead.bmp b/src/windows/native/sun/jkernel/graphics/masthead.bmp
new file mode 100644
index 0000000..f4fa2a8
--- /dev/null
+++ b/src/windows/native/sun/jkernel/graphics/masthead.bmp
Binary files differ
diff --git a/src/windows/native/sun/jkernel/graphics/warningmasthead.bmp b/src/windows/native/sun/jkernel/graphics/warningmasthead.bmp
new file mode 100644
index 0000000..65b2a32
--- /dev/null
+++ b/src/windows/native/sun/jkernel/graphics/warningmasthead.bmp
Binary files differ
diff --git a/src/windows/native/sun/jkernel/kernel.cpp b/src/windows/native/sun/jkernel/kernel.cpp
new file mode 100644
index 0000000..354b47c
--- /dev/null
+++ b/src/windows/native/sun/jkernel/kernel.cpp
@@ -0,0 +1,1621 @@
+/*
+ * Copyright 2008 - 2009 Sun Microsystems, Inc.  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.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+#define _WIN32_WINNT 0x0500
+#define WINVER 0x0500
+
+#include "stdafx.h"
+#include <shlobj.h>
+#include <atlbase.h>
+#include <locale.h>
+
+CComModule _Module;
+
+#include <atlwin.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include "Windows.h"
+#include "WinNT.h"
+#include <shellapi.h>
+#include "DownloadDialog.h"
+#include "DownloadHelper.h"
+#include "kernel.h"
+#include "sun_jkernel_DownloadManager.h"
+#include "sun_jkernel_Bundle.h"
+#include "sun_jkernel_Mutex.h"
+#include "sun_jkernel_BackgroundDownloader.h"
+#include <stdio.h>
+#include <windows.h>
+#include <conio.h>
+#include <tchar.h>
+#include <tchar.h>
+#include <sddl.h>
+#include <Aclapi.h>
+#include <strsafe.h>
+
+BOOL IsPlatformWindowsVista();
+
+#define BUFSIZE 4096
+
+#define JBROKERPIPE           "\\\\.\\pipe\\jbrokerpipe"
+#define JREMAINKEY              "SOFTWARE\\JavaSoft\\Java Runtime Environment"
+#define JRE_VERSION_REGISTRY_KEY    JREMAINKEY "\\" VERSION
+#define ReleaseAndClose(mutex) \
+        if (mutex != NULL) { \
+            ReleaseMutex(mutex);  \
+            CloseHandle(mutex); \
+            mutex = NULL; \
+        }
+
+#define KERNEL_DEBUG false
+
+// used to inform kernel that we believe it is running in high integrity
+#define JBROKER_KEY "-Dkernel.spawned.from.jbroker=true -Dkernel.background.download=false"
+
+// this is only available on Vista SDK, hard code it here for now
+#define LABEL_SECURITY_INFORMATION (0x00000010L)
+
+// The LABEL_SECURITY_INFORMATION SDDL SACL to be set for low integrity
+LPCSTR LOW_INTEGRITY_SDDL_SACL = "S:(ML;;NW;;;LW)";
+
+CDownloadDialog dlg;
+BOOL createDialog = TRUE;
+
+CComAutoCriticalSection m_csCreateDialog;
+
+typedef BOOL (WINAPI *LPFNInitializeSecurityDescriptor)(
+        PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD dwRevision);
+typedef BOOL (WINAPI *LPFNSetSecurityDescriptorDacl)(
+        PSECURITY_DESCRIPTOR pSecurityDescriptor, BOOL bDaclPresent, PACL pDacl,
+        BOOL bDaclDefaulted);
+
+typedef BOOL (WINAPI *LPFNConvertStringSecurityDescriptorToSecurityDescriptorA)(
+        LPCSTR StringSecurityDescriptor, DWORD StringSDRevision,
+        PSECURITY_DESCRIPTOR* SecurityDescriptor,
+        PULONG SecurityDescriptorSize);
+
+typedef BOOL (WINAPI *LPFNGetSecurityDescriptorSacl)(
+        PSECURITY_DESCRIPTOR pSecurityDescriptor, LPBOOL lpbSaclPresent,
+        PACL* pSacl, LPBOOL lpbSaclDefaulted);
+
+typedef DWORD (WINAPI *LPFNSetSecurityInfo)(HANDLE handle,
+        SE_OBJECT_TYPE ObjectType, SECURITY_INFORMATION SecurityInfo,
+        PSID psidOwner, PSID psidGroup, PACL pDacl, PACL pSacl);
+
+BOOL APIENTRY DllMain( HANDLE hModule,
+                       DWORD  ul_reason_for_call,
+                       LPVOID lpReserved
+                     )
+{
+    return TRUE;
+}
+
+char* getStringPlatformChars(JNIEnv* env, jstring jstr) {
+    char *result = NULL;
+    size_t len;
+    const jchar* utf16 = env->GetStringChars(jstr, NULL);
+    len = wcstombs(NULL, utf16, env->GetStringLength(jstr) * 4) + 1;
+    if (len == -1)
+        return NULL;
+    result = (char*) malloc(len);
+    if (wcstombs(result, utf16, len) == -1)
+        return NULL;
+    env->ReleaseStringChars(jstr, utf16);
+    return result;
+}
+
+bool SetObjectToLowIntegrity ( HANDLE hObject,
+        SE_OBJECT_TYPE type = SE_KERNEL_OBJECT ) {
+
+    bool bRet = false;
+    DWORD dwErr = ERROR_SUCCESS;
+    PSECURITY_DESCRIPTOR pSD = NULL;
+    PACL pSacl = NULL;
+    BOOL fSaclPresent = FALSE;
+    BOOL fSaclDefaulted = FALSE;
+
+    // initialize function pointers
+    HMODULE hModule = LoadLibrary("Advapi32.dll");
+
+    // ConvertStringSecurityDescriptorToSecurityDescriptorA
+    LPFNConvertStringSecurityDescriptorToSecurityDescriptorA
+            lpfnConvertStringSecurityDescriptorToSecurityDescriptorA =
+            (LPFNConvertStringSecurityDescriptorToSecurityDescriptorA)GetProcAddress(
+            hModule,
+            "ConvertStringSecurityDescriptorToSecurityDescriptorA");
+
+    // GetSecurityDescriptorSacl
+    LPFNGetSecurityDescriptorSacl lpfnGetSecurityDescriptorSacl =
+            (LPFNGetSecurityDescriptorSacl)GetProcAddress(hModule,
+            "GetSecurityDescriptorSacl");
+
+    // SetSecurityInfo
+    LPFNSetSecurityInfo lpfnSetSecurityInfo =
+            (LPFNSetSecurityInfo)GetProcAddress(hModule,
+            "SetSecurityInfo");
+
+    if (lpfnConvertStringSecurityDescriptorToSecurityDescriptorA == NULL ||
+            lpfnGetSecurityDescriptorSacl == NULL ||
+            lpfnSetSecurityInfo == NULL) {
+        if (KERNEL_DEBUG) {
+            printf("Fail to initialize function pointer\n");
+        }
+        FreeLibrary(hModule);
+        return FALSE;
+    }
+
+    // Set object to lower integrity
+    if ( lpfnConvertStringSecurityDescriptorToSecurityDescriptorA(
+            LOW_INTEGRITY_SDDL_SACL, SDDL_REVISION_1, &pSD, NULL ) ) {
+        if ( lpfnGetSecurityDescriptorSacl(
+                pSD, &fSaclPresent, &pSacl, &fSaclDefaulted ) ) {
+            dwErr = lpfnSetSecurityInfo(
+                    hObject, type, LABEL_SECURITY_INFORMATION,
+                    NULL, NULL, NULL, pSacl );
+
+            bRet = (ERROR_SUCCESS == dwErr);
+        }
+
+        LocalFree( pSD );
+    }
+
+    FreeLibrary(hModule);
+    return bRet;
+}
+
+
+JNIEXPORT jlong JNICALL Java_sun_jkernel_Mutex_createNativeMutex
+                                (JNIEnv *env , jclass cls, jstring id) {
+    SECURITY_ATTRIBUTES sa;
+    PSECURITY_DESCRIPTOR pSD = NULL;
+    BOOL saInitialized = FALSE;
+
+    // initialize function pointers
+    HMODULE hModule = LoadLibrary("Advapi32.dll");
+
+    // InitializeSecurityDescriptor
+    LPFNInitializeSecurityDescriptor lpfnInitializeSecurityDescriptor =
+            (LPFNInitializeSecurityDescriptor)GetProcAddress(hModule,
+            "InitializeSecurityDescriptor");
+
+    // SetSecurityDescriptorDacl
+    LPFNSetSecurityDescriptorDacl lpfnSetSecurityDescriptorDacl =
+            (LPFNSetSecurityDescriptorDacl)GetProcAddress(hModule,
+            "SetSecurityDescriptorDacl");
+
+    if (lpfnInitializeSecurityDescriptor != NULL &&
+            lpfnSetSecurityDescriptorDacl != NULL) {
+
+        // Initialize a security descriptor.
+        pSD = (PSECURITY_DESCRIPTOR) LocalAlloc(LPTR,
+                SECURITY_DESCRIPTOR_MIN_LENGTH);
+        if (NULL == pSD) {
+            if (KERNEL_DEBUG) {
+                printf("LocalAlloc Error %u\n", GetLastError());
+            }
+            FreeLibrary(hModule);
+            return NULL;
+        }
+
+        if (!lpfnInitializeSecurityDescriptor(pSD,
+                SECURITY_DESCRIPTOR_REVISION)) {
+            if (KERNEL_DEBUG) {
+                printf("InitializeSecurityDescriptor Error %u\n", GetLastError());
+            }
+            FreeLibrary(hModule);
+            return NULL;
+
+        }
+        // Add the ACL to the security descriptor.
+        if (!lpfnSetSecurityDescriptorDacl(pSD,
+                TRUE,     // bDaclPresent flag
+                NULL,     // NULL DACL is assigned to the security descriptor,
+                // which allows all access to the object.
+                // This is to allow the mutex to be accessbile by
+                // all users;  The background downloader launched
+                // by the installer will be running as SYSTEM user;
+                // while other java process started by the current
+                // user will be running as the current username.
+                FALSE))   // not a default DACL
+        {
+            if (KERNEL_DEBUG) {
+                printf("SetSecurityDescriptorDacl Error %u\n",
+                        GetLastError());
+            }
+            FreeLibrary(hModule);
+            return NULL;
+        }
+
+        // Initialize a security attributes structure.
+        sa.nLength = sizeof (SECURITY_ATTRIBUTES);
+        sa.lpSecurityDescriptor = pSD;
+        sa.bInheritHandle = FALSE;
+
+        saInitialized = TRUE;
+        FreeLibrary(hModule);
+    }
+
+    HANDLE m = CreateMutex(saInitialized ? &sa : NULL, FALSE,
+            (LPCSTR) getStringPlatformChars(env, id));
+    if (m == NULL) {
+        if (KERNEL_DEBUG) {
+            printf("CreateMutex Error %u\n", GetLastError());
+        }
+    }
+
+    // set the mutex object to low integrity on vista, so the mutex
+    // can be accessed by different integrity level
+    if (IsPlatformWindowsVista()) {
+        if (!SetObjectToLowIntegrity(m)) {
+            if (KERNEL_DEBUG) {
+                printf("Fail to set Mutex object to low integrity\n");
+            }
+        }
+    }
+    return (jlong)m ;
+}
+
+
+HANDLE getMutexHandle(JNIEnv *env, jobject mutex) {
+    jfieldID handle = env->GetFieldID(env->GetObjectClass(mutex), "handle", "J");
+    return (HANDLE) env->GetLongField(mutex, handle);
+}
+
+JNIEXPORT jboolean JNICALL Java_sun_jkernel_Mutex_acquire__I
+                                (JNIEnv *env, jobject mutex, jint timeout) {
+    HANDLE hmutex = getMutexHandle(env, mutex);
+    if (hmutex != NULL) {
+        int result = WaitForSingleObject(hmutex, timeout);
+        if (result == WAIT_ABANDONED)
+            result = WaitForSingleObject(hmutex, timeout);
+        return (result == WAIT_OBJECT_0);
+    }
+    else
+        return false;
+}
+
+void ThrowByName(JNIEnv *env, const char *name, const char *msg) {
+    jclass cls = env->FindClass(name);
+    /* if cls is NULL, an exception has already been thrown */
+    if (cls != NULL) {
+        env->ThrowNew(cls, msg);
+    }
+    /* free the local ref */
+    env->DeleteLocalRef(cls);
+}
+
+JNIEXPORT void JNICALL Java_sun_jkernel_Mutex_acquire__
+        (JNIEnv *env, jobject mutex) {
+    if (!Java_sun_jkernel_Mutex_acquire__I(env, mutex, INFINITE)) {
+        // failed to acquire mutex, most likely because it was already disposed
+        ThrowByName(env, "java/lang/IllegalStateException",
+                "error acquiring mutex");
+    }
+}
+
+JNIEXPORT void JNICALL Java_sun_jkernel_Mutex_release
+                                (JNIEnv *env, jobject mutex) {
+    HANDLE hmutex = getMutexHandle(env, mutex);
+    if (hmutex != NULL)
+        ReleaseMutex(hmutex);
+    else
+        ThrowByName(env, "java/lang/IllegalStateException",
+                "releasing disposed mutex");
+}
+
+JNIEXPORT void JNICALL Java_sun_jkernel_Mutex_destroyNativeMutex
+        (JNIEnv *env, jobject mutex) {
+    HANDLE hmutex = getMutexHandle(env, mutex);
+    if (hmutex != NULL) {
+        Java_sun_jkernel_Mutex_release(env, mutex);
+        CloseHandle(hmutex);
+    }
+}
+
+void createDownloadWindowProc(LPVOID lpParameter) {
+    CDownloadDialog* pDlg = (CDownloadDialog *) lpParameter;
+
+    pDlg->delayedDoModal();
+
+    // dialog destroyed, need to create a new one next time
+    createDialog = TRUE;
+}
+
+
+void createDownloadWindow(LPVOID lpParameter) {
+    // Create a new thread for download window
+    DWORD dwThreadId = NULL;
+    ::CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) createDownloadWindowProc, lpParameter, 0, &dwThreadId);
+}
+
+JNIEXPORT void JNICALL Java_sun_jkernel_DownloadManager_bundleInstallComplete
+    (JNIEnv *env, jclass dm) {
+    dlg.bundleInstallComplete();
+}
+
+JNIEXPORT void JNICALL Java_sun_jkernel_DownloadManager_bundleInstallStart
+    (JNIEnv *env, jclass dm) {
+
+    dlg.bundleInstallStart();
+}
+
+typedef HRESULT (WINAPI *LPFNIEIsProtectedModeProcess)(BOOL *pbResult);
+
+BOOL isRunningIEProtectedMode() {
+
+    HMODULE hModule = NULL;
+    LPFNIEIsProtectedModeProcess lpfnIEIsProtectedModeProcess;
+
+    __try {
+        hModule = LoadLibrary("ieframe.dll");
+        if (hModule != NULL) {
+
+            lpfnIEIsProtectedModeProcess = (LPFNIEIsProtectedModeProcess)
+                GetProcAddress(hModule, "IEIsProtectedModeProcess");
+
+            if (lpfnIEIsProtectedModeProcess != NULL) {
+                BOOL bProtectedMode = FALSE;
+                HRESULT hr = lpfnIEIsProtectedModeProcess(&bProtectedMode);
+                if ( SUCCEEDED(hr) && bProtectedMode ) {
+                    // IE is running in protected mode
+                    return TRUE;
+                } else {
+                    // IE isn't running in protected mode
+                    return FALSE;
+                }
+            }
+        }
+    } __finally {
+        if (hModule != NULL) {
+            FreeLibrary(hModule);
+        }
+    }
+    return FALSE;
+}
+
+/* Return TRUE if current running platform is Windows Vista, FALSE otherwise */
+BOOL IsPlatformWindowsVista() {
+    static BOOL initialized = FALSE;
+    static BOOL isVista = FALSE;
+    OSVERSIONINFO  osvi;
+
+    if (initialized) {
+        return isVista;
+    }
+
+    // Initialize the OSVERSIONINFO structure.
+    ZeroMemory( &osvi, sizeof( osvi ) );
+    osvi.dwOSVersionInfoSize = sizeof( osvi );
+
+    GetVersionEx( &osvi );  // Assume this function succeeds.
+
+    if ( osvi.dwPlatformId == VER_PLATFORM_WIN32_NT &&
+        osvi.dwMajorVersion == 6 ) {
+        isVista = TRUE;
+    } else {
+        isVista = FALSE;
+    }
+
+    initialized = TRUE;
+
+    return isVista;
+}
+
+JNIEXPORT jboolean  JNICALL Java_sun_jkernel_DownloadManager_isIEProtectedMode
+    (JNIEnv *env, jclass dm) {
+
+    if (isRunningIEProtectedMode()) {
+        return TRUE;
+    }
+    return FALSE;
+}
+
+JNIEXPORT jboolean JNICALL Java_sun_jkernel_DownloadManager_isWindowsVista
+    (JNIEnv *env, jclass dm) {
+
+    if (IsPlatformWindowsVista()) {
+        return TRUE;
+    }
+    return FALSE;
+}
+
+int sendMessageToBroker(const char * message) {
+        char ackString[1024];
+        HANDLE hp = INVALID_HANDLE_VALUE;
+
+        while (hp == INVALID_HANDLE_VALUE) {
+            hp = CreateNamedPipe(_T(JBROKERPIPE),
+                    PIPE_ACCESS_DUPLEX | FILE_FLAG_FIRST_PIPE_INSTANCE ,
+                    PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT,
+                    1, // number of pipes that can exist
+                    1024, // output buffer
+                    1024, // input buffer
+                    0, // timeout
+                    NULL); // security attributes
+
+            if (hp == INVALID_HANDLE_VALUE) {
+                DWORD err = GetLastError();
+                // we only allow one instance of the pipe; if the instance
+                // already exists, we will get ERROR_ACCESS_DENIED, which means
+                // some other process is using the pipe, so let's try again
+                if (err != ERROR_ACCESS_DENIED && err != ERROR_PIPE_BUSY) {
+                    // create pipe failed
+                    return 0;
+                }
+                // pipe instance might be in use, keep trying
+            }
+        }
+
+        // Wait for the client to connect; if it succeeds,
+        // the function returns a nonzero value. If the function
+        // returns zero, GetLastError returns ERROR_PIPE_CONNECTED.
+        BOOL fConnected = ConnectNamedPipe(hp, NULL) ?
+                TRUE : (GetLastError() == ERROR_PIPE_CONNECTED);
+
+        if (fConnected)
+        {
+                // Send message to the pipe server.
+                DWORD cbWritten;
+
+                BOOL fSuccess = WriteFile(
+                        hp,                  // pipe handle
+                        message,             // message
+                        (strlen(message)+1)*sizeof(char), // message length
+                        &cbWritten,             // bytes written
+                        NULL);                  // not overlapped
+
+                if (!fSuccess)
+                {
+                        // WriteFile failed
+                        CloseHandle(hp);
+                        return 0;
+                }
+
+                // wait for ack from server
+                DWORD cbRead;
+                TCHAR chBuf[BUFSIZE];
+
+                do
+                {
+                        // Read from the pipe.
+                        fSuccess = ReadFile(
+                                hp,    // pipe handle
+                                chBuf,    // buffer to receive reply
+                                BUFSIZE*sizeof(TCHAR),  // size of buffer
+                                &cbRead,  // number of bytes read
+                                NULL);    // not overlapped
+
+                        if (! fSuccess && GetLastError() != ERROR_MORE_DATA)
+                                break;
+
+                        sprintf(ackString, "%s", chBuf);
+
+
+                } while (!fSuccess);  // repeat loop if ERROR_MORE_DATA
+        }
+
+        CloseHandle(hp);
+
+        if (strcmp(ackString, "SUCCESS") == 0) {
+                // server completed move command successfully
+                return 1;
+        }
+
+        return 0;
+}
+
+int sendMoveMessageToBroker(const char * fromPath, const char * userHome) {
+    // Send move message
+    char * movecmd = "MOVEFILE";
+
+    char * msg = (char*)malloc((strlen(fromPath) + strlen(movecmd) +
+            strlen(userHome) + 3) * sizeof(char));
+
+    sprintf(msg, "%s*%s*%s", movecmd, fromPath, userHome);
+
+    return sendMessageToBroker(msg);
+}
+
+int sendMoveDirMessageToBroker(const char * fromPath, const char * userHome) {
+        // Send move dir message
+    char * movecmd = "MOVEDIR";
+
+    char * msg = (char*)malloc((strlen(fromPath) + strlen(movecmd) +
+            strlen(userHome) + 3) * sizeof(char));
+
+    sprintf(msg, "%s*%s*%s", movecmd, fromPath, userHome);
+
+    return sendMessageToBroker(msg);
+}
+
+
+int sendKillMessageToBroker() {
+        // Send move message
+        char * killcmd = "KILLBROKER";
+        return sendMessageToBroker(killcmd);
+}
+
+
+int sendPerformCompletionMessageToBroker(const char *javaHome) {
+    const char *cmd = "PERFORMCOMPLETION";
+
+    int result = sendMessageToBroker(cmd);
+
+    if (result)
+        sendKillMessageToBroker();
+    return result;
+}
+
+int getConstantInt(JNIEnv *env, jclass cls, const char *name) {
+    jfieldID handle = env->GetStaticFieldID(cls, name, "I");
+    return env->GetStaticIntField(cls, handle);
+}
+
+JNIEXPORT void JNICALL Java_sun_jkernel_DownloadManager_displayError
+        (JNIEnv *env, jclass dm, jint code, jstring arg) {
+    int messageId = IDS_FATAL_ERROR;
+    int titleId = IDS_ERROR_CAPTION;
+    if (code == getConstantInt(env, dm, "ERROR_MALFORMED_BUNDLE_PROPERTIES"))
+        messageId = IDS_ERROR_MALFORMED_BUNDLE_PROPERTIES;
+    else if (code == getConstantInt(env, dm, "ERROR_DOWNLOADING_BUNDLE_PROPERTIES"))
+        messageId = IDS_ERROR_DOWNLOADING_BUNDLE_PROPERTIES;
+    else if (code == getConstantInt(env, dm, "ERROR_MALFORMED_URL"))
+        messageId = IDS_ERROR_MALFORMED_URL;
+    char message[BUFFER_SIZE];
+    char rawMessage[BUFFER_SIZE];
+    char title[BUFFER_SIZE];
+    ::LoadString(_Module.GetModuleInstance(), titleId, title, BUFFER_SIZE);
+    ::LoadString(_Module.GetModuleInstance(), messageId, rawMessage, BUFFER_SIZE);
+    if (arg != NULL) {
+        char *chars = getStringPlatformChars(env, arg);
+        sprintf(message, rawMessage, chars);
+    }
+    else
+        strcpy(message, rawMessage);
+
+    MessageBox(NULL, message, title, MB_OK|MB_TASKMODAL);
+}
+
+JNIEXPORT jboolean JNICALL Java_sun_jkernel_DownloadManager_askUserToRetryDownloadOrQuit
+        (JNIEnv *env, jclass dm, jint code) {
+
+        int ret;
+        if (code == getConstantInt(env, dm, "ERROR_DISK_FULL")) {
+           ret = dlg.SafeMessageBox(IDS_DISK_FULL_ERROR,
+                                    IDS_DISK_FULL_ERROR_CAPTION,
+                                    IDS_ERROR_CAPTION,
+                                    DIALOG_ERROR_RETRYCANCEL);
+        } else {
+           ret = dlg.SafeMessageBox(IDS_DOWNLOAD_RETRY_TEXT,
+                                    IDS_DOWNLOAD_RETRY,
+                                    IDS_ERROR_CAPTION,
+                                    DIALOG_ERROR_RETRYCANCEL);
+        }
+        if (ret != IDRETRY) {
+                // user choose to exit, return 0
+                return JNI_FALSE;
+        }
+
+        // return 1 (retry the download)
+        return JNI_TRUE;
+}
+
+JNIEXPORT void JNICALL Java_sun_jkernel_DownloadManager_startBackgroundDownloadWithBrokerImpl
+(JNIEnv *env, jclass dm, jstring command) {
+
+        char* szCommand = getStringPlatformChars(env, command);
+
+        // Send createprocess message
+        char * createproccmd = "STARTBACKGROUNDDOWNLOAD";
+
+        char * msg = (char*)malloc((strlen(createproccmd) + strlen(szCommand) + 2) * sizeof(char));
+
+        sprintf(msg, "%s*%s", createproccmd, szCommand);
+
+        sendMessageToBroker(msg);
+
+        free(szCommand);
+}
+
+
+void getParent(const TCHAR *path, TCHAR *dest) {
+    char* lastSlash = max(strrchr(path, '\\'), strrchr(path, '/'));
+    if (lastSlash == NULL) {
+        *dest = NULL;
+        return;
+    }
+    if (path != dest)
+        strcpy(dest, path);
+    *lastSlash = NULL;
+}
+
+
+bool createProcess(const TCHAR *path, const TCHAR *args) {
+    SHELLEXECUTEINFOA shInfo;
+
+    shInfo.cbSize = sizeof(SHELLEXECUTEINFOA);
+    shInfo.fMask = 0;
+    shInfo.hwnd = NULL;
+    shInfo.lpVerb = "runas";
+    shInfo.lpFile = path;
+    shInfo.lpParameters = args;
+    shInfo.lpDirectory = NULL;
+    shInfo.nShow = SW_NORMAL;
+    shInfo.hInstApp = NULL;
+
+    int result = (int) ::ShellExecuteExA(&shInfo);
+    // ShellExecute is documented to return >32 on success, but I'm consistently
+    // getting a return of 1 despite obviously successful results.  1 is not a
+    // documented return code from ShellExecute, and this may have something to
+    // do with the fact that we're using an undocumented verb in the first place
+    // ("runas").
+    return result > 32 || result == 1;
+}
+
+
+bool launchJBroker(const char *szJavaHome) {
+        char szPath[2048];
+        wsprintf(szPath, "%s\\bin\\jbroker.exe", szJavaHome);
+    return createProcess(szPath, NULL);
+}
+
+
+JNIEXPORT jboolean JNICALL Java_sun_jkernel_DownloadManager_launchJBroker
+(JNIEnv *env, jclass dm, jstring javaHomePath) {
+        char* szJavaHome = getStringPlatformChars(env, javaHomePath);
+    bool result = launchJBroker(szJavaHome);
+        free(szJavaHome);
+    return result ? TRUE : FALSE;
+}
+
+
+bool isJBrokerRunning() {
+        HANDLE hMutex = NULL;
+        DWORD ret = 0;
+
+        if (isRunningIEProtectedMode()) {
+
+                // check if jbroker process is running
+                // Use OpenMutex since we have limited access rights.
+                // CreateMutex function will fail with ERROR_ACCESS_DENIED in protected mode
+                hMutex = OpenMutex(SYNCHRONIZE, FALSE, "SunJavaBrokerMutex");
+
+                ret = ::GetLastError();
+
+                if (hMutex != NULL) {
+                        CloseHandle(hMutex);
+                }
+
+                if (ret == ERROR_FILE_NOT_FOUND)
+                {
+                        // jbroker not running yet, launch it
+                        return FALSE;
+                }
+
+                return TRUE;
+
+        } else {
+                hMutex = ::CreateMutex(NULL, TRUE, "SunJavaBrokerMutex");
+
+                if ( (hMutex == NULL) || (::GetLastError() == ERROR_ALREADY_EXISTS)) {
+                        // jbroker already running
+                        if (hMutex != NULL) ::CloseHandle(hMutex);
+                        return TRUE;
+                }
+
+                if (hMutex != NULL) ::CloseHandle(hMutex);
+
+                return FALSE;
+        }
+}
+
+
+JNIEXPORT jboolean JNICALL Java_sun_jkernel_DownloadManager_isJBrokerRunning
+(JNIEnv *env, jclass dm) {
+    return isJBrokerRunning() ? TRUE : FALSE;
+}
+
+
+JNIEXPORT jboolean JNICALL Java_sun_jkernel_DownloadManager_moveDirWithBrokerImpl
+    (JNIEnv *env, jclass dm, jstring fromPath, jstring userHome) {
+
+    char* fromPathChars = getStringPlatformChars(env, fromPath);
+
+    char* userHomeChars = getStringPlatformChars(env, userHome);
+
+    int ret = sendMoveDirMessageToBroker(fromPathChars, userHomeChars);
+
+    free(fromPathChars);
+
+    free(userHomeChars);
+
+    if (ret == 0) {
+        return FALSE;
+    }
+    return TRUE;
+}
+
+JNIEXPORT jboolean JNICALL Java_sun_jkernel_DownloadManager_moveFileWithBrokerImpl
+    (JNIEnv *env, jclass dm, jstring fromPath, jstring userHome) {
+
+    char* fromPathChars = getStringPlatformChars(env, fromPath);
+
+    char* userHomeChars = getStringPlatformChars(env, userHome);
+
+    int ret = sendMoveMessageToBroker(fromPathChars, userHomeChars);
+
+    free(fromPathChars);
+
+    free(userHomeChars);
+
+    if (ret == 0) {
+        return FALSE;
+    }
+    return TRUE;
+}
+
+/**
+ * Throw an exception with the last Windows error code if available.
+ */
+
+void ThrowByNameWithLastError(JNIEnv *env, char *exception, char* msg) {
+    char fullMsg[1024] = {0};
+    if (StringCbPrintf(fullMsg, 1024, "%s. Windows error: %d\n",
+        msg, GetLastError()) != S_OK) {
+
+        // Formatting failed: fall back to msg w/o error code
+        ThrowByName(env, exception, msg);
+    } else {
+        ThrowByName(env, exception, fullMsg);
+    }
+}
+
+/**
+ * Common code for "extra" compression or uncompression. If extra code
+ * not available do nothing but return false. If available, return true
+ * after locating the extra compression library at ".." and the defined
+ * path relative to the native library containing this method's code.
+ * If enabled, compress or uncompress the srcPath file into destpath,
+ * throwing exceptions for errors (see JNI routine docs below for details).
+ */
+
+jboolean extraCommon(BOOL docompress,
+        JNIEnv *env, jclass dm, jstring srcPath, jstring destPath) {
+#ifdef EXTRA_COMP_INSTALL_PATH
+    const char *operation = (docompress == true) ? "e" : "d";
+
+    // This should be shared with the deploy tree and should be defined
+    // in an implementation like LzmaAlone.h. However the deploy build
+    // doesn't exit yet wrt to this function pointer type.
+
+    typedef int (*EXTRACOMPTRTYPE) (int, const char**);
+
+    // Function pointer for invoking the encoder/decoder (uncompressor)
+    static volatile EXTRACOMPTRTYPE mptr = NULL;
+    // Volatile boolean becomes true when mptr init is finished
+
+// Stringifier macros to get the relative library path
+
+#define K_STRING(x) #x
+#define K_GETSTRING(x) K_STRING(x)
+
+    char *srcPathChars = getStringPlatformChars(env, srcPath);
+
+    if (srcPathChars == NULL) {
+        // TODO (for all throw calls). If the class&method are *reliably*
+        // reported to the user these message prefixes are silly.
+        ThrowByName(env, "java/io/IOException",
+            "Bundle.uncompress: GetStringPlatformChars failed");
+        return true;
+    }
+
+    char *destPathChars = getStringPlatformChars(env, destPath);
+    if (destPathChars == NULL) {
+        free(srcPathChars);
+        ThrowByName(env, "java/io/IOException",
+            "Bundle.uncompress: GetStringPlatformChars failed");
+        return true;
+    }
+    if (KERNEL_DEBUG) {
+        printf("LZMA: %s %s to %s\n", operation, srcPathChars, destPathChars);
+    }
+
+
+    // This loop avoids a lot of repetitious code for exception handling.
+    // If any loops are put inside this one be careful to properly
+    // handle exceptions within the inner loops.
+
+    do {
+
+        if (mptr == NULL) {
+
+            // Need to locate and link to the extra compression lib, which
+            // has a pathname relative to the directory containing the library
+            // containing this code, which is assumed to be one directory
+            // "below" the JRE base path. That is, the JRE base path is
+            // assumed to be ".." from the path of this library and then
+            // EXTRA_COMP_INSTALL_PATH from the JRE base path is expected to
+            // be the compression lib path.
+            // But this code is defensive and tries not to fail if the
+            // currently executing library is in ".". It will fail in a
+            // case like this if the extra compression lib path isn't
+            // "./EXTRA_CMP_INSTALL_PATH" (or just "EXTRA_CMP_INSTALL_PATH").
+            // Use macro magic to get the path macro as a string value.
+
+            const char *libRelativePath = K_GETSTRING(EXTRA_COMP_INSTALL_PATH);
+
+            // The max length the base JRE path can be to safely concatenate
+            // libRelativePath, a (possible) separator, and a null terminator.
+            int jreMaxPathLength = MAX_PATH - sizeof(libRelativePath) - 2;
+
+            TCHAR extraLibPath[MAX_PATH] = {0};
+            HMODULE kernel = GetModuleHandle("jkernel");
+            if (kernel != NULL) {
+                DWORD result = GetModuleFileName(kernel, extraLibPath,
+                    MAX_PATH-1);
+                if (result > 0) {
+                    // remove the name of this library (and maybe a
+                    // separator)
+                    getParent(extraLibPath, extraLibPath);
+                    if (extraLibPath[0] != NULL) {
+                        // There was a directory containing the library
+                        // (probably "<something or nothing\\>bin"), so
+                        // remove that to go up to the assumed JRE base path
+                        getParent(extraLibPath, extraLibPath);
+                    } else {
+                        ThrowByName(env, "java/io/IOException",
+                            "bundle uncompression: expected lib path component not found");
+                        break;
+                    }
+                    // This is effectively an assertion that the concat
+                    // below cannot overflow
+                    if (extraLibPath[0] != NULL) {
+                        // Current dir is not ".", so add a separator
+                        strcat(extraLibPath, "\\");
+                    }
+                    if ((strlen(extraLibPath) + 1) > jreMaxPathLength) {
+                        ThrowByName(env, "java/io/IOException",
+                            "bundle uncompression: JRE base pathname too long");
+                        break;
+                    }
+                    strcat(extraLibPath, libRelativePath);
+                } else {
+                    ThrowByName(env, "java/io/IOException",
+                        "bundle uncompression: GetModuleFileName failed");
+                    break;
+                }
+            } else {
+                ThrowByNameWithLastError(env, "java/io/IOException",
+                   "bundle uncompression: GetModuleHandle failed");
+                break;
+            }
+
+            // Load the library and develop a pointer to the decoder routine
+
+            if (KERNEL_DEBUG) {
+                printf("bundle uncompression: extra library path %s\n",
+                    extraLibPath);
+            }
+
+            HMODULE handle = LoadLibrary(extraLibPath);
+            if (handle == NULL) {
+                ThrowByNameWithLastError(env, "java/io/IOException",
+                    "bundle uncompression: LoadLibrary failed");
+                break;
+            }
+
+            // find the extra uncompression routine
+
+            mptr = (EXTRACOMPTRTYPE) GetProcAddress(handle,
+                "ExtraCompressionMain");
+
+            if (mptr == NULL) {
+                ThrowByNameWithLastError(env, "java/io/IOException",
+                    "bundle uncompression: GetProcAddress failed");
+                break;
+            }
+        }
+
+        // Create the arguments for the decoder
+        // Decoder options must go *between* the "d" argument and the
+        // source path arguments and don't forget to keep the 1st arg to
+        // (*mptr) the same as the number of elements of args.
+        const char *args[] = {
+            "", // the shared lib makes no attempt access it's "command name"
+            operation,
+
+            // Special decoder/encoder switch strings would go here
+
+            // For example: "-d24", to set the dictionary size to 16MB
+
+            "-q", // Suppress banner msg output
+
+            // No special option switch strings after here
+
+            srcPathChars,
+            destPathChars
+        };
+        int argc = sizeof(args) / sizeof(const char *);
+        if ((*mptr)(argc, args) != 0) {
+            if (KERNEL_DEBUG) {
+                printf("uncompress lib call failed with args: ");
+                for (int i = 0; i < argc; i++) {
+                    printf("%s", args[i]);
+                }
+                printf("\n");
+            }
+            ThrowByName(env, "java/io/IOException",
+                "bundle uncompression: uncompression failed");
+            break;
+        }
+    } while (false);
+
+    free(srcPathChars);
+    free(destPathChars);
+    return TRUE;
+#else
+    if (KERNEL_DEBUG) {
+        printf("LZMA not compiled in!\n");
+    }
+
+    return FALSE;
+#endif // EXTRA_COMP_INSTALL_PATH
+}
+
+/**
+ * Compress file sourcePath with "extra" algorithm (e.g. 7-Zip LZMA)
+ * if available, put the compressed data into file destPath and
+ * return true. If extra compression is not available do nothing
+ * with destPath and return false;
+ * @param srcPath the path of the uncompressed file
+ * @param destPath the path of the compressed file, if used
+ * @return true if the extra algorithm was used and destPath created
+ *
+ * @throws IOException if the extra compression code should be available
+ *     but cannot be located or linked to, the destination file already
+ *     exists or cannot be opened for writing, or the compression fails
+ */
+JNIEXPORT jboolean JNICALL Java_sun_jkernel_Bundle_extraCompress
+        (JNIEnv *env, jclass dm, jstring srcPath, jstring destPath) {
+    return extraCommon(true, env, dm, srcPath, destPath);
+}
+
+/**
+ * Uncompress file sourcePath with "extra" algorithm (e.g. 7-Zip LZMA)
+ * if available, put the uncompressed data into file destPath and
+ * return true. If if the extra algorithm is not available, leave the
+ * destination path unchanged and return false;
+ * @param srcPath the path of the file having extra compression
+ * @param destPath the path of the uncompressed file
+ * @return true if the extra algorithm was used
+ *
+ * @throws IOException if the extra uncompression code should be available
+ *     but cannot be located or linked to, the destination file already
+ *     exists or cannot be opened for writing, or the uncompression fails
+ */
+
+JNIEXPORT jboolean JNICALL Java_sun_jkernel_Bundle_extraUncompress
+        (JNIEnv *env, jclass dm, jstring srcPath, jstring destPath) {
+    return extraCommon(false, env, dm, srcPath, destPath);
+}
+
+
+JNIEXPORT void JNICALL Java_sun_jkernel_DownloadManager_addToTotalDownloadSize
+    (JNIEnv *env, jclass dm, jint size) {
+    dlg.addToTotalContentLength(size);
+}
+
+JNIEXPORT void JNICALL Java_sun_jkernel_DownloadManager_downloadFromURLImpl
+    (JNIEnv *env, jclass dm, jstring url, jobject file, jstring name,
+        jboolean showProgress) {
+    jclass object = env->FindClass("java/lang/Object");
+    jmethodID toString = env->GetMethodID(object, "toString", "()Ljava/lang/String;");
+    jstring urlString = (jstring) env->CallObjectMethod(url, toString);
+    char* urlChars = getStringPlatformChars(env, urlString);
+    if (KERNEL_DEBUG) {
+        printf("Kernel downloadFromURL: %s\n", urlChars);
+    }
+    jstring fileString = (jstring) env->CallObjectMethod(file, toString);
+    char* fileChars = getStringPlatformChars(env, fileString);
+    char* nameChars = getStringPlatformChars(env, name);
+
+    JavaVM *jvm;
+    env->GetJavaVM(&jvm);
+
+    __try
+    {
+
+        m_csCreateDialog.Lock();
+        if (createDialog && showProgress) {
+            // create download progress dialog in a new thread
+            dlg.setJavaVM(jvm);
+            createDownloadWindow(&dlg);
+            createDialog = FALSE;
+        }
+
+    }
+    __finally
+    {
+        m_csCreateDialog.Unlock();
+    }
+
+    DownloadHelper dh;
+
+    dh.setJavaVM(jvm);
+    dh.setURL(urlChars);
+    dh.setFile(fileChars);
+    dh.setNameText((char*) nameChars);
+    dh.setShowProgressDialog(showProgress);
+    dh.setDownloadDialog(&dlg);
+
+    if (dh.doDownload() != S_OK) {
+        // remove incomplete file
+        int ret = DeleteFile(fileChars);
+    }
+
+    free(urlChars);
+    free(fileChars);
+    free(nameChars);
+}
+
+
+void error(char* msg) {
+    MessageBox(NULL, msg, "Java Error", MB_OK);
+}
+
+
+// Replace the dest file with the src file.  Returns zero on success, Windows
+// error code otherwise.
+int replace(TCHAR* fullDest, TCHAR* fullSrc) {
+    struct _stat stat;
+    int result = _stat(fullSrc, &stat);
+    if (result == 0) {
+        DeleteFile(fullDest);
+        if (MoveFile(fullSrc, fullDest))
+            return 0;
+        else
+            return GetLastError();
+    }
+    else
+        return ENOENT; // src file not found
+}
+
+
+// Replace the dest file with the src file, where both paths are relative to
+// the specified root.  Returns zero on success, Windows error code otherwise.
+int replaceRelative(TCHAR* root, TCHAR* dest, TCHAR* src) {
+    TCHAR fullDest[MAX_PATH];
+    TCHAR fullSrc[MAX_PATH];
+    strcpy(fullDest, root);
+    strcat(fullDest, dest);
+    strcpy(fullSrc, root);
+    strcat(fullSrc, src);
+    return replace(fullDest, fullSrc);
+}
+
+
+// Atomically deletes a file tree.  Returns zero on success, Windows
+// error code otherwise.
+int deleteAll(TCHAR* root) {
+    TCHAR tmp[MAX_PATH];
+    if (strlen(root) + 5 > MAX_PATH)
+        return ERROR_BUFFER_OVERFLOW;
+    strcpy(tmp, root);
+    strcat(tmp, ".tmp");
+    struct _stat stat;
+    int result = _stat(tmp, &stat);
+    if (result == 0) {
+        result = !deleteAll(tmp);
+        if (result)
+            return result;
+    }
+    if (!MoveFile(root, tmp))
+        return GetLastError();
+    struct _SHFILEOPSTRUCTA fileOp;
+    memset(&fileOp, NULL, sizeof(fileOp));
+    fileOp.wFunc = FO_DELETE;
+    TCHAR pFrom[MAX_PATH + 1];
+    strcpy(pFrom, tmp);
+    pFrom[strlen(pFrom) + 1] = NULL; // extra null to signify that there is only one file in the list
+    fileOp.pFrom = pFrom;
+    fileOp.fFlags = FOF_NOCONFIRMATION | FOF_SILENT | FOF_NOERRORUI;
+    return SHFileOperation(&fileOp);
+}
+
+
+// moves all file with "wait='true'" specified in bundles.xml into their final
+// locations.  These files are stored under lib/bundles/tmp, e.g. lib/meta-index
+// is stored at lib/bundles/tmp/lib/meta-index.
+// relativePath is the current relative path we are searching (e.g. "lib" for the
+// example above), which begins as the empty string.
+int moveDelayedFiles(TCHAR* javaHome, TCHAR* relativePath) {
+    TCHAR src[MAX_PATH];
+    TCHAR* tmp = "lib\\bundles\\tmp";
+    if (strlen(javaHome) + strlen(relativePath) + strlen(tmp) > MAX_PATH) {
+        error("Path too long.");
+        return ERROR_BUFFER_OVERFLOW;
+    }
+    strcpy(src, javaHome);
+    strcat(src, tmp);
+    if (relativePath[0] != NULL) {
+        strcat(src, "\\");
+        strcat(src, relativePath);
+    }
+
+    struct _stat stat;
+    int result = _stat(src, &stat);
+    if (result == 0) {
+        if (stat.st_mode & _S_IFDIR) { // is a directory, loop through contents
+            strcat(src, "\\*");
+            struct _WIN32_FIND_DATAA file;
+            HANDLE findHandle = FindFirstFile(src, &file);
+            if (findHandle != INVALID_HANDLE_VALUE) {
+                do {
+                    if (file.cFileName[0] != '.') {
+                        char child[MAX_PATH];
+                        strcpy(child, relativePath);
+                        strcat(child, "\\");
+                        strcat(child, file.cFileName);
+                        moveDelayedFiles(javaHome, child);
+                    }
+                }
+                while (FindNextFile(findHandle, &file) != 0);
+                FindClose(findHandle);
+            }
+        }
+        else { // normal file, move into place
+            if (strcmp(relativePath, "\\finished")) {
+                TCHAR dest[MAX_PATH];
+                strcpy(dest, javaHome);
+                strcat(dest, relativePath);
+
+                DeleteFile(dest); // just in case; ignore failures
+                if (MoveFile(src, dest))
+                    return 0;
+                else
+                    return GetLastError();
+            }
+        }
+    }
+    return result;
+}
+
+
+// activates Class Data Sharing
+void activateCDS(const char *javaHome) {
+    char java[MAX_PATH];
+    strcpy(java, javaHome);
+    strcat(java, "bin\\javaw.exe");
+
+    STARTUPINFO si;
+    PROCESS_INFORMATION pi;
+    ZeroMemory(&si, sizeof(si));
+    si.cb = sizeof(si);
+    ZeroMemory(&pi, sizeof(pi));
+    const char *args = " -Xshare:dump";
+    const int argLength = 13;
+    char commandLine[MAX_PATH + argLength + 2];
+    strcpy(commandLine, "\"");
+    strcat(commandLine, java);
+    strcat(commandLine, "\"");
+    strcat(commandLine, args);
+    if (KERNEL_DEBUG)
+        printf("Exec: %s\n", commandLine);
+    if (CreateProcess(java, commandLine, NULL, NULL, FALSE, 0,
+            NULL, NULL, &si, &pi)) {
+        CloseHandle(pi.hProcess);
+        CloseHandle(pi.hThread);
+    }
+    else
+        printf("Error initializing Class Data Sharing: %d", GetLastError());
+}
+
+typedef BOOL (*LPFNInstallJQS)();
+
+// activates the Java Quickstart Service
+void activateJQS(HMODULE hModule) {
+    LPFNInstallJQS lpfnInstallJQS;
+
+    if (hModule != NULL) {
+        lpfnInstallJQS = (LPFNInstallJQS)GetProcAddress(hModule, "InstallJQS");
+        if (lpfnInstallJQS != NULL) {
+            if ((lpfnInstallJQS)() == false && KERNEL_DEBUG) {
+                printf("InstallJQS returned FALSE\n");
+            }
+        }
+    }
+}
+
+// determines JAVA_HOME and stores it in the specified buffer.  Returns true on success.
+BOOL getJavaHome(char* buffer, int bufferSize) {
+    HMODULE kernel = GetModuleHandle("jkernel");
+    if (kernel != NULL) {
+        DWORD result = GetModuleFileName(kernel, buffer, bufferSize);
+        if (result > 0) {
+            getParent(buffer, buffer); // remove "jkernel.dll"
+            if (buffer[0] != NULL)
+                getParent(buffer, buffer); // remove "bin"
+            if (buffer[0] != NULL) {
+                strcat(buffer, "\\");
+                return TRUE;
+            }
+        }
+    }
+    return FALSE;
+}
+
+typedef unsigned int (WINAPI *LPFNPostPing)(LPVOID err);
+HANDLE PostPing(HMODULE hModule, char* fname, DWORD err)
+{
+    LPFNPostPing lpfnPostPing;
+    HANDLE hThread = NULL;
+    lpfnPostPing = (LPFNPostPing)GetProcAddress(hModule, fname);
+    if (lpfnPostPing != NULL) {
+        printf("############# ERROR CODE: %d\n", err);
+        hThread = (HANDLE)_beginthreadex(NULL, 0, lpfnPostPing,
+                                             (LPVOID)err, 0, NULL);
+        if (hThread == NULL)
+            lpfnPostPing((LPVOID)err);
+    }
+    return hThread;
+}
+
+void postPingAndWait(char* fname, DWORD err) {
+    TCHAR path[MAX_PATH];
+    if (getJavaHome(path, MAX_PATH)) {
+        strcat(path, "bin\\regutils.dll");
+        HANDLE hThread = NULL;
+        HMODULE hModule = LoadLibrary(path);
+        if (hModule != NULL) {
+            hThread = PostPing(hModule, fname, err);
+            if (hThread != NULL) {
+                DWORD dwRet = 0;
+                WaitForSingleObject(hThread, 60*1000);
+                GetExitCodeThread(hThread, &dwRet);
+                CloseHandle(hThread);
+            }
+        }
+    }
+    else
+        printf("error determining JAVA_HOME for ping\n");
+}
+
+JNIEXPORT void JNICALL Java_sun_jkernel_DownloadManager_postDownloadError
+        (JNIEnv *env, jclass dm, jint error) {
+    postPingAndWait("PostKernelDLComp", error);
+}
+
+JNIEXPORT void JNICALL Java_sun_jkernel_DownloadManager_postDownloadComplete
+        (JNIEnv *env, jclass dm) {
+    Java_sun_jkernel_DownloadManager_postDownloadError(env, dm, ERROR_SUCCESS);
+}
+
+bool spawnedFromJBroker() {
+    return strstr(GetCommandLine(), JBROKER_KEY) != NULL;
+}
+
+
+// Determines if we have sufficient access to go ahead and perform completion.
+// This is true either if we are not on Vista (in which case we can't elevate
+// privileges anyway and have to hope for the best) or if we are on Vista and
+// running at High integrity level.
+bool highIntegrity() {
+    if (!IsPlatformWindowsVista())
+        return TRUE;
+    else {
+        // directly determining this would require access to Vista-specific
+        // APIs, which aren't supported by our current build configurations.
+        // Instead we look for the presence of a flag on the command line to
+        // indicate that we were launched by the jbroker process.  This is
+        // actually safer, as it prevents us from re-launching another JRE in
+        // the event that we somehow didn't end up with high integrity.
+        return spawnedFromJBroker();
+    }
+}
+
+JNIEXPORT jint JNICALL Java_sun_jkernel_DownloadManager_getCurrentProcessId
+        (JNIEnv *env, jclass dm) {
+    return (jint) GetCurrentProcessId();
+}
+
+JNIEXPORT jstring JNICALL Java_sun_jkernel_DownloadManager_getVisitorId0
+        (JNIEnv *env, jclass dm) {
+    CRegKey swKey, jsKey, juKey, pKey;
+    if (swKey.Open(HKEY_LOCAL_MACHINE, "SOFTWARE", KEY_READ) != ERROR_SUCCESS){
+        return NULL;
+    }
+
+    if (jsKey.Open(swKey, "JavaSoft", KEY_READ) != ERROR_SUCCESS){
+        return NULL;
+    }
+
+    if (juKey.Open(jsKey, "Java Update", KEY_READ) != ERROR_SUCCESS){
+        return NULL;
+    }
+
+    if (pKey.Open(juKey, "Policy", KEY_READ) != ERROR_SUCCESS){
+        return NULL;
+    }
+
+    DWORD dwCount = BUFSIZE;
+    char* keyValue = new char[BUFSIZE];
+    if (pKey.QueryValue(keyValue, "VisitorId", &dwCount) != ERROR_SUCCESS){
+        return NULL;
+    }
+    jstring visitorId = env->NewStringUTF(keyValue);
+
+    return visitorId;
+}
+
+
+JNIEXPORT jstring JNICALL Java_sun_jkernel_DownloadManager_getUrlFromRegistry
+        (JNIEnv *env, jclass dm) {
+
+    CRegKey swKey, jsKey;
+    if (swKey.Open(HKEY_LOCAL_MACHINE, "SOFTWARE", KEY_READ) != ERROR_SUCCESS){
+        return NULL;
+    }
+
+    if (jsKey.Open(swKey, "JavaSoft", KEY_READ) != ERROR_SUCCESS){
+        return NULL;
+    }
+
+    DWORD dwCount = BUFSIZE;
+        char * keyValue = new char[BUFSIZE];
+    if (jsKey.QueryValue(keyValue, "KernelDownloadUrl", &dwCount) != ERROR_SUCCESS){
+        return NULL;
+    }
+
+    jstring downloadKeyValue = env->NewStringUTF(keyValue);
+
+    return downloadKeyValue;
+}
+
+
+
+jboolean getBooleanRegistryKey(char *name, jboolean defaultValue) {
+    // Check DWORD registry key
+    // HKEY_LOCAL_MACHINE/Software/JavaSoft/<name>
+
+    CRegKey swKey, jsKey;
+    if (swKey.Open(HKEY_LOCAL_MACHINE, "SOFTWARE", KEY_READ) != ERROR_SUCCESS){
+        return NULL;
+    }
+
+    if (jsKey.Open(swKey, "JavaSoft", KEY_READ) != ERROR_SUCCESS){
+        return NULL;
+    }
+
+    DWORD dwValue = 0;
+    if (jsKey.QueryValue(dwValue, name) != ERROR_SUCCESS){
+
+        // Key does not exist, will return default value
+        return defaultValue;
+    }
+
+    return dwValue != 0;
+}
+
+
+JNIEXPORT jboolean JNICALL Java_sun_jkernel_BackgroundDownloader_getBackgroundDownloadKey
+        (JNIEnv *env, jclass dm) {
+    return getBooleanRegistryKey("KernelBackgroundDownload", TRUE);
+}
+
+
+JNIEXPORT jboolean JNICALL Java_sun_jkernel_DownloadManager_getDebugKey
+        (JNIEnv *env, jclass dm) {
+    return getBooleanRegistryKey("KernelDebug", FALSE);
+}
+
+
+// Called by the launcher before the JVM starts.  If all kernel bundles have been
+// downloaded, this function performs various post-download cleanups such as
+// moving the merged rt.jar into place.  At the end of cleanup, the JRE should
+// be indistinguishable from the non-kernel JRE.
+void preJVMStart() {
+    char rawMsg[BUFFER_SIZE];
+    char msg[BUFFER_SIZE];
+    HMODULE kernel = GetModuleHandle("jkernel");
+    if (kernel != NULL) {
+        TCHAR javaHome[MAX_PATH];
+        DWORD result = GetModuleFileName(kernel, javaHome, MAX_PATH);
+        if (result > 0) {
+            getParent(javaHome, javaHome); // remove "jkernel.dll"
+            if (javaHome[0] != NULL)
+                getParent(javaHome, javaHome); // remove "bin"
+            if (javaHome[0] != NULL) {
+                // should now be pointing to correct java.home
+                strcat(javaHome, "\\");
+                bool jbroker = spawnedFromJBroker();
+                HANDLE file;
+                TCHAR rt[MAX_PATH];
+                strcpy(rt, javaHome);
+                strcat(rt, "lib\\rt.jar");
+                HANDLE startMutex = CreateMutex(NULL, FALSE, "jvmStart");
+                if (!jbroker) { // else mutex is already held by the pre-jbroker JVM
+                    if (KERNEL_DEBUG)
+                        printf("Locking startMutex\n");
+                    WaitForSingleObject(startMutex, INFINITE);
+                    if (KERNEL_DEBUG)
+                        printf("Locked startMutex\n");
+                    // open rt.jar for reading.  This prevents other JREs from being
+                    // able to acquire a write lock on rt.jar, which is used as a test
+                    // to ensure that no other JREs are running.
+                    // The failure to close the file handle is intentional -- if we
+                    // close it, there will be a brief window between the close and
+                    // when the JRE reopens it during which another jre could get
+                    // a write lock on it, hosing us.
+                    file = CreateFile(rt, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, NULL, NULL);
+                    if (file == INVALID_HANDLE_VALUE) {
+                        ReleaseAndClose(startMutex);
+                        return;
+                    }
+                    if (KERNEL_DEBUG)
+                        printf("Opened rt.jar for reading\n");
+                }
+                TCHAR finished[MAX_PATH];
+                TCHAR* finishedPath = "lib\\bundles\\tmp\\finished";
+                if (strlen(javaHome) + strlen(finishedPath) < MAX_PATH) {
+                    strcpy(finished, javaHome);
+                    strcat(finished, finishedPath);
+                    struct _stat finishedStat;
+                    result = _stat(finished, &finishedStat);
+                    if (result == 0) { // JRE has been fully downloaded but not yet cleaned up
+                        if (KERNEL_DEBUG)
+                            printf("Beginning completion.\n");
+                        if (!jbroker)
+                            CloseHandle(file);
+                        if (highIntegrity()) {
+                            // attempt to open rt.jar for exclusive write access -- if this succeeds,
+                            // we know no other JREs are running
+                            file = CreateFile(rt, GENERIC_WRITE, NULL, NULL, OPEN_EXISTING, NULL, NULL);
+                            if (file == INVALID_HANDLE_VALUE) {
+                                // must be another JRE running...
+                                ReleaseAndClose(startMutex);
+                                return;
+                            }
+                            if (KERNEL_DEBUG)
+                                printf("Opened rt.jar for writing.\n");
+                            CloseHandle(file);
+                            if (KERNEL_DEBUG)
+                                printf("Closed rt.jar.\n");
+                            int result = replaceRelative(javaHome, "lib\\rt.jar",
+                                    "lib\\bundles\\tmp\\merged-rt.jar");
+                            if (result != 0 && result != ENOENT) {
+                                ::LoadString(_Module.GetModuleInstance(), IDS_FILE_UPDATE_ERROR, rawMsg, BUFFER_SIZE);
+                                wsprintf(msg, rawMsg, javaHome, "lib\\rt.jar");
+                                error(msg);
+                                ReleaseAndClose(startMutex);
+                                return;
+                            }
+                            result = replaceRelative(javaHome, "lib\\resources.jar",
+                                    "lib\\bundles\\tmp\\merged-resources.jar");
+                            if (result != 0 && result != ENOENT) {
+                                ::LoadString(_Module.GetModuleInstance(), IDS_FILE_UPDATE_ERROR, rawMsg, BUFFER_SIZE);
+                                wsprintf(msg, rawMsg, javaHome, "lib\\resources.jar");
+                                error(msg);
+                                ReleaseAndClose(startMutex);
+                                return;
+                            }
+
+                            TCHAR bundles[MAX_PATH];
+                            strcpy(bundles, javaHome);
+                            strcat(bundles, "lib\\bundles");
+                            if (moveDelayedFiles(javaHome, "")) {
+                                ::LoadString(_Module.GetModuleInstance(), IDS_FILE_UPDATE_ERROR, msg, BUFFER_SIZE);
+                                error(msg);
+                                ReleaseAndClose(startMutex);
+                                return;
+                            }
+
+                            TCHAR kernel[MAX_PATH];
+                            strcpy(kernel, javaHome);
+                            strcat(kernel, "bin\\kernel");
+                            result = deleteAll(kernel);
+                            if (result != 0 && result != ENOENT) {
+                                ::LoadString(_Module.GetModuleInstance(), IDS_FILE_DELETE_ERROR, rawMsg, BUFFER_SIZE);
+                                wsprintf(msg, rawMsg, kernel);
+                                error(msg);
+                                ReleaseAndClose(startMutex);
+                                return;
+                            }
+
+                            if (deleteAll(bundles)) {
+                                // fail silently, CR #6643218
+                                printf("deleteAll failed!\n");
+                                ReleaseAndClose(startMutex);
+                                return;
+                            }
+
+                            TCHAR kernelMap[MAX_PATH];
+                            strcpy(kernelMap, javaHome);
+                            strcat(kernelMap, "lib\\kernel.map");
+                            result = deleteAll(kernelMap);
+                            if (result != 0 && result != ENOENT) {
+                                ::LoadString(_Module.GetModuleInstance(), IDS_FILE_DELETE_ERROR, rawMsg, BUFFER_SIZE);
+                                wsprintf(msg, rawMsg, kernelMap);
+                                error(msg);
+                                ReleaseAndClose(startMutex);
+                                return;
+                            }
+
+                            strcpy(rt, javaHome);
+                            strcat(rt, "bin\\regutils.dll");
+                            HANDLE hThread = NULL;
+                            HMODULE hModule = LoadLibrary(rt);
+                            if (hModule != NULL)
+                                hThread = PostPing(hModule, "PostKernelComp", ERROR_SUCCESS);
+                            if (KERNEL_DEBUG)
+                                printf("Activating JQS.\n");
+                            activateJQS(hModule);
+
+                            if (KERNEL_DEBUG)
+                                printf("Activating CDS.\n");
+                            activateCDS(javaHome);
+
+                            if (hThread != NULL) {
+                                DWORD dwRet = 0;
+                                WaitForSingleObject(hThread, 60*1000);
+                                GetExitCodeThread(hThread, &dwRet);
+                                CloseHandle(hThread);
+                            }
+                            if (hModule != NULL)
+                                FreeLibrary(hModule);
+                        } else {
+                            bool jbroker = isJBrokerRunning();
+                            if (!jbroker) {
+                                // remove trailing slash
+                                javaHome[strlen(javaHome) - 1] = 0;
+                                jbroker = launchJBroker(javaHome);
+                                if (!jbroker) {
+                                    ::LoadString(_Module.GetModuleInstance(),
+                                                IDS_JBROKER_ERROR,
+                                                msg,
+                                                BUFFER_SIZE);
+                                    error(msg);
+                                }
+                            }
+                            if (jbroker)
+                                sendPerformCompletionMessageToBroker(javaHome);
+                        }
+                    }
+                }
+                if (KERNEL_DEBUG)
+                    printf("Releasing startMutex.\n");
+                ReleaseAndClose(startMutex);
+            } else {
+                ::LoadString(_Module.GetModuleInstance(), IDS_JAVA_HOME_ERROR, msg, BUFFER_SIZE);
+                error(msg);
+            }
+        } else {
+            ::LoadString(_Module.GetModuleInstance(), IDS_KERNEL_HOME_ERROR, msg, BUFFER_SIZE);
+            error(msg);
+        }
+    } else {
+        ::LoadString(_Module.GetModuleInstance(), IDS_KERNEL_HOME_ERROR, msg, BUFFER_SIZE);
+        error(msg);
+    }
+}
diff --git a/src/windows/native/sun/jkernel/kernel.def b/src/windows/native/sun/jkernel/kernel.def
new file mode 100644
index 0000000..1e05fd0
--- /dev/null
+++ b/src/windows/native/sun/jkernel/kernel.def
@@ -0,0 +1,28 @@
+;
+; Copyright 2008 - 2009 Sun Microsystems, Inc.  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.  Sun designates this
+; particular file as subject to the "Classpath" exception as provided
+; by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+; CA 95054 USA or visit www.sun.com if you need additional information or
+; have any questions.
+;
+
+LIBRARY jkernel
+EXPORTS
+   preJVMStart @1
diff --git a/src/windows/native/sun/jkernel/kernel.h b/src/windows/native/sun/jkernel/kernel.h
new file mode 100644
index 0000000..f48ca5a
--- /dev/null
+++ b/src/windows/native/sun/jkernel/kernel.h
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2008 - 2009 Sun Microsystems, Inc.  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.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+void preJVMStart();
diff --git a/src/windows/native/sun/jkernel/kernel.rc b/src/windows/native/sun/jkernel/kernel.rc
new file mode 100644
index 0000000..c84853a
--- /dev/null
+++ b/src/windows/native/sun/jkernel/kernel.rc
@@ -0,0 +1,198 @@
+/*
+ * Copyright 2008 - 2009 Sun Microsystems, Inc.  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.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+#include "version.rc"
+
+#include "resource.h"
+#define APSTUDIO_READONLY_SYMBOLS
+#include "afxres.h"
+#undef APSTUDIO_READONLY_SYMBOLS
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+IDI_JAVA                ICON      DISCARDABLE     "graphics\\java-icon.ico"
+IDI_MASTHEAD            BITMAP    DISCARDABLE     "graphics\\masthead.bmp"
+
+/////////////////////////////////////////////////////////////////////////////
+// Include foreign resources
+/////////////////////////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////////////////////////////////////
+// Japanese resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JPN)
+#ifdef _WIN32
+LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
+#pragma code_page(932)
+#endif //_WIN32
+#include "kernel_ja.rc"
+#endif	  // Japanese resources
+/////////////////////////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////////////////////////////////////
+// Chinese (P.R.C.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS)
+#ifdef _WIN32
+LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
+#pragma code_page(936)
+#endif //_WIN32
+#include "kernel_zh.rc"
+#endif	  // Chinese (P.R.C.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////////////////////////////////////
+// Korean resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_KOR)
+#ifdef _WIN32
+LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT
+#pragma code_page(949)
+#endif //_WIN32
+#include "kernel_ko.rc"
+#endif	  // Korean resources
+/////////////////////////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////////////////////////////////////
+// Chinese (Taiwan) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHT)
+#ifdef _WIN32
+LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL
+#pragma code_page(950)
+#endif //_WIN32
+#include "kernel_zh_TW.rc"
+#endif	  // Chinese (Taiwan) resources
+/////////////////////////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////////////////////////////////////
+// German (Germany) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU)
+#ifdef _WIN32
+LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL
+#pragma code_page(1252)
+#endif //_WIN32
+#include "kernel_de.rc"
+#endif	  // German (Germany) resources
+/////////////////////////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////////////////////////////////////
+// Spanish (Castilian) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ESP)
+#ifdef _WIN32
+LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL
+#pragma code_page(1252)
+#endif //_WIN32
+#include "kernel_es.rc"
+#endif	  // Spanish (Castilian) resources
+/////////////////////////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////////////////////////////////////
+// French (France) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
+#ifdef _WIN32
+LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL
+#pragma code_page(1252)
+#endif //_WIN32
+#include "kernel_fr.rc"
+#endif	  // French (France) resources
+/////////////////////////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////////////////////////////////////
+// Italian (Italy) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ITA)
+#ifdef _WIN32
+LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL
+#pragma code_page(1252)
+#endif //_WIN32
+#include "kernel_it.rc"
+#endif	  // Italian (Italy) resources
+/////////////////////////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////////////////////////////////////
+// Swedish resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_SVE)
+#ifdef _WIN32
+LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL
+#pragma code_page(1252)
+#endif //_WIN32
+#include "kernel_sv.rc"
+#endif	  // Swedish resources
+/////////////////////////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+#include "kernel_en.rc"
+#endif	  // English resources
+
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
diff --git a/src/windows/native/sun/jkernel/kernel_de.rc b/src/windows/native/sun/jkernel/kernel_de.rc
new file mode 100644
index 0000000..9daf445
--- /dev/null
+++ b/src/windows/native/sun/jkernel/kernel_de.rc
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2008 - 2009 Sun Microsystems, Inc.  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.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 340, 120
+STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | 
+    WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+CAPTION "Zusätzliche Komponenten erforderlich"
+EXSTYLE WS_EX_APPWINDOW
+FONT 8, "MS Sans Serif"
+BEGIN
+    LTEXT           "", IDC_DOWNLOAD_MASTHEAD, 0, 0, 340, 39
+    LTEXT           "", IDC_MASTHEAD_TEXT, 60, 4, 220, 30
+    CONTROL         "", IDC_STATIC,"Static", SS_BLACKFRAME | SS_SUNKEN,
+                    0, 39, 340, 1
+    LTEXT           "", IDC_DOWNLOAD_TEXT, 12, 60, 316, 20
+    LTEXT           "", IDC_TIME_REMAINING, 12, 90, 316, 10
+    CONTROL         "Progress1",1006,"msctls_progress32",PBS_SMOOTH,
+                    12, 100, 265, 14
+    PUSHBUTTON	    "Abbrechen",  2, 285, 100, 46, 14
+END
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO DISCARDABLE 
+BEGIN
+    105, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 236
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 63
+    END
+END
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE DISCARDABLE 
+BEGIN
+    IDS_DOWNLOAD_CANCEL_MESSAGE   "Wenn Sie die Installation zusätzlicher Komponenten, die für die Anwendung erforderlich sind, abbrechen, wird die Anwendung möglicherweise geschlossen.\n\nMöchten Sie die Installation zusätzlicher Komponenten wirklich abbrechen?"
+    IDS_DOWNLOAD_CANCEL_CAPTION   "Abbrechen - Zusätzliche Komponenten"
+    IDS_DOWNLOAD_CANCEL_INSTRUCTION   ""
+    IDS_HTTP_INSTRUCTION_REQUEST_TIMEOUT      "Verbindungszeitüberschreitung"
+    IDS_HTTP_INSTRUCTION_SERVER_NOT_REACHABLE "Internetverbindung kann nicht hergestellt werden"
+    IDS_HTTP_INSTRUCTION_UNKNOWN_ERROR        "Serverfehler (Fehler %s)"
+    IDS_HTTP_INSTRUCTION_SERVICE_UNAVAIL      "Der Dienst nicht verfügbar (Fehler %s)"
+    IDS_HTTP_INSTRUCTION_FORBIDDEN            "Zugriff verweigert oder verboten (Fehler %s)"
+    IDS_HTTP_STATUS_OTHER                     "Bei der Anfrage ist ein Fehler aufgetreten. Möchten Sie die Anfrage wiederholen?"
+
+// HTTP status code
+    IDS_HTTP_STATUS_REQUEST_TIMEOUT "Während der Server auf die Anforderung wartete, kam es zu einer Zeitüberschreitung."
+    IDS_HTTP_STATUS_FORBIDDEN		"Der Server hat die Anforderung verstanden, verweigert jedoch deren Ausführung."
+    IDS_HTTP_STATUS_SERVER_ERROR	"Der Server stieß auf eine unerwartete Bedingung, die das Ausführen der Anforderung verhinderte."
+    IDS_HTTP_STATUS_SERVICE_UNAVAIL	"Der Dienst ist vorübergehend überlastet."
+
+
+    IDS_DOWNLOAD_STATUS_RETRY		"Server beschäftigt. Erneuter Versuch in %ld Sekunden ..."
+
+    IDS_ERROR_CAPTION               "Fehler - Java Kernel"
+    IDS_HOURSMINUTESECOND	    "Verbleibende Zeit (geschätzt): %d Stunden, %d Minuten und %.0f Sekunden"
+    IDS_HOURMINUTESECOND	    "Verbleibende Zeit (geschätzt): %d Stunde, %d Minuten und %.0f Sekunden"
+    IDS_MINUTESECOND 		    "Verbleibende Zeit (geschätzt): %d Minuten %.0f Sekunden"
+    IDS_SECOND                      "Verbleibende Zeit (geschätzt): %.0f Sekunden"
+    IDS_DISK_FULL_ERROR_CAPTION     "Festplatte voll"
+    IDS_DISK_FULL_ERROR             "Java Kernel konnte erforderliche Komponenten nicht herunterladen, da der Datenträger voll ist.  Noch einmal versuchen?"
+    IDS_DISK_WRITE_ERROR_CAPTION    "Fehler beim Schreiben auf Datenträger"
+    IDS_DISK_WRITE_ERROR            "Java Kernel hat beim Schreiben uf den Datenträger einen Fehler verursacht  Noch einmal versuchen?"
+    IDS_HTTP_STATUS_SERVER_NOT_REACHABLE "Java Kernel kann aufgrund der aktuellen Internetverbindungseinstellungen Ihres Systems nicht fortfahren.  Überprüfen Sie in der Windows-Systemsteuerung unter 'Internetoptionen -> Verbindungen' die Einstellungen und Proxy-Angaben."
+
+    IDS_DOWNLOAD_RETRY             "Downloadfehler"
+    IDS_DOWNLOAD_RETRY_TEXT        "Beim Herunterladen einiger benötigter Komponenten ist ein Fehler aufgetreten. Möchten Sie noch einmal versuchen, diese Komponenten herunterzuladen?"
+
+    IDS_DOWNLOAD                   "Zusätzliche Komponenten werden installiert."
+    IDS_DOWNLOAD_UNPACKING         "Entpacken des Pakets"
+    IDS_DOWNLOAD_TEXT              "Die Java-Anwendung wird starten, sobald zusätzliche Komponenten heruntergeladen und installiert sind."
+    
+    IDS_FILE_UPDATE_ERROR          "Beim Aktualisieren von %s%s ist ein Fehler aufgetreten."
+    IDS_FILE_DELETE_ERROR          "Beim Entfernen von %s ist ein Fehler aufgetreten."
+    IDS_JAVA_HOME_ERROR            "Java-Verzeichnis kann nicht ermittelt werden."
+    IDS_KERNEL_HOME_ERROR          "Pfad der jkernel.dll kann nicht ermittelt werden."
+    IDS_JBROKER_ERROR              "jbroker.exe kann nicht gestartet werden."
+    IDS_FATAL_ERROR                "Java konnte einige erforderliche Komponenten nicht herunterladen.  Das Programm wird geschlossen."
+    IDS_ERROR_DOWNLOADING_BUNDLE_PROPERTIES "Java konnte keine Verbindung zum Downloadserver herstellen.  Das Programm wird geschlossen."
+    IDS_ERROR_MALFORMED_BUNDLE_PROPERTIES "Bei der Verbindung mit dem Downloadserver ist ein Fehler aufgetreten.  Das Programm wird geschlossen."
+    IDS_ERROR_MALFORMED_URL "Java konnte von URL '%s' keinen Dowload ausführen.  Das Programm wird geschlossen."
+END
diff --git a/src/windows/native/sun/jkernel/kernel_en.rc b/src/windows/native/sun/jkernel/kernel_en.rc
new file mode 100644
index 0000000..b1d1598
--- /dev/null
+++ b/src/windows/native/sun/jkernel/kernel_en.rc
@@ -0,0 +1,122 @@
+/*
+ * Copyright 2008 - 2009 Sun Microsystems, Inc.  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.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 340, 120
+STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | 
+    WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+CAPTION "Additional Components Needed"
+EXSTYLE WS_EX_APPWINDOW
+FONT 8, "MS Sans Serif"
+BEGIN
+    LTEXT           "", IDC_DOWNLOAD_MASTHEAD, 0, 0, 340, 39
+    LTEXT           "", IDC_MASTHEAD_TEXT, 60, 14, 200, 12
+    CONTROL         "", IDC_STATIC,"Static", SS_BLACKFRAME | SS_SUNKEN,
+                    0, 39, 340, 1
+    LTEXT           "", IDC_DOWNLOAD_TEXT, 12, 60, 316, 20
+    LTEXT           "", IDC_TIME_REMAINING, 12, 90, 316, 10
+    CONTROL         "Progress1",1006,"msctls_progress32",PBS_SMOOTH,
+                    12, 100, 265, 14
+    PUSHBUTTON	    "Cancel",  2, 285, 100, 46, 14
+END
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO DISCARDABLE 
+BEGIN
+    105, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 236
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 63
+    END
+END
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE DISCARDABLE 
+BEGIN
+    IDS_DOWNLOAD_CANCEL_MESSAGE   "Canceling the installation of additional components which the application needs may cause the application to exit.\n\nAre you sure you want to cancel the installation of additional components?"
+    IDS_DOWNLOAD_CANCEL_CAPTION   "Cancel - Additional Components"
+    IDS_DOWNLOAD_CANCEL_INSTRUCTION   ""
+    IDS_HTTP_INSTRUCTION_REQUEST_TIMEOUT      "Connection Timed Out"
+    IDS_HTTP_INSTRUCTION_SERVER_NOT_REACHABLE "Unable to connect to the Internet"
+    IDS_HTTP_INSTRUCTION_UNKNOWN_ERROR        "Server error (Error %s)"
+    IDS_HTTP_INSTRUCTION_SERVICE_UNAVAIL      "Service Unavailable (Error %s)"
+    IDS_HTTP_INSTRUCTION_FORBIDDEN            "Access Denied or Forbidden (Error %s)"
+    IDS_HTTP_STATUS_OTHER                     "An error has occured during this request. Do you want to try the request again?"
+
+// HTTP status code
+    IDS_HTTP_STATUS_REQUEST_TIMEOUT "The server used to download the requested components is not responding and the connection has timed out. Do you want to try to connect again?"
+    IDS_HTTP_STATUS_FORBIDDEN		"You do not have permission to access the server to download the components requested by the application. Retry your access to the server?"
+    IDS_HTTP_STATUS_SERVER_ERROR	"An error occured on the server and it could not complete the request. Do you want to try the request again?"
+    IDS_HTTP_STATUS_SERVICE_UNAVAIL	"The requested service is temporarily unavailable. Do you want to try the request again?"
+
+
+    IDS_DOWNLOAD_STATUS_RETRY		"Server is currently busy, retry in %ld seconds ..."
+  
+    IDS_ERROR_CAPTION               "Java Installer"
+    IDS_HOURSMINUTESECOND	    "Estimated time remaining: %d hours %d minutes %.0f seconds"
+    IDS_HOURMINUTESECOND	    "Estimated time remaining: %d hour %d minutes %.0f seconds"
+    IDS_MINUTESECOND 		    "Estimated time remaining: %d minutes %.0f seconds"
+    IDS_SECOND                      "Estimated time remaining: %.0f seconds"
+    IDS_DISK_FULL_ERROR_CAPTION     "Disk Full %s"
+    IDS_DISK_FULL_ERROR             "There is not enough space on the disk to download the requested components. Clear space on the disk and then Retry."
+    IDS_DISK_WRITE_ERROR_CAPTION    "Can't write to the disk %s"
+    IDS_DISK_WRITE_ERROR            "An error occurred during writing to the disk. Please check that the disk is not write protected."
+    IDS_HTTP_STATUS_SERVER_NOT_REACHABLE "Java cannot connect to the Internet. Please check that the Internet Connection settings are correct (these can be found in the Windows Control Panel under Internet Options > Connection) and that your firewall allows java.exe to access the Internet."
+
+    IDS_DOWNLOAD_RETRY             "Download error"
+    IDS_DOWNLOAD_RETRY_TEXT        "An error occurred during the download of some requested components. Do you want to try the download of these components again?"
+
+    IDS_DOWNLOAD                   "Installing Additional Components"
+    IDS_DOWNLOAD_UNPACKING         "Unpacking bundle"
+    IDS_DOWNLOAD_TEXT              "The Java application will start when additional components that it requires are downloaded and installed."
+    
+    IDS_FILE_UPDATE_ERROR          "An error occurred while updating %s%s."
+    IDS_FILE_DELETE_ERROR          "An error occurred while removing %s."
+    IDS_JAVA_HOME_ERROR            "Unable to determine Java home directory."
+    IDS_KERNEL_HOME_ERROR          "Unable to determine path to jkernel.dll."
+    IDS_JBROKER_ERROR              "Unable to launch jbroker.exe."
+    IDS_FATAL_ERROR                "Java was unable to download required components.  The program will now exit."
+    IDS_ERROR_DOWNLOADING_BUNDLE_PROPERTIES "Java was unable to communicate with the download server.  The program will now exit."
+    IDS_ERROR_MALFORMED_BUNDLE_PROPERTIES "Java encountered an error communicating with the download server.  The program will now exit."
+    IDS_ERROR_MALFORMED_URL "Java was unable to download from the URL '%s'.  The program will now exit."
+END
diff --git a/src/windows/native/sun/jkernel/kernel_es.rc b/src/windows/native/sun/jkernel/kernel_es.rc
new file mode 100644
index 0000000..119a35e
--- /dev/null
+++ b/src/windows/native/sun/jkernel/kernel_es.rc
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2008 - 2009 Sun Microsystems, Inc.  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.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 340, 120
+STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | 
+    WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+CAPTION "Componentes adicionales necesarios"
+EXSTYLE WS_EX_APPWINDOW
+FONT 8, "MS Sans Serif"
+BEGIN
+    LTEXT           "", IDC_DOWNLOAD_MASTHEAD, 0, 0, 340, 39
+    LTEXT           "", IDC_MASTHEAD_TEXT, 60, 8, 225, 20
+    CONTROL         "", IDC_STATIC,"Static", SS_BLACKFRAME | SS_SUNKEN,
+                    0, 39, 340, 1
+    LTEXT           "", IDC_DOWNLOAD_TEXT, 12, 60, 316, 20
+    LTEXT           "", IDC_TIME_REMAINING, 12, 90, 316, 10
+    CONTROL         "Progress1",1006,"msctls_progress32",PBS_SMOOTH,
+                    12, 100, 265, 14
+    PUSHBUTTON	    "Cancelar",  2, 285, 100, 46, 14
+END
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO DISCARDABLE 
+BEGIN
+    105, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 236
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 63
+    END
+END
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE DISCARDABLE 
+BEGIN
+    IDS_DOWNLOAD_CANCEL_MESSAGE   "Cancelar la instalación de los componentes adicionales que necesita la aplicación puede hacer que se cierre la aplicación.\n\n¿Seguro que desea cancelar la instalación de componentes adicionales?"
+    IDS_DOWNLOAD_CANCEL_CAPTION   "Cancelar - Componentes adicionales"
+    IDS_DOWNLOAD_CANCEL_INSTRUCTION   ""
+    IDS_HTTP_INSTRUCTION_REQUEST_TIMEOUT      "Se ha agotado el tiempo de espera de la conexión"
+    IDS_HTTP_INSTRUCTION_SERVER_NOT_REACHABLE "No es posible conectarse a Internet"
+    IDS_HTTP_INSTRUCTION_UNKNOWN_ERROR        "Ha habido un error en el servidor (error %s)"
+    IDS_HTTP_INSTRUCTION_SERVICE_UNAVAIL      "El servicio no está disponible (error %s)"
+    IDS_HTTP_INSTRUCTION_FORBIDDEN            "El acceso se ha denegado o está prohibido (error %s)"
+    IDS_HTTP_STATUS_OTHER                     "Ha habido un error en el transcurso de esta solicitud. ¿Desea ejecutar de nuevo la solicitud?"
+
+// HTTP status code
+    IDS_HTTP_STATUS_REQUEST_TIMEOUT "El servidor ha agotado el tiempo de espera de la solicitud."
+    IDS_HTTP_STATUS_FORBIDDEN		"El servidor ha podido interpretar la solicitud, pero la rechaza."
+    IDS_HTTP_STATUS_SERVER_ERROR	"El servidor ha encontrado una condición inesperada que le ha impedido satisfacer la solicitud."
+    IDS_HTTP_STATUS_SERVICE_UNAVAIL	"El servicio está temporalmente sobrecargado."
+
+
+    IDS_DOWNLOAD_STATUS_RETRY		"El servidor está ocupado en este momento, se volverá a intentar la conexión en %ld segundos..."
+
+    IDS_ERROR_CAPTION               "Error - Java Kernel"
+    IDS_HOURSMINUTESECOND	    "Tiempo restante estimado: %d horas %d minutos %.0f segundos"
+    IDS_HOURMINUTESECOND	    "Tiempo restante estimado: %d hora %d minutos %.0f segundos"
+    IDS_MINUTESECOND 		    "Tiempo restante estimado: %d minutos %.0f segundos"
+    IDS_SECOND                      "Tiempo restante estimado: %.0f segundos"
+    IDS_DISK_FULL_ERROR_CAPTION     "Disco lleno"
+    IDS_DISK_FULL_ERROR             "Java Kernel no puede descargar los componentes necesarios porque el disco está lleno.  ¿Desea volver a intentarlo?"
+    IDS_DISK_WRITE_ERROR_CAPTION    "Error de escritura en disco"
+    IDS_DISK_WRITE_ERROR            "Se ha producido un error cuando Java Kernel intentaba escribir en el disco.  ¿Desea volver a intentarlo?"
+    IDS_HTTP_STATUS_SERVER_NOT_REACHABLE "Java Kernel no puede continuar con la configuración actual de conexión a Internet del sistema.  En el Panel de control de Windows, compruebe Opciones de Internet -> Conexiones para verificar que la información de la configuración y de proxy sea la correcta."
+
+    IDS_DOWNLOAD_RETRY             "Error de descarga"
+    IDS_DOWNLOAD_RETRY_TEXT        "Se ha producido un error durante la descarga de algunos componentes solicitados. ¿Quiere volver a intentar descargar estos componentes?"
+
+    IDS_DOWNLOAD                   "Instalación de componentes adicionales"
+	IDS_DOWNLOAD_UNPACKING         "Desempaquetando paquete"
+    IDS_DOWNLOAD_TEXT              "La aplicación Java se iniciará cuando los componentes adicionales necesarios se hayan descargado e instalado."
+    
+    IDS_FILE_UPDATE_ERROR          "Se ha producido un error al actualizar %s%s."
+    IDS_FILE_DELETE_ERROR          "Se ha producido un error al eliminar %s."
+    IDS_JAVA_HOME_ERROR            "Imposible determinar el directorio de inicio Java."
+    IDS_KERNEL_HOME_ERROR          "Imposible determinar la ruta a jkernel.dll."
+    IDS_JBROKER_ERROR              "Imposible iniciar jbroker.exe."
+    IDS_FATAL_ERROR                "Java no ha podido descargar los componentes necesarios.  El programa se cerrará."
+    IDS_ERROR_DOWNLOADING_BUNDLE_PROPERTIES "Java no ha podido comunicarse con el servidor de descarga.  El programa se cerrará."
+    IDS_ERROR_MALFORMED_BUNDLE_PROPERTIES "Se ha producido un error en la comunicación entre Java y el servidor de descarga.  El programa se cerrará."
+    IDS_ERROR_MALFORMED_URL "Java no ha podido realizar la descarga desde el URL '%s'.  El programa se cerrará."
+END
diff --git a/src/windows/native/sun/jkernel/kernel_fr.rc b/src/windows/native/sun/jkernel/kernel_fr.rc
new file mode 100644
index 0000000..0ea3434
--- /dev/null
+++ b/src/windows/native/sun/jkernel/kernel_fr.rc
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2008 - 2009 Sun Microsystems, Inc.  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.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 340, 120
+STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | 
+    WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+CAPTION "Composants supplémentaires requis"
+EXSTYLE WS_EX_APPWINDOW
+FONT 8, "MS Sans Serif"
+BEGIN
+    LTEXT           "", IDC_DOWNLOAD_MASTHEAD, 0, 0, 340, 39
+    LTEXT           "", IDC_MASTHEAD_TEXT, 60, 4, 220, 30
+    CONTROL         "", IDC_STATIC,"Static", SS_BLACKFRAME | SS_SUNKEN,
+                    0, 39, 340, 1
+    LTEXT           "", IDC_DOWNLOAD_TEXT, 12, 60, 316, 20
+    LTEXT           "", IDC_TIME_REMAINING, 12, 90, 316, 10
+    CONTROL         "Progress1",1006,"msctls_progress32",PBS_SMOOTH,
+                    12, 100, 265, 14
+    PUSHBUTTON	    "Annuler",  2, 285, 100, 46, 14
+END
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO DISCARDABLE 
+BEGIN
+    105, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 236
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 63
+    END
+END
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE DISCARDABLE 
+BEGIN
+    IDS_DOWNLOAD_CANCEL_MESSAGE   "L'annulation de l'installation de composants supplémentaires nécessaires à l'application risque d'entraîner la fermeture de celle-ci.\n\nVoulez-vous vraiment annuler l'installation des composants supplémentaires ?"
+    IDS_DOWNLOAD_CANCEL_CAPTION   "Annuler : composants supplémentaires"
+    IDS_DOWNLOAD_CANCEL_INSTRUCTION   ""
+    IDS_HTTP_INSTRUCTION_REQUEST_TIMEOUT      "Délai de connexion dépassé"
+    IDS_HTTP_INSTRUCTION_SERVER_NOT_REACHABLE "Connexion à Internet impossible"
+    IDS_HTTP_INSTRUCTION_UNKNOWN_ERROR        "Erreur de serveur (erreur %s)"
+    IDS_HTTP_INSTRUCTION_SERVICE_UNAVAIL      "Service non disponible (erreur %s)"
+    IDS_HTTP_INSTRUCTION_FORBIDDEN            "Accès refusé ou interdit (erreur %s)"
+    IDS_HTTP_STATUS_OTHER                     "Une erreur s'est produite lors de cette demande. Voulez-vous effectuer à nouveau la demande ?"
+
+// HTTP status code
+    IDS_HTTP_STATUS_REQUEST_TIMEOUT "Temporisation du serveur lors de l'attente de la requête."
+    IDS_HTTP_STATUS_FORBIDDEN		"Le serveur a compris la requête mais refuse de la satisfaire."
+    IDS_HTTP_STATUS_SERVER_ERROR	"Le serveur a rencontré une condition inattendue l'empêchant de satisfaire la requête."
+    IDS_HTTP_STATUS_SERVICE_UNAVAIL	"Le service est temporairement surchargé."
+
+
+    IDS_DOWNLOAD_STATUS_RETRY		"Le serveur est occupé ; veuillez réessayer dans %ld secondes..."
+
+    IDS_ERROR_CAPTION               "Erreur - Java Kernel"
+    IDS_HOURSMINUTESECOND	    "Temps restant prévu : %d heures %d minutes %.0f secondes"
+    IDS_HOURMINUTESECOND	    "Temps restant prévu : %d heure %d minutes %.0f secondes"
+    IDS_MINUTESECOND 		    "Temps restant prévu : %d minutes %.0f secondes"
+    IDS_SECOND                      "Temps restant prévu : %.0f secondes"
+    IDS_DISK_FULL_ERROR_CAPTION     "Disque saturé"
+    IDS_DISK_FULL_ERROR             "En raison de la saturation du disque, Java Kernel n'a pas été en mesure de télécharger les composants requis.  Voulez-vous réessayer ?"
+    IDS_DISK_WRITE_ERROR_CAPTION    "Erreur d'écriture sur le disque"
+    IDS_DISK_WRITE_ERROR            "Java Kernel a rencontré une erreur lors de l'écriture sur le disque.  Voulez-vous réessayer ?"
+    IDS_HTTP_STATUS_SERVER_NOT_REACHABLE "Java Kernel ne peut pas s'exécuter avec les paramètres de connexion Internet actuels de votre système.  Dans le Panneau de configuration de Windows, cliquez sur Options Internet -> Connexions pour vérifier les paramètres et informations de proxy."
+
+    IDS_DOWNLOAD_RETRY             "Erreur de téléchargement"
+    IDS_DOWNLOAD_RETRY_TEXT        "Une erreur s'est produite lors du téléchargement de certains composants requis. Souhaitez-vous réessayer de télécharger ces composants ?"
+
+    IDS_DOWNLOAD                   "Installation de composants supplémentaires"
+	IDS_DOWNLOAD_UNPACKING         "Décompression du bundle"
+    IDS_DOWNLOAD_TEXT              "L'application Java démarre lorsque des composants supplémentaires requis sont téléchargés et installés."
+    
+    IDS_FILE_UPDATE_ERROR          "Une erreur s'est produite lors de la mise à jour de %s%s."
+    IDS_FILE_DELETE_ERROR          "Une erreur s'est produite lors de la suppression de %s."
+    IDS_JAVA_HOME_ERROR            "Le répertoire d'accueil Java est introuvable."
+    IDS_KERNEL_HOME_ERROR          "Le chemin de jkernel.dll est introuvable."
+    IDS_JBROKER_ERROR              "Impossible de lancer jbroker.exe."
+    IDS_FATAL_ERROR                "Java n'a pas été en mesure de télécharger les composants requis.  Fermeture imminente du programme."
+    IDS_ERROR_DOWNLOADING_BUNDLE_PROPERTIES "Java n'a pas été en mesure de communiquer avec le serveur de téléchargement.  Fermeture imminente du programme."
+    IDS_ERROR_MALFORMED_BUNDLE_PROPERTIES "Java a rencontré une erreur lors de la communication avec le serveur de téléchargement.  Fermeture imminente du programme."
+    IDS_ERROR_MALFORMED_URL "Java n'a pas été en mesure de réaliser le téléchargement à partir de l'URL '%s'.  Fermeture imminente du programme."
+END
diff --git a/src/windows/native/sun/jkernel/kernel_it.rc b/src/windows/native/sun/jkernel/kernel_it.rc
new file mode 100644
index 0000000..4c0a58b
--- /dev/null
+++ b/src/windows/native/sun/jkernel/kernel_it.rc
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2008 - 2009 Sun Microsystems, Inc.  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.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 340, 120
+STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | 
+    WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+CAPTION "Componenti aggiuntivi richiesti"
+EXSTYLE WS_EX_APPWINDOW
+FONT 8, "MS Sans Serif"
+BEGIN
+    LTEXT           "", IDC_DOWNLOAD_MASTHEAD, 0, 0, 340, 39
+    LTEXT           "", IDC_MASTHEAD_TEXT, 60, 4, 220, 30
+    CONTROL         "", IDC_STATIC,"Static", SS_BLACKFRAME | SS_SUNKEN,
+                    0, 39, 340, 1
+    LTEXT           "", IDC_DOWNLOAD_TEXT, 12, 60, 316, 20
+    LTEXT           "", IDC_TIME_REMAINING, 12, 90, 316, 10
+    CONTROL         "Progress1",1006,"msctls_progress32",PBS_SMOOTH,
+                    12, 100, 265, 14
+    PUSHBUTTON	    "Annulla",  2, 285, 100, 46, 14
+END
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO DISCARDABLE 
+BEGIN
+    105, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 236
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 63
+    END
+END
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE DISCARDABLE 
+BEGIN
+    IDS_DOWNLOAD_CANCEL_MESSAGE   "Se si annulla l'installazione di componenti aggiuntivi necessari per l'applicazione, quest'ultima potrebbe chiudersi.\n\nAnnullare l'installazione di componenti aggiuntivi?"
+    IDS_DOWNLOAD_CANCEL_CAPTION   "Annulla - Componenti aggiuntivi"
+    IDS_DOWNLOAD_CANCEL_INSTRUCTION   ""
+    IDS_HTTP_INSTRUCTION_REQUEST_TIMEOUT      "Timeout della connessione"
+    IDS_HTTP_INSTRUCTION_SERVER_NOT_REACHABLE "Impossibile stabilire una connessione a Internet"
+    IDS_HTTP_INSTRUCTION_UNKNOWN_ERROR        "Errore del server (errore %s)"
+    IDS_HTTP_INSTRUCTION_SERVICE_UNAVAIL      "Servizio non disponibile (errore %s)"
+    IDS_HTTP_INSTRUCTION_FORBIDDEN            "Accesso negato o vietato (errore %s)"
+    IDS_HTTP_STATUS_OTHER                     "Errore durante la richiesta. Provare a reinviare la richiesta?"
+
+// HTTP status code
+    IDS_HTTP_STATUS_REQUEST_TIMEOUT "Tempo scaduto del server in attesa della richiesta."
+    IDS_HTTP_STATUS_FORBIDDEN		"Il server ha ricevuto la richiesta ma non ne consente l'elaborazione."
+    IDS_HTTP_STATUS_SERVER_ERROR	"Il server ha rilevato una condizione imprevista che ha impedito di soddisfare la richiesta."
+    IDS_HTTP_STATUS_SERVICE_UNAVAIL	"Il servizio è temporaneamente sovraccarico."
+
+
+    IDS_DOWNLOAD_STATUS_RETRY		"Server occupato, riprovare tra %ld secondi..."
+
+    IDS_ERROR_CAPTION               "Errore - Java Kernel"
+    IDS_HOURSMINUTESECOND	    "Tempo rimanente previsto: %d ore %d minuti %.0f secondi"
+    IDS_HOURMINUTESECOND	    "Tempo rimanente previsto: %d ora %d minuti %.0f secondi"
+    IDS_MINUTESECOND 		    "Tempo rimanente previsto: %d minuti %.0f secondi"
+    IDS_SECOND                      "Tempo rimanente previsto: %.0f secondi"
+    IDS_DISK_FULL_ERROR_CAPTION     "Disco pieno"
+    IDS_DISK_FULL_ERROR             "Java Kernel non ha effettuato il download dei componenti necessari perché il disco è pieno.  Riprovare?"
+    IDS_DISK_WRITE_ERROR_CAPTION    "Errore di scrittura sul disco"
+    IDS_DISK_WRITE_ERROR            "Java Kernel ha rilevato un errore durante la scrittura sul disco.  Riprovare?"
+    IDS_HTTP_STATUS_SERVER_NOT_REACHABLE "Non è possibile utilizzare Java Kernel con le impostazioni di connessione Internet attive nel sistema.  Nel Pannello di controllo di Windows, selezionare Opzioni Internet -> Connessioni per controllare che le impostazioni e le informazioni sul proxy siano corrette."
+
+    IDS_DOWNLOAD_RETRY             "Errore di download"
+    IDS_DOWNLOAD_RETRY_TEXT        "Si è verificato un errore durante il download di alcuni componenti richiesti. Ritentare il download di tali componenti?"
+
+    IDS_DOWNLOAD                   "Installazione di componenti aggiuntivi in corso"
+	IDS_DOWNLOAD_UNPACKING         "Decompressione del bundle in corso"
+    IDS_DOWNLOAD_TEXT              "L'applicazione Java verrà avviata dopo il download e l'installazione dei componenti richiesti."
+    
+    IDS_FILE_UPDATE_ERROR          "Errore durante l'aggiornamento di %s%s."
+    IDS_FILE_DELETE_ERROR          "Errore durante la rimozione di %s."
+    IDS_JAVA_HOME_ERROR            "Impossibile determinare la directory home di Java."
+    IDS_KERNEL_HOME_ERROR          "Impossibile determinare il percorso di jkernel.dll."
+    IDS_JBROKER_ERROR              "Impossibile avviare jbroker.exe."
+    IDS_FATAL_ERROR                "Java non è in grado di scaricare i componenti necessari. Il programma verrà terminato."
+    IDS_ERROR_DOWNLOADING_BUNDLE_PROPERTIES "Java non è in grado di comunicare con il server di download. Il programma verrà terminato."
+    IDS_ERROR_MALFORMED_BUNDLE_PROPERTIES "Java ha rilevato un errore durante la comunicazione con il server di download. Il programma verrà terminato."
+    IDS_ERROR_MALFORMED_URL "Java non è in grado di eseguire il download dall'URL '%s'. Il programma verrà terminato."
+END
diff --git a/src/windows/native/sun/jkernel/kernel_ja.rc b/src/windows/native/sun/jkernel/kernel_ja.rc
new file mode 100644
index 0000000..198cb91
--- /dev/null
+++ b/src/windows/native/sun/jkernel/kernel_ja.rc
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2008 - 2009 Sun Microsystems, Inc.  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.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 340, 120
+STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | 
+    WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+CAPTION "’ljÁƒRƒ“ƒ|[ƒlƒ“ƒg‚ª•K—v"
+EXSTYLE WS_EX_APPWINDOW
+FONT 10, "MS UI Gothic"
+BEGIN
+    LTEXT           "", IDC_DOWNLOAD_MASTHEAD, 0, 0, 340, 39
+    LTEXT           "", IDC_MASTHEAD_TEXT, 60, 14, 200, 12
+    CONTROL         "", IDC_STATIC,"Static", SS_BLACKFRAME | SS_SUNKEN,
+                    0, 39, 340, 1
+    LTEXT           "", IDC_DOWNLOAD_TEXT, 12, 60, 316, 20
+    LTEXT           "", IDC_TIME_REMAINING, 12, 90, 316, 10
+    CONTROL         "Progress1",1006,"msctls_progress32",PBS_SMOOTH,
+                    12, 100, 265, 14
+    PUSHBUTTON	    "ŽæÁ‚µ",  2, 285, 100, 46, 14
+END
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO DISCARDABLE 
+BEGIN
+    105, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 236
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 63
+    END
+END
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE DISCARDABLE 
+BEGIN
+    IDS_DOWNLOAD_CANCEL_MESSAGE   "ƒAƒvƒŠƒP[ƒVƒ‡ƒ“‚ª•K—v‚Æ‚·‚é’ljÁƒRƒ“ƒ|[ƒlƒ“ƒg‚̃Cƒ“ƒXƒg[ƒ‹‚ðƒLƒƒƒ“ƒZƒ‹‚·‚邯AƒAƒvƒŠƒP[ƒVƒ‡ƒ“‚ªI—¹‚·‚é‰Â”\«‚ª‚ ‚è‚Ü‚·B\n\n’ljÁƒRƒ“ƒ|[ƒlƒ“ƒg‚̃Cƒ“ƒXƒg[ƒ‹‚ðƒLƒƒƒ“ƒZƒ‹‚µ‚Ä‚æ‚낵‚¢‚Å‚·‚©H"
+    IDS_DOWNLOAD_CANCEL_CAPTION   "ƒLƒƒƒ“ƒZƒ‹ - ’ljÁƒRƒ“ƒ|[ƒlƒ“ƒg"
+    IDS_DOWNLOAD_CANCEL_INSTRUCTION   ""
+    IDS_HTTP_INSTRUCTION_REQUEST_TIMEOUT      "Ú‘±‚ªƒ^ƒCƒ€ƒAƒEƒg‚µ‚Ü‚µ‚½"
+    IDS_HTTP_INSTRUCTION_SERVER_NOT_REACHABLE "ƒCƒ“ƒ^[ƒlƒbƒg‚ɐڑ±‚Å‚«‚Ü‚¹‚ñ"
+    IDS_HTTP_INSTRUCTION_UNKNOWN_ERROR        "ƒT[ƒo[ƒGƒ‰[ (ƒGƒ‰[ %s)"
+    IDS_HTTP_INSTRUCTION_SERVICE_UNAVAIL      "ƒT[ƒrƒX—˜—p•s‰Â (ƒGƒ‰[ %s)"
+    IDS_HTTP_INSTRUCTION_FORBIDDEN            "ƒAƒNƒZƒX‚ª‹‘”Û‚Ü‚½‚͋֎~‚³‚ê‚Ä‚¢‚Ü‚· (ƒGƒ‰[ %s)"
+    IDS_HTTP_STATUS_OTHER                     "‚±‚Ì—v‹‚̏ˆ—’†‚ɃGƒ‰[‚ª”­¶‚µ‚Ü‚µ‚½B—v‹‚ðÄŽŽs‚µ‚Ü‚·‚©?"
+
+// HTTP status code
+    IDS_HTTP_STATUS_REQUEST_TIMEOUT "—v‹‚ð‘Ò‹@’†‚ɃT[ƒo[‚ªƒ^ƒCƒ€ƒAƒEƒg‚µ‚Ü‚µ‚½B"
+    IDS_HTTP_STATUS_FORBIDDEN		"ƒT[ƒo[‚́A—v‹‚ð”Fޝ‚µ‚Ä‚¢‚Ü‚·‚ªAŽÀs‚ð‹‘”Û‚µ‚Ä‚¢‚Ü‚·B"
+    IDS_HTTP_STATUS_SERVER_ERROR	"ƒT[ƒo[‚́A—v‹‚ÌŽÀs‚ð–W‚°‚é—\Šú‚µ‚È‚¢ó‹µ‚É‘˜‹ö‚µ‚Ü‚µ‚½B"
+    IDS_HTTP_STATUS_SERVICE_UNAVAIL	"ƒT[ƒrƒX‚ªˆêŽž“I‚ɃI[ƒo[ƒ[ƒh‚µ‚Ä‚¢‚Ü‚·B"
+
+
+    IDS_DOWNLOAD_STATUS_RETRY		"ƒT[ƒo[‚ÍŒ»ÝƒrƒW[‚Å‚·B%ld •bŒã‚ÉÄŽŽs‚µ‚Ü‚· ..."
+
+    IDS_ERROR_CAPTION               "ƒGƒ‰[ - Java ƒJ[ƒlƒ‹"
+    IDS_HOURSMINUTESECOND	    "—\‘zŽc‚莞ŠÔ: %d ŽžŠÔ %d •ª %.0f •b"
+    IDS_HOURMINUTESECOND	    "—\‘zŽc‚莞ŠÔ: %d ŽžŠÔ %d •ª %.0f •b"
+    IDS_MINUTESECOND 		    "—\‘zŽc‚莞ŠÔ: %d •ª %.0f •b"
+    IDS_SECOND                      "—\‘zŽc‚莞ŠÔ: %.0f •b"
+    IDS_DISK_FULL_ERROR_CAPTION     "ƒfƒBƒXƒN‚ª‚¢‚Á‚Ï‚¢‚Å‚·"
+    IDS_DISK_FULL_ERROR             "ƒfƒBƒXƒN‚ª‚¢‚Á‚Ï‚¢‚Ì‚½‚߁AJava ƒJ[ƒlƒ‹‚ª•K—v‚ȃRƒ“ƒ|[ƒlƒ“ƒg‚ðƒ_ƒEƒ“ƒ[ƒh‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B‚à‚¤ˆê“xŽŽ‚µ‚Ü‚·‚©?"
+    IDS_DISK_WRITE_ERROR_CAPTION    "ƒfƒBƒXƒN‘‚«ž‚݃Gƒ‰["
+    IDS_DISK_WRITE_ERROR            "Java ƒJ[ƒlƒ‹‚ªƒfƒBƒXƒN‚ւ̏‘‚«ž‚ÝŽž‚ɃGƒ‰[‚ðŒŸo‚µ‚Ü‚µ‚½B‚à‚¤ˆê“xŽŽ‚µ‚Ü‚·‚©?"
+    IDS_HTTP_STATUS_SERVER_NOT_REACHABLE "Java ƒJ[ƒlƒ‹‚́A‚¨Žg‚¢‚̃VƒXƒeƒ€‚ÌŒ»Ý‚̃Cƒ“ƒ^[ƒlƒbƒgÚ‘±Ý’è‚ł͓®ì‚µ‚Ü‚¹‚ñBWindows ‚̃Rƒ“ƒgƒ[ƒ‹ƒpƒlƒ‹‚ŁAuƒCƒ“ƒ^[ƒlƒbƒgƒIƒvƒVƒ‡ƒ“v -> uÚ‘±v‚ð‘I‘ð‚µ‚ÄAÝ’肨‚æ‚уvƒƒLƒVî•ñ‚ª³‚µ‚¢‚±‚Æ‚ðŠm”F‚µ‚Ä‚­‚¾‚³‚¢B"
+
+    IDS_DOWNLOAD_RETRY             "ƒ_ƒEƒ“ƒ[ƒhƒGƒ‰["
+    IDS_DOWNLOAD_RETRY_TEXT        "—v‹‚³‚ꂽƒRƒ“ƒ|[ƒlƒ“ƒg‚̈ꕔ‚ðƒ_ƒEƒ“ƒ[ƒh’†‚ɃGƒ‰[‚ª”­¶‚µ‚Ü‚µ‚½B‚±‚ê‚ç‚̃Rƒ“ƒ|[ƒlƒ“ƒg‚̃_ƒEƒ“ƒ[ƒh‚ðÄ“xŽŽ‚݂܂·‚© ?"
+
+    IDS_DOWNLOAD                   "’ljÁƒRƒ“ƒ|[ƒlƒ“ƒg‚ðƒCƒ“ƒXƒg[ƒ‹‚µ‚Ä‚¢‚Ü‚·"
+	IDS_DOWNLOAD_UNPACKING         "ƒoƒ“ƒhƒ‹‚ð“WŠJ‚µ‚Ä‚¢‚Ü‚·"
+    IDS_DOWNLOAD_TEXT              "Java ƒAƒvƒŠƒP[ƒVƒ‡ƒ“‚́A•K{‚̒ljÁƒRƒ“ƒ|[ƒlƒ“ƒg‚̃_ƒEƒ“ƒ[ƒh‚¨‚æ‚уCƒ“ƒXƒg[ƒ‹Œã‚É‹N“®‚µ‚Ü‚·B"
+    
+    IDS_FILE_UPDATE_ERROR          "%s%s ‚̍XV’†‚ɃGƒ‰[‚ª”­¶‚µ‚Ü‚µ‚½B"
+    IDS_FILE_DELETE_ERROR          "%s ‚̍폜’†‚ɃGƒ‰[‚ª”­¶‚µ‚Ü‚µ‚½B"
+    IDS_JAVA_HOME_ERROR            "Java ƒz[ƒ€ƒfƒBƒŒƒNƒgƒŠ‚ð”»’è‚Å‚«‚Ü‚¹‚ñB"
+    IDS_KERNEL_HOME_ERROR          "jkernel.dll ‚̃pƒX‚ð”»’è‚Å‚«‚Ü‚¹‚ñB"
+    IDS_JBROKER_ERROR              "jbroker.exe ‚ð‹N“®‚Å‚«‚Ü‚¹‚ñB"
+    IDS_FATAL_ERROR                "Java ‚ª•K—v‚ȃRƒ“ƒ|[ƒlƒ“ƒg‚ðƒ_ƒEƒ“ƒ[ƒh‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½BƒvƒƒOƒ‰ƒ€‚͏I—¹‚µ‚Ü‚·B"
+    IDS_ERROR_DOWNLOADING_BUNDLE_PROPERTIES "Java ‚ªƒ_ƒEƒ“ƒ[ƒhƒT[ƒo[‚ƒʐM‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½BƒvƒƒOƒ‰ƒ€‚͏I—¹‚µ‚Ü‚·B"
+    IDS_ERROR_MALFORMED_BUNDLE_PROPERTIES "Java ‚ªƒ_ƒEƒ“ƒ[ƒhƒT[ƒo[‚Ƃ̒ʐM’†‚ɃGƒ‰[‚ðŒŸo‚µ‚Ü‚µ‚½BƒvƒƒOƒ‰ƒ€‚͏I—¹‚µ‚Ü‚·B"
+    IDS_ERROR_MALFORMED_URL "Java ‚ª URL '%s' ‚©‚çƒ_ƒEƒ“ƒ[ƒh‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½BƒvƒƒOƒ‰ƒ€‚͏I—¹‚µ‚Ü‚·B"
+END
diff --git a/src/windows/native/sun/jkernel/kernel_ko.rc b/src/windows/native/sun/jkernel/kernel_ko.rc
new file mode 100644
index 0000000..bf8495e
--- /dev/null
+++ b/src/windows/native/sun/jkernel/kernel_ko.rc
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2008 - 2009 Sun Microsystems, Inc.  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.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 340, 120
+STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | 
+    WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+CAPTION "Ãß°¡ ±¸¼º ¿ä¼Ò ÇÊ¿ä"
+EXSTYLE WS_EX_APPWINDOW
+FONT 8, "MS Sans Serif"
+BEGIN
+    LTEXT           "", IDC_DOWNLOAD_MASTHEAD, 0, 0, 340, 39
+    LTEXT           "", IDC_MASTHEAD_TEXT, 60, 14, 200, 12
+    CONTROL         "", IDC_STATIC,"Static", SS_BLACKFRAME | SS_SUNKEN,
+                    0, 39, 340, 1
+    LTEXT           "", IDC_DOWNLOAD_TEXT, 12, 60, 316, 20
+    LTEXT           "", IDC_TIME_REMAINING, 12, 90, 316, 10
+    CONTROL         "Progress1",1006,"msctls_progress32",PBS_SMOOTH,
+                    12, 100, 265, 14
+    PUSHBUTTON	    "Ãë¼Ò",  2, 285, 100, 46, 14
+END
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO DISCARDABLE 
+BEGIN
+    105, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 236
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 63
+    END
+END
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE DISCARDABLE 
+BEGIN
+    IDS_DOWNLOAD_CANCEL_MESSAGE   "ÀÀ¿ë ÇÁ·Î±×·¥¿¡¼­ ÇÊ¿äÇÑ Ãß°¡ ±¸¼º ¿ä¼ÒÀÇ ¼³Ä¡¸¦ Ãë¼ÒÇϸé ÀÀ¿ë ÇÁ·Î±×·¥ÀÌ Á¾·áµÉ ¼ö ÀÖ½À´Ï´Ù.\n\nÃß°¡ ±¸¼º ¿ä¼ÒÀÇ ¼³Ä¡¸¦ Ãë¼ÒÇϽðڽÀ´Ï±î?"
+    IDS_DOWNLOAD_CANCEL_CAPTION   "Ãë¼Ò - Ãß°¡ ±¸¼º ¿ä¼Ò"
+    IDS_DOWNLOAD_CANCEL_INSTRUCTION   ""
+    IDS_HTTP_INSTRUCTION_REQUEST_TIMEOUT      "¿¬°á ½Ã°£ Ãʰú"
+    IDS_HTTP_INSTRUCTION_SERVER_NOT_REACHABLE "ÀÎÅͳݿ¡ ¿¬°áÇÒ ¼ö ¾ø½À´Ï´Ù."
+    IDS_HTTP_INSTRUCTION_UNKNOWN_ERROR        "¼­¹ö ¿À·ù(¿À·ù %s)"
+    IDS_HTTP_INSTRUCTION_SERVICE_UNAVAIL      "¼­ºñ½º¸¦ »ç¿ëÇÒ ¼ö ¾øÀ½(¿À·ù %s)"
+    IDS_HTTP_INSTRUCTION_FORBIDDEN            "¾×¼¼½º°¡ °ÅºÎµÇ¾ú°Å³ª ±ÝÁöµÊ(¿À·ù %s)"
+    IDS_HTTP_STATUS_OTHER                     "ÀÌ ¿äû µ¿¾È ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù. ¿äûÀ» ´Ù½Ã ½ÃµµÇϽðڽÀ´Ï±î?"
+
+// HTTP status code
+    IDS_HTTP_STATUS_REQUEST_TIMEOUT "¼­¹ö°¡ ¿äûÀ» ±â´Ù¸®´Â µ¿¾È ½Ã°£ÀÌ ÃʰúµÇ¾ú½À´Ï´Ù."
+    IDS_HTTP_STATUS_FORBIDDEN		"¼­¹ö°¡ ¿äûÀ» ÀÌÇØÇßÁö¸¸ ÀÌÇàÇϱ⸦ °ÅºÎÇÕ´Ï´Ù."
+    IDS_HTTP_STATUS_SERVER_ERROR	"¼­¹ö¿¡¼­ ¿äû ÀÌÇàÀ» ¹æÇØÇÏ´Â ¿¹»óÄ¡ ¸øÇÑ Á¶°ÇÀÌ ¹ß°ßµÇ¾ú½À´Ï´Ù."
+    IDS_HTTP_STATUS_SERVICE_UNAVAIL	"¼­¹ö°¡ ÀϽÃÀûÀ¸·Î °úºÎÇϵǾú½À´Ï´Ù."
+
+
+    IDS_DOWNLOAD_STATUS_RETRY		"ÇöÀç ¼­¹ö°¡ »ç¿ë ÁßÀ̹ǷΠ%ldÃÊ ÈÄ¿¡ ´Ù½Ã ½ÃµµÇϽʽÿÀ."
+
+    IDS_ERROR_CAPTION               "¿À·ù - Java Ä¿³Î"
+    IDS_HOURSMINUTESECOND	    "¿¹»óµÈ ³²Àº ½Ã°£: %d½Ã°£ %dºÐ %.0fÃÊ"
+    IDS_HOURMINUTESECOND	    "¿¹»óµÈ ³²Àº ½Ã°£: %d½Ã°£ %dºÐ %.0fÃÊ"
+    IDS_MINUTESECOND 		    "¿¹»óµÈ ³²Àº ½Ã°£: %dºÐ %.0fÃÊ"
+    IDS_SECOND                      "¿¹»óµÈ ³²Àº ½Ã°£: %.0fÃÊ"
+    IDS_DISK_FULL_ERROR_CAPTION     "µð½ºÅ©°¡ °¡µæ Âü"
+    IDS_DISK_FULL_ERROR             "µð½ºÅ©°¡ °¡µæ Â÷¼­ Java Kernel¿¡¼­ ÇÊ¿äÇÑ ±¸¼º ¿ä¼Ò¸¦ ´Ù¿î·ÎµåÇÏÁö ¸øÇß½À´Ï´Ù. ´Ù½Ã ½ÃµµÇϽðڽÀ´Ï±î?"
+    IDS_DISK_WRITE_ERROR_CAPTION    "µð½ºÅ© ¾²±â ¿À·ù"
+    IDS_DISK_WRITE_ERROR            "µð½ºÅ©¿¡ ¾²´Â µ¿¾È Java Kernel¿¡¼­ ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù. ´Ù½Ã ½ÃµµÇϽðڽÀ´Ï±î?"
+    IDS_HTTP_STATUS_SERVER_NOT_REACHABLE "½Ã½ºÅÛÀÇ ÇöÀç ÀÎÅÍ³Ý ¿¬°á ¼³Á¤À¸·Î´Â Java KernelÀ» °è¼ÓÇÒ ¼ö ¾ø½À´Ï´Ù.  Windows Á¦¾îÆÇ¿¡¼­ ÀÎÅÍ³Ý ¿É¼Ç -> ¿¬°áÀ» ¼±ÅÃÇÏ¿© ¼³Á¤ ¹× ÇÁ·Ï½Ã Á¤º¸°¡ ¿Ã¹Ù¸¥Áö È®ÀÎÇϽʽÿÀ."
+
+    IDS_DOWNLOAD_RETRY             "´Ù¿î·Îµå ¿À·ù"
+    IDS_DOWNLOAD_RETRY_TEXT        "¿äûµÈ ±¸¼º ¿ä¼Ò¸¦ ´Ù¿î·ÎµåÇÏ´Â µ¿¾È ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù. ÀÌ ±¸¼º ¿ä¼Ò¸¦ ´Ù½Ã ´Ù¿î·ÎµåÇϽðڽÀ´Ï±î?"
+
+    IDS_DOWNLOAD                   "Ãß°¡ ±¸¼º ¿ä¼Ò ¼³Ä¡"
+	IDS_DOWNLOAD_UNPACKING         "¹øµé ¾ÐÃà Ç®±â"
+    IDS_DOWNLOAD_TEXT              "ÇÊ¿äÇÑ Ãß°¡ ±¸¼º ¿ä¼Ò°¡ ´Ù¿î·ÎµåµÇ¾î ¼³Ä¡µÇ¸é Java ÀÀ¿ë ÇÁ·Î±×·¥ÀÌ ½ÃÀ۵˴ϴÙ."
+    
+    IDS_FILE_UPDATE_ERROR          "%s%sÀ»(¸¦) ¾÷µ¥ÀÌÆ®ÇÏ´Â µ¿¾È ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù."
+    IDS_FILE_DELETE_ERROR          "%sÀ»(¸¦) Á¦°ÅÇÏ´Â µ¿¾È ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù."
+    IDS_JAVA_HOME_ERROR            "Java Ȩ µð·ºÅ丮¸¦ È®ÀÎÇÒ ¼ö ¾ø½À´Ï´Ù."
+    IDS_KERNEL_HOME_ERROR          "jkernel.dllÀÇ °æ·Î¸¦ È®ÀÎÇÒ ¼ö ¾ø½À´Ï´Ù."
+    IDS_JBROKER_ERROR              "jbroker.exe¸¦ ½ÃÀÛÇÒ ¼ö ¾ø½À´Ï´Ù."
+    IDS_FATAL_ERROR                "ÇÊ¿äÇÑ ±¸¼º ¿ä¼Ò¸¦ ´Ù¿î·ÎµåÇÏÁö ¸øÇß½À´Ï´Ù.  ÇÁ·Î±×·¥ÀÌ Á¾·áµË´Ï´Ù."
+    IDS_ERROR_DOWNLOADING_BUNDLE_PROPERTIES "´Ù¿î·Îµå ¼­¹ö¿Í Åë½ÅÇÏÁö ¸øÇß½À´Ï´Ù.  ÇÁ·Î±×·¥ÀÌ Á¾·áµË´Ï´Ù."
+    IDS_ERROR_MALFORMED_BUNDLE_PROPERTIES "´Ù¿î·Îµå ¼­¹ö¿ÍÀÇ Åë½Å ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù.  ÇÁ·Î±×·¥ÀÌ Á¾·áµË´Ï´Ù."
+    IDS_ERROR_MALFORMED_URL "URL '%s'¿¡¼­ ´Ù¿î·ÎµåÇÏÁö ¸øÇß½À´Ï´Ù.  ÇÁ·Î±×·¥ÀÌ Á¾·áµË´Ï´Ù."
+END
diff --git a/src/windows/native/sun/jkernel/kernel_sv.rc b/src/windows/native/sun/jkernel/kernel_sv.rc
new file mode 100644
index 0000000..b3df336
--- /dev/null
+++ b/src/windows/native/sun/jkernel/kernel_sv.rc
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2008 - 2009 Sun Microsystems, Inc.  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.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 340, 120
+STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | 
+    WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+CAPTION "Ytterligare komponenter behövs"
+EXSTYLE WS_EX_APPWINDOW
+FONT 8, "MS Sans Serif"
+BEGIN
+    LTEXT           "", IDC_DOWNLOAD_MASTHEAD, 0, 0, 340, 39
+    LTEXT           "", IDC_MASTHEAD_TEXT, 60, 14, 200, 12
+    CONTROL         "", IDC_STATIC,"Static", SS_BLACKFRAME | SS_SUNKEN,
+                    0, 39, 340, 1
+    LTEXT           "", IDC_DOWNLOAD_TEXT, 12, 60, 316, 20
+    LTEXT           "", IDC_TIME_REMAINING, 12, 90, 316, 10
+    CONTROL         "Progress1",1006,"msctls_progress32",PBS_SMOOTH,
+                    12, 100, 265, 14
+    PUSHBUTTON	    "Avbryt",  2, 285, 100, 46, 14
+END
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO DISCARDABLE 
+BEGIN
+    105, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 236
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 63
+    END
+END
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE DISCARDABLE 
+BEGIN
+    IDS_DOWNLOAD_CANCEL_MESSAGE   "Programmet kan avslutas om du avbryter installationen av ytterligare komponenter som är nödvändiga för programmet.\n\nVill du avbryta installationen av ytterligare komponenter?"
+    IDS_DOWNLOAD_CANCEL_CAPTION   "Avbryt - Ytterligare komponenter"
+    IDS_DOWNLOAD_CANCEL_INSTRUCTION   ""
+    IDS_HTTP_INSTRUCTION_REQUEST_TIMEOUT      "Anslutningen avbröts på grund av timeout"
+    IDS_HTTP_INSTRUCTION_SERVER_NOT_REACHABLE "Det går inte att ansluta till Internet."
+    IDS_HTTP_INSTRUCTION_UNKNOWN_ERROR        "Serverfel (Fel %s)"
+    IDS_HTTP_INSTRUCTION_SERVICE_UNAVAIL      "Tjänsten är inte tillgänglig (Fel %s)"
+    IDS_HTTP_INSTRUCTION_FORBIDDEN            "Åtkomst nekad eller förbjuden (Fel %s)"
+    IDS_HTTP_STATUS_OTHER                     "Ett fel inträffade i samband med begäran. Vill du försöka skicka begäran igen?"
+
+// HTTP status code
+    IDS_HTTP_STATUS_REQUEST_TIMEOUT "Ett tidsfel inträffade medan servern väntade på begäran."
+    IDS_HTTP_STATUS_FORBIDDEN		"Servern förstod begäran men vägrar uppfylla den."
+    IDS_HTTP_STATUS_SERVER_ERROR	"Ett oväntat tillstånd som innebär att begäran inte kan uppfyllas påträffades."
+    IDS_HTTP_STATUS_SERVICE_UNAVAIL	"Tjänsten är tillfälligt överbelastad."
+
+
+    IDS_DOWNLOAD_STATUS_RETRY		"Servern är upptagen för närvarande. Försök igen om %ld sekund(er) ..."
+
+    IDS_ERROR_CAPTION               "Fel - Java Kernel"
+    IDS_HOURSMINUTESECOND	    "Återstående tid: %d timmar %d minuter %.0f sekunder"
+    IDS_HOURMINUTESECOND	    "Återstående tid: %d timme %d minuter %.0f sekunder"
+    IDS_MINUTESECOND 		    "Återstående tid: %d minuter %.0f sekunder"
+    IDS_SECOND                      "Återstående tid: %.0f sekunder"
+    IDS_DISK_FULL_ERROR_CAPTION     "Disken är full"
+    IDS_DISK_FULL_ERROR             "Java Kernel kunde inte ladda ned nödvändiga komponenter därför att disken är full.  Försöka igen?"
+    IDS_DISK_WRITE_ERROR_CAPTION    "Fel vid skrivning till disk"
+    IDS_DISK_WRITE_ERROR            "Java Kernel stötte på ett fel vid skrivning till disken.  Försöka igen?"
+    IDS_HTTP_STATUS_SERVER_NOT_REACHABLE "Java Kernel kan inte fortsätta med systemets aktuella inställningar för Internetanslutning.  Öppna Kontrollpanelen, Internet-alternativ > Anslutningar och kontrollera att inställningarna och proxyinformationen stämmer."
+
+    IDS_DOWNLOAD_RETRY             "Nedladdningsfel"
+    IDS_DOWNLOAD_RETRY_TEXT        "Ett fel uppstod under nedladdning av vissa begärda komponenter. Vill du försöka ladda ned dessa komponenter igen?"
+
+    IDS_DOWNLOAD                   "Ytterligare komponenter installeras"
+	IDS_DOWNLOAD_UNPACKING         "Uppackning av paket"
+    IDS_DOWNLOAD_TEXT              "Java-applikationen startar när ytterligare komponenter som krävs är nedladdade och installerade."
+    
+    IDS_FILE_UPDATE_ERROR          "Ett fel uppstod när %s%s uppdaterades."
+    IDS_FILE_DELETE_ERROR          "Ett fel uppstod när %s skulle tas bort."
+    IDS_JAVA_HOME_ERROR            "Det går inte att avgöra Javas hemkatalog"
+    IDS_KERNEL_HOME_ERROR          "Det går inte att avgöra sökvägen till jkernell.dll."
+    IDS_JBROKER_ERROR              "Det går inte att starta jbroker.exe."
+    IDS_FATAL_ERROR                "Det gick inte att ladda ned de nödvändiga komponenterna med Java.  Programmet avslutas."
+    IDS_ERROR_DOWNLOADING_BUNDLE_PROPERTIES "Det gick inte att upprätta någon kommunikation mellan Java och nedladdningsservern.  Programmet avslutas."
+    IDS_ERROR_MALFORMED_BUNDLE_PROPERTIES "Det uppstod ett fel i kommunikationen mellan Java och nedladdningsservern.  Programmet avslutas."
+    IDS_ERROR_MALFORMED_URL "Det gick inte att ladda ned från webbadressen '%s'.  Programmet avslutas."
+END
diff --git a/src/windows/native/sun/jkernel/kernel_zh.rc b/src/windows/native/sun/jkernel/kernel_zh.rc
new file mode 100644
index 0000000..8867445
--- /dev/null
+++ b/src/windows/native/sun/jkernel/kernel_zh.rc
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2008 - 2009 Sun Microsystems, Inc.  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.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 340, 120
+STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | 
+    WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+CAPTION "ËùÐèµÄÆäËû×é¼þ"
+EXSTYLE WS_EX_APPWINDOW
+FONT 8, "MS Sans Serif"
+BEGIN
+    LTEXT           "", IDC_DOWNLOAD_MASTHEAD, 0, 0, 340, 39
+    LTEXT           "", IDC_MASTHEAD_TEXT, 60, 14, 200, 12
+    CONTROL         "", IDC_STATIC,"Static", SS_BLACKFRAME | SS_SUNKEN,
+                    0, 39, 340, 1
+    LTEXT           "", IDC_DOWNLOAD_TEXT, 12, 60, 316, 20
+    LTEXT           "", IDC_TIME_REMAINING, 12, 90, 316, 10
+    CONTROL         "Progress1",1006,"msctls_progress32",PBS_SMOOTH,
+                    12, 100, 265, 14
+    PUSHBUTTON	    "È¡Ïû",  2, 285, 100, 46, 14
+END
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO DISCARDABLE 
+BEGIN
+    105, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 236
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 63
+    END
+END
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE DISCARDABLE 
+BEGIN
+    IDS_DOWNLOAD_CANCEL_MESSAGE   "È¡Ïû°²×°Ó¦ÓóÌÐòËùÐèµÄ¶îÍâ×é¼þ¿ÉÄܻᵼÖ¸ÃÓ¦ÓóÌÐòÍ˳ö¡£\n\nÊÇ·ñÈ·¶¨ÒªÈ¡Ïû°²×°¶îÍâ×é¼þ£¿"
+    IDS_DOWNLOAD_CANCEL_CAPTION   "È¡Ïû - ¶îÍâ×é¼þ"
+    IDS_DOWNLOAD_CANCEL_INSTRUCTION   ""
+    IDS_HTTP_INSTRUCTION_REQUEST_TIMEOUT      "Á¬½ÓÒѳ¬Ê±"
+    IDS_HTTP_INSTRUCTION_SERVER_NOT_REACHABLE "ÎÞ·¨Á¬½Óµ½ Internet"
+    IDS_HTTP_INSTRUCTION_UNKNOWN_ERROR        "·þÎñÆ÷´íÎ󣨴íÎó %s£©"
+    IDS_HTTP_INSTRUCTION_SERVICE_UNAVAIL      "·þÎñ²»¿ÉÓ㨴íÎó %s£©"
+    IDS_HTTP_INSTRUCTION_FORBIDDEN            "¾Ü¾ø·ÃÎÊ»ò½ûÖ¹·ÃÎÊ£¨´íÎó %s£©"
+    IDS_HTTP_STATUS_OTHER                     "ÔÚ´ËÇëÇóÆÚ¼ä³öÏÖ´íÎó¡£ÄúÊÇ·ñÒªÖØÊÔÇëÇó£¿"
+
+// HTTP status code
+    IDS_HTTP_STATUS_REQUEST_TIMEOUT "·þÎñÆ÷µÈ´ýÇëÇóʱ³¬Ê±¡£"
+    IDS_HTTP_STATUS_FORBIDDEN		"·þÎñÆ÷ÒѽÓÊÜÇëÇ󣬵«¾Ü¾øÖ´ÐС£"
+    IDS_HTTP_STATUS_SERVER_ERROR	"·þÎñÆ÷Óöµ½ÒâÍâÇé¿ö£¬ÎÞ·¨Íê³ÉÇëÇó¡£"
+    IDS_HTTP_STATUS_SERVICE_UNAVAIL	"·þÎñÔÝʱ¹ýÔØ¡£"
+
+
+    IDS_DOWNLOAD_STATUS_RETRY		"·þÎñÆ÷Õý棬ÇëÔÚ %ld ÃëºóÖØÊÔ..."
+
+    IDS_ERROR_CAPTION               "´íÎó - Java Kernel"
+    IDS_HOURSMINUTESECOND	    "¹À¼ÆÊ£Óàʱ¼ä:%d Сʱ %d ·ÖÖÓ %.0f Ãë"
+    IDS_HOURMINUTESECOND	    "¹À¼ÆÊ£Óàʱ¼ä:%d Сʱ  %d ·ÖÖÓ %.0f Ãë"
+    IDS_MINUTESECOND 		    "¹À¼ÆÊ£Óàʱ¼ä:%d ·ÖÖÓ %.0f Ãë"
+    IDS_SECOND                      "¹À¼ÆÊ£Óàʱ¼ä:%.0f Ãë"
+    IDS_DISK_FULL_ERROR_CAPTION     "´ÅÅÌÒÑÂú"
+    IDS_DISK_FULL_ERROR             "ÓÉÓÚ´ÅÅÌÒÑÂú£¬Java Kernel ÎÞ·¨ÏÂÔØËùÐèµÄ×é¼þ¡£ÊÇ·ñÖØÊÔ£¿"
+    IDS_DISK_WRITE_ERROR_CAPTION    "´ÅÅÌдÈë´íÎó"
+    IDS_DISK_WRITE_ERROR            "ÔÚÏò´ÅÅÌÖ´ÐÐдÈë²Ù×÷ʱ Java Kernel Óöµ½´íÎó¡£ÊÇ·ñÖØÊÔ£¿"
+    IDS_HTTP_STATUS_SERVER_NOT_REACHABLE "ÔÚʹÓÃϵͳµ±Ç°µÄ Internet Á¬½ÓÉèÖõÄÇé¿öÏ£¬Java Kernel ÎÞ·¨¼ÌÐøÖ´ÐС£ÔÚ Windows""¿ØÖÆÃæ°å""ÖУ¬Çë¼ì²é""Internet Ñ¡Ïî""->""Á¬½Ó""ÒÔÈ·±£ÉèÖúʹúÀíÐÅÏ¢ÕýÈ·¡£"
+
+    IDS_DOWNLOAD_RETRY             "ÏÂÔØ´íÎó"
+    IDS_DOWNLOAD_RETRY_TEXT        "ÔÚÏÂÔØÄ³Ð©ÇëÇóµÄ×é¼þÆÚ¼ä·¢Éú´íÎó¡£ÊÇ·ñÒªÔÙÊÔÒ»´ÎÏÂÔØÕâЩ×é¼þ£¿"
+
+    IDS_DOWNLOAD                   "°²×°ÆäËû×é¼þ"
+	IDS_DOWNLOAD_UNPACKING         "ÕýÔÚ½âѹËõ°ü"
+    IDS_DOWNLOAD_TEXT              "ÏÂÔØ²¢°²×° Java Ó¦ÓóÌÐòËùÐèµÄÆäËû×é¼þºó£¬¸ÃÓ¦ÓóÌÐò½«Æô¶¯¡£"
+    
+    IDS_FILE_UPDATE_ERROR          "¸üР%s%s ʱ·¢Éú´íÎó¡£"
+    IDS_FILE_DELETE_ERROR          "ɾ³ý %s ʱ·¢Éú´íÎó¡£"
+    IDS_JAVA_HOME_ERROR            "ÎÞ·¨È·¶¨ Java Ö÷Ŀ¼¡£"
+    IDS_KERNEL_HOME_ERROR          "ÎÞ·¨È·¶¨ jkernel.dll µÄ·¾¶¡£"
+    IDS_JBROKER_ERROR              "ÎÞ·¨Æô¶¯ jbroker.exe¡£"
+    IDS_FATAL_ERROR                "Java ÎÞ·¨ÏÂÔØËùÐèµÄ×é¼þ¡£ÏÖÔÚ³ÌÐò½«Í˳ö¡£"
+    IDS_ERROR_DOWNLOADING_BUNDLE_PROPERTIES "Java ÎÞ·¨ÓëÏÂÔØ·þÎñÆ÷½øÐÐͨÐÅ¡£ÏÖÔÚ³ÌÐò½«Í˳ö¡£"
+    IDS_ERROR_MALFORMED_BUNDLE_PROPERTIES "Java ÔÚÓëÏÂÔØ·þÎñÆ÷½øÐÐͨÐÅʱÓöµ½´íÎó¡£ÏÖÔÚ³ÌÐò½«Í˳ö¡£"
+    IDS_ERROR_MALFORMED_URL "Java ÎÞ·¨´Ó URL '%s' Ö´ÐÐÏÂÔØ¡£ÏÖÔÚ³ÌÐò½«Í˳ö¡£"
+END
diff --git a/src/windows/native/sun/jkernel/kernel_zh_TW.rc b/src/windows/native/sun/jkernel/kernel_zh_TW.rc
new file mode 100644
index 0000000..d0882b9
--- /dev/null
+++ b/src/windows/native/sun/jkernel/kernel_zh_TW.rc
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2008 - 2009 Sun Microsystems, Inc.  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.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 340, 120
+STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | 
+    WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+CAPTION "©Ò»Ýªº¨ä¥L¤¸¥ó"
+EXSTYLE WS_EX_APPWINDOW
+FONT 8, "MS Sans Serif"
+BEGIN
+    LTEXT           "", IDC_DOWNLOAD_MASTHEAD, 0, 0, 340, 39
+    LTEXT           "", IDC_MASTHEAD_TEXT, 60, 14, 200, 12
+    CONTROL         "", IDC_STATIC,"Static", SS_BLACKFRAME | SS_SUNKEN,
+                    0, 39, 340, 1
+    LTEXT           "", IDC_DOWNLOAD_TEXT, 12, 60, 316, 20
+    LTEXT           "", IDC_TIME_REMAINING, 12, 90, 316, 10
+    CONTROL         "Progress1",1006,"msctls_progress32",PBS_SMOOTH,
+                    12, 100, 265, 14
+    PUSHBUTTON	    "¨ú®ø",  2, 285, 100, 46, 14
+END
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO DISCARDABLE 
+BEGIN
+    105, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 236
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 63
+    END
+END
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE DISCARDABLE 
+BEGIN
+    IDS_DOWNLOAD_CANCEL_MESSAGE   "¨ú®ø¦w¸ËÀ³¥Îµ{¦¡©Ò»Ýªº¨ä¥L¤¸¥ó¡A¥i¯à·|¾É­PÀ³¥Îµ{¦¡µ²§ô¡C\n\n±z½T©w­n¨ú®ø¦w¸Ë¨ä¥L¤¸¥ó¡H"
+    IDS_DOWNLOAD_CANCEL_CAPTION   "¨ú®ø - ¨ä¥L¤¸¥ó"
+    IDS_DOWNLOAD_CANCEL_INSTRUCTION   ""
+    IDS_HTTP_INSTRUCTION_REQUEST_TIMEOUT      "³s½u¹O®É"
+    IDS_HTTP_INSTRUCTION_SERVER_NOT_REACHABLE "µLªk³s½u¦Üºô»Úºô¸ô"
+    IDS_HTTP_INSTRUCTION_UNKNOWN_ERROR        "¦øªA¾¹¿ù»~ (¿ù»~ %s)"
+    IDS_HTTP_INSTRUCTION_SERVICE_UNAVAIL      "µLªk¨Ï¥ÎªA°È (¿ù»~ %s)"
+    IDS_HTTP_INSTRUCTION_FORBIDDEN            "©Úµ´©Î¸T¤î¦s¨ú (¿ù»~ %s)"
+    IDS_HTTP_STATUS_OTHER                     "¦b¦¹½Ð¨D´Á¶¡µo¥Í¿ù»~¡C¬O§_­n­«¸Õ½Ð¨D¡H"
+
+// HTTP status code
+    IDS_HTTP_STATUS_REQUEST_TIMEOUT "¦øªA¾¹µ¥«Ý½Ð¨D®É¥X²{¹O®É¡C"
+    IDS_HTTP_STATUS_FORBIDDEN		"¦øªA¾¹ÁA¸Ñ¸Ó½Ð¨D¡A¦ý¥¿¦b©Úµ´¹ê²{¥¦¡C"
+    IDS_HTTP_STATUS_SERVER_ERROR	"¦øªA¾¹¹J¨ìªý¤î¨ä¹ê²{½Ð¨Dªº¥¼¹w´Á±ø¥ó¡C"
+    IDS_HTTP_STATUS_SERVICE_UNAVAIL	"ªA°È¼È®É¶W¸ü¡C"
+
+
+    IDS_DOWNLOAD_STATUS_RETRY		"¦øªA¾¹¥Ø«e³B©ó¦£¸Lª¬ºA¡A½Ð¦b %ld ¬í«á­«¸Õ..."
+
+    IDS_ERROR_CAPTION               "¿ù»~ - Java Kernel"
+    IDS_HOURSMINUTESECOND	    "¹w¦ô³Ñ¾l®É¶¡¡G%d ¤p®É %d ¤À %.0f ¬í"
+    IDS_HOURMINUTESECOND	    "¹w¦ô³Ñ¾l®É¶¡¡G%d ¤p®É %d ¤À %.0f ¬í"
+    IDS_MINUTESECOND 		    "¹w¦ô³Ñ¾l®É¶¡¡G%d ¤À %.0f ¬í"
+    IDS_SECOND                      "¹w¦ô³Ñ¾l®É¶¡¡G%.0f ¬í"
+    IDS_DISK_FULL_ERROR_CAPTION     "ºÏºÐ¤wº¡"
+    IDS_DISK_FULL_ERROR             "¥Ñ©óºÏºÐ¤wº¡¡AJava Kernel µLªk¤U¸ü©Ò»Ýªº¤¸¥ó¡C¬O§_­n­«¸Õ¡H"
+    IDS_DISK_WRITE_ERROR_CAPTION    "ºÏºÐ¼g¤J¿ù»~"
+    IDS_DISK_WRITE_ERROR            "Java Kernel ¦b¼g¤J¦ÜºÏºÐ®É¹J¨ì¿ù»~¡C¬O§_­n­«¸Õ¡H"
+    IDS_HTTP_STATUS_SERVER_NOT_REACHABLE "¦b¨t²Î¥Ø«eªººô»Úºô¸ô³s½u³]©w¤U¡AJava Kernel µLªkÄ~Äò°õ¦æ¡C¦b Windows¡u±±¨î¥x¡v¤¤¡A½Ð®Ö¹ï¡uºô»Úºô¸ô¿ï¶µ¡v->¡u³s½u¡v¡A¥H½T©w³]©w©M¥N²z¦øªA¾¹¸ê°T¥¿½T¡C"
+
+    IDS_DOWNLOAD_RETRY             "¤U¸ü¿ù»~"
+    IDS_DOWNLOAD_RETRY_TEXT        "¤U¸ü¬Y¨Ç©Ò»Ý¤¸¥ó®Éµo¥Í¿ù»~¡C¬O§_­n­«¸Õ¤U¸ü³o¨Ç¤¸¥ó¡H"
+
+    IDS_DOWNLOAD                   "¥¿¦b¦w¸Ë¨ä¥L¤¸¥ó"
+	IDS_DOWNLOAD_UNPACKING         "¥¿¦b¸ÑÀ£ÁY§ô"
+    IDS_DOWNLOAD_TEXT              "¤U¸ü¨Ã¦w¸Ë¨ä¥L©Ò»Ý¤¸¥ó«á¡AJava À³¥Îµ{¦¡±N±Ò°Ê¡C"
+    
+    IDS_FILE_UPDATE_ERROR          "§ó·s %s%s ®Éµo¥Í¿ù»~¡C"
+    IDS_FILE_DELETE_ERROR          "²¾°£ %s ®Éµo¥Í¿ù»~¡C"
+    IDS_JAVA_HOME_ERROR            "µLªk½T©w Java ¥D¥Ø¿ý¡C"
+    IDS_KERNEL_HOME_ERROR          "µLªk½T©w jkernel.dll ªº¸ô®|¡C"
+    IDS_JBROKER_ERROR              "µLªk±Ò°Ê jbroker.exe¡C"
+    IDS_FATAL_ERROR                "Java µLªk¤U¸ü©Ò»Ýªº¤¸¥ó¡Cµ{¦¡±N¥ß§Yµ²§ô¡C"
+    IDS_ERROR_DOWNLOADING_BUNDLE_PROPERTIES "Java µLªk»P¤U¸ü¦øªA¾¹¶i¦æ³q°T¡Cµ{¦¡±N¥ß§Yµ²§ô¡C"
+    IDS_ERROR_MALFORMED_BUNDLE_PROPERTIES "Java ¦b»P¤U¸ü¦øªA¾¹¶i¦æ³q°T®É¹J¨ì¤F¤@­Ó¿ù»~¡Cµ{¦¡±N¥ß§Yµ²§ô¡C"
+    IDS_ERROR_MALFORMED_URL "Java µLªk±q URL¡u%s¡v¤U¸ü¡Cµ{¦¡±N¥ß§Yµ²§ô¡C"
+END
diff --git a/src/windows/native/sun/jkernel/resource.h b/src/windows/native/sun/jkernel/resource.h
new file mode 100644
index 0000000..424531d
--- /dev/null
+++ b/src/windows/native/sun/jkernel/resource.h
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2008 - 2009 Sun Microsystems, Inc.  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.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+//
+//
+
+
+// HTTP status code
+#define IDS_HTTP_STATUS_FORBIDDEN           403
+#define IDS_HTTP_STATUS_REQUEST_TIMEOUT     408
+#define IDS_HTTP_STATUS_SERVER_ERROR        500
+#define IDS_HTTP_STATUS_SERVICE_UNAVAIL     503
+
+
+
+#define IDS_HTTP_INSTRUCTION_REQUEST_TIMEOUT           2408
+#define IDS_HTTP_INSTRUCTION_SERVICE_UNAVAIL           2503
+#define IDS_HTTP_INSTRUCTION_FORBIDDEN                 2403
+#define IDS_HTTP_INSTRUCTION_SERVER_NOT_REACHABLE      2035
+#define IDS_HTTP_INSTRUCTION_UNKNOWN_ERROR             2036
+#define IDS_HTTP_STATUS_OTHER                          2037
+
+#define IDS_DOWNLOAD_STATUS_RETRY           3004
+
+#define IDD_DOWNLOAD_DIALOG             105
+#define IDI_JAVA                        114
+#define IDI_MASTHEAD                    115
+#define IDC_DOWNLOAD_PROGRESS           1006
+#define IDC_DOWNLOAD_INFO               1007
+#define IDC_DOWNLOAD_STATUS             1008
+#define IDC_DOWNLOAD_ANIMATE            1009
+#define IDS_ERROR_CAPTION               2004
+#define IDS_HOURSMINUTESECOND           2007
+#define IDS_HOURMINUTESECOND            2008
+#define IDS_MINUTESECOND                2009
+#define IDS_SECOND                      2010
+#define IDS_DISK_FULL_ERROR             2023
+#define IDS_DISK_FULL_ERROR_CAPTION     2024
+#define IDS_DISK_WRITE_ERROR            2025
+#define IDS_DISK_WRITE_ERROR_CAPTION    2026
+#define IDS_HTTP_STATUS_SERVER_NOT_REACHABLE  2028
+#define IDS_FATAL_ERROR                 2029
+#define IDS_ERROR_DOWNLOADING_BUNDLE_PROPERTIES 2030
+#define IDS_ERROR_MALFORMED_BUNDLE_PROPERTIES 2031
+#define IDS_ERROR_MALFORMED_URL         2032
+
+#define IDS_DOWNLOAD_CANCEL_CAPTION            2038
+#define IDS_DOWNLOAD_CANCEL_INSTRUCTION        2039
+#define IDS_DOWNLOAD_CANCEL_MESSAGE            2040
+
+// codes for download and install dialog
+#define IDC_MASTHEAD_TEXT               116
+#define IDC_DOWNLOAD_MASTHEAD           121
+#define IDC_TIME_REMAINING              122
+#define IDC_DOWNLOAD_TEXT               123
+
+// codes for download retry dialog
+#define IDS_DOWNLOAD_RETRY              130
+#define IDS_DOWNLOAD_RETRY_TEXT         131
+
+#define IDS_DOWNLOAD_UNPACKING          3900
+#define IDS_DOWNLOAD                    4000
+#define IDS_DOWNLOAD_TEXT               4001
+
+// codes for completion cleanup
+#define IDS_FILE_UPDATE_ERROR           4101
+#define IDS_FILE_DELETE_ERROR           4103
+#define IDS_JAVA_HOME_ERROR             4104
+#define IDS_KERNEL_HOME_ERROR           4105
+#define IDS_JBROKER_ERROR               4106
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        128
+#define _APS_NEXT_COMMAND_VALUE         40001
+#define _APS_NEXT_CONTROL_VALUE         1016
+#define _APS_NEXT_SYMED_VALUE           103
+#endif
+#endif
diff --git a/src/windows/native/sun/jkernel/stdafx.cpp b/src/windows/native/sun/jkernel/stdafx.cpp
new file mode 100644
index 0000000..f0c6e9f
--- /dev/null
+++ b/src/windows/native/sun/jkernel/stdafx.cpp
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2008 - 2009 Sun Microsystems, Inc.  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.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+// stdafx.cpp : source file that includes just the standard includes
+//  stdafx.pch will be the pre-compiled header
+//  stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+#ifdef _ATL_STATIC_REGISTRY
+#include <statreg.h>
+#include <statreg.cpp>
+#endif
+
+#include <atlimpl.cpp>
diff --git a/src/windows/native/sun/jkernel/stdafx.h b/src/windows/native/sun/jkernel/stdafx.h
new file mode 100644
index 0000000..131c1a3
--- /dev/null
+++ b/src/windows/native/sun/jkernel/stdafx.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2008 - 2009 Sun Microsystems, Inc.  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.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+// stdafx.h : include file for standard system include files,
+//      or project specific include files that are used frequently,
+//      but are changed infrequently
+
+#if !defined(AFX_STDAFX_H__FBC6C744_18F8_11D6_9DF1_0001023B10AA__INCLUDED_)
+#define AFX_STDAFX_H__FBC6C744_18F8_11D6_9DF1_0001023B10AA__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#define STRICT
+#ifndef _WIN32_WINNT
+#define _WIN32_WINNT 0x0400
+#endif
+#define _ATL_APARTMENT_THREADED
+
+#include <atlbase.h>
+//You may derive a class from CComModule and use it if you want to override
+//something, but do not change the name of _Module
+extern CComModule _Module;
+#include <atlcom.h>
+#include <atlwin.h>
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_STDAFX_H__FBC6C744_18F8_11D6_9DF1_0001023B10AA__INCLUDED)
diff --git a/src/windows/native/sun/jkernel/version.rc b/src/windows/native/sun/jkernel/version.rc
new file mode 100644
index 0000000..1d2cbb0
--- /dev/null
+++ b/src/windows/native/sun/jkernel/version.rc
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2008 - 2009 Sun Microsystems, Inc.  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.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+#include "afxres.h"
+
+// Need 2 defines so macro argument to XSTR will get expanded before quoting.
+#define XSTR(x) STR(x)
+#define STR(x)  #x
+
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION    JDK_FVER
+ PRODUCTVERSION JDK_FVER
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ // FILEOS 0x4 is Win32, 0x40004 is Win32 NT only
+ FILEOS 0x4L
+ // FILETYPE should be 0x1 for .exe and 0x2 for .dll
+ FILETYPE JDK_FTYPE
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "000004b0"
+        BEGIN
+            VALUE "CompanyName",      XSTR(JDK_COMPANY)       "\0"
+            VALUE "FileDescription",  XSTR(JDK_COMPONENT)     "\0"
+            VALUE "FileVersion",      XSTR(JDK_VER)           "\0"
+            VALUE "Full Version",     XSTR(JDK_BUILD_ID)      "\0"
+	    VALUE "InternalName",     XSTR(JDK_INTERNAL_NAME) "\0"
+            VALUE "LegalCopyright",   XSTR(JDK_COPYRIGHT)     "\0"
+            VALUE "OriginalFilename", XSTR(JDK_FNAME)         "\0"
+            VALUE "ProductName",      XSTR(JDK_NAME)          "\0"
+            VALUE "ProductVersion",   XSTR(JDK_VER)           "\0"
+        END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x0, 1200
+    END
+END
diff --git a/src/windows/native/sun/windows/awt.rc b/src/windows/native/sun/windows/awt.rc
index 7eb4d41..a5367ec 100644
--- a/src/windows/native/sun/windows/awt.rc
+++ b/src/windows/native/sun/windows/awt.rc
@@ -48,8 +48,8 @@
 //
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION    J2SE_FVER
- PRODUCTVERSION J2SE_FVER
+ FILEVERSION    JDK_FVER
+ PRODUCTVERSION JDK_FVER
  FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
  FILEFLAGS 0x1L
@@ -59,22 +59,22 @@
  // FILEOS 0x4 is Win32, 0x40004 is Win32 NT only
  FILEOS 0x4L
  // FILETYPE should be 0x1 for .exe and 0x2 for .dll
- FILETYPE J2SE_FTYPE
+ FILETYPE JDK_FTYPE
  FILESUBTYPE 0x0L
 BEGIN
     BLOCK "StringFileInfo"
     BEGIN
         BLOCK "040904b0"
         BEGIN
-            VALUE "CompanyName",      XSTR(J2SE_COMPANY)       "\0"
-            VALUE "FileDescription",  XSTR(J2SE_COMPONENT)     "\0"
-            VALUE "FileVersion",      XSTR(J2SE_VER)           "\0"
-            VALUE "Full Version",     XSTR(J2SE_BUILD_ID)      "\0"
-	    VALUE "InternalName",     XSTR(J2SE_INTERNAL_NAME) "\0"
-            VALUE "LegalCopyright",   XSTR(J2SE_COPYRIGHT)     "\0"
-            VALUE "OriginalFilename", XSTR(J2SE_FNAME)         "\0"
-            VALUE "ProductName",      XSTR(J2SE_NAME)          "\0"
-            VALUE "ProductVersion",   XSTR(J2SE_VER)           "\0"
+            VALUE "CompanyName",      XSTR(JDK_COMPANY)       "\0"
+            VALUE "FileDescription",  XSTR(JDK_COMPONENT)     "\0"
+            VALUE "FileVersion",      XSTR(JDK_VER)           "\0"
+            VALUE "Full Version",     XSTR(JDK_BUILD_ID)      "\0"
+	    VALUE "InternalName",     XSTR(JDK_INTERNAL_NAME) "\0"
+            VALUE "LegalCopyright",   XSTR(JDK_COPYRIGHT)     "\0"
+            VALUE "OriginalFilename", XSTR(JDK_FNAME)         "\0"
+            VALUE "ProductName",      XSTR(JDK_NAME)          "\0"
+            VALUE "ProductVersion",   XSTR(JDK_VER)           "\0"
         END
     END
     BLOCK "VarFileInfo"
diff --git a/src/windows/resource/unpack200_proto.exe.manifest b/src/windows/resource/unpack200_proto.exe.manifest
new file mode 100644
index 0000000..739f9b9
--- /dev/null
+++ b/src/windows/resource/unpack200_proto.exe.manifest
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> 
+  <assemblyIdentity version="IMVERSION"
+     processorArchitecture="X86"
+     name="unpack200.exe"
+     type="win32"/> 
+
+  <description>Java(TM) SE Runtime Environment unpack200 Process.</description> 
+  <!-- Identify the application security requirements. -->
+  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
+    <security>
+      <requestedPrivileges>
+        <requestedExecutionLevel
+          level="asInvoker"
+          uiAccess="false"/>
+        </requestedPrivileges>
+       </security>
+  </trustInfo>
+</assembly>
diff --git a/src/windows/resource/version.rc b/src/windows/resource/version.rc
index 4147956..dff3ae5 100644
--- a/src/windows/resource/version.rc
+++ b/src/windows/resource/version.rc
@@ -37,8 +37,8 @@
 //
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION    J2SE_FVER
- PRODUCTVERSION J2SE_FVER
+ FILEVERSION    JDK_FVER
+ PRODUCTVERSION JDK_FVER
  FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
  FILEFLAGS 0x1L
@@ -48,22 +48,22 @@
  // FILEOS 0x4 is Win32, 0x40004 is Win32 NT only
  FILEOS 0x4L
  // FILETYPE should be 0x1 for .exe and 0x2 for .dll
- FILETYPE J2SE_FTYPE
+ FILETYPE JDK_FTYPE
  FILESUBTYPE 0x0L
 BEGIN
     BLOCK "StringFileInfo"
     BEGIN
         BLOCK "000004b0"
         BEGIN
-            VALUE "CompanyName",      XSTR(J2SE_COMPANY)       "\0"
-            VALUE "FileDescription",  XSTR(J2SE_COMPONENT)     "\0"
-            VALUE "FileVersion",      XSTR(J2SE_VER)           "\0"
-            VALUE "Full Version",     XSTR(J2SE_BUILD_ID)      "\0"
-	    VALUE "InternalName",     XSTR(J2SE_INTERNAL_NAME) "\0"
-            VALUE "LegalCopyright",   XSTR(J2SE_COPYRIGHT)     "\0"
-            VALUE "OriginalFilename", XSTR(J2SE_FNAME)         "\0"
-            VALUE "ProductName",      XSTR(J2SE_NAME)          "\0"
-            VALUE "ProductVersion",   XSTR(J2SE_VER)           "\0"
+            VALUE "CompanyName",      XSTR(JDK_COMPANY)       "\0"
+            VALUE "FileDescription",  XSTR(JDK_COMPONENT)     "\0"
+            VALUE "FileVersion",      XSTR(JDK_VER)           "\0"
+            VALUE "Full Version",     XSTR(JDK_BUILD_ID)      "\0"
+	    VALUE "InternalName",     XSTR(JDK_INTERNAL_NAME) "\0"
+            VALUE "LegalCopyright",   XSTR(JDK_COPYRIGHT)     "\0"
+            VALUE "OriginalFilename", XSTR(JDK_FNAME)         "\0"
+            VALUE "ProductName",      XSTR(JDK_NAME)          "\0"
+            VALUE "ProductVersion",   XSTR(JDK_VER)           "\0"
         END
     END
     BLOCK "VarFileInfo"