summaryrefslogtreecommitdiffstats
path: root/MultiMC.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'MultiMC.cpp')
-rw-r--r--MultiMC.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/MultiMC.cpp b/MultiMC.cpp
index a0745a87..f6e4e995 100644
--- a/MultiMC.cpp
+++ b/MultiMC.cpp
@@ -1,4 +1,3 @@
-
#include "MultiMC.h"
#include <iostream>
#include <QDir>
@@ -43,6 +42,11 @@
#include "logger/QsLog.h"
#include <logger/QsLogDest.h>
+#ifdef Q_OS_WIN32
+#include <windows.h>
+static const int APPDATA_BUFFER_SIZE = 1024;
+#endif
+
using namespace Util::Commandline;
MultiMC::MultiMC(int &argc, char **argv, bool root_override)
@@ -340,7 +344,16 @@ void MultiMC::initGlobalSettings()
#ifdef Q_OS_LINUX
QString ftbDefault = QDir::home().absoluteFilePath(".ftblauncher");
#elif defined(Q_OS_WIN32)
- QString ftbDefault = PathCombine(QStandardPaths::writableLocation(QStandardPaths::DataLocation), "/ftblauncher");
+ wchar_t buf[APPDATA_BUFFER_SIZE];
+ QString ftbDefault;
+ if(!GetEnvironmentVariableW(L"APPDATA", buf, APPDATA_BUFFER_SIZE))
+ {
+ QLOG_FATAL() << "Your APPDATA folder is missing! If you are on windows, this means your system is broken. If you aren't on windows, how the **** are you running the windows build????";
+ }
+ else
+ {
+ ftbDefault = PathCombine(QString::fromWCharArray(buf), "ftblauncher");
+ }
#elif defined(Q_OS_MAC)
QString ftbDefault =
PathCombine(QDir::homePath(), "Library/Application Support/ftblauncher");
@@ -457,6 +470,7 @@ void MultiMC::initHttpMetaCache()
m_metacache->addBase("versions", QDir("versions").absolutePath());
m_metacache->addBase("libraries", QDir("libraries").absolutePath());
m_metacache->addBase("minecraftforge", QDir("mods/minecraftforge").absolutePath());
+ m_metacache->addBase("liteloader", QDir("mods/liteloader").absolutePath());
m_metacache->addBase("skins", QDir("accounts/skins").absolutePath());
m_metacache->addBase("root", QDir(root()).absolutePath());
m_metacache->Load();