summaryrefslogtreecommitdiffstats
path: root/api/logic/minecraft
diff options
context:
space:
mode:
Diffstat (limited to 'api/logic/minecraft')
-rw-r--r--api/logic/minecraft/launch/DirectJavaLaunch.cpp11
-rw-r--r--api/logic/minecraft/launch/LauncherPartLaunch.cpp11
2 files changed, 14 insertions, 8 deletions
diff --git a/api/logic/minecraft/launch/DirectJavaLaunch.cpp b/api/logic/minecraft/launch/DirectJavaLaunch.cpp
index d82d9ff2..07dbb86c 100644
--- a/api/logic/minecraft/launch/DirectJavaLaunch.cpp
+++ b/api/logic/minecraft/launch/DirectJavaLaunch.cpp
@@ -17,6 +17,7 @@
#include <launch/LaunchTask.h>
#include <minecraft/MinecraftInstance.h>
#include <FileSystem.h>
+#include <Commandline.h>
#include <QStandardPaths>
DirectJavaLaunch::DirectJavaLaunch(LaunchTask *parent) : LaunchStep(parent)
@@ -57,9 +58,11 @@ void DirectJavaLaunch::executeTask()
auto mcArgs = minecraftInstance->processMinecraftArgs(m_session);
args.append(mcArgs);
- QString wrapperCommand = instance->getWrapperCommand();
- if(!wrapperCommand.isEmpty())
+ QString wrapperCommandStr = instance->getWrapperCommand().trimmed();
+ if(!wrapperCommandStr.isEmpty())
{
+ auto wrapperArgs = Commandline::splitArgs(wrapperCommandStr);
+ auto wrapperCommand = wrapperArgs.takeFirst();
auto realWrapperCommand = QStandardPaths::findExecutable(wrapperCommand);
if (realWrapperCommand.isEmpty())
{
@@ -68,9 +71,9 @@ void DirectJavaLaunch::executeTask()
emitFailed(reason);
return;
}
- emit logLine("Wrapper command is:\n" + wrapperCommand + "\n\n", MessageLevel::MultiMC);
+ emit logLine("Wrapper command is:\n" + wrapperCommandStr + "\n\n", MessageLevel::MultiMC);
args.prepend(javaPath);
- m_process.start(wrapperCommand, args);
+ m_process.start(wrapperCommand, wrapperArgs + args);
}
else
{
diff --git a/api/logic/minecraft/launch/LauncherPartLaunch.cpp b/api/logic/minecraft/launch/LauncherPartLaunch.cpp
index d9441e56..b641968c 100644
--- a/api/logic/minecraft/launch/LauncherPartLaunch.cpp
+++ b/api/logic/minecraft/launch/LauncherPartLaunch.cpp
@@ -18,6 +18,7 @@
#include <launch/LaunchTask.h>
#include <minecraft/MinecraftInstance.h>
#include <FileSystem.h>
+#include <Commandline.h>
#include <QStandardPaths>
#include "Env.h"
@@ -46,9 +47,11 @@ void LauncherPartLaunch::executeTask()
args << "-jar" << FS::PathCombine(ENV.getJarsPath(), "NewLaunch.jar");
- QString wrapperCommand = instance->getWrapperCommand();
- if(!wrapperCommand.isEmpty())
+ QString wrapperCommandStr = instance->getWrapperCommand().trimmed();
+ if(!wrapperCommandStr.isEmpty())
{
+ auto wrapperArgs = Commandline::splitArgs(wrapperCommandStr);
+ auto wrapperCommand = wrapperArgs.takeFirst();
auto realWrapperCommand = QStandardPaths::findExecutable(wrapperCommand);
if (realWrapperCommand.isEmpty())
{
@@ -57,9 +60,9 @@ void LauncherPartLaunch::executeTask()
emitFailed(reason);
return;
}
- emit logLine("Wrapper command is:\n" + wrapperCommand + "\n\n", MessageLevel::MultiMC);
+ emit logLine("Wrapper command is:\n" + wrapperCommandStr + "\n\n", MessageLevel::MultiMC);
args.prepend(javaPath);
- m_process.start(wrapperCommand, args);
+ m_process.start(wrapperCommand, wrapperArgs + args);
}
else
{