added small usage examples
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3703 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
07eb9b6425
commit
38b693f19a
24 changed files with 618 additions and 23 deletions
|
@ -14,18 +14,32 @@ Define/conditional compilation related commands:
|
|||
|
||||
This command will add 'gflag' to the global define list. This will have a similar effect as using the /D switch on the command line (only the define only becomes effective after the !define command).
|
||||
|
||||
\c !define VERSION 1.2
|
||||
|
||||
\S1{undef} !undef
|
||||
|
||||
\c gflag
|
||||
|
||||
Removes an item from the global define list. Note that $\{SYMBOL\} where SYMBOL is undefined will be translated to "$\{SYMBOL\}".
|
||||
|
||||
\c !define SOMETHING
|
||||
\c !undef SOMETHING
|
||||
|
||||
\S1{ifdef} !ifdef
|
||||
|
||||
\c gflag [bcheck [gflag [...]]]
|
||||
|
||||
This command, when paired with an !endif command, will tell the compiler whether or not to compile the lines in between the two lines. If gflag is globally defined (using !define or the /D switch), then the contained lines will be compiled. Otherwise, they will be skipped. 'bcheck' can be specified as & (boolean and) or | (boolean or) along with more gflags -- precedence is simple, left to right.
|
||||
|
||||
\c !define SOMETHING
|
||||
\c !ifdef SOMETHING
|
||||
\c !echo "SOMETHING is defined"
|
||||
\c !endif
|
||||
\c !undef SOMETHING
|
||||
\c !ifdef SOMETHING
|
||||
\c !echo "SOMETHING is defined" # will never be printed
|
||||
\c !endif
|
||||
|
||||
\S1{ifndef} !ifndef
|
||||
|
||||
\c gflag [bcheck [gflag [...]]]
|
||||
|
@ -38,6 +52,12 @@ The opposite of !ifdef. The lines will be compiled when the gflag has not been d
|
|||
|
||||
This command, when paired with an !endif command, will tell the compiler whether or not to compile the lines in between the two lines. If the macro gflag exists, then the contained lines will be compiled. Otherwise, they will be skipped. 'bcheck' can be specified as & (boolean and) or | (boolean or) along with more gflags -- precedence is simple, left to right.
|
||||
|
||||
\c !macro SomeMacro
|
||||
\c !macroend
|
||||
\c !ifmacrodef SomeMacro
|
||||
\c !echo "SomeMacro is defined"
|
||||
\c !endif
|
||||
|
||||
\S1{ifmacrondef} !ifmacrondef
|
||||
|
||||
\c gflag [bcheck [gflag [...]]]
|
||||
|
@ -50,6 +70,12 @@ The opposite of !ifmacrodef. The lines will be compiled when the macro gflag doe
|
|||
|
||||
This command allows to easily insert different code when different defines or macros are set. You can create blocks like !ifdef/!else/!endif, !ifdef/!else ifdef/!else/!endif etc.
|
||||
|
||||
\c !ifdef VERSION
|
||||
\c OutFile installer-${VERSION}.exe
|
||||
\c !else
|
||||
\c OutFile installer.exe
|
||||
\c !endif
|
||||
|
||||
\S1{endif} !endif
|
||||
|
||||
This command closes a block started with !ifdef, !ifndef, !ifmacrodef or !ifmacrondef.
|
||||
|
@ -60,12 +86,24 @@ This command closes a block started with !ifdef, !ifndef, !ifmacrodef or !ifmacr
|
|||
|
||||
Inserts the contents of a macro that was created with !macro. If the macro was created with parameters, then you must pass as many parameters to the macro as it requires.
|
||||
|
||||
\c !macro Print text
|
||||
\c DetailPrint "${text}"
|
||||
\c !macroend
|
||||
\c !insertmacro Print "some text"
|
||||
\c !insertmacro Print "some more text"
|
||||
|
||||
\S1{macro} !macro
|
||||
|
||||
\c macro_name [parameter][...]
|
||||
|
||||
Creates a macro named 'macro_name'. All lines between the !macro and the !macroend will be saved. To insert the macro later on, use !insertmacro. !macro definitions can have one or more parameters defined. The parameters may be accessed the same way a !define would (e.g. $\{PARMNAME\}) from inside the macro.
|
||||
|
||||
\c !macro SomeMacro parm1 parm2 parm3
|
||||
\c DetailPrint "${parm1}"
|
||||
\c MessageBox MB_OK "${parm2}"
|
||||
\c File "${parm3}"
|
||||
\c !macroend
|
||||
|
||||
\S1{macroend} !macroend
|
||||
|
||||
Ends a macro that was started with !macro.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue