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
|
@ -10,36 +10,55 @@ These commands are similar to the C preprocessor in terms of purpose and functio
|
|||
|
||||
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.
|
||||
|
||||
\c !include WinMessages.nsh
|
||||
\c !include Library.nsh
|
||||
\c !include MyConfig.nsh
|
||||
\c !include ..\MyConfig.nsh
|
||||
|
||||
\S1{addincludedir} !addincludedir
|
||||
|
||||
\c 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.
|
||||
|
||||
\c !addincludedir ..\include
|
||||
\c !include something.nsh
|
||||
|
||||
\S1{addplugindir} !addplugindir
|
||||
|
||||
\c directory
|
||||
|
||||
Causes the NSIS compiler to scan the given directory for Plugin DLLs.
|
||||
|
||||
\c !addplugindir myplugin
|
||||
\c MyPlugin::SomeFunction
|
||||
|
||||
\S1{cd} !cd
|
||||
|
||||
\c new_path
|
||||
|
||||
This command will change the compiler to the new directory, new_path. new_path can be relative or absolute.
|
||||
|
||||
\c !cd ..\more-scripts\new
|
||||
|
||||
\S1{echo} !echo
|
||||
|
||||
\c message
|
||||
|
||||
This command will echo a message to the user compiling the script.
|
||||
|
||||
\c !echo "hello world"
|
||||
|
||||
\S1{error} !error
|
||||
|
||||
\c [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.
|
||||
|
||||
\c !ifdef VERSION & NOVERSION
|
||||
\c !error "both VERSION and NOVERSION are defined"
|
||||
\c !endif
|
||||
|
||||
\S1{execute} !execute
|
||||
|
||||
\c command
|
||||
|
@ -48,24 +67,39 @@ This command will execute 'command' using a call to CreateProcess(). Unlike \R{s
|
|||
|
||||
On POSIX platforms, !execute will use system() just like \R{system}{!system}.
|
||||
|
||||
\c !execute '"%WINDIR%\notepad.exe" "${NSISDIR}\license.txt"'
|
||||
|
||||
\S1{packhdr} !packhdr
|
||||
|
||||
\c tempfile command
|
||||
|
||||
This option makes the compiler use an external EXE packer (such as \W{http://www.un4seen.com/petite/}{Petite} or \W{http://upx.sourceforge.net/}{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.
|
||||
|
||||
\c !packhdr "%TEMP%\exehead.tmp" '"C:\Program Files\UPX\upx.exe" "%TEMP%\exehead.tmp"'
|
||||
|
||||
\S1{system} !system
|
||||
|
||||
\c 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 '='.
|
||||
|
||||
\c !system '"%WINDIR%\notepad.exe" "${NSISDIR}\license.txt"'
|
||||
\c !system 'echo !define something > newinclude.nsh'
|
||||
\c !include newinclude.nsh
|
||||
\c !ifdef something
|
||||
\c !echo "something is defined"
|
||||
\c !endif
|
||||
|
||||
\S1{warning} !warning
|
||||
|
||||
\c [message]
|
||||
|
||||
This command will issue a warning to the script compiler. You can also add a message to this warning.
|
||||
|
||||
\c !ifdef USE_DANGEROUS_STUFF
|
||||
\c !warning "using dangerous stuff"
|
||||
\c !endif
|
||||
|
||||
\S1{verbose} !verbose
|
||||
|
||||
\c level | push | pop
|
||||
|
@ -74,6 +108,11 @@ This command will set the level of verbosity. 4=all, 3=no script, 2=no info, 1=n
|
|||
|
||||
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.
|
||||
|
||||
\c !verbose push
|
||||
\c !verbose 1
|
||||
\c !include WinMessages.nsh
|
||||
\c !verbose pop
|
||||
|
||||
\S0{comppredefines} Predefines
|
||||
|
||||
You can use these standard predefines to automatically add the build time to the title of development versions, add the date to the version number, etc.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue