3

Is there anyway to set the registry based on the system locale? For example I am creating the below registry entry irrespective of system locale, and I want to create this entry only when system OS is in Arabic and Hebrew languages. Please suggest.

<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>
Srikanth Bhandary
  • 1,707
  • 3
  • 19
  • 34

2 Answers2

2

I have fixed this by adding this 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>
Srikanth Bhandary
  • 1,707
  • 3
  • 19
  • 34
1

You need to check the registry for the language and save it as avariable, and then use it as a condition in the component element.

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

Then add a condition inside the component element.

For example:

    <Condition>
      <![CDATA[REGIONLANG = 'Place the correct string']]>
    </Condition>
Arkady Sitnitsky
  • 1,846
  • 11
  • 22