summaryrefslogtreecommitdiffstats
path: root/logic/ftb
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2015-05-21 23:25:16 +0200
committerPetr Mrázek <peterix@gmail.com>2015-05-21 23:25:16 +0200
commit81b37dae1839cd2daabbe18404a5dbe0c7292f35 (patch)
treec185c5f0a8f45095bcfda83079de0a181bb62ad4 /logic/ftb
parent29ce36c7bc2238cfed55eb81d439f030072beaad (diff)
downloadMultiMC-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.cpp12
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
{