1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-17 20:58:07 +02:00

fix registry check for systems with WOW6432Node

This commit is contained in:
Laserlicht 2024-12-07 22:51:02 +01:00
parent 543ce94132
commit 74a511c1aa

View File

@ -296,12 +296,18 @@ QString FirstLaunchView::getHeroesInstallDir()
{
#ifdef VCMI_WINDOWS
QString gogPath = QSettings("HKEY_LOCAL_MACHINE\\SOFTWARE\\GOG.com\\Games\\1207658787", QSettings::NativeFormat).value("path").toString();
if(!gogPath.isEmpty())
return gogPath;
gogPath = QSettings("HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\GOG.com\\Games\\1207658787", QSettings::NativeFormat).value("path").toString();
if(!gogPath.isEmpty())
return gogPath;
QString cdPath = QSettings("HKEY_LOCAL_MACHINE\\SOFTWARE\\New World Computing\\Heroes of Might and Magic® III\\1.0", QSettings::NativeFormat).value("AppPath").toString();
if(!cdPath.isEmpty())
return cdPath;
cdPath = QSettings("HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\New World Computing\\Heroes of Might and Magic® III\\1.0", QSettings::NativeFormat).value("AppPath").toString();
if(!cdPath.isEmpty())
return cdPath;
#endif
return QString{};
}