Registry views
On 64-bit Windows systems, the registry is internally subdivided into 32-bit and 64-bit "views". 64-bit programs see the 64-bit version of the registry, while 32-bit programs see the 32-bit version. To a large extent these views are identical and correspond to the same underlying registry keys and values, but they may differ in the following ways:
- Some 64-bit registry keys are mirrored in the 32-bit registry and vice versa, so although they are physically distinct, they contain the same values and data.
- Some 64-bit registry keys co-exist with 32-bit registry keys that have the same name, but contain different values or data.
Microsoft introduced these different views to accommodate 64-bit and 32-bit software side-by-side on a single system, for example 32-bit and 64-bit versions of in-process COM servers such as ActiveX controls. In many cases the 64/32 registry distinction is either immaterial to an application, or the default registry view (64-64 or 32-32) achieves the desired result.
Notes
- The different views apply at the registry key level; any registry values that you create use the same view as their parent key. It is not possible to change the registry view on a per-value basis; this must be done at the registry key level.
- Registry views are not inherited from a parent registry key by its children; you must set the desired view on each registry key individually.
- These remarks and the following only apply to 64-bit Windows versions. On 32-bit Windows versions, there is only one registry view and all registry actions operate on that single view.
Microsoft documentation
For documentation about how registry views are accessed through the Win32 API as used by InstallMate, please refer to the following help topics on MSDN:
InstallMate internally uses the KEY_WOW64_xxx flags mentioned in the documentation above to access the different registry views. Your program might need to do the same.
When do you need to be aware of registry views?
During installation of software on a 64-bit Windows system you may need to take the required registry view into account, in particular if you are installing a 32-bit application on a 64-bit system. Pay extra attention if all of the following are true:
- You are installing a 32-bit application on a 64-bit Windows system; and
- As part of your installer, you are explicitly creating one or more registry keys or values that are used by your application (registry values created by self-registering DLLs etc. may be ignored for this purpose); and
- The registry keys or values that you create are subject to the 64/32 registry view distinction (this is only the case for some registry keys and values under HKEY_LOCAL_MACHINE).
To find out if condition #3 is true, start the Windows Registry Editor on a 64-bit system that has your application installed, and look for the HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node registry key branch. If your registry keys and values appear under this branch, then they were created under the 32-bit view of the registry and you must take special action to install them correctly.
Available registry view options
You can specify the registry key behavior on 64-bit Windows versions (and to some extent on Windows 32-bit versions). The following registry view options are available in the Registry view attribute associated with each registry key.
Note: This behavior is independent of the Setup stub that your installer uses; it only depends on the target system: 32-bit Windows or 64-bit Windows.
Registry view option | 32-bit Windows | 64-bit Windows |
---|---|---|
Existing key, else Native | Always uses 32-bit registry | Checks 64-bit and 32-bit views (in that order) and uses the first that already contains the key. If neither does, uses the 64-bit registry. |
Native only | Always uses 32-bit registry | Always uses 64-bit registry |
64-bit, then 32-bit | Always uses 32-bit registry | Tries to use the 64-bit view first, followed by the 32-bit one if the 64-bit failed. Note: This option differs from Existing key, else Native in that it will not try the 32-bit registry view if the registry action succeeds in the 64-bit view, even if the key already exists in the 32-bit view. |
64-bit only | Always fails | Always uses 64-bit registry |
32-bit only | Always uses 32-bit registry | Always uses 32-bit registry |
Should you install under Wow6432Node?
As an alternative to the registry views offered by InstallMate, you may consider installing your 32-bit registry keys and values directly under HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node on a 64-bit Windows system. However, we advise against this for the following reasons:
- Microsoft documentation states that the 64/32 -bit registry view is implementation-dependent and may change in future versions of Windows. Your installer might not be compatible with those future versions in that case. In contrast, InstallMate's Setup program uses documented registry flags to access the 64-bit and 32-bit registry views, which should be independent of any future implementation changes in Windows.
- The Wow6432Node registry node does not exist on 32-bit Windows versions. The installer will still create the requested registry keys, but they will have no effect, or at least not the effect that you intended. In contrast, InstallMate's Setup program automatically falls back to the 32-bit registry view on 32-bit Windows versions.
What if you need both 64-bit and 32-bit versions of the same registry key or value?
If you need to install both 64-bit and 32-bit versions of the same registry keys or values (but perhaps with different data) on 64-bit Windows systems, then you must create two versions of the same named registry keys and values, and control them by separate components, as follows:
- Create (or reuse) at least two components on the Components project page. Set the Platforms... of the first component to include all the 32-bit and 64-bit platforms that you are interested in, and the Platforms... of the second component to all the 64-bit platforms (both x64 and IA64, if need be), but no 32-bit platforms.
- Create the registry keys and values that you want to use for the 32-bit data. Set the Registry view attribute of each key to 32-bit only and assign each key and each value to the mixed 32/64-bit component that you created in step 1.
- Create an identical set of registry keys and values that you want to use for the 64-bit data. Set the Registry view attribute of each key to 64-bit only and assign each key and each value to the 64-bit only component that you created in step 1.
With this configuration, both sets of registry keys and values will be installed (separately) on 64-bit Windows systems, but only the 32-bit set on 32-bit Windows systems.