How can I compare two versions?

asked 14 Sep '11, 08:04

Jake's gravatar image

Jake ♦♦
826222226235
accept rate: 98%


Since version 6.2.2, InstallBuilder includes a new <compareVersions> rule. Its basic usage is explained in the below snippet:

<showInfo text="version1 is greater than version2">
   <ruleList>
     <compareVersions version1="1.04-3" version2="1.4.2_9" logic="greater" /> 
   </ruleList>
</showInfo>

The <compareVersions> rule will compare the components of both versions split by the characters '.', '-' or '_'. The rule can also accept letters (1-4-a vs 1.4-b) but it cannot compares letters with numbers (1.4 vs 1-b).

The allowed values to the 'logic' property are: 'less_or_equal', 'less', 'greater_or_equal', 'greater', 'does_not_equal', 'equals'.

link

answered 14 Sep '11, 08:05

Jake's gravatar image

Jake ♦♦
826222226235
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:

×4
×1

Asked: 14 Sep '11, 08:04

Seen: 814 times

Last updated: 14 Sep '11, 08:05