megan19
8th April 2006 21:29 UTC
if readINIStr then else?
Hi all,
I was wondering if someone could show me how to build this construction?
As in:
ReadINIStr $0 $INSTDIR\winamp.ini winamp outname == nothing?
Basically I want to use this method to verify an existance of an ini file. In MEL, it returns "" if there is no such file, keystring, etc. But not sure about NSIS, so that's why I wrote nothing.
Thanks!!!
empezar
9th April 2006 00:45 UTC
with LogicLib.nsh
ReadINIStr $0 "$INSTDIR\winamp.ini" winamp outname
${Unless} $0 == ""
MessageBox MB_OK "Value: $0"
${EndUnless}
megan19
9th April 2006 02:11 UTC
empezar,
Thanks for replying. But I am not sure where to put the else statement?
${Unless} $0 == ""
THEN_STATEMENT...
${EndUnless}
Afrow UK
9th April 2006 10:16 UTC
Use IfFileExists.
-Stu
megan19
9th April 2006 19:31 UTC
Thanks alot Afrow.
IfFileExists $WINDIR\notepad.exe 0 +2
MessageBox MB_OK "notepad is installed"
else do_something??
Where do I place the else statement?
Thanks!!
dienjd
9th April 2006 19:55 UTC
Use the logic library to be able to use if-else-end logic.
!include LogicLib.nsh
${If} ${FileExists} $WINDIR\notepad.exe
MessageBox MB_OK "notepad found"
${Else}
MessageBox MB_OK "notepad not found"
${EndIf}
megan19
9th April 2006 22:59 UTC
Hi dienjd,
Thanks alot for replying. I really appreciate it!
Thanks all!!