Wix:在HKCU\Software\Classes\Wow6432Node下写寄存器条目 [英] Wix: Write register entries under HKCU\Software\Classes\Wow6432Node

查看:19
本文介绍了Wix:在HKCU\Software\Classes\Wow6432Node下写寄存器条目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个超级简单的安装程序来测试安装程序是否可以在 HKCU\Software\Classes\Wow6432Node 下写入寄存器条目(msi 是目标 x86,我正在 Win7 x64 机器上测试它).

I have a super simple installer to test if a installer can write register entries under HKCU\Software\Classes\Wow6432Node (the msi is target x86 and I'm testing it on a Win7 x64 machine).

问题是:它根本不想在Wow6432Node下写任何东西.代码如下:

The problem is: it just does not want to write anything under Wow6432Node at all. Following is the code:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product Id="f671ee4d-dd0a-4f7f-a4d1-1d181d2f3002" Name="TestWow" Language="1033" Version="1.0.0.0" Manufacturer="X" UpgradeCode="5d030587-0b6f-4a55-b090-c97a4fd22d13">
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perUser" InstallPrivileges="limited"/>

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
    <MediaTemplate />

    <Feature Id="ProductFeature" Title="XWix" Level="1">
      <ComponentRef Id="TestWow" />
    </Feature>
  </Product>

  <Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir" />
  </Fragment>

  <Fragment>
    <DirectoryRef Id="TARGETDIR">
      <Component Id="TestWow" Guid="f671ee4d-dd0a-4f7f-a4d1-1d181d2f3002">
        **<RegistryKey Root="HKCU" Key="Software\Classes\TestWow">
          <RegistryValue Name="Test" Value="Wow" Type="string" KeyPath="yes"/>
        </RegistryKey>**
      </Component>
    </DirectoryRef>
  </Fragment>
</Wix>

我什至尝试修改注册表部分,如:

I've even tried to modify the registry part like:

<RegistryKey Root="HKCU" Key="Software\Classes\Wow6432Node\TestWow">
  <RegistryValue Name="Test" Value="Wow" Type="string" KeyPath="yes"/>
</RegistryKey>

还是不行.

非常感谢您的帮助!

推荐答案

我认为 hkcu 的虚拟化方式与 hklm 不同.您需要确保您的组件被标记为 32 位,并且任何虚拟化都会为您处理.

I don't think hkcu is virtualised in the same way as hklm. You need to ensure your component is marked as a 32 bit one and any virtualization will be taken care of for you.

这篇关于Wix:在HKCU\Software\Classes\Wow6432Node下写寄存器条目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆