streamdown
streamdown

Reputation: 390

How can I record a 32-bit key in the registry on a 64-bit machine using WiX?

I have this key:

<Package
    InstallerVersion="200"
    Compressed="yes"
    SummaryCodepage="1251"
    Platform="x64"
    InstallScope="perMachine"/>

<Component Id="RegistryEntries1" Guid="*">
    <RegistryKey Root="HKLM"
                 Key="Software\SolidWorks\Addins\{GUID-PLACEHOLDER}"
                 Action="createAndRemoveOnUninstall">
        <RegistryValue Type="integer" Value="0"/>
        <RegistryValue Name="Description" Value="SomeText" Type="string"/>
        <RegistryValue Name="Title" Value="ProductName" Type="string"/>
    </RegistryKey>
</Component>

This key needs to be written in the 32-bit registry section, even if the Windows edition is 64-bit. How can I do this?

Upvotes: 2

Views: 1263

Answers (1)

Marlos
Marlos

Reputation: 1965

As @PhilDW correctly pointed out, your installation package platform is targeting the x64 but your registry key is being created in the Wow6432Node. This node is a source of confusion for me, so here is its definition:

The Wow6432Node registry entry indicates that you are running a 64-bit Windows version. The operating system uses this key to display a separate view of HKEY_LOCAL_MACHINE\SOFTWARE for 32-bit applications that run on 64-bit Windows versions.

Since the registry key is being created in the HKLM\SOFTWARE\Wow6432Node\SolidWorks\Addins\, it means it's 32-bit. If you want to explicitly create it for 64-bit, add the Win64="yes" attribute to the Component.

<Component Id="RegistryEntries1" Guid="*" Win64="yes">
    <RegistryKey Root="HKLM"
                 Key="Software\SolidWorks\Addins\{GUID-PLACEHOLDER}"
                 Action="createAndRemoveOnUninstall">
        ...
    </RegistryKey>
</Component>

Upvotes: 1

Related Questions