Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   conditional !define (http://forums.winamp.com/showthread.php?t=271915)

dans 28th May 2007 16:43

conditional !define
 
I apologize, but this is a pretty basic question.
I was trying to use !define to have conditional actions in the install/uninstall process until I released jumping over the !define lines wasn't really skipping them. How can I have this functionality in NSIS? I basically want to set a "flag" in the onInit function and know about it or the lack of it in the main section.

Thanks in advance!

Comperio 28th May 2007 17:57

Sounds like you may be confusing compile time with run time.

Compile time instructions begin with a "!" symbol and get processed once while your setup is compiling. Compile time conditionals include !if, !ifdef,and !ifmacrodef. The !define command is also a compile-time command

Run-time conditionals are processed at runtime (when the user is actually running the installation).

Based on your explanation, I'd say you are likely looking for a run-time conditional.

LogicLib, can make run-time decisions easy. Let's say you use use the variable $Flag to control. You might use something like this:
code:

${If} $Flag == "1"
; do something here for flag value 1
${Else}
; do something here for other flag values
${EndIf}


dans 28th May 2007 18:45

Ah, I guessed !define was compile time but I didn't know ! meant that :)

Thanks for your help!


All times are GMT. The time now is 04:30.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.