Adding and Deleting Registry Keys

Visual Studio 6.0

You can use the Registry editor in Microsoft® Visual Studio® Installer to modify the target machine registry as necessary for your application installation. After your installation package (.msi) file installs your components and files on the target machine, it can write the associated registry keys and values to the system registry. You establish the keys and values your .msi file writes to the system registry by setting them up in the Registry editor.

This topic explains how to:

For information about adding, deleting, and setting registry values, see Adding and Deleting Registry Values and Setting Registry Values.

To add registry keys

  1. In the Project Explorer window, expand the Target Machine node under your installer project.

  2. Double-click Registry in the Target Machine node.

    The Registry editor is displayed.

  3. In the Registry on Target Machine hierarchy, select the node representing the registry subtree where you want to add a registry key. For example, select HKEY_USERS to add a registry key to the HKEY_USERS registry subtree on the target machine.

    Note   You can expand the HKEY_CURRENT_USER and HKEY_LOCAL_MACHINE nodes in the Registry editor and any other subtrees, keys, or subkeys with child keys or subkeys.

  4. Right-click the selected node in the Registry editor, highlight New in the context menu, and then select Key.

    A new registry key is added to your installer project and shown in the Registry on Target Machine hierarchy with the label New Key #1 (or New Key #2, 3, 4, and so on) in the location you had selected. You can change the default name, if desired.

To rename registry keys

  1. Display the Registry editor.

  2. If necessary, expand the Registry on Target Machine hierarchy to show the registry key or subkey you want to rename.

  3. Right-click the registry key or subkey you want to rename.

  4. Select Rename from the context menu.

  5. Enter the new name for the registry key or subkey.

To delete registry keys

Important   You can only delete empty registry keys. If the registry key you want to delete contains any keys, subkeys, or values, you must delete them before you can delete the parent key. Follow this procedure to delete any registry keys or subkeys; for information about deleting registry values, see Adding and Deleting Registry Values.

  1. Display the Registry editor.

  2. If necessary, expand the Registry on Target Machine hierarchy to show the registry key or subkey you want to delete.

  3. In the Registry on Target Machine hierarchy, right-click the registry key or subkey you want to delete.

    Note   You can only delete empty registry keys; you cannot delete a registry key that contains any subkeys or values.

  4. Select Delete from the context menu.

    The selected registry key is deleted from your installer project and is no longer shown in the Registry on Target Machine hierarchy. The information will not be written to the target machine registry when your application is installed.

Show: