This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Using version numbers in conditional statements
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Mar 10, 2014
03:12 PM
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
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
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Mar 11, 2014
11:26 AM
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.
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.