Inno Setup Preprocessor: ReadReg

Prototype

any ReadReg(int RootKey, str SubKey, str? Name, any? Default)

Description

Reads the value of the specified registry key. The first parameter is the root key, such as HKEY_LOCAL_MACHINE, HKEY_LOCAL_MACHINE_32, or HKEY_LOCAL_MACHINE_64. Constants for use with this parameter are declared in ISPPBuiltins.iss accompanying ISPP. The second parameter specifies a subkey. The third parameter specifies the name of the value to read; if it is omitted or empty, the key's default (unnamed) value is read. The last optional parameter specifies the value to return on failure.

Note that this function can return a value of any type depending on the type of actual value in the registry.

A compiler error will be raised if an invalid root key is specified or if 64-bit registry keys are requested on 32-bit Windows.