commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r997218 - /commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.c
Date Wed, 15 Sep 2010 08:05:32 GMT
Author: mturk
Date: Wed Sep 15 08:05:32 2010
New Revision: 997218

URL: http://svn.apache.org/viewvc?rev=997218&view=rev
Log:
DAEMON-173 Allow --JavaHome=jdk or --JavaHome=jre that will guess JavaHome from the registry
for --StartMode=java

Modified:
    commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.c

Modified: commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.c
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.c?rev=997218&r1=997217&r2=997218&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.c (original)
+++ commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.c Wed Sep 15 08:05:32
2010
@@ -59,6 +59,8 @@ typedef struct APX_STDWRAP {
 static LPCWSTR      PRSRV_AUTO   = L"auto";
 static LPCWSTR      PRSRV_JAVA   = L"java";
 static LPCWSTR      PRSRV_JVM    = L"jvm";
+static LPCWSTR      PRSRV_JDK    = L"jdk";
+static LPCWSTR      PRSRV_JRE    = L"jre";
 static LPCWSTR      PRSRV_MANUAL = L"manual";
 static LPCWSTR      PRSRV_JBIN   = L"\\bin\\java.exe";
 static LPCWSTR      PRSRV_SIGNAL = L"SIGNAL";
@@ -1221,6 +1223,14 @@ void WINAPI serviceMain(DWORD argc, LPTS
             LPWSTR jx = NULL, szJH = SO_JAVAHOME;
             if (!szJH)
                 szJH = apxGetJavaSoftHome(gPool, FALSE);
+            else if (!lstrcmpiW(szJH, PRSRV_JDK)) {
+                /* Figure out the JDK JavaHome */
+                szJH = apxGetJavaSoftHome(gPool, FALSE);
+            }
+            else if (!lstrcmpiW(szJH, PRSRV_JRE)) {
+                /* Figure out the JRE JavaHome */
+                szJH = apxGetJavaSoftHome(gPool, TRUE);
+            }
             if (szJH) {
                 jx = apxPoolAlloc(gPool, (lstrlenW(szJH) + 16) * sizeof(WCHAR));
                 lstrcpyW(jx, szJH);
@@ -1248,6 +1258,14 @@ void WINAPI serviceMain(DWORD argc, LPTS
             LPWSTR jx = NULL, szJH = SO_JAVAHOME;
             if (!szJH)
                 szJH = apxGetJavaSoftHome(gPool, FALSE);
+            else if (!lstrcmpiW(szJH, PRSRV_JDK)) {
+                /* Figure out the JDK JavaHome */
+                szJH = apxGetJavaSoftHome(gPool, FALSE);
+            }
+            else if (!lstrcmpiW(szJH, PRSRV_JRE)) {
+                /* Figure out the JRE JavaHome */
+                szJH = apxGetJavaSoftHome(gPool, TRUE);
+            }
             if (szJH) {
                 jx = apxPoolAlloc(gPool, (lstrlenW(szJH) + 16) * sizeof(WCHAR));
                 lstrcpyW(jx, szJH);



Mime
View raw message