Wix: Setting up RegistryKey Root HKMU

If I set the root attribute in HKMU in RegistryKey, how do I know where to look (RegistrySearch root = HKCU or HKLM) in my registry for my RegistryValue. Or how to set the dynamic value of the root?

+7
source share
2 answers

This is usually done using two queries with the same property: one search for HKLM and the other for HKCU.

The following scenarios are possible:

  • the first search finds the value and sets the property; in this case, the second search result is ignored, since its property is already set by the first search
  • the second search will find the value and set the property
  • both searches find nothing and the property is empty
+6
source

my quick idea: you are requesting the installation location of this component from the installer.

this can be done using the api installer. if you use the material on demand, you should still ask the installer.

you can use the MsiGetComponentPathEx function of the MsiGetComponentPath function to do this:

+1
source

All Articles