How can I read and store the value of a Windows registry key in an installer variable?
You can store the value of a registry key in an installer variable using a <registryGet>
action. If the key or name does not exist, then the variable created will be empty. You will have to include a section like the one below inside an action list section of your XML installer project file.
<registryGet>
<variable>installdir</variable>
<key>HKEY_
LOCAL_
MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment</key>
<name>MY_APPDIR</name>
</registryGet>