2016-01-21 50 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。還有其他建議嗎? –

相關問題