summaryrefslogtreecommitdiff
path: root/native/WinLauncher/WinLauncher/WinLauncher.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'native/WinLauncher/WinLauncher/WinLauncher.cpp')
-rw-r--r--native/WinLauncher/WinLauncher/WinLauncher.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/native/WinLauncher/WinLauncher/WinLauncher.cpp b/native/WinLauncher/WinLauncher/WinLauncher.cpp
index 3249a9a1f0de..681cb46ae6aa 100644
--- a/native/WinLauncher/WinLauncher/WinLauncher.cpp
+++ b/native/WinLauncher/WinLauncher/WinLauncher.cpp
@@ -194,11 +194,16 @@ bool LocateJVM()
return result;
}
- std::string jreDir = GetAdjacentDir(need64BitJRE ? "jre64":"jre");
- if (FindValidJVM(jreDir.c_str()) && Is64BitJRE(jvmPath) == need64BitJRE)
- {
- return true;
- }
+
+ std::vector<std::string> jrePaths;
+ if(need64BitJRE) jrePaths.push_back(GetAdjacentDir("jre64"));
+ jrePaths.push_back(GetAdjacentDir("jre"));
+ for(std::vector<std::string>::iterator it = jrePaths.begin(); it != jrePaths.end(); ++it) {
+ if (FindValidJVM((*it).c_str()) && Is64BitJRE(jvmPath) == need64BitJRE)
+ {
+ return true;
+ }
+ }
if (FindJVMInRegistry())
{