2016-01-21 56 views
3

有没有办法根据系统区域设置注册表?例如,我正在创建下面的注册表项,而不考虑系统区域设置,并且我只在系统操作系统使用阿拉伯语和希伯来语时才创建此条目。请建议。自定义操作使用wix设置基于系统区域设置的注册表

<Component Id="HelpViewer_Browser_Emulation" Guid="*">   
<RegistryValue Root="HKLM" Id="HelpViewer_Browser_Emulation" Key="SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION"KeyPath="yes" Type="integer" Value="10001" Name="myapp.exe"/></Component> 

回答

2

我已通过添加该条件固定这一点。

<Property Id="REGIONLANG"> 
    <RegistrySearch Id="REGIONLANG_VAL" 
        Root="HKCU" 
        Key="Control Panel\International" 
        Name="sLanguage" 
        Type="raw" /> 
</Property> 
<Component Id="HelpViewer_Browser_Emulation" Guid="*" > 
    <Condition> 
     <![CDATA[REGIONLANG = "ARA"]]> 
    </Condition> 
    <RegistryValue Root="HKLM" Id="HelpViewer_Browser_Emulation" Key="SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION" KeyPath="yes" Type="integer" Value="10001" Name="myapp.exe"/> 
</Component> 
1

你需要检查注册表中的语言并将其保存为avariable,然后用它作为组件元素的条件。

<util:RegistrySearch Id="Path" 
      Variable="REGIONLANG" 
      Root="HKCU" 
      Key="Control Panel\International\sLanguage"/> 

然后在组件元素中添加一个条件。

例如:

<Condition> 
     <![CDATA[REGIONLANG = 'Place the correct string']]> 
    </Condition> 
+0

这段代码不适用于wix 3.9。还有其他建议吗? –