I am having a big problem trying to uninstall an application that I have created an installer for using WiX Toolset v3.11
I am using the "remember property" pattern to store some properties in a registry key so they can be read back during the uninstall. I will provide an example, but note there are 5 in total.
<Property Id="MyProperty" Value="DefaultValue">
<RegistrySearch Id="MyPropertyRegSearch" Root="HKLM" Key="Software\Company\Installer" Name="myproperty" Type="raw" />
</Property>
then I have a component which handles the writing of the registry.
<Component Id="InstallPropertiesWrite" Guid="*">
<RegistryKey Root="HKLM" Key="Software\Company\Installer" Action="createAndRemoveOnUninstall">
<RegistryValue Name="myproperty" Type="string" Value="[MyProperty]">
</RegistryValue>
</RegistryKey>
</Component>
all of this works fine.
My problem is when uninstalling I get an error in the install log which says
MSI (s) (CC:D4) [14:59:26:414]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE32\Software\Company\Installer 3: 5 Info 1402.Could not open key: HKEY_LOCAL_MACHINE32\Software\Company\Installer. System error 5. Verify that you have sufficient access to that key, or contact your support personnel.
Now I have run process monitor to determine the exact key and account that is trying to access that registry key and it is HKLM\Software\WOW6432Node\Company\Installer which is correct, so I do not believe this is a 32/64-bit related problem. Process monitor also identified that the msiexec executable trying to access that key is running under the NT AUTHORITY\SYSTEM user.
I have verified that the SYSTEM account has "Full Control" permissions (via regedit) to that key but I still get the error.
I am a total loss of what could be wrong, any suggestions would be greatly appreciated, thank you in advance!
I can get it to read without error by adding permissions for "Everyone" to the required keys and that works, but this seems a big security flaw to me, and something I want to avoid if possible.
<Permission User="Everyone" GenericAll="yes" />