summaryrefslogtreecommitdiffstats
path: root/logic/ftb
diff options
context:
space:
mode:
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
{