From 52c7a6a181e0028e318b8ce6433fb577f7bbecad Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Fri, 17 Apr 2020 09:14:24 -0400 Subject: added directory checks for desktop and onedrive --- src/sanitychecks.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'src/sanitychecks.cpp') diff --git a/src/sanitychecks.cpp b/src/sanitychecks.cpp index 6da42e79..3372f81c 100644 --- a/src/sanitychecks.cpp +++ b/src/sanitychecks.cpp @@ -268,28 +268,23 @@ std::vector> getSystemDirectories() { // folder ids and display names for logging const std::vector> systemFolderIDs = { - {FOLDERID_ProgramFiles, "Program Files"}, - {FOLDERID_ProgramFilesX86, "Program Files"} + {FOLDERID_ProgramFiles, "in program files"}, + {FOLDERID_ProgramFilesX86, "in program files"}, + {FOLDERID_Desktop, "on the desktop"}, + {FOLDERID_OneDrive, "in OneDrive"} }; std::vector> systemDirs; for (auto&& p : systemFolderIDs) { - try - { - const auto dir = MOBase::getKnownFolder(p.first); - - auto path = QDir::toNativeSeparators(dir.absolutePath()).toLower(); + if (const auto dir=MOBase::getOptionalKnownFolder(p.first)) { + auto path = QDir::toNativeSeparators(dir->absolutePath()).toLower(); if (!path.endsWith("\\")) { path += "\\"; } systemDirs.push_back({path, p.second}); } - catch(std::exception&) - { - // ignore - } } return systemDirs; @@ -306,7 +301,7 @@ int checkProtected(const QDir& d, const QString& what) for (auto&& sd : systemDirs) { if (path.startsWith(sd.first)) { log::warn( - "{} is in {}; this may cause issues because it's a protected " + "{} is {}; this may cause issues because it's a special " "system folder", what, sd.second); -- cgit v1.3.1 From 77d292727b06841f07b4b3bc449655faff5f5d19 Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Fri, 17 Apr 2020 09:27:17 -0400 Subject: sanity checks: added nahimicmsiosd.dll, specialk64.dll and mactype64.dll --- src/sanitychecks.cpp | 53 +++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 48 insertions(+), 5 deletions(-) (limited to 'src/sanitychecks.cpp') diff --git a/src/sanitychecks.cpp b/src/sanitychecks.cpp index 3372f81c..5ccd7699 100644 --- a/src/sanitychecks.cpp +++ b/src/sanitychecks.cpp @@ -214,7 +214,7 @@ int checkMissingFiles() return n; } -int checkIncompatibleModule(const env::Module& m) +int checkBadOSDs(const env::Module& m) { // these dlls seems to interfere mostly with dialogs, like the mod info // dialog: it renders dialogs fully white and makes it impossible to interact @@ -224,11 +224,16 @@ int checkIncompatibleModule(const env::Module& m) // where it got loaded later, so this is also called every time a new module // is loaded into this process + const char* nahimic = + "Nahimic (also known as SonicSuite, SonicRadar, SteelSeries, etc.)"; + static const std::map names = { - {"NahimicOSD.dll", "Nahimic"}, - {"RTSSHooks64.dll", "RivaTuner Statistics Server"}, - {"SSAudioOSD.dll", "SteelSeries Audio"}, - {"SS3DevProps.dll", "Sonic Suite 3"} + {"NahimicOSD.dll", nahimic}, + {"nahimicmsiosd.dll", nahimic}, + {"RTSSHooks64.dll", "RivaTuner Statistics Server"}, + {"SSAudioOSD.dll", "SteelSeries Audio"}, + {"SS3DevProps.dll", "Sonic Suite 3"}, + {"specialk64.dll", "SpecialK"} }; const QFileInfo file(m.path()); @@ -251,6 +256,44 @@ int checkIncompatibleModule(const env::Module& m) return n; } +int checkUsvfsIncompatibilites(const env::Module& m) +{ + // these dlls seems to interfere with usvfs + + static const std::map names = { + {"mactype64.dll", "Mactype"} + }; + + const QFileInfo file(m.path()); + int n = 0; + + for (auto&& p : names) { + if (file.fileName().compare(p.first, Qt::CaseInsensitive) == 0) { + log::warn("{}", QObject::tr( + "%1 is loaded. This program is known to cause issues with " + "Mod Organizer and its virtual filesystem, such script extenders " + "refusing to run. Consider uninstalling it.") + .arg(p.second)); + + log::warn("{}", file.absoluteFilePath()); + + ++n; + } + } + + return n; +} + +int checkIncompatibleModule(const env::Module& m) +{ + int n = 0; + + n += checkBadOSDs(m); + n += checkUsvfsIncompatibilites(m); + + return n; +} + int checkIncompatibilities(const env::Environment& e) { log::debug(" . incompatibilities"); -- cgit v1.3.1