I am trying to use Qt to detect if .Net is installed on the client machine.
QSettings netKey(
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v4",
QSettings::NativeFormat);
if(!netKey){ //what do I check here to see if the key was found??
}
Edit:
This works but is detecting a value, not a key.
// path is "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v4\\client"
if(netKey.value("InstallPath").isNull()){
// this works but is detecting a value, not key
}
See the QSettings documentation, in the section “Accessing the Windows Registry Directly”. Use the value() method to obtain the value of a key, or contains() to check if a key exists.