Archive: Is there a way for "Conditional Check"?


Is there a way for "Conditional Check"?
Hello,

Good morg.
I'm having some doubts in NSIS Scripting.

Is there anyway in scirpting, so that I can do a Conditional
Check...?

Like,

If "$1==0"
ExecShell open '$INSTDIR\Readme.html'

The above snippet will try to open the Readme.html only if
the Variable $1 equals to Zero..

Thanks In Advance,

Regards
Venky


Venky,

use StrCmp to set conditional statements, eg:

 StrCmp $1 0 "" NotGood
ExecShell open '$INSTDIR\Readme.html'
NotGood:


Greetz, Hendri

Henri,

Thankx for ur response...!

I've some more doubts on that..

I've to do a Integer Comparsion.
I can achieve the same using IntCmp.

However, My comparision wud go like this

If "$?==0"
Do Something
If "$?!=""
Do Someother Thing

I can achieve the "$?!=0 " thru an IntCmp, Where
I'm not aware of the Value $? ( what Negative Value
it may hold)

Thanks In Advance

Regards
Venky


Venky,

use labels, eg:

IntCmp $0 0 "" NotZero
;Do something if zero
Goto Continue
NotZero:
;Do something if not zero
Continue:
;other commands...


Is this what you mean to do?

Good luck, greetz, Hendri.