Table Of Contents

Adding Registry Keys

Last Modified: November 6, 2020

Use this procedure to create a custom execute which adds registry keys directly or by using a registry export file (.reg file) after you install the package.
  1. In the Root property, select [System (32-bit)].
  2. Set the Executable Path to the name of the command prompt executable:
  3. In the Arguments property, provide the arguments needed to pass in a string to the command prompt and then run one of the following commands:
    1. If you have a .reg file, use regedit. For example:
      /c regedit /s <file.reg>

      The /c flag carries out the command specified and then terminates.

      Where <file.reg> is replaced by the full path to your .reg file.

    2. If you want to add a registry key without a .reg file, use reg_add. For example:
      /c reg add <KeyName> /v <entryName> /d <entryData>

      Where <KeyName> is replaced by the full path of your subkey.

      Where <entryName> and <entryData> are replaced by the name of the registry entry you are entering and the data for the entry.

  4. Click OK.
  5. Build all packages by selecting Build»Build All Packages.

You can create a custom execute to remove these registry keys when the package is uninstalled. Repeat the procedure but select the Post All Uninstall option when you set up the custom execute. In step 3, use reg delete instead of reg add to remove the keys. However, you should exercise caution when using this process. If multiple packages share the registry keys, using this approach will prevent installed packages from accessing the deleted registry keys.

Recently Viewed Topics