diff --git a/bin/WinLauncher/WinLauncher.exe b/bin/WinLauncher/WinLauncher.exe index 1a8c9effc739..8b500d2ad95f 100644 Binary files a/bin/WinLauncher/WinLauncher.exe and b/bin/WinLauncher/WinLauncher.exe differ diff --git a/bin/WinLauncher/WinLauncher64.exe b/bin/WinLauncher/WinLauncher64.exe index a324ccae5842..0dc7d05fb869 100644 Binary files a/bin/WinLauncher/WinLauncher64.exe and b/bin/WinLauncher/WinLauncher64.exe differ diff --git a/build/conf/ideaCE-launcher.properties b/build/conf/ideaCE-launcher.properties index 904a0a136092..cc001f078cb7 100644 --- a/build/conf/ideaCE-launcher.properties +++ b/build/conf/ideaCE-launcher.properties @@ -1,8 +1,10 @@ IDS_JDK_ONLY=true IDS_APP_TITLE=__IDE-NAME__ Launcher IDS_VM_OPTIONS_PATH=%USERPROFILE%\\.__PRODUCT_PATHS_SELECTOR__ +IDS_VM_OPTION_ERRORFILE=-XX:ErrorFile=%USERPROFILE%\\java_error_in___product_uc___%p.log +IDS_VM_OPTION_HEAPDUMPPATH=-XX:HeapDumpPath=%USERPROFILE%\\java_error_in___product_uc__.hprof IDC_WINLAUNCHER=__IDE-NAME___LAUNCHER IDS_PROPS_ENV_VAR=__IDE-NAME___PROPERTIES IDS_VM_OPTIONS_ENV_VAR=__IDE-NAME___VM_OPTIONS IDS_ERROR_LAUNCHING_APP=Error launching __IDE-NAME__ -IDS_VM_OPTIONS=-Didea.paths.selector=__PRODUCT_PATHS_SELECTOR__ -XX:ErrorFile=%USERPROFILE%\\java_error_in___product_uc___%p.log -XX:HeapDumpPath=%USERPROFILE%\\java_error_in___product_uc__.hprof -Didea.jre.check=true +IDS_VM_OPTIONS=-Didea.paths.selector=__PRODUCT_PATHS_SELECTOR__ -Didea.jre.check=true diff --git a/build/conf/ideaCE64-launcher.properties b/build/conf/ideaCE64-launcher.properties index cb79dba4c71c..aae51c0ecf9c 100644 --- a/build/conf/ideaCE64-launcher.properties +++ b/build/conf/ideaCE64-launcher.properties @@ -2,8 +2,10 @@ IDS_JDK_ONLY=true IDS_JDK_ENV_VAR=IDEA_JDK_64 IDS_APP_TITLE=__IDE-NAME__ Launcher IDS_VM_OPTIONS_PATH=%USERPROFILE%\\.__PRODUCT_PATHS_SELECTOR__ +IDS_VM_OPTION_ERRORFILE=-XX:ErrorFile=%USERPROFILE%\\java_error_in___product_uc___%p.log +IDS_VM_OPTION_HEAPDUMPPATH=-XX:HeapDumpPath=%USERPROFILE%\\java_error_in___product_uc__.hprof IDC_WINLAUNCHER=__IDE-NAME___LAUNCHER IDS_PROPS_ENV_VAR=__IDE-NAME___PROPERTIES IDS_VM_OPTIONS_ENV_VAR=__IDE-NAME__64_VM_OPTIONS IDS_ERROR_LAUNCHING_APP=Error launching __IDE-NAME__ -IDS_VM_OPTIONS=-Didea.paths.selector=__PRODUCT_PATHS_SELECTOR__ -XX:ErrorFile=%USERPROFILE%\\java_error_in___product_uc___%p.log -XX:HeapDumpPath=%USERPROFILE%\\java_error_in___product_uc__.hprof -Didea.jre.check=true +IDS_VM_OPTIONS=-Didea.paths.selector=__PRODUCT_PATHS_SELECTOR__ -Didea.jre.check=true diff --git a/native/WinLauncher/WinLauncher/WinLauncher.cpp b/native/WinLauncher/WinLauncher/WinLauncher.cpp index 371eb1b65dd5..9399e9391b75 100644 --- a/native/WinLauncher/WinLauncher/WinLauncher.cpp +++ b/native/WinLauncher/WinLauncher/WinLauncher.cpp @@ -430,16 +430,22 @@ bool FindValidVMOptions(std::vector files, std::wstring& used, std return false; } -void AddPredefinedVMOptions(std::vector& vmOptionLines) -{ +std::string getVMOption(int resource){ TCHAR buffer[_MAX_PATH]; TCHAR copy[_MAX_PATH]; - if (LoadString(hInst, IDS_VM_OPTIONS, buffer, _MAX_PATH)) + std::string vmOption = ""; + if (LoadString(hInst, resource, buffer, _MAX_PATH)) { ExpandEnvironmentStrings(buffer, copy, _MAX_PATH); + std::wstring module(copy); + vmOption = std::string(module.begin(), module.end()); } - std::wstring module(copy); - std::string vmOptions(module.begin(), module.end()); + return vmOption; +} + +void AddPredefinedVMOptions(std::vector& vmOptionLines) +{ + std::string vmOptions = LoadStdString(IDS_VM_OPTIONS); while (vmOptions.size() > 0) { int pos = vmOptions.find(' '); @@ -449,6 +455,11 @@ void AddPredefinedVMOptions(std::vector& vmOptionLines) vmOptions = vmOptions.substr(pos); } + std::string errorFile = getVMOption(IDS_VM_OPTION_ERRORFILE); + std::string heapDumpPath = getVMOption(IDS_VM_OPTION_HEAPDUMPPATH); + if (errorFile != "") vmOptionLines.push_back(errorFile); + if (heapDumpPath != "") vmOptionLines.push_back(heapDumpPath); + char propertiesFile[_MAX_PATH]; if (GetEnvironmentVariableA(LoadStdString(IDS_PROPS_ENV_VAR).c_str(), propertiesFile, _MAX_PATH)) { diff --git a/native/WinLauncher/WinLauncher/WinLauncher.rc b/native/WinLauncher/WinLauncher/WinLauncher.rc index 790907fb14a4..189f5df50f5f 100644 --- a/native/WinLauncher/WinLauncher/WinLauncher.rc +++ b/native/WinLauncher/WinLauncher/WinLauncher.rc @@ -140,6 +140,8 @@ BEGIN IDS_APP_TITLE "WinLauncher" IDS_JDK_ENV_VAR "IDEA_JDK" IDS_VM_OPTIONS_PATH "%USERPROFILE%\\.__PRODUCT_PATHS_SELECTOR__" + IDS_VM_OPTION_ERRORFILE "-XX:ErrorFile=%USERPROFILE%\\java_error_in___product_uc___%p.log" + IDS_VM_OPTION_HEAPDUMPPATH "-XX:HeapDumpPath=%USERPROFILE%\\java_error_in___product_uc__.hprof" IDS_MAIN_CLASS "com/intellij/idea/Main" IDS_CLASSPATH_LIBS "bootstrap.jar;extensions.jar;util.jar;jdom.jar;log4j.jar;trove4j.jar;jna.jar" IDS_JDK_ONLY "true" diff --git a/native/WinLauncher/WinLauncher/resource.h b/native/WinLauncher/WinLauncher/resource.h index 61721ab3e70d..ea739f444652 100644 --- a/native/WinLauncher/WinLauncher/resource.h +++ b/native/WinLauncher/WinLauncher/resource.h @@ -19,6 +19,8 @@ #define IDS_PROPS_ENV_VAR 112 #define IDS_VM_OPTIONS_ENV_VAR 113 #define IDS_ERROR_LAUNCHING_APP 114 +#define IDS_VM_OPTION_ERRORFILE 115 +#define IDS_VM_OPTION_HEAPDUMPPATH 116 #define IDR_MAINFRAME 128 #define IDS_VM_OPTIONS 129 #define IDB_BITMAP1 130 diff --git a/python/build/pycharm64_community_launcher.properties b/python/build/pycharm64_community_launcher.properties index ea2fd825c3c6..3453c65d52e6 100644 --- a/python/build/pycharm64_community_launcher.properties +++ b/python/build/pycharm64_community_launcher.properties @@ -2,8 +2,10 @@ IDS_JDK_ENV_VAR=PYCHARM_JDK_64 IDS_JDK_ONLY=true IDS_APP_TITLE=__IDE-NAME__ Launcher IDS_VM_OPTIONS_PATH=%USERPROFILE%\\.__PRODUCT_PATHS_SELECTOR__ +IDS_VM_OPTION_ERRORFILE=-XX:ErrorFile=%USERPROFILE%\\java_error_in___product_uc___%p.log +IDS_VM_OPTION_HEAPDUMPPATH=-XX:HeapDumpPath=%USERPROFILE%\\java_error_in___product_uc__.hprof IDC_WINLAUNCHER=__IDE-NAME___LAUNCHER IDS_PROPS_ENV_VAR=__IDE-NAME___PROPERTIES IDS_VM_OPTIONS_ENV_VAR=__IDE-NAME__64_VM_OPTIONS IDS_ERROR_LAUNCHING_APP=Error launching __IDE-NAME__ -IDS_VM_OPTIONS=-Didea.platform.prefix=PyCharmCore -Didea.paths.selector=__PRODUCT_PATHS_SELECTOR__ -XX:ErrorFile=%USERPROFILE%\\java_error_in___product_uc___%p.log -XX:HeapDumpPath=%USERPROFILE%\\java_error_in___product_uc__.hprof +IDS_VM_OPTIONS=-Didea.platform.prefix=PyCharmCore -Didea.paths.selector=__PRODUCT_PATHS_SELECTOR__ diff --git a/python/build/pycharm_community_launcher.properties b/python/build/pycharm_community_launcher.properties index c43457f9edd3..83de195036d8 100644 --- a/python/build/pycharm_community_launcher.properties +++ b/python/build/pycharm_community_launcher.properties @@ -2,8 +2,10 @@ IDS_JDK_ENV_VAR=PYCHARM_JDK IDS_JDK_ONLY=false IDS_APP_TITLE=__IDE-NAME__ Launcher IDS_VM_OPTIONS_PATH=%USERPROFILE%\\.__PRODUCT_PATHS_SELECTOR__ +IDS_VM_OPTION_ERRORFILE=-XX:ErrorFile=%USERPROFILE%\\java_error_in___product_uc___%p.log +IDS_VM_OPTION_HEAPDUMPPATH=-XX:HeapDumpPath=%USERPROFILE%\\java_error_in___product_uc__.hprof IDC_WINLAUNCHER=__IDE-NAME___LAUNCHER IDS_PROPS_ENV_VAR=__IDE-NAME___PROPERTIES IDS_VM_OPTIONS_ENV_VAR=__IDE-NAME___VM_OPTIONS IDS_ERROR_LAUNCHING_APP=Error launching __IDE-NAME__ -IDS_VM_OPTIONS=-Didea.platform.prefix=PyCharmCore -Didea.paths.selector=__PRODUCT_PATHS_SELECTOR__ -XX:ErrorFile=%USERPROFILE%\\java_error_in___product_uc___%p.log -XX:HeapDumpPath=%USERPROFILE%\\java_error_in___product_uc__.hprof +IDS_VM_OPTIONS=-Didea.platform.prefix=PyCharmCore -Didea.paths.selector=__PRODUCT_PATHS_SELECTOR__ diff --git a/python/educational-python/build/pycharm_edu_launcher.properties b/python/educational-python/build/pycharm_edu_launcher.properties index 79b973202a74..587b5f499e4a 100644 --- a/python/educational-python/build/pycharm_edu_launcher.properties +++ b/python/educational-python/build/pycharm_edu_launcher.properties @@ -2,8 +2,10 @@ IDS_JDK_ENV_VAR=PYCHARM_JDK IDS_JDK_ONLY=false IDS_APP_TITLE=__IDE-NAME__ Launcher IDS_VM_OPTIONS_PATH=%USERPROFILE%\\.__PRODUCT_PATHS_SELECTOR__ +IDS_VM_OPTION_ERRORFILE=-XX:ErrorFile=%USERPROFILE%\\java_error_in___product_uc___%p.log +IDS_VM_OPTION_HEAPDUMPPATH=-XX:HeapDumpPath=%USERPROFILE%\\java_error_in___product_uc__.hprof IDC_WINLAUNCHER=__IDE-NAME___LAUNCHER IDS_PROPS_ENV_VAR=__IDE-NAME___PROPERTIES IDS_VM_OPTIONS_ENV_VAR=__IDE-NAME___VM_OPTIONS IDS_ERROR_LAUNCHING_APP=Error launching __IDE-NAME__ -IDS_VM_OPTIONS=-Didea.platform.prefix=PyCharmEdu -Didea.paths.selector=__PRODUCT_PATHS_SELECTOR__ -XX:ErrorFile=%USERPROFILE%\\java_error_in___product_uc___%p.log -XX:HeapDumpPath=%USERPROFILE%\\java_error_in___product_uc__.hprof +IDS_VM_OPTIONS=-Didea.platform.prefix=PyCharmEdu -Didea.paths.selector=__PRODUCT_PATHS_SELECTOR__