使用 wix 根据系统区域设置设置注册表的自定义操作

Custom action setting the registry based on system locale using wix

有没有根据系统区域设置注册表的方法?例如,无论系统区域设置如何,我都在创建以下注册表项,并且我只想在系统 OS 使用阿拉伯语和希伯来语时创建此条目。请提出建议。

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

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

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

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

例如:

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

我已经通过添加这个条件解决了这个问题。

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