BLD:W0041

Registry editing under HKLM/HKU may fail with less than All Users access

The indicated registry key or value is being installed to or removed from a registry hive that has access restrictions under Windows NT-based platforms (Windows NT4, 2000, XP, 2003, and later). Moreover, the Installer's Installation level attribute allows installation with less than All Users access. As a result, the installation of the registry key or value may fail.

Background

Windows NT-based platforms protect sections of the registry against unauthorized modification. In particular, the HKEY_CLASSES_ROOT (HKCR), HKEY_LOCAL_MACHINE (HKLM), and HKEY_USERS (HKU) hives are read-only to ordinary users. HKEY_CURRENT_USER (HKCU) is always read-write for the installing user, but is not accessible to other users.

Under Windows 2000 and later, HKEY_CLASSES_ROOT can be redirected to a Current User equivalent and InstallMate will do so if the installation has less than Power User privileges. However, NT4 does not support this redirection and HKEY_CLASSES_ROOT is therefore off-limits to ordinary users on NT4.

See Access rights and Installation types for more information.

Solution

There are a number of different ways to resolve this; choose the one that is most appropriate to your situation.

If the registry value must be under HKLM

If the registry key or value in question must always be installed under HKEY_LOCAL_MACHINE, then you should set the Installer's Installation level attribute to All Users or Administrator. This guarantees that the installer will only run if it has Power User or Administrator access rights; failing that, it will prompt the user to re-run the installer under a user account that has.

If the registry value may be under HKCU

If the registry key or value in question may be installed under HKEY_CURRENT_USER if the installing user does not have sufficient privileges to perform an All Users installation, then you should move the registry key or value to an equivalent position under the HKEY_ALL_USERS hive. This pseudo-hive translates to HKEY_LOCAL_MACHINE during All Users installations, and to HKEY_CURRENT_USER during Current User installations. It is therefore suitable for all user levels.

If the registry value is under HKCR

If you receive this message for a registry key or value under HKEY_CLASSES_ROOT, it means that the component to which the registry key or value belongs specifies Windows NT4 among its installation platforms, or that it does not belong to a component. Because NT4 (in contrast to Windows 2000 and later) does not support redirection of HKEY_CLASSES_ROOT, this hive requires an All Users installation to succeed.

To resolve this, you must either remove NT4 from the component's installation platforms (or add the registry key or value to a component that does not install on NT4) , or set the Installer's Installation level attribute to All Users or Administrator. The former implies that the registry key or value will not be installed on NT4 and is therefore only applicable if your application does not have to be installed on that platform.