Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.4.0, 5.7.0
-
None
-
Tested on Windows 7 and Windows 10, Qt 5.4.0 and Qt 5.7.0
Description
I tried to get the path of an installed application from the Windows registry. I can read values from HKEY_CLASSES_ROOT but reading any registry value from the HKEY_LOCAL_MACHINE branch (where installed applications tend to be) returns an empty value. Tested it with a DWORD key too.
Sample code:
QSettings windowsRegistry("HKEY_CLASSES_ROOT\\*", QSettings::NativeFormat); QString Path = windowsRegistry.value("ContentViewModeLayoutPatternForBrowse", "").toString(); qDebug() << Path; //works fine QSettings windowsRegistrySteam("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Steam App 22320", QSettings::NativeFormat); QString PathSteam = windowsRegistrySteam.value("InstallLocation", "").toString(); qDebug() << PathSteam; //Does not work. Basically reading any registry value from the HKEY_LOCAL_MACHINE branch returns an empty value. Tested it with a DWORD key too.