mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 09:19:13 +07:00
exe launchers: fixed the case when folder jre\bin was locked.
It prevented updating the folder during patches.
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -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 ";
|
||||
|
||||
Reference in New Issue
Block a user