title: One registry key for many products not deleted on uninstall
body: <p>My company has many products, we want to create a registry key <code>Software\$(var.Manufacturer)</code>that will have all of our products if our customers have installed more than one (which is likely) I then want to have a secondary key for each of our products which get removed on uninstall but the main one does not. I have tried to achieve this like below but my main key gets deleted so all of my other products also get deleted from the registry. I know this is trivial but I cannot find an answer.</p>
  
  <pre><code>&lt;DirectoryRef Id="TARGETDIR"&gt;
    &lt;Component Id="Registry" Guid="*" MultiInstance="yes" Permanent="yes"&gt;
      &lt;RegistryKey Root="HKLM" Key="Software\$(var.Manufacturer)" ForceCreateOnInstall="yes"&gt;
        &lt;RegistryValue Type="string" Name="Default" Value="true" KeyPath="yes"/&gt;
      &lt;/RegistryKey&gt;
    &lt;/Component&gt;
  &lt;/DirectoryRef&gt;
  
  &lt;DirectoryRef Id="TARGETDIR"&gt;
    &lt;Component Id="RegistryEntries" Guid="*" MultiInstance="yes" &gt;
      &lt;RegistryKey Root="HKLM" Key="Software\$(var.Manufacturer)\[PRODUCTNAME]" Action="createAndRemoveOnUninstall"&gt;
        &lt;RegistryValue Type="string" Name="Installed" Value="true" KeyPath="yes"/&gt;
        &lt;RegistryValue Type="string" Name="ProductName" Value="[PRODUCTNAME]"/&gt;
      &lt;/RegistryKey&gt;
    &lt;/Component&gt;
  &lt;/DirectoryRef&gt;
  </code></pre>
  
  <p>EDIT: I have got my registry keys to stay using the following code. However they only all delete wen all products are deleted, not one by one as they need to.</p>
  
  <pre><code>&lt;DirectoryRef Id="TARGETDIR"&gt;
    &lt;Component Id="Registry" Guid="FF75CA48-27DE-430E-B78F-A1DC9468D699" Permanent="yes" Shared="yes" Win64="$(var.Win64)"&gt;
      &lt;RegistryKey Root="HKLM" Key="Software\$(var.Manufacturer)" ForceCreateOnInstall="yes"&gt;
        &lt;RegistryValue Type="string" Name="Default" Value="true" KeyPath="yes"/&gt;
      &lt;/RegistryKey&gt;
    &lt;/Component&gt;
  &lt;/DirectoryRef&gt;
  
  &lt;DirectoryRef Id="TARGETDIR"&gt;
    &lt;Component Id="RegistryEntries" Guid="D94FA576-970F-4503-B6C6-BA6FBEF8A60A" Win64="$(var.Win64)" &gt;
      &lt;RegistryKey Root="HKLM" Key="Software\$(var.Manufacturer)\[PRODUCTNAME]" ForceDeleteOnUninstall="yes"&gt;
        &lt;RegistryValue Type="string" Name="Installed" Value="true" KeyPath="yes"/&gt;
        &lt;RegistryValue Type="string" Name="ProductName" Value="[PRODUCTNAME]"/&gt;
      &lt;/RegistryKey&gt;
    &lt;/Component&gt;
  &lt;/DirectoryRef&gt;
  </code></pre>