The following blog doesn't compare properly the ${index} value:

<setInstallerVariable name="index_txt" value="" />
<setInstallerVariable name="index" value="0"/>
<while>
  <actionList>
    <setInstallerVariable name="index_txt" value=" (${index})">
      <ruleList>
        <compareValues>
          <value1>$(index)</value1>
          <logic>greater_or_equal</logic>
          <value2>1</value2>
        </compareValues>
      </ruleList>
    </setInstallerVariable>
    <showInfo text="Index_txt: ${index_txt} Index: ${index} "/>
    <mathExpression>
      <text>${index} +1</text>
      <variable>index</variable>
    </mathExpression>
  </actionList>
  <conditionRuleList>
    <compareText>
      .............
    </compareText>
  </conditionRuleList>
</while>

My expectation are the first time the ${index_txt} to be "", but after that to contain the ${index}.

If the compareValues condition is "1", the ${index_txt} contains ${index} even for Zero. Is it a bug in my code, or a general problem?

asked 07 Aug '13, 08:34

Kris%20Kolev's gravatar image

Kris Kolev
16112
accept rate: 0%

edited 08 Aug '13, 04:08

juanjo's gravatar image

juanjo ♦♦
5.8k413


The problem is that the rule is using $(index) to reference the variable (using parentheses):

    <compareValues>
      <value1>$(index)</value1>
      <logic>greater_or_equal</logic>
      <value2>1</value2>
    </compareValues>

Where you should use curly brackets:

    <compareValues>
      <value1>${index}</value1>
      <logic>greater_or_equal</logic>
      <value2>1</value2>
    </compareValues>
link

answered 08 Aug '13, 04:13

juanjo's gravatar image

juanjo ♦♦
5.8k413
accept rate: 23%

Thank you, Problem solved!

(08 Aug '13, 04:24) Kris Kolev
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:

×2

Asked: 07 Aug '13, 08:34

Seen: 498 times

Last updated: 08 Aug '13, 04:24