RegistryKey Element

WiX Toolset

RegistryKey Element

Description
Used for organization of child RegistryValue elements or to create a registry key (and optionally remove it during uninstallation).
Windows Installer references
Registry Table
Parents
Component, RegistryKey
Inner Text
None
Children
Choice of elements (min: 0, max: unbounded)
  • Permission (min: 0, max: unbounded): ACL permission
  • PermissionEx (min: 0, max: unbounded): Can also configure the ACLs for this registry key.
  • RegistryKey (min: 0, max: unbounded)
  • RegistryValue (min: 0, max: unbounded)
  • Any Element (namespace='##other' processContents='Lax') Extensibility point in the WiX XML Schema. Schema extensions can register additional elements at this point in the schema.
Attributes
Name Type Description Required
Action Enumeration The Action attribute has been deprecated. In most cases, you can simply omit @Action. If you need to force Windows Installer to create an empty key or recursively delete the key, use the ForceCreateOnInstall or ForceDeleteOnUninstall attributes instead. This attribute's value must be one of the following:
create
Creates the key, if absent, when the parent component is installed.
createAndRemoveOnUninstall
Creates the key, if absent, when the parent component is installed then remove the key with all its values and subkeys when the parent component is uninstalled. Note that this value is useful only if your program creates additional values or subkeys under this key and you want an uninstall to remove them. MSI already removes all values and subkeys that it creates, so this option just adds additional overhead to uninstall.
none
Does nothing; this element is used merely in WiX authoring for organization and does nothing to the final output. This is the default value.
 
ForceCreateOnInstall YesNoType Set this attribute to 'yes' to create an empty key, if absent, when the parent component is installed. This value is needed only to create an empty key with no subkeys or values. Windows Installer creates keys as needed to store subkeys and values. The default is "no".  
ForceDeleteOnUninstall YesNoType Set this attribute to 'yes' to remove the key with all its values and subkeys when the parent component is uninstalled. Note that this value is useful only if your program creates additional values or subkeys under this key and you want an uninstall to remove them. MSI already removes all values and subkeys that it creates, so this option just adds additional overhead to uninstall. The default is "no".  
Id String Primary key used to identify this particular entry. If this attribute is not specified, an identifier will be generated by hashing the parent Component identifier, Root, Key, and Name.  
Key String The localizable key for the registry value. If the parent element is a RegistryKey, this value may be omitted to use the path of the parent, or if its specified it will be appended to the path of the parent.  
Root RegistryRootType The predefined root key for the registry value.  
How Tos and Examples
See Also
Wix Schema