• R/O
  • SSH
  • HTTPS

exewrap: Commit


Commit MetaInfo

Revision49 (tree)
Time2018-06-13 22:14:53
Authorhirukawa_ryo

Log Message

* exewrap 1.2.5
JRE検索機能でjdkで始まるディレクトリも検出対象にするようにしました。

Change Summary

Incremental Difference

--- exewrap/trunk/exewrap/src/jvm.c (revision 48)
+++ exewrap/trunk/exewrap/src/jvm.c (revision 49)
@@ -398,6 +398,7 @@
398398 char* buffer;
399399 char* token;
400400 DWORD size = MAX_PATH;
401+ TCHAR jdk1[MAX_PATH+1];
401402 TCHAR jre1[MAX_PATH+1];
402403 TCHAR jre2[MAX_PATH+1];
403404 TCHAR jre3[MAX_PATH+1];
@@ -445,6 +446,49 @@
445446 opt_policy_path[0] = 0x00;
446447 }
447448
449+ // Find local JDK
450+ if (useSideBySideJRE && jvmpath[0] == 0)
451+ {
452+ GetModulePath(jdk1, MAX_PATH);
453+ lstrcpy(search, jdk1);
454+ lstrcat(search, "\\jdk*");
455+ hSearch = FindFirstFile(search, &fd);
456+ if (hSearch != INVALID_HANDLE_VALUE)
457+ {
458+ found = FALSE;
459+ do
460+ {
461+ if (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
462+ {
463+ lstrcat(jdk1, "\\");
464+ lstrcat(jdk1, fd.cFileName);
465+ found = TRUE;
466+ }
467+ } while (!found && FindNextFile(hSearch, &fd));
468+ FindClose(hSearch);
469+ if (found)
470+ {
471+ strcpy(jre1, jdk1);
472+ strcat(jre1, "\\jre");
473+
474+ if (FindJavaVM(jvmpath, jre1, useServerVM))
475+ {
476+ int bits = GetArchitectureBits(jvmpath);
477+ if (bits == 0 || bits == GetProcessArchitecture())
478+ {
479+ SetEnvironmentVariable("JAVA_HOME", jdk1);
480+ lstrcpy(binpath, jdk1);
481+ lstrcat(binpath, "\\bin");
482+ }
483+ else
484+ {
485+ jvmpath[0] = '\0';
486+ }
487+ }
488+ }
489+ }
490+ }
491+
448492 // Find local JRE
449493 if (useSideBySideJRE && jvmpath[0] == 0)
450494 {
Show on old repository browser