Fixed windows bundled java path

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
(cherry picked from commit 5ae98f4f90)
This commit is contained in:
Trial97 2024-04-24 15:49:05 +03:00 committed by github-actions[bot]
parent 4cd6ac5fe5
commit c74099ec7b

View File

@ -449,13 +449,13 @@ QStringList getMinecraftJavaBundle()
executable += "w.exe"; executable += "w.exe";
auto appDataPath = QProcessEnvironment::systemEnvironment().value("APPDATA", ""); auto appDataPath = QProcessEnvironment::systemEnvironment().value("APPDATA", "");
processpaths << FS::PathCombine(QFileInfo(appDataPath).absolutePath(), ".minecraft", "runtime"); processpaths << FS::PathCombine(QFileInfo(appDataPath).absoluteFilePath(), ".minecraft", "runtime");
// add the microsoft store version of the launcher to the search. the current path is: // add the microsoft store version of the launcher to the search. the current path is:
// C:\Users\USERNAME\AppData\Local\Packages\Microsoft.4297127D64EC6_8wekyb3d8bbwe\LocalCache\Local\runtime // C:\Users\USERNAME\AppData\Local\Packages\Microsoft.4297127D64EC6_8wekyb3d8bbwe\LocalCache\Local\runtime
auto localAppDataPath = QProcessEnvironment::systemEnvironment().value("LOCALAPPDATA", ""); auto localAppDataPath = QProcessEnvironment::systemEnvironment().value("LOCALAPPDATA", "");
auto minecraftMSStorePath = auto minecraftMSStorePath =
FS::PathCombine(QFileInfo(localAppDataPath).absolutePath(), "Packages", "Microsoft.4297127D64EC6_8wekyb3d8bbwe"); FS::PathCombine(QFileInfo(localAppDataPath).absoluteFilePath(), "Packages", "Microsoft.4297127D64EC6_8wekyb3d8bbwe");
processpaths << FS::PathCombine(minecraftMSStorePath, "LocalCache", "Local", "runtime"); processpaths << FS::PathCombine(minecraftMSStorePath, "LocalCache", "Local", "runtime");
#else #else
processpaths << FS::PathCombine(QDir::homePath(), ".minecraft", "runtime"); processpaths << FS::PathCombine(QDir::homePath(), ".minecraft", "runtime");