java implementation and downloading

This commit is contained in:
2026-08-27 19:35:11 +03:00
parent 08e0dc4965
commit dddc0261d4
14 changed files with 2907 additions and 10 deletions
+10
View File
@@ -1,5 +1,7 @@
#include "javalocator.h"
#include "javaruntime.h"
#include <QDir>
#include <QDirIterator>
#include <QFileInfo>
@@ -72,6 +74,14 @@ QStringList JavaLocator::findAll(const QString &gameDir)
{
QStringList result;
// 0. Сборки, скачанные самим лаунчером. Идут первыми: пользователь выбирал
// их осознанно, в отличие от того, что нашлось в системе.
const QList<InstalledJavaRuntime> managed = JavaRuntimeStore::installed();
for (const InstalledJavaRuntime &entry : managed) {
if (!result.contains(entry.javaPath))
result << entry.javaPath;
}
// 1. Рантайм, скачанный самим Minecraft: .minecraft/runtime/<component>/<os>/<component>/bin
const QString runtime = gameDir + QStringLiteral("/runtime");
if (QDir(runtime).exists()) {