Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
基于注册表项值在WiX中设置的属性值_Wix_Installation_Windows Installer - Fatal编程技术网

基于注册表项值在WiX中设置的属性值

基于注册表项值在WiX中设置的属性值,wix,installation,windows-installer,Wix,Installation,Windows Installer,如果注册表项HKEY\U CURRENT\U USER\Control Panel\International\LocaleName具有值DE,我想将INSTALL\u DE属性值设置为1 我写了下面的代码 <Property Id="INSTALL_DE"> <RegistrySearch Id="NetFramework20" Root="HKCU" Key="HKEY_CURRENT_USER\Control Pan

如果注册表项HKEY\U CURRENT\U USER\Control Panel\International\LocaleName具有值
DE
,我想将INSTALL\u DE属性值设置为1

我写了下面的代码

<Property Id="INSTALL_DE">
    <RegistrySearch
        Id="NetFramework20"
        Root="HKCU"
        Key="HKEY_CURRENT_USER\Control Panel\International"
        Name="LocaleName"
        Type="raw" />
</Property>

<SetProperty Id="INSTALL_DE" After="AppSearch" Value="1">
    <[CDATA[INSTALL_DE="de-DE"]]>
</SetProperty>


如何更正它?

尽可能接近您的示例代码,我发现三个问题:

  • 双重使用标识符(在这种情况下
    INSTALL\u DE
  • 错误的密钥名称;不要将
    HKEY\U CURRENT\U USER
    作为搜索路径的前缀,
    Root=“HKCU”
    会处理它
  • 在CDATA中缺少“
  • 写下

    <Property Id="LOCAL_NAME">
        <RegistrySearch Id="NetFramework20"
                Root="HKCU"
                Key="Control Panel\International"
                Name="LocaleName"
                Type="raw" />
    </Property>
    
    <SetProperty Id="INSTALL_DE" After="AppSearch" Value="1">
        <![CDATA[LOCAL_NAME="de-DE"]]>
    </SetProperty>
    

    您的问题解决了吗?答案是否有帮助?