Previous | Contents | Next

5.1 Compiler Utility Commands

These commands are similar to the C preprocessor in terms of purpose and functionality. They allow file inclusion, conditional compilation, executable header packing, and processes execution during the build process. Note: none of these commands allow use of variables.

5.1.1 !include

file

This command will include 'file' as if it was part of the original script. Note that if a file is included in another directory, the current directory is still where the script was compiled from (not where the included file resides). If the compiler can't find the file it will look for it in every include directory. See !addincludedir for more information.

5.1.2 !addincludedir

directory

Adds another include directory to the include directories list. This list is searched when !include is used. This list's initial value is ${NSISDIR}\Include alone.

5.1.3 !addplugindir

directory

Causes the NSIS compiler to scan the given directory for Plugin DLLs.

5.1.4 !cd

new_path

This command will change the compiler to the new directory, new_path. new_path can be relative or absolute.

5.1.5 !echo

message

This command will echo a message to the user compiling the script.

5.1.6 !error

[message]

This command will issue an error to the script compiler and will stop execution of the script. You can also add a message to this error.

5.1.7 !packhdr

tempfile command

This option makes the compiler an external EXE packer (such as Petite or UPX) to compress the executable header. Specify a temporary file name (such as "temp.dat") and a command line (such as "C:\program files\upx\upx -9 temp.dat") to compress the header.

5.1.8 !system

command [compare comparevalue]

This command will execute 'command' using a call to system(), and if the return value compared (using 'compare') to 'comparevalue' is false, execution will halt. 'compare' can be '<' or '>' or '<>' or '='.

5.1.9 !warning

[message]

This command will issue a warning to the script compiler. You can also add a message to this warning.

5.1.10 !verbose

level | push | pop

This command will set the level of verbosity. 4=all, 3=no script, 2=no info, 1=no warnings, 0=none.

Passing push will cause !verbose to push the current verbosity level on a special stack. Passing pop will cause !verbose to pop the current verbosity level from the same stack and use it.

Previous | Contents | Next