diff --git a/bin/WinLauncher/WinLauncher.exe b/bin/WinLauncher/WinLauncher.exe
index 3f1317cddac5..1a8c9effc739 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 6bcb49a9be53..a324ccae5842 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 bb8259af9757..c1d1e232aaf6 100644
--- a/build/conf/ideaCE-launcher.properties
+++ b/build/conf/ideaCE-launcher.properties
@@ -5,4 +5,4 @@ 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__ -Didea.jre.check=true
+IDS_VM_OPTIONS=-Didea.paths.selector=__PRODUCT_PATHS_SELECTOR__ -XX:ErrorFile=%USERPROFILE%\\.__PRODUCT_PATHS_SELECTOR__\\java_error_in___product_uc___%p.log -XX:HeapDumpPath=%USERPROFILE%\\.__PRODUCT_PATHS_SELECTOR__\\java_error_in___product_uc__.hprof -Didea.jre.check=true
diff --git a/build/conf/ideaCE64-launcher.properties b/build/conf/ideaCE64-launcher.properties
index ba9686fa0fbf..088632bdcbff 100644
--- a/build/conf/ideaCE64-launcher.properties
+++ b/build/conf/ideaCE64-launcher.properties
@@ -6,4 +6,4 @@ 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__ -Didea.jre.check=true
+IDS_VM_OPTIONS=-Didea.paths.selector=__PRODUCT_PATHS_SELECTOR__ -XX:ErrorFile=%USERPROFILE%\\.__PRODUCT_PATHS_SELECTOR__\\java_error_in___product_uc___%p.log -XX:HeapDumpPath=%USERPROFILE%\\.__PRODUCT_PATHS_SELECTOR__\\java_error_in___product_uc__.hprof -Didea.jre.check=true
diff --git a/build/conf/mac/Contents/Info.plist b/build/conf/mac/Contents/Info.plist
index 1354f7cf8e50..1cf26d55a816 100644
--- a/build/conf/mac/Contents/Info.plist
+++ b/build/conf/mac/Contents/Info.plist
@@ -87,7 +87,7 @@
VMOptions
- @@vmoptions@@ -Xbootclasspath/a:../lib/boot.jar
+ @@vmoptions@@ -XX:ErrorFile=$USER_HOME/@@idea.paths.selector@@/java_error_in_@@executable@@_%p.log -XX:HeapDumpPath=$USER_HOME/@@idea.paths.selector@@/java_error_in_@@executable@@.hprof -Xbootclasspath/a:../lib/boot.jar
WorkingDirectory
$APP_PACKAGE/Contents/bin
diff --git a/native/WinLauncher/WinLauncher/WinLauncher.cpp b/native/WinLauncher/WinLauncher/WinLauncher.cpp
index af7a8fb266d4..371eb1b65dd5 100644
--- a/native/WinLauncher/WinLauncher/WinLauncher.cpp
+++ b/native/WinLauncher/WinLauncher/WinLauncher.cpp
@@ -432,7 +432,14 @@ bool FindValidVMOptions(std::vector files, std::wstring& used, std
void AddPredefinedVMOptions(std::vector& vmOptionLines)
{
- std::string vmOptions = LoadStdString(IDS_VM_OPTIONS);
+ TCHAR buffer[_MAX_PATH];
+ TCHAR copy[_MAX_PATH];
+ if (LoadString(hInst, IDS_VM_OPTIONS, buffer, _MAX_PATH))
+ {
+ ExpandEnvironmentStrings(buffer, copy, _MAX_PATH);
+ }
+ std::wstring module(copy);
+ std::string vmOptions(module.begin(), module.end());
while (vmOptions.size() > 0)
{
int pos = vmOptions.find(' ');