When you create a registry key and a value in a Visual Studio Setup project, the value for the registry key may be empty when you install the application on a computer


Symptoms


When you create a registry key and a value in a Microsoft Visual Studio Setup project, the value for the registry key may be empty when you install the application on a computer. This issue may occur if you use the Registry Editor in Microsoft Visual Studio 2005 or in Microsoft Visual Studio .NET to create the registry key for the project.

Cause


This issue occurs if the left bracket ([) character is the first character in the Value field in the Visual Studio Registry Editor.

Resolution


To resolve this issue, use the Formatted data type to format the value. For example, to create a value of [ABC] for a registry key, type the following in the Value field in the Visual Studio Registry Editor:
[\[]ABC[\]]

More Information


Steps to reproduce the issue

  1. In Visual Studio 2005 or in Visual Studio .NET, create a new Setup project.
  2. On the View menu, point to
    Editor, and then click Registry.
  3. Expand HKEY_LOCAL_MACHINE.
  4. Right-click Software, point to
    New, and then click String Value.
  5. Type Test, and then press ENTER.
  6. Click Test, and then type
    [ABC] in the Value field of the Properties window.
  7. Compile the project.
  8. Install the application on a computer.
  9. Verify that the value for the following registry key is empty:
    HKEY_LOCAL_MACHINE\Software\Test

References


For more information about how to use the Formatted data type, visit the following Microsoft Developer Network (MSDN) Web site: