Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 27th June 2006, 07:42   #1
Swapan Das
Senior Member
 
Join Date: Nov 2005
Location: Kolkata (Calcutta),India
Posts: 106
How to implement If Else Endif condition (e.g if ${OUT3} = 1...read the msg)

I have an issue where if else condition is to be used. I want to check my bundled exe(s)
of my installer with the client's exe and as per the condition I have to upgrade the
user's exe.

I did the following things:

Var Out1
Var Out2
Var Out3
Var BundledExe1 ; MyExe1.exe
Var BundledExe2 ; MyExe2.exe
Var BundledExe3 ; MyExe3.exe

Section ..
;I hard-coded my bundled exe's version in variable
;BundledExe1:
StrCpy $BundledExe1 "5.166.0.29"
${GetFileVersion} '$INSTDIR\MyExe1.exe' $OUT2
${VersionCompare} $BundledExe1 $OUT2 $OUT3

The variable OUT3 is storing the result of versioncompare,which is correct.
Now I want to do something like this with if else branch-out:
if ${OUT3} = 1
MessageBox MB_OK "Older version found - going for upgradation"
.... do the necessary jobs
elseif ${OUT3} = 0
MessageBox MB_OK "SAME VERSION - NO UPGRADE"
.... do the necessary jobs
elseif ${OUT3} = 2
MessageBox MB_OK "UR Version is higher- NO UPGRADE"
.... do the necessary jobs
endif

;;;; i've tried to use the following code but it is giving error:
${If} ${OUT3} ='1'
${Else}
${EndIf}

SectionEnd
Swapan Das 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