Sjharrison
Sjharrison

Reputation: 729

Wix - If check box is true in installer then add in certain config

Within the installer I'm going to have a checkbox called 'SSLValue'

If SSLValue is checked then i need to add in additional configuration to my web.config file which is created by the installer

However I'm unsure how / if the installer can handle such a request

I've seen from here that you can add in a expression for if but doesn't really explain how to use them

Here is the code I have so far which at the moment isn't working

?if [SSLValue] = "True"?>
  <util:XmlFile
     Id="XMLConfiguration34"
     File="[VersionFolder]web.config"
     Action="setValue"
     ElementPath="//configuration/system.web/httpCookies/@requireSSL"
     Value="false"
     Sequence="8"/>
<?endif?>

Has anyone done anything similar who could help?

Upvotes: 0

Views: 218

Answers (1)

Arkady Sitnitsky
Arkady Sitnitsky

Reputation: 1886

The steps are:

  1. Add control checkbox in the UI.

    <Control Id="SSLValueCheckBox" Type="CheckBox" X="11" Y="90" Width="116" Height="17" Property="SSLValue" Hidden="no" CheckBoxValue="1" Text="Click Me"/>
    

Then, Inside the component element where "XMLConfiguration34" is located add a Condition:

  <Condition>
    <![CDATA[SSLValue = "1"]]>
  </Condition>

And that's it.

Hope it helps...

Upvotes: 1

Related Questions