Prev Previous Post   Next Post Next
Old 4th July 2008, 18:16   #1
richiebabes
Junior Member
 
Join Date: Jun 2008
Posts: 27
Convert string to integer?

I am trying to read a text file to get a version number from it. I then want to compare that to the current version and abort if a newer version is already installed. This is what I have so far:

; check existing version
Push 1
Push "$INSTDIR\config\version.txt"
Call ReadFileLine
Pop $0

${If} $0 > 730
MessageBox MB_OK "A newer version of blah is already installed on this machine. Please uninstall it first."
Abort
${EndIf}

The problem is that $0 is a string and I can't find anywhere in the documentation how to convert it to an integer. I don't want to compare strings because 730 would be bigger than 1000.

How do I convert $0 to an integer?
richiebabes is offline   Reply With Quote
 
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump