Check loading of blacklisted dlls and show warning dialog at startup. Also show these dlls in sysinfo dialog.

This commit is contained in:
David Kocik 2021-01-27 10:39:39 +01:00
parent 4f161607c7
commit fa2568a5e3
11 changed files with 172 additions and 5 deletions

View file

@ -48,6 +48,7 @@
#include "libslic3r/Format/SL1.hpp"
#include "libslic3r/Utils.hpp"
#include "libslic3r/Thread.hpp"
#include "libslic3r/LibraryCheck.hpp"
#include "PrusaSlicer.hpp"
@ -566,6 +567,7 @@ int CLI::run(int argc, char **argv)
}
}
if (start_gui) {
#ifdef SLIC3R_GUI
Slic3r::GUI::GUI_InitParams params;
@ -600,6 +602,18 @@ bool CLI::setup(int argc, char **argv)
}
}
#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();
MessageBoxW(NULL, text.c_str(), L"Warning"/*L"Incopatible library found"*/, MB_OK);
}
#endif
// See Invoking prusa-slicer from $PATH environment variable crashes #5542
// boost::filesystem::path path_to_binary = boost::filesystem::system_complete(argv[0]);
boost::filesystem::path path_to_binary = boost::dll::program_location();