How to use If-else clauses

Author: BitRock Support       Date: November 25, 2009 09:44       Tags: Actions
Rules

Since InstallBuilder 6.2.1, you can use if-else clauses to reuse your rules. Instead of using:

<actionGroup>
   <actionList>
      <!-- Some Actions related to Windows -->
   </actionList>
   <ruleList>
      <platformTest type="windows" />
   </ruleList>
</actionGroup>

<actionGroup>
   <actionList>
      <!-- Some Actions not related to Windows -->
   </actionList>
   <ruleList>
      <platformTest negate="1" type="windows" />
   </ruleList>
</actionGroup>

You can use:

 <if>
  <conditionRuleList>
      <platformTest type="windows" />
  </conditionRuleList>
  <actionList>
     <!-- Some Actions related to Windows -->
  </actionList>
  <elseActionList>
     <!-- Some Actions not related to Windows -->
  </elseActionList>
</if>

The new action also accepts a <conditionRuleEvaluationLogic> tag which defaults to 'and':

 <if>
  <conditionRuleEvaluationLogic>or</conditionRuleEvaluationLogic>
  <conditionRuleList>
      <platformTest type="windows" />
      <platformTest type="osx" />
  </conditionRuleList>
  <!-- Actions executed if the condition is true -->
  <actionList>
     <!-- Some Actions related to Windows or OS X-->
  </actionList>
  <!-- Actions executed if the condition is false -->
  <elseActionList>
     <!-- Some Actions not related to Windows or OS X -->
  </elseActionList>
</if>

 

Back You should login to comment

 

You are
currently not
logged in.

 Log in 

or

Sign up