cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
IronGem
Level 2

Using version numbers in conditional statements

I am using a Basic MSI project built in IS2013 (not upgrading from a previous IS project). I would like to set conditions on certain components (XML and Text file changes and such) based on Version numbers (for upgrade purposes). I use the registry component to store the current version on install. What I want to do is, when running updated versions of the MSI, I need to grab the registry value for the previously installed version, then use that value to conditionally install updated components. I.E. A component condition could read something like this '[PREVIOUSVERSION] < [ProductVersion]' (the current installer version) or '[PREVIOUSVERSION] > "1.0.0.1" AND [PREVIOUSVERSION] < "1.0.1.0"' The problem is, I know that the Version properties are stored as Strings and I don't think strings evaluate correctly like this.

Is there an easy way to accomplish this logic and am I heading in the right direction? Is there another mechanism in IS2013 that accomplishes this logic that I haven't found yet?
Any direction would be appreciated.

Thanks
Labels (1)
0 Kudos
(1) Reply
MichaelU
Level 12 Flexeran
Level 12 Flexeran

According to Conditional Statement Syntax, you "cannot use comparative operators to compare versions such as "01.10" and "1.010" in a conditional statement." You are much better off if you can use the various built-in version checking support of Windows Installer.

For installing an unversioned file (like the initial XML file), you can use companion files to control the installation of the unversioned file by that of a versioned file. For changes like XML File Changes which key off of the state of the component, a versioned key file in that component should do the trick.
0 Kudos