Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Convert Version Number? (http://forums.winamp.com/showthread.php?t=230736)

Jamyn 11th November 2005 18:52

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.

kichik 11th November 2005 19:00

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.

Jamyn 11th November 2005 19:06

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


All times are GMT. The time now is 17:46.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.