根据注册表项值在WiX中设置的属性值 [英] Property value set in WiX based on registry key value
本文介绍了根据注册表项值在WiX中设置的属性值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果注册表项HKEY_CURRENT_USER \ Control Panel \ International \ LocaleName的值为 de-DE
,我想将INSTALL_DE属性值设置为1.
I want to set the INSTALL_DE property value to 1 if registry entry HKEY_CURRENT_USER\Control Panel\International\LocaleName has value de-DE
.
我写了下面的代码.
<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>
我该如何纠正?
推荐答案
在尽可能接近您的示例代码之后,我看到了三个问题:
Following your sample code as close as possible, I see three problems:
- 双重使用标识符(在本例中为
INSTALL_DE
) - 键名错误;不要在您的搜索路径前添加
HKEY_CURRENT_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>
这篇关于根据注册表项值在WiX中设置的属性值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文