summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--MultiMC.cpp17
2 files changed, 17 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 2ef0d673..d49ca85b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,6 +13,8 @@ MultiMC5.kdev4
MultiMC.pro.user
CMakeLists.txt.user
CMakeLists.txt.user.*
+/.project
+/.settings
# Build dirs
build
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");