diff options
| author | Tannin <devnull@localhost> | 2015-01-11 11:28:02 +0100 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2015-01-11 11:28:02 +0100 |
| commit | 30c016567fef14460867155d80bd9af05575af81 (patch) | |
| tree | 7fd6763684e6dfd4d422aa3aaaaeeaaa43b3615b /src/mainwindow.cpp | |
| parent | da27ec45da02bcb49e7eb9783f78820b6b54cae5 (diff) | |
bugfix: first attempt at discovering java binary always failed
Diffstat (limited to 'src/mainwindow.cpp')
| -rw-r--r-- | src/mainwindow.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 63598d27..6bb77a79 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -4547,14 +4547,15 @@ int MainWindow::getBinaryExecuteInfo(const QFileInfo &targetInfo, QFileInfo &bin WCHAR buffer[MAX_PATH]; if (::FindExecutableW(targetPathW.c_str(), NULL, buffer) > (HINSTANCE)32) { DWORD binaryType = 0UL; - if (!::GetBinaryTypeW(targetPathW.c_str(), &binaryType)) { - qDebug("failed to determine binary type of \"%ls\": %lu", targetPathW.c_str(), ::GetLastError()); + if (!::GetBinaryTypeW(buffer, &binaryType)) { + qDebug("failed to determine binary type of \"%ls\": %lu", buffer, ::GetLastError()); } else if (binaryType == SCS_32BIT_BINARY) { binaryPath = ToQString(buffer); } } } if (binaryPath.isEmpty() && (extension == "jar")) { + // second attempt: look to the registry QSettings javaReg("HKEY_LOCAL_MACHINE\\Software\\JavaSoft\\Java Runtime Environment", QSettings::NativeFormat); if (javaReg.contains("CurrentVersion")) { QString currentVersion = javaReg.value("CurrentVersion").toString(); |
