2

I am deploying an user control by help of a MSI installer. The installer is created using WiX 3.8 and is supposed to install the control into the GAC on the users machine:

<Directory Id="D_GAC_PH" Name="GAC">
    <Component Id="RT_PRODUCTDLL" Guid="CC18029F-3D4D-4C16-8871-88438DF5F8C1">
        <!-- Runtime, assembly in GAC -->
            <File Id="F_RT_PRODUCTDLL" 
                  Name="control.dll" 
                  Source="$(var.ProductDLLPath)" 
                  KeyPath="yes" 
                  Assembly=".net"/>
    </Component>
</Directory>

In order for the control to show up in the "Add Components" list in Visual Studio there are several resources stating that for this to work, one needs to manually set certain keys to the registry:

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\AssemblyFolders\ProductName

The following WiX component does register the key just fine:

<RegistryKey
       Root="HKLM"
       Key="SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\$(var.CompanySafeName)">
            <RegistryValue
                Value="[$DT_ProductDLL]"
                Type="string"/>
</RegistryKey>

Notice, I selected the key without the 'Wow6432' node. However, this key is actually the one expected for 32 bit systems. Testing on a 64 bit system the above (non-WoW) key leads to the correct (WOW6432Node) key to be added. I suppose, WiX / Windows /Windows Installer is redirecting the key to the correct WoW node on 64 bit. (?)

How reliable is that among different versions of WiX / Windows Installer? I would like this to work on older Windows Installer versions as well as on 32 bit system. Is this documented or specified somewhere? Or is it better to use conditionals in the WiX and decide for the keys manually?

Community
  • 1
  • 1
user492238
  • 4,094
  • 1
  • 20
  • 26

1 Answers1

2

In general you direct a registry to the appropriate place by having the component be Win64 or not, then it just works. I believe the default value of Win64 might default to the architecture of the package, so you probably have a 32-bit setup. To be explicit you could mark the component as Win64="no" as a reminder, but the short answer is that it should be reliable. Your component is evidently defaulting to a 32-bit component and therefore it just does the right thing on old and new systems.

PhilDW
  • 20,260
  • 1
  • 18
  • 28