How can I compare two versions?

asked 14 Sep '11, 08:04

Jake's gravatar image

Jake ♦♦
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">
     <compareVersions version1="1.04-3" version2="1.4.2_9" logic="greater" /> 

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'.


answered 14 Sep '11, 08:05

Jake's gravatar image

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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



Asked: 14 Sep '11, 08:04

Seen: 814 times

Last updated: 14 Sep '11, 08:05