diff options
author | Sefa Eyeoglu <contact@scrumplex.net> | 2022-06-14 22:00:24 +0200 |
---|---|---|
committer | Sefa Eyeoglu <contact@scrumplex.net> | 2022-07-03 17:31:01 +0200 |
commit | 474d77ac574c24918759413c2a77dc657e1e8581 (patch) | |
tree | d1a516863a97caec0443e949580017c8d9a91cc2 /launcher/minecraft/launch | |
parent | 412fdb0f7b363e91d4f4ef3e973f29ab2b5a3613 (diff) | |
download | PrismLauncher-474d77ac574c24918759413c2a77dc657e1e8581.tar.gz PrismLauncher-474d77ac574c24918759413c2a77dc657e1e8581.tar.bz2 PrismLauncher-474d77ac574c24918759413c2a77dc657e1e8581.zip |
feat: resolve JARs dynamically
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
Diffstat (limited to 'launcher/minecraft/launch')
-rw-r--r-- | launcher/minecraft/launch/LauncherPartLaunch.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/launcher/minecraft/launch/LauncherPartLaunch.cpp b/launcher/minecraft/launch/LauncherPartLaunch.cpp index fe8a1b1b..3ed5e957 100644 --- a/launcher/minecraft/launch/LauncherPartLaunch.cpp +++ b/launcher/minecraft/launch/LauncherPartLaunch.cpp @@ -92,6 +92,15 @@ bool fitsInLocal8bit(const QString & string) void LauncherPartLaunch::executeTask() { + QString jarPath = APPLICATION->getJarPath("NewLaunch.jar"); + if (jarPath.isEmpty()) + { + const char *reason = QT_TR_NOOP("Launcher library could not be found. Please check your installation."); + emit logLine(tr(reason), MessageLevel::Fatal); + emitFailed(tr(reason)); + return; + } + auto instance = m_parent->instance(); std::shared_ptr<MinecraftInstance> minecraftInstance = std::dynamic_pointer_cast<MinecraftInstance>(instance); @@ -108,7 +117,7 @@ void LauncherPartLaunch::executeTask() m_process.setDetachable(true); auto classPath = minecraftInstance->getClassPath(); - classPath.prepend(FS::PathCombine(APPLICATION->getJarsPath(), "NewLaunch.jar")); + classPath.prepend(jarPath); auto natPath = minecraftInstance->getNativePath(); #ifdef Q_OS_WIN |