Archive: Convert Version Number?


Convert Version Number?
Hi all,

Can anyone help me with converting a version number to a name? Basically, I'm reading the version info from the program's .exe file and trying to change a VERSION variable in the installer.

I have used the last number in the version string to specify what type of release it is. For example:

x.x.x.0 - 89 specifies beta versions.
1.0.3.5 - 1.0.3 beta 5

x.x.x.91 - 99 specifies release candidates.
1.0.4.92 - 1.0.4 RC 2

x.x.x.100 specifies a release build.
1.0.2.100 - 1.0.2 release

Reading the version number from the exe file is fine, thanks to scripting by others in the wiki. But can someone show me an example where I can "search" in the version string for each piece of the version number? The "." makes a great delimiter when searching, but I can't quite wrap my head around how to read each piece into temporary vars. If I could figure out how to read each piece, I think I will be able to do number comparisons to see if the number is higher or lower than a range, etc.

Then I can put the version number in various parts of the installer as "1.0 beta 6" or whatever. I will still try to figure this out myself of course, I'm just not that great with NSIS yet.


There's no need to parse the version number and search for dots. When converting from the values returned by GetDLLVersion to that string, you get those numbers as a byproduct. Read the code comments in the conversion script and you'll see that you can find what you need in $R2, $R3, $R4 and $R5.


You're Right
I feel quite silly now, but you are right. Thanks very much.