Deployment in Visual Studio
How to: Create a Default Registry Value in Registry Editor

The Registry Editor can be used to specify a default value for any registry key. Each key can have only one default value; marking more than one value as default will cause a build error.

NoteNote:

The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. To change your settings, click Import and Export Settings on the Tools menu. For more information, see Visual Studio Settings.

To specify a default value

  1. Select a value name in the right-hand pane of Registry Editor.

  2. Right-click the value name and then click Rename.

  3. On the Edit menu, click Delete.

  4. Press ENTER. The name is replaced with '(Default)'.

See Also

Tasks

Concepts

Other Resources

Tags :


Community Content

EddP
Hmm

This doesn't work at all and just deletes the value you've selected. Here's how I found to do it. Run

reg add <name of key> /t <whatever type> /d "a value" /ve

at the command prompt.

This will overwrite the current default value with the data specified ("a value"). You can then use regedit.exe to change the value to whatever you like by just double-clicking it.

The good thing about this method is that it allows you to change the type of the default value, which is usually REG_SZ and which cannot be changed from Regedit (from what I can see).


EddP
Hmm

This doesn't work at all and just deletes the value you've selected. Here's how I found to do it. Run

reg add <name of key> /t <whatever type> /d "a value" /ve


at the command prompt.

This will overwrite the current default value with the data specified ("a value"). You can then use regedit.exe to change the value to whatever you like by just double-clicking it.

The good thing about this method is that it allows you to change the type of the default value, which is usually REG_SZ and which cannot be changed from Regedit (from what I can see).


Paul_Singh
Actually it does work....

The way I got it to work was
1) create a new string value
2) give it a name
3) then select the string value
4) in the properties window delete the (Name) field
5) the string value name automatically goes to default.

Tags :

Richard Winks
Not setting a (Default) value may create a bad key on install
I figured I would do a quick and dirty installer with a VS 2008 deployment project. I used the Registry Editor to create some keys, importing an exported set. There were keys that had no values. The vdproj built ok. The resulting installer installed without error. While trying to figure out why my application wasn't running, I checked the registry keys on the target machine with regedit. An error message was displayed for the keys without a value.

I checked everything in the Registry Editor and it all looked good.

Eventually I manually added (Default) values (as explained above) and rebuilt the vdproj. After that the keys installed and read ok. This corrected the application problem as well.

Page view tracker