Archive: if readINIStr then else?


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!!!


with LogicLib.nsh

ReadINIStr $0 "$INSTDIR\winamp.ini" winamp outname
${Unless} $0 == ""
MessageBox MB_OK "Value: $0"
${EndUnless}

empezar,

Thanks for replying. But I am not sure where to put the else statement?

${Unless} $0 == ""
THEN_STATEMENT...
${EndUnless}


Use IfFileExists.

-Stu


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!!


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}

Hi dienjd,

Thanks alot for replying. I really appreciate it!


Thanks all!!