RegistrySearch Element

WiX Toolset

RegistrySearch Element

Description
Searches for file, directory or registry key and assigns to value of parent Property
Windows Installer references
RegLocator Table, Signature Table
Parents
ComplianceCheck, Property
Inner Text
None
Children
Choice of elements (min: 0, max: 1)
Attributes
Name Type Description Required
Id String Signature to be used for the file, directory or registry key being searched for. Yes
Key String Key for the registry value. Yes
Name String Registry value name. If this value is null, then the value from the key's unnamed or default value, if any, is retrieved.  
Root Enumeration Root key for the registry value. This attribute's value must be one of the following:
HKCR
HKEY_CLASSES_ROOT
HKCU
HKEY_CURRENT_USER
HKLM
HKEY_LOCAL_MACHINE
HKU
HKEY_USERS
Yes
Type Enumeration The value must be 'file' if the child is a FileSearch element, and must be 'directory' if child is a DirectorySearch element. This attribute's value must be one of the following:
directory
The registry value contains the path to a directory.
file
The registry value contains the path to a file. To return the full file path you must add a FileSearch element as a child of this element; otherwise, the parent directory of the file path is returned.
raw
Sets the raw value from the registry value. Please note that this value will contain a prefix as follows:

DWORD
Starts with '#' optionally followed by '+' or '-'.
REG_BINARY
Starts with '#x' and the installer converts and saves each hexadecimal digit (nibble) as an ASCII character prefixed by '#x'.
REG_EXPAND_SZ
Starts with '#%'.
REG_MULTI_SZ
Starts with '[~]' and ends with '[~]'.
REG_SZ
No prefix, but if the first character of the registry value is '#', the installer escapes the character by prefixing it with another '#'.
Yes
Win64 YesNoType Instructs the search to look in the 64-bit registry when the value is 'yes'. When the value is 'no', the search looks in the 32-bit registry. The default value is based on the platform set by the -arch switch to candle.exe or the InstallerPlatform property in a .wixproj MSBuild project: For x86 and ARM, the default value is 'no'. For x64 and IA64, the default value is 'yes'.  
Remarks

When the Type attribute value is 'directory' the registry value must specify the path to a directory excluding the file name. When the Type attribute value is 'file' the registry value must specify the path to a file including the file name; however, if there is no child FileSearch element the parent directory of the file is returned. The FileSearch element requires that you author the name of the file you are searching for. If you do not know the file name you must set the Type attribute to 'raw' to return the full file path including the file name.

How Tos and Examples
See Also
Wix Schema, ComponentSearch, IniFileSearch