diff --git a/bin/WinLauncher/WinLauncher.exe b/bin/WinLauncher/WinLauncher.exe index ec7b3edf4c1b..ae38036efcde 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 1e2f0331938f..8bb8a862c4b2 100644 Binary files a/bin/WinLauncher/WinLauncher64.exe and b/bin/WinLauncher/WinLauncher64.exe differ diff --git a/native/WinLauncher/WinLauncher/WinLauncher.cpp b/native/WinLauncher/WinLauncher/WinLauncher.cpp index 257e42ce479d..564cb44c64f0 100644 --- a/native/WinLauncher/WinLauncher/WinLauncher.cpp +++ b/native/WinLauncher/WinLauncher/WinLauncher.cpp @@ -1,5 +1,5 @@ /* -* Copyright 2000-2013 JetBrains s.r.o. +* Copyright 2000-2017 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -532,6 +532,7 @@ bool LoadJVMLibrary() { std::string dllName(jvmPath); std::string binDir = dllName + "\\bin"; + TCHAR currentDir[MAX_PATH]; std::string serverDllName = binDir + "\\server\\jvm.dll"; std::string clientDllName = binDir + "\\client\\jvm.dll"; if ((bServerJVM && FileExists(serverDllName)) || !FileExists(clientDllName)) @@ -544,12 +545,14 @@ bool LoadJVMLibrary() } // ensure we can find msvcr100.dll which is located in jre/bin directory; jvm.dll depends on it. + GetCurrentDirectory(sizeof(currentDir),currentDir); SetCurrentDirectoryA(binDir.c_str()); hJVM = LoadLibraryA(dllName.c_str()); if (hJVM) { pCreateJavaVM = (JNI_createJavaVM) GetProcAddress(hJVM, "JNI_CreateJavaVM"); } + SetCurrentDirectory(currentDir); if (!pCreateJavaVM) { std::string jvmError = "Failed to load JVM DLL ";