I ran into an issue today with Conditional components in WIX. I've been working on a project to internationalize the product that I work on. I finished the work in the application and needed to make sure that the installer supported my changes. I created a new screen that allowed you to choose the language that you desired. I created a property, set the value in the radio buttons and then set a conditional in the component to deploy the correct .resx files. No luck. Compiled just fine, the wix output (from msiexe /lvx!) showed that my variable was getting changed, but my conditional would evaluate correctly. Turns out that the variable that I was using was mixed case (LangSetting). Once I changed it to LANG_SETTING, all worked fine. Here is the code that finally worked.
<Control Id="radioButtonGroupBox1" Type="RadioButtonGroup" Height="110" Width="145" X="9" Y="80" Property="LANG_SETTING">
<RadioButtonGroup Property="LANG_SETTING">
<RadioButton X="20" Y="14" Height="18" Width="96" Text="English" Value="0" />
<RadioButton X="20" Y="36" Height="18" Width="122" Text="Deutsch" Value="1" />
<RadioButton X="20" Y="58" Height="18" Width="122" Text="Francais" Value="2" />
<RadioButton X="20" Y="80" Height="18" Width="122" Text="Japanese" Value="3" />
</RadioButtonGroup>
</Control>
<Component Id="englishConfig" Guid="CC1F253F-E0EA-4054-A75A-6F79ABD17EAD">
<CreateFolder />
<Condition>LANG_SETTING = "0"</Condition>
<util:XmlFile Id="changeEnCulture" ElementPath="/configuration/system.web/globalization/@uiCulture" Action="setValue" Value="en-US" File="[INSTALLDIR]\web.config"/>
<File Id="Resources.enUS.resx" Name="Resources.en-US.resx" Source="$(var.resPath)\Resources.en-US.resx" />
</Component>
No comments:
Post a Comment