diff options
Diffstat (limited to 'src/shared/skyriminfo.cpp')
| -rw-r--r-- | src/shared/skyriminfo.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/shared/skyriminfo.cpp b/src/shared/skyriminfo.cpp index 6302cef3..26395e67 100644 --- a/src/shared/skyriminfo.cpp +++ b/src/shared/skyriminfo.cpp @@ -27,6 +27,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. #include "error_report.h"
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
+#include <Shlwapi.h>
#include <boost/assign.hpp>
namespace MOShared {
@@ -36,6 +37,11 @@ SkyrimInfo::SkyrimInfo(const std::wstring &omoDirectory, const std::wstring &gam : GameInfo(omoDirectory, gameDirectory)
{
identifyMyGamesDirectory(L"skyrim");
+
+ wchar_t appDataPath[MAX_PATH];
+ if (SUCCEEDED(SHGetFolderPathW(NULL, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, appDataPath))) {
+ m_AppData = appDataPath;
+ }
}
bool SkyrimInfo::identifyGame(const std::wstring &searchPath)
@@ -258,8 +264,12 @@ bool SkyrimInfo::rerouteToProfile(const wchar_t *fileName, const wchar_t *fullPa }
}
+if (_wcsicmp(fileName, L"plugins.txt") == 0) {
+ log("plugins.txt expected in \"%ls\", got \"%ls\"", m_AppData.c_str(), fullPath);
+}
+
if ((_wcsicmp(fileName, L"plugins.txt") == 0) &&
- (wcsstr(fullPath, L"AppData") != NULL)){
+ (m_AppData.empty() || (StrStrIW(fullPath, m_AppData.c_str()) != NULL))) {
return true;
}
|
