• R/O
  • SSH
  • HTTPS

exewrap: コミット


コミットメタ情報

リビジョン96 (tree)
日時2020-09-14 15:42:42
作者hirukawa_ryo

ログメッセージ

* exewrap 1.6.3

変更サマリ

差分

--- exewrap/trunk/exewrap/src/exewrap.c (revision 95)
+++ exewrap/trunk/exewrap/src/exewrap.c (revision 96)
@@ -101,7 +101,7 @@
101101 L" -s \t Create Windows Service application.\r\n"
102102 L" -A <architecture> \t Select exe-file architecture. (default %ls)\r\n"
103103 L" -t <version> \t Set target java runtime version. (default 1.5)\r\n"
104- L" -l <search-flags> \t Set Java VM search location flags\r\n"
104+ L" -l <search-flags> \t Set Java VM search location flags.\r\n"
105105 L" -M <main-class> \t Set main-class.\r\n"
106106 L" -L <ext-dirs> \t Set ext-dirs.\r\n"
107107 L" -e <ext-flags> \t Set extended flags.\r\n"
--- exewrap/trunk/exewrap/src/jvm.c (revision 95)
+++ exewrap/trunk/exewrap/src/jvm.c (revision 96)
@@ -842,6 +842,7 @@
842842
843843 BOOL initialize_path(const wchar_t* relative_classpath, const wchar_t* relative_extdirs, BOOL use_server_vm, DWORD vm_search_locations)
844844 {
845+ wchar_t* path_env = NULL;
845846 wchar_t* module_path = NULL;
846847 wchar_t* buffer = NULL;
847848 wchar_t* search = NULL;
@@ -920,6 +921,13 @@
920921 }
921922 *(wcsrchr(module_path, L'\\')) = L'\0';
922923
924+ path_env = (wchar_t*)malloc(BUFFER_SIZE * sizeof(wchar_t));
925+ if(path_env == NULL)
926+ {
927+ goto EXIT;
928+ }
929+ GetEnvironmentVariable(L"PATH", path_env, BUFFER_SIZE);
930+
923931 jvmpath[0] = L'\0';
924932
925933 // Find local JDK
@@ -1435,10 +1443,6 @@
14351443
14361444 GetModuleFileName(NULL, buffer, BUFFER_SIZE);
14371445 wcscpy_s(libpath, BUFFER_SIZE, L".;");
1438- wcscat_s(libpath, BUFFER_SIZE, jvmpath);
1439- wcscat_s(libpath, BUFFER_SIZE, L";");
1440- wcscat_s(libpath, BUFFER_SIZE, binpath);
1441- wcscat_s(libpath, BUFFER_SIZE, L";");
14421446
14431447 if(relative_classpath != NULL)
14441448 {
@@ -1460,6 +1464,8 @@
14601464 wcscat_s(path, BUFFER_SIZE, token);
14611465 if(is_directory(path))
14621466 {
1467+ wcscat_s(libpath, BUFFER_SIZE, path);
1468+ wcscat_s(libpath, BUFFER_SIZE, L";");
14631469 add_path_env(path);
14641470 add_dll_directory(path);
14651471 }
@@ -1498,6 +1504,8 @@
14981504 wchar_t* dir = dirs;
14991505 while(*dir)
15001506 {
1507+ wcscat_s(libpath, BUFFER_SIZE, dir);
1508+ wcscat_s(libpath, BUFFER_SIZE, L";");
15011509 add_path_env(dir);
15021510 add_dll_directory(dir);
15031511
@@ -1509,9 +1517,11 @@
15091517 }
15101518 }
15111519
1512- if(GetEnvironmentVariable(L"PATH", buffer, BUFFER_SIZE))
1520+ // PATH環境変数の内容もjava.library.pathに含めます。
1521+ // JPKIなどのライブラリをロードするために必要になります。
1522+ if(path_env != NULL)
15131523 {
1514- wcscat_s(libpath, BUFFER_SIZE, buffer);
1524+ wcscat_s(libpath, BUFFER_SIZE, path_env);
15151525 }
15161526
15171527 add_path_env(binpath);
@@ -1523,6 +1533,10 @@
15231533 path_initialized = TRUE;
15241534
15251535 EXIT:
1536+ if(path_env != NULL)
1537+ {
1538+ free(path_env);
1539+ }
15261540 if(module_path != NULL)
15271541 {
15281542 free(module_path);
旧リポジトリブラウザで表示