如何使用WiX在64位计算机上的注册表中记录32位密钥?

时间:2014-09-28 14:13:15

标签: wix installer windows-installer

我有这把钥匙:

<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>

即使Windows版本是64位,也需要在32位注册表部分中编写此密钥。我怎么能这样做?

1 个答案:

答案 0 :(得分:0)

正如@PhilDW正确指出的那样,您的安装包平台以x64为目标,但您的注册表项是在Wow6432Node中创建的。这个节点对我来说是一个混乱的源头,所以这里是它的定义:

  

Wow6432Node注册表项表示您运行的是64位Windows版本。操作系统使用此键为在64位Windows版本上运行的32位应用程序显示HKEY_LOCAL_MACHINE \ SOFTWARE的单独视图。

由于在HKLM\SOFTWARE\Wow6432Node\SolidWorks\Addins\中创建了注册表项,因此它意味着它是32位的。如果要为64位显式创建它,请将Win64="yes"属性添加到Component

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