Log visual c++ redist version
This commit is contained in:
@@ -64,7 +64,7 @@ namespace Noggit::Application
|
||||
if (!std::filesystem::exists(noggitProjectPath))
|
||||
{
|
||||
std::filesystem::create_directory(noggitProjectPath);
|
||||
Log << "Noggit Project Folder Not Loaded! Creating..." << std::endl;
|
||||
// Log << "Noggit Project Folder Not Loaded! Creating..." << std::endl;
|
||||
}
|
||||
|
||||
auto listFilePath = applicationConfiguration.ApplicationListFilePath;
|
||||
@@ -78,11 +78,43 @@ namespace Noggit::Application
|
||||
auto databaseDefinitionPath = applicationConfiguration.ApplicationDatabaseDefinitionsPath;
|
||||
if (!std::filesystem::exists(databaseDefinitionPath))
|
||||
{
|
||||
// LogError << "Unable to find database definitions! please reinstall Noggit Red, or download from wow.tools" << std::endl;
|
||||
LogError << "Unable to find database definitions! please reinstall Noggit Red, or download from wow.tools" << std::endl;
|
||||
}
|
||||
|
||||
Log << "Database Definitions found! : " << databaseDefinitionPath << std::endl;
|
||||
|
||||
// Check MSVC redistribuable version
|
||||
const QString registryPath = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\";
|
||||
|
||||
// Visual C++ 2015 (MSVC++ 14.0)
|
||||
// Visual C++ 2017 (MSVC++ 14.1)
|
||||
// Visual C++ 2019 (MSVC++ 14.2)
|
||||
// Visual C++ 2022 (MSVC++ 14.3)
|
||||
const QStringList versions = {
|
||||
"14.0", // MSVC 14.0 Visual Studio 2015
|
||||
// "15.0", // MSVC 14.1 Visual Studio 2017
|
||||
// "16.0", // MSVC 14.2 Visual Studio 2019
|
||||
// "17.0" // MSVC 14.3 Visual Studio 2022
|
||||
};
|
||||
|
||||
bool redist_found = false;
|
||||
foreach (const QString & version, versions) {
|
||||
QString keyPath = registryPath + version + "\\VC\\Runtimes\\x64";
|
||||
QSettings settings(keyPath, QSettings::NativeFormat);
|
||||
|
||||
if (settings.contains("Installed")) {
|
||||
bool installed = settings.value("Installed").toBool();
|
||||
if (installed) {
|
||||
redist_found = true;
|
||||
QString versionNumber = settings.value("Version").toString();
|
||||
LogDebug << "Found MSVC " << version.toStdString() << " Redistributable Version: " << versionNumber.toStdString() << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!redist_found)
|
||||
LogDebug << "No Redistribuable MSVC version found" << std::endl;
|
||||
|
||||
// Initialize OpenGL
|
||||
QSurfaceFormat format;
|
||||
|
||||
format.setRenderableType(QSurfaceFormat::OpenGL);
|
||||
|
||||
Reference in New Issue
Block a user