diff options
author | Petr Mrázek <peterix@gmail.com> | 2014-03-09 23:59:47 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-03-09 23:59:47 +0100 |
commit | df89183c10a4cb1d442094d5329beb0d724c720b (patch) | |
tree | 50fcef75b77c2ba29fa58b4fd18eb3f45f33ccfa /MultiMC.cpp | |
parent | d18b97ae3dc05fdf6ea1793ea06ecad52c28f5e2 (diff) | |
parent | 96ee20072f4e20e279089c6b6e8de63d2da1f94e (diff) | |
download | MultiMC-df89183c10a4cb1d442094d5329beb0d724c720b.tar MultiMC-df89183c10a4cb1d442094d5329beb0d724c720b.tar.gz MultiMC-df89183c10a4cb1d442094d5329beb0d724c720b.tar.lz MultiMC-df89183c10a4cb1d442094d5329beb0d724c720b.tar.xz MultiMC-df89183c10a4cb1d442094d5329beb0d724c720b.zip |
Merge remote-tracking branch 'origin/fix_ftb_again' into integration_butchery
Diffstat (limited to 'MultiMC.cpp')
-rw-r--r-- | MultiMC.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/MultiMC.cpp b/MultiMC.cpp index ddb264d1..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"); |