How to use If-else clauses

asked 14 Sep '11, 09:43

Jake's gravatar image

Jake ♦♦
796222226235
accept rate: 98%


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>
link

answered 14 Sep '11, 09:46

Jake's gravatar image

Jake ♦♦
796222226235
accept rate: 98%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×3
×3
×1
×1

Asked: 14 Sep '11, 09:43

Seen: 1,270 times

Last updated: 14 Sep '11, 09:46