Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Bug or error in script ( IntCmp) (http://forums.winamp.com/showthread.php?t=224852)

BioDuo 30th August 2005 12:46

Bug or error in script ( IntCmp)
 
Well for some reason, yet unknown to me.
The following script will jump each time to "install"
is it a bug in IntCmp that it can't reconise a '.' in it
or is it something else?

Function .onInit

StrCpy $0 "1.64"

IntCmp $0 1.65 install old 0
IntCmp $0 1.71 install 0 new

old:
MessageBox MB_YESNO|MB_ICONEXCLAMATION|MB_TOPMOST|MB_DEFBUTTON2 "Older version" IDYES install
Abort

new:
MessageBox MB_YESNO|MB_ICONEXCLAMATION|MB_TOPMOST|MB_DEFBUTTON2 "Newer version" IDYES +2
Abort

install:
FunctionEnd

Pidgeot 30th August 2005 14:33

Int signifies an integer. Since your numbers have decimals, they're not integers, and IntCmp won't work.

You should be able to use StrCmp instead.

deguix 30th August 2005 18:32

No, those are version numbers. There are functions in the wiki that compare between version numbers, but I can't access the wiki right now to indicate them to you.


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

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.