Using Registry conditions in VS.NET Installer projects

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

Print | posted on Wednesday, September 29, 2004 10:54 PM

Comments on this post

# re: Registry Entries

Requesting Gravatar...
How can i set the following registry entries while working on setup project?so that when Installer runs,it overwrites entries with my entries:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Toolbar] "{<your deskband guid>}"="<Your app name>"

IE will also need for some additional info such as menu and help text, so you need to create these as well:

[HKEY_CLASSES_ROOT\CLSID\{<your guid>}]
"MenuText"="<what you wish to be displayed in IE Toolbars menu" "HelpText"="Show/hide <your app>"


thanks

-adnan
Left by Adnan Siddiqi on Nov 25, 2004 10:22 PM

# Using Registry conditions in VS.NET Installer projects

Requesting Gravatar...
I wish I had found this before I spent several hours trying to figure it out.
http://geekswithblogs.net/ajohns/archive/2004/09/29/11936.asp...
Left by aspZone.com on Aug 30, 2005 6:44 AM

# re: Using Registry conditions in VS.NET Installer projects

Requesting Gravatar...

Hi Andy,

Thanks for your comments. It has helped me solved my problem.


Thanks.
Left by khong from Sulzer Chemtech on Sep 20, 2005 2:55 AM

Your comment:

 (will show your gravatar)
 
Please add 8 and 5 and type the answer here: