WIN32 specific Blacklisted libraries check:

1) Polished up wording of the error messages.
2) Made some messages in the SysInfo dialog localized.
3) Renamed LibraryCheck.cpp/hpp to BlacklistedLibraryCheck.cpp/hpp
4) CPPized the BlacklistedLibraryCheck WIN32 C code.
This commit is contained in:
Vojtech Bubnik 2021-07-30 15:52:43 +02:00
parent 64c8a6de8f
commit 2f6f1f0e55
5 changed files with 58 additions and 64 deletions

View file

@ -49,7 +49,7 @@
#include "libslic3r/Format/SL1.hpp"
#include "libslic3r/Utils.hpp"
#include "libslic3r/Thread.hpp"
#include "libslic3r/LibraryCheck.hpp"
#include "libslic3r/BlacklistedLibraryCheck.hpp"
#include "PrusaSlicer.hpp"
@ -622,13 +622,18 @@ bool CLI::setup(int argc, char **argv)
detect_platform();
#ifdef WIN32
// Notify user if blacklisted library is already loaded (Nahimic)
// If there are cases of no reports with blacklisted lib - this check should be performed later.
// Some libraries are loaded when we load libraries during startup.
if (LibraryCheck::get_instance().perform_check()) {
std::wstring text = L"Following libraries has been detected inside of the PrusaSlicer process."
L" We suggest stopping or uninstalling these services if you experience crashes or unexpected behaviour while using PrusaSlicer.\n\n";
text += LibraryCheck::get_instance().get_blacklisted_string();
// Notify user that a blacklisted DLL was injected into PrusaSlicer process (for example Nahimic, see GH #5573).
// We hope that if a DLL is being injected into a PrusaSlicer process, it happens at the very start of the application,
// thus we shall detect them now.
if (BlacklistedLibraryCheck::get_instance().perform_check()) {
std::wstring text = L"Following DLLs have been injected into the PrusaSlicer process:\n\n";
text += BlacklistedLibraryCheck::get_instance().get_blacklisted_string();
text += L"\n\n"
L"PrusaSlicer is known to not run correctly with these DLLs injected. "
L"We suggest stopping or uninstalling these services if you experience "
L"crashes or unexpected behaviour while using PrusaSlicer.\n"
L"For example, ASUS Sonic Studio injects a Nahimic driver, which makes PrusaSlicer "
L"to crash on a secondary monitor, see PrusaSlicer github issue #5573";
MessageBoxW(NULL, text.c_str(), L"Warning"/*L"Incopatible library found"*/, MB_OK);
}
#endif