summaryrefslogtreecommitdiffstats
path: root/MultiMC.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-12-29 01:13:57 +0100
committerPetr Mrázek <peterix@gmail.com>2013-12-29 01:13:57 +0100
commit997be947c9baa1499f708594d7a954d772ea99b7 (patch)
tree044518dd08f731f48e7f9f11aa36d10de3902874 /MultiMC.cpp
parent695ad1474e00a62b5afe19fb2b81974f584efeef (diff)
downloadMultiMC-997be947c9baa1499f708594d7a954d772ea99b7.tar
MultiMC-997be947c9baa1499f708594d7a954d772ea99b7.tar.gz
MultiMC-997be947c9baa1499f708594d7a954d772ea99b7.tar.lz
MultiMC-997be947c9baa1499f708594d7a954d772ea99b7.tar.xz
MultiMC-997be947c9baa1499f708594d7a954d772ea99b7.zip
Maybe break updater even more?
Diffstat (limited to 'MultiMC.cpp')
-rw-r--r--MultiMC.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/MultiMC.cpp b/MultiMC.cpp
index cf626fc7..71d0e5a7 100644
--- a/MultiMC.cpp
+++ b/MultiMC.cpp
@@ -32,6 +32,16 @@
#include <logger/QsLogDest.h>
#include "config.h"
+#ifdef WINDOWS
+#define UPDATER_BIN "updater.exe"
+#elif LINUX
+#define UPDATER_BIN "updater"
+#elif OSX
+#define UPDATER_BIN "updater"
+#else
+#error Unsupported operating system.
+#endif
+
using namespace Util::Commandline;
MultiMC::MultiMC(int &argc, char **argv, const QString &root)
@@ -432,6 +442,7 @@ void MultiMC::initHttpMetaCache()
m_metacache->addBase("libraries", QDir("libraries").absolutePath());
m_metacache->addBase("minecraftforge", QDir("mods/minecraftforge").absolutePath());
m_metacache->addBase("skins", QDir("accounts/skins").absolutePath());
+ m_metacache->addBase("root", QDir(".").absolutePath());
m_metacache->Load();
}
@@ -480,16 +491,6 @@ std::shared_ptr<JavaVersionList> MultiMC::javalist()
return m_javalist;
}
-#ifdef WINDOWS
-#define UPDATER_BIN "updater.exe"
-#elif LINUX
-#define UPDATER_BIN "updater"
-#elif OSX
-#define UPDATER_BIN "updater"
-#else
-#error Unsupported operating system.
-#endif
-
void MultiMC::installUpdates(const QString &updateFilesDir, bool restartOnFinish)
{
QLOG_INFO() << "Installing updates.";
@@ -527,8 +528,8 @@ void MultiMC::installUpdates(const QString &updateFilesDir, bool restartOnFinish
args << "--finish-cmd" << finishCmd;
QLOG_INFO() << "Running updater with command" << updaterBinary << args.join(" ");
+ QFile::setPermissions(updaterBinary, (QFileDevice::Permission) 0x7755);
- QFile::setPermissions(updaterBinary, (QFileDevice::Permission) 0755);
if(!QProcess::startDetached(updaterBinary, args))
{
QLOG_ERROR() << "Failed to start the updater process!";