diff options
author | Petr Mrázek <peterix@gmail.com> | 2015-05-21 23:25:16 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2015-05-21 23:25:16 +0200 |
commit | 81b37dae1839cd2daabbe18404a5dbe0c7292f35 (patch) | |
tree | c185c5f0a8f45095bcfda83079de0a181bb62ad4 /logic/ftb | |
parent | 29ce36c7bc2238cfed55eb81d439f030072beaad (diff) | |
download | MultiMC-81b37dae1839cd2daabbe18404a5dbe0c7292f35.tar MultiMC-81b37dae1839cd2daabbe18404a5dbe0c7292f35.tar.gz MultiMC-81b37dae1839cd2daabbe18404a5dbe0c7292f35.tar.lz MultiMC-81b37dae1839cd2daabbe18404a5dbe0c7292f35.tar.xz MultiMC-81b37dae1839cd2daabbe18404a5dbe0c7292f35.zip |
GH-977 possibly fix FTB on windows. Maybe. Partially.
Diffstat (limited to 'logic/ftb')
-rw-r--r-- | logic/ftb/FTBPlugin.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/logic/ftb/FTBPlugin.cpp b/logic/ftb/FTBPlugin.cpp index 88f6e793..b30fc378 100644 --- a/logic/ftb/FTBPlugin.cpp +++ b/logic/ftb/FTBPlugin.cpp @@ -282,8 +282,16 @@ void FTBPlugin::initialize(SettingsObjectPtr globalSettings) QString ftbDefault, newFtbDefault, oldFtbDefault; if (!GetEnvironmentVariableW(L"LOCALAPPDATA", newBuf, APPDATA_BUFFER_SIZE)) { - qCritical() << "Your LOCALAPPDATA folder is missing! If you are on windows, this means " - "your system is broken."; + if(!GetEnvironmentVariableW(L"USERPROFILE", newBuf, APPDATA_BUFFER_SIZE)) + { + qCritical() << "Your LOCALAPPDATA folder is missing! If you are on windows, this means your system is broken."; + } + else + { + auto userHome = QString::fromWCharArray(newBuf); + auto localAppData = PathCombine(QString::fromWCharArray(newBuf), "Local Settings", "Application Data"); + newFtbDefault = QDir(localAppData).absoluteFilePath("ftblauncher"); + } } else { |