From 81b37dae1839cd2daabbe18404a5dbe0c7292f35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Thu, 21 May 2015 23:25:16 +0200 Subject: GH-977 possibly fix FTB on windows. Maybe. Partially. --- logic/ftb/FTBPlugin.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'logic/ftb') 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 { -- cgit v1.2.3