summaryrefslogtreecommitdiff
path: root/src/sanitychecks.cpp
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2020-04-17 10:31:47 -0400
committerGitHub <noreply@github.com>2020-04-17 10:31:47 -0400
commit855650215f5011082f6a3fa4dcfb69b040367911 (patch)
treec744c49d7c62c1051c99a12b793377ae40113e1f /src/sanitychecks.cpp
parentff912b5f6199ade55a4eaff1c8e7eefb8145c970 (diff)
parent21166f820bc793111ad40a950807dc84e961fad5 (diff)
Merge pull request #1054 from isanae/bunch-of-fixes
Bunch of fixes
Diffstat (limited to 'src/sanitychecks.cpp')
-rw-r--r--src/sanitychecks.cpp72
1 files changed, 55 insertions, 17 deletions
diff --git a/src/sanitychecks.cpp b/src/sanitychecks.cpp
index 6da42e79..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<QString, QString> 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<QString, QString> 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");
@@ -268,28 +311,23 @@ std::vector<std::pair<QString, QString>> getSystemDirectories()
{
// folder ids and display names for logging
const std::vector<std::pair<GUID, QString>> 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<std::pair<QString, QString>> 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 +344,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);