fix: fix unicode issue with JavaChecker on Windows
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
parent
1a26a53659
commit
c0bf267bae
@ -202,12 +202,12 @@ QList<JavaInstallPtr> JavaUtils::FindJavaFromRegistryKey(DWORD keyType, QString
|
|||||||
{
|
{
|
||||||
// Read the current type version from the registry.
|
// Read the current type version from the registry.
|
||||||
// This will be used to find any key that contains the JavaHome value.
|
// This will be used to find any key that contains the JavaHome value.
|
||||||
char *value = new char[0];
|
TCHAR *value = new TCHAR[0];
|
||||||
DWORD valueSz = 0;
|
DWORD valueSz = 0;
|
||||||
if (RegQueryValueExW(jreKey, L"CurrentVersion", NULL, NULL, (BYTE *)value, &valueSz) ==
|
if (RegQueryValueExW(jreKey, L"CurrentVersion", NULL, NULL, (BYTE *)value, &valueSz) ==
|
||||||
ERROR_MORE_DATA)
|
ERROR_MORE_DATA)
|
||||||
{
|
{
|
||||||
value = new char[valueSz];
|
value = new TCHAR[valueSz];
|
||||||
RegQueryValueExW(jreKey, L"CurrentVersion", NULL, NULL, (BYTE *)value, &valueSz);
|
RegQueryValueExW(jreKey, L"CurrentVersion", NULL, NULL, (BYTE *)value, &valueSz);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,22 +237,24 @@ QList<JavaInstallPtr> JavaUtils::FindJavaFromRegistryKey(DWORD keyType, QString
|
|||||||
KEY_READ | KEY_WOW64_64KEY, &newKey) == ERROR_SUCCESS)
|
KEY_READ | KEY_WOW64_64KEY, &newKey) == ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
// Read the JavaHome value to find where Java is installed.
|
// Read the JavaHome value to find where Java is installed.
|
||||||
value = new char[0];
|
value = new TCHAR[0];
|
||||||
valueSz = 0;
|
valueSz = 0;
|
||||||
if (RegQueryValueExW(newKey, keyJavaDir.toStdWString().c_str(), NULL, NULL, (BYTE *)value,
|
if (RegQueryValueExW(newKey, keyJavaDir.toStdWString().c_str(), NULL, NULL, (BYTE *)value,
|
||||||
&valueSz) == ERROR_MORE_DATA)
|
&valueSz) == ERROR_MORE_DATA)
|
||||||
{
|
{
|
||||||
value = new char[valueSz];
|
value = new TCHAR[valueSz];
|
||||||
RegQueryValueExW(newKey, keyJavaDir.toStdWString().c_str(), NULL, NULL, (BYTE *)value,
|
RegQueryValueExW(newKey, keyJavaDir.toStdWString().c_str(), NULL, NULL, (BYTE *)value,
|
||||||
&valueSz);
|
&valueSz);
|
||||||
|
|
||||||
|
QString newValue = QString::fromWCharArray(value);
|
||||||
|
|
||||||
// Now, we construct the version object and add it to the list.
|
// Now, we construct the version object and add it to the list.
|
||||||
JavaInstallPtr javaVersion(new JavaInstall());
|
JavaInstallPtr javaVersion(new JavaInstall());
|
||||||
|
|
||||||
javaVersion->id = newSubkeyName;
|
javaVersion->id = newSubkeyName;
|
||||||
javaVersion->arch = archType;
|
javaVersion->arch = archType;
|
||||||
javaVersion->path =
|
javaVersion->path =
|
||||||
QDir(FS::PathCombine(value, "bin")).absoluteFilePath("javaw.exe");
|
QDir(FS::PathCombine(newValue, "bin")).absoluteFilePath("javaw.exe");
|
||||||
javas.append(javaVersion);
|
javas.append(javaVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user