I was trying to use a registry condition in a VS.NET setup project today and having a damn hard time with it. The docs seemed simple enough, the registry value I was looking for was there, yet the setup MSI kept telling me the value didn't match.... After much puzzling, and a hint from a co-worker I found the solution....
The trick was the "value" is not as the help indicates, ie the data. The value is the Name of the key as indicated in the right pane of the RegEdit tool. The comparison is simple, "value" exists and has non-blank data, or it doesn't.
For example, my search of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSMQ\DisplayName
Becomes:
RegKey: SYSTEM\CurrentControlSet\Services\MSMQ
Root: vsdrrHKLM
Value: DisplayName
If the RegKey path exists, and the DisplayName "value" exists and the data of the DisplayName is not blank then the condition passes.
Ugh, the docs are clearly wrong. For the Value property they state:
The Value property takes a string that matches the value as displayed in the Data column of the Windows Registry Editor.
And the docs for the RegKey property state:
The RegKey property takes a string that includes the full path to the registry key. For example, if you want to search for the Start Page key for Internet Explorer, the RegKey property should be set to Software\Microsoft\Internet Explorer\Main\Start Page.
Actually the Value is the final part of the key: in the docs example that would be "Start Page"
Ugh, the docs are clearly wrong. For the Value property they state:
Correcting the example in the online docs, the properties should be:
RegKey: Software\Microsoft\Internet Explorer\Main
Root: vsdrrHKCU
Value: Start Page
Detecting the actual value of Start Page does not seem possible....
-Andy