aboutsummaryrefslogtreecommitdiff
path: root/launcher/minecraft
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2022-07-06 17:40:09 +0200
committerGitHub <noreply@github.com>2022-07-06 17:40:09 +0200
commitf1902a44716201d9d6431cab762663cd749b58eb (patch)
tree4f952a91312804ab44cd12bb7db10b044eadce0c /launcher/minecraft
parent04b865adaec8f7af1a148e004c67c0483dbcc67b (diff)
parent474d77ac574c24918759413c2a77dc657e1e8581 (diff)
downloadPrismLauncher-f1902a44716201d9d6431cab762663cd749b58eb.tar.gz
PrismLauncher-f1902a44716201d9d6431cab762663cd749b58eb.tar.bz2
PrismLauncher-f1902a44716201d9d6431cab762663cd749b58eb.zip
Merge pull request #794 from Scrumplex/resolve-jars-dynamically
Diffstat (limited to 'launcher/minecraft')
-rw-r--r--launcher/minecraft/launch/LauncherPartLaunch.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/launcher/minecraft/launch/LauncherPartLaunch.cpp b/launcher/minecraft/launch/LauncherPartLaunch.cpp
index ea73ba60..9965ef89 100644
--- a/launcher/minecraft/launch/LauncherPartLaunch.cpp
+++ b/launcher/minecraft/launch/LauncherPartLaunch.cpp
@@ -96,6 +96,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);
@@ -112,7 +121,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