summaryrefslogtreecommitdiff
path: root/Docs/src
diff options
context:
space:
mode:
authorDidier Raboud <odyx@debian.org>2018-03-31 20:38:05 +0200
committerDidier Raboud <odyx@debian.org>2018-03-31 20:38:05 +0200
commit57ba1ad89a375b1a6748bf19df10cc12f6d4706a (patch)
tree73e163b8702ead43b428864cec176f96d6f1bcf4 /Docs/src
parent1a96fb2827d0e735fce6f6a084f73b9fb186dc3f (diff)
Import Upstream version 2.08
Diffstat (limited to 'Docs/src')
-rwxr-xr-x[-rw-r--r--]Docs/src/SConscript3
-rwxr-xr-x[-rw-r--r--]Docs/src/attributes.but2
-rwxr-xr-x[-rw-r--r--]Docs/src/basic.but0
-rwxr-xr-x[-rw-r--r--]Docs/src/bin/halibut/LICENSE0
-rwxr-xr-x[-rw-r--r--]Docs/src/bin/halibut/SConscript0
-rwxr-xr-x[-rw-r--r--]Docs/src/bin/halibut/biblio.c0
-rwxr-xr-x[-rw-r--r--]Docs/src/bin/halibut/bk_xhtml.c0
-rwxr-xr-x[-rw-r--r--]Docs/src/bin/halibut/contents.c0
-rwxr-xr-x[-rw-r--r--]Docs/src/bin/halibut/error.c0
-rwxr-xr-x[-rw-r--r--]Docs/src/bin/halibut/halibut.h0
-rwxr-xr-x[-rw-r--r--]Docs/src/bin/halibut/help.c0
-rwxr-xr-x[-rw-r--r--]Docs/src/bin/halibut/index.c0
-rwxr-xr-x[-rw-r--r--]Docs/src/bin/halibut/input.c6
-rwxr-xr-x[-rw-r--r--]Docs/src/bin/halibut/keywords.c0
-rwxr-xr-x[-rw-r--r--]Docs/src/bin/halibut/licence.c0
-rwxr-xr-x[-rw-r--r--]Docs/src/bin/halibut/main.c0
-rwxr-xr-x[-rw-r--r--]Docs/src/bin/halibut/malloc.c0
-rwxr-xr-x[-rw-r--r--]Docs/src/bin/halibut/misc.c0
-rwxr-xr-x[-rw-r--r--]Docs/src/bin/halibut/style.c0
-rwxr-xr-x[-rw-r--r--]Docs/src/bin/halibut/tree234.c0
-rwxr-xr-x[-rw-r--r--]Docs/src/bin/halibut/tree234.h0
-rwxr-xr-x[-rw-r--r--]Docs/src/bin/halibut/ustring.c0
-rwxr-xr-x[-rw-r--r--]Docs/src/bin/halibut/version.c0
-rwxr-xr-x[-rw-r--r--]Docs/src/build.but6
-rwxr-xr-x[-rw-r--r--]Docs/src/callback.but6
-rwxr-xr-x[-rw-r--r--]Docs/src/chm_config.but2
-rwxr-xr-x[-rw-r--r--]Docs/src/chmlink.js0
-rwxr-xr-x[-rw-r--r--]Docs/src/compiler.but4
-rwxr-xr-x[-rw-r--r--]Docs/src/compilerflags.but0
-rwxr-xr-x[-rw-r--r--]Docs/src/config.but2
-rwxr-xr-x[-rw-r--r--]Docs/src/credits.but4
-rwxr-xr-x[-rw-r--r--]Docs/src/defines.but0
-rwxr-xr-x[-rw-r--r--]Docs/src/file.but0
-rwxr-xr-x[-rw-r--r--]Docs/src/flowcontrol.but2
-rwxr-xr-x[-rw-r--r--]Docs/src/functions.but0
-rwxr-xr-x[-rw-r--r--]Docs/src/generalpurpose.but0
-rwxr-xr-xDocs/src/headers.but2506
-rwxr-xr-x[-rw-r--r--]Docs/src/history.but49
-rwxr-xr-x[-rw-r--r--]Docs/src/int.but0
-rwxr-xr-x[-rw-r--r--]Docs/src/intro.but2
-rwxr-xr-x[-rw-r--r--]Docs/src/jumps.but0
-rwxr-xr-x[-rw-r--r--]Docs/src/labels.but0
-rwxr-xr-x[-rw-r--r--]Docs/src/langs.but0
-rwxr-xr-x[-rw-r--r--]Docs/src/library.but2
-rwxr-xr-x[-rw-r--r--]Docs/src/license.but0
-rwxr-xr-x[-rw-r--r--]Docs/src/log.but0
-rwxr-xr-x[-rw-r--r--]Docs/src/misc.but0
-rwxr-xr-x[-rw-r--r--]Docs/src/modernui.but0
-rwxr-xr-x[-rw-r--r--]Docs/src/nsis.hhp0
-rwxr-xr-x[-rw-r--r--]Docs/src/pages.but0
-rwxr-xr-x[-rw-r--r--]Docs/src/plugin.but0
-rwxr-xr-x[-rw-r--r--]Docs/src/reboot.but0
-rwxr-xr-x[-rw-r--r--]Docs/src/registry.but0
-rwxr-xr-x[-rw-r--r--]Docs/src/script.but2
-rwxr-xr-x[-rw-r--r--]Docs/src/sec.but0
-rwxr-xr-x[-rw-r--r--]Docs/src/sections.but0
-rwxr-xr-x[-rw-r--r--]Docs/src/silent.but0
-rwxr-xr-x[-rw-r--r--]Docs/src/stack.but0
-rwxr-xr-x[-rw-r--r--]Docs/src/string.but0
-rwxr-xr-x[-rw-r--r--]Docs/src/tutorial.but6
-rwxr-xr-x[-rw-r--r--]Docs/src/ui.but6
-rwxr-xr-x[-rw-r--r--]Docs/src/uninstall.but0
-rwxr-xr-x[-rw-r--r--]Docs/src/usage.but41
-rwxr-xr-x[-rw-r--r--]Docs/src/usection.but0
-rwxr-xr-x[-rw-r--r--]Docs/src/usefulfunc.but2
-rwxr-xr-x[-rw-r--r--]Docs/src/usefulinfos.but6
-rwxr-xr-x[-rw-r--r--]Docs/src/var.but12
67 files changed, 2640 insertions, 31 deletions
diff --git a/Docs/src/SConscript b/Docs/src/SConscript
index 4f399cf..c3eaab9 100644..100755
--- a/Docs/src/SConscript
+++ b/Docs/src/SConscript
@@ -1,7 +1,7 @@
config_but = 'config.but'
chapters = 5
-appendices = 8
+appendices = 9
htmls = Split('IndexPage.html Contents.html') \
+ map(lambda ch: 'Chapter' + str(ch + 1) + '.html', range(chapters)) \
@@ -47,6 +47,7 @@ buts = Split("""
library.but
usefulfunc.but
usefulinfos.but
+ headers.but
history.but
build.but
credits.but
diff --git a/Docs/src/attributes.but b/Docs/src/attributes.but
index 090c757..e2893af 100644..100755
--- a/Docs/src/attributes.but
+++ b/Docs/src/attributes.but
@@ -207,7 +207,7 @@ Sets the colors to use for the install info screen (the default is 00FF00 000000
\c definstdir
-Sets the default installation directory is. See the \R{variables}{variables section} for variables that can be used to make this string (especially $PROGRAMFILES). Note that the part of this string following the last \\ will be used if the user selects 'browse', and may be appended back on to the string at install time (to disable this, end the directory with a \\ (which will require the entire parameter to be enclosed with quotes). If this doesn't make any sense, play around with the browse button a bit.
+Sets the default installation directory. See the \R{variables}{variables section} for variables that can be used to make this string (especially $PROGRAMFILES). Note that the part of this string following the last \\ will be used if the user selects 'browse', and may be appended back on to the string at install time (to disable this, end the directory with a \\ (which will require the entire parameter to be enclosed with quotes). If this doesn't make any sense, play around with the browse button a bit.
\S2{ainstalldirregkey} InstallDirRegKey
diff --git a/Docs/src/basic.but b/Docs/src/basic.but
index 033a43e..033a43e 100644..100755
--- a/Docs/src/basic.but
+++ b/Docs/src/basic.but
diff --git a/Docs/src/bin/halibut/LICENSE b/Docs/src/bin/halibut/LICENSE
index 7a6b724..7a6b724 100644..100755
--- a/Docs/src/bin/halibut/LICENSE
+++ b/Docs/src/bin/halibut/LICENSE
diff --git a/Docs/src/bin/halibut/SConscript b/Docs/src/bin/halibut/SConscript
index 24ecfcb..24ecfcb 100644..100755
--- a/Docs/src/bin/halibut/SConscript
+++ b/Docs/src/bin/halibut/SConscript
diff --git a/Docs/src/bin/halibut/biblio.c b/Docs/src/bin/halibut/biblio.c
index 0b67105..0b67105 100644..100755
--- a/Docs/src/bin/halibut/biblio.c
+++ b/Docs/src/bin/halibut/biblio.c
diff --git a/Docs/src/bin/halibut/bk_xhtml.c b/Docs/src/bin/halibut/bk_xhtml.c
index 5b1bb7b..5b1bb7b 100644..100755
--- a/Docs/src/bin/halibut/bk_xhtml.c
+++ b/Docs/src/bin/halibut/bk_xhtml.c
diff --git a/Docs/src/bin/halibut/contents.c b/Docs/src/bin/halibut/contents.c
index 28bc1f6..28bc1f6 100644..100755
--- a/Docs/src/bin/halibut/contents.c
+++ b/Docs/src/bin/halibut/contents.c
diff --git a/Docs/src/bin/halibut/error.c b/Docs/src/bin/halibut/error.c
index 9d45e82..9d45e82 100644..100755
--- a/Docs/src/bin/halibut/error.c
+++ b/Docs/src/bin/halibut/error.c
diff --git a/Docs/src/bin/halibut/halibut.h b/Docs/src/bin/halibut/halibut.h
index 43cd7da..43cd7da 100644..100755
--- a/Docs/src/bin/halibut/halibut.h
+++ b/Docs/src/bin/halibut/halibut.h
diff --git a/Docs/src/bin/halibut/help.c b/Docs/src/bin/halibut/help.c
index bcb3701..bcb3701 100644..100755
--- a/Docs/src/bin/halibut/help.c
+++ b/Docs/src/bin/halibut/help.c
diff --git a/Docs/src/bin/halibut/index.c b/Docs/src/bin/halibut/index.c
index 94ccf52..94ccf52 100644..100755
--- a/Docs/src/bin/halibut/index.c
+++ b/Docs/src/bin/halibut/index.c
diff --git a/Docs/src/bin/halibut/input.c b/Docs/src/bin/halibut/input.c
index a126e38..04f9a2a 100644..100755
--- a/Docs/src/bin/halibut/input.c
+++ b/Docs/src/bin/halibut/input.c
@@ -731,6 +731,12 @@ static void read_file(paragraph *** ret, input * in, indexdata * idx)
continue;
}
+ while (t.type == tok_cmd && macrolookup(macros, in, t.text, &t.pos))
+ {
+ dtor(t), t = get_token(in);
+ }
+
+
/*
* This token begins a paragraph. See if it's one of the
* special commands that define a paragraph type.
diff --git a/Docs/src/bin/halibut/keywords.c b/Docs/src/bin/halibut/keywords.c
index 0c9ba17..0c9ba17 100644..100755
--- a/Docs/src/bin/halibut/keywords.c
+++ b/Docs/src/bin/halibut/keywords.c
diff --git a/Docs/src/bin/halibut/licence.c b/Docs/src/bin/halibut/licence.c
index b48e0f1..b48e0f1 100644..100755
--- a/Docs/src/bin/halibut/licence.c
+++ b/Docs/src/bin/halibut/licence.c
diff --git a/Docs/src/bin/halibut/main.c b/Docs/src/bin/halibut/main.c
index 18c136c..18c136c 100644..100755
--- a/Docs/src/bin/halibut/main.c
+++ b/Docs/src/bin/halibut/main.c
diff --git a/Docs/src/bin/halibut/malloc.c b/Docs/src/bin/halibut/malloc.c
index 07c8519..07c8519 100644..100755
--- a/Docs/src/bin/halibut/malloc.c
+++ b/Docs/src/bin/halibut/malloc.c
diff --git a/Docs/src/bin/halibut/misc.c b/Docs/src/bin/halibut/misc.c
index e1818ad..e1818ad 100644..100755
--- a/Docs/src/bin/halibut/misc.c
+++ b/Docs/src/bin/halibut/misc.c
diff --git a/Docs/src/bin/halibut/style.c b/Docs/src/bin/halibut/style.c
index 2e92b41..2e92b41 100644..100755
--- a/Docs/src/bin/halibut/style.c
+++ b/Docs/src/bin/halibut/style.c
diff --git a/Docs/src/bin/halibut/tree234.c b/Docs/src/bin/halibut/tree234.c
index 7a72a3f..7a72a3f 100644..100755
--- a/Docs/src/bin/halibut/tree234.c
+++ b/Docs/src/bin/halibut/tree234.c
diff --git a/Docs/src/bin/halibut/tree234.h b/Docs/src/bin/halibut/tree234.h
index ff80ea6..ff80ea6 100644..100755
--- a/Docs/src/bin/halibut/tree234.h
+++ b/Docs/src/bin/halibut/tree234.h
diff --git a/Docs/src/bin/halibut/ustring.c b/Docs/src/bin/halibut/ustring.c
index 8811546..8811546 100644..100755
--- a/Docs/src/bin/halibut/ustring.c
+++ b/Docs/src/bin/halibut/ustring.c
diff --git a/Docs/src/bin/halibut/version.c b/Docs/src/bin/halibut/version.c
index e59e97c..e59e97c 100644..100755
--- a/Docs/src/bin/halibut/version.c
+++ b/Docs/src/bin/halibut/version.c
diff --git a/Docs/src/build.but b/Docs/src/build.but
index e9f68b2..bc8a590 100644..100755
--- a/Docs/src/build.but
+++ b/Docs/src/build.but
@@ -45,7 +45,7 @@ To get a complete list of options that the build system has to offer, type:
\c scons -h
-To get a complete list of options SCons has to offset, type:
+To get a complete list of options SCons has to offer, type:
\c scons -H
@@ -63,6 +63,8 @@ If you get errors about the compiler or the Platform SDK not being found, use:
You can also build using the open-source \W{http://www.mingw.org/}{MinGW}, but this results in noticeably larger installers. Borland C++ or Open Watcom C/C++ might also work, but haven't been tested.
+To compile the documentation as a CHM file, you must have hhc.exe from \W{http://msdn.microsoft.com/library/en-us/htmlhelp/html/hwMicrosoftHTMLHelpDownloads.asp}{HTML Help Workshop} in the PATH.
+
\\<b\\>Important notes for Microsoft Visual C++ 6.0 users:\\</b\\> You should install the latest \W{http://www.microsoft.com/msdownload/platformsdk/sdkupdate/}{Platform SDK}. Because of flaws in the libraries distributed with Microsoft Visual C++ 6.0, not installing the Platform SDK will result in crashes when using the CopyFiles command. See \W{http://forums.winamp.com/showthread.php?s=&threadid=131964}{this forum topic} for more information. Installing the \W{http://msdn.microsoft.com/vstudio/downloads/tools/ppack/download.aspx}{Processor Pack} is highly recommended to decrease the size of the installer overhead.
\H{build_posix}Building on POSIX
@@ -75,6 +77,8 @@ If you don't have a cross compiler, you can use:
This should only build makensis. Once you have makensis, you can drop it in a downloaded precompiled package such as the nightly build. Note that the in order for this to work, the precompiled package must be compiled using the exact same sources as makensis. In particular, \c{Source\\exehead\\config.h} and \c{Source\\exehead\\fileform.h} must be identical.
+Note that compiling on big-endian platforms is possible. However, makensis will not work on such platforms.
+
\H{build_nightly}Nightly Builds
If you don't want to build NSIS on your own but want to get the latest CVS version, you can use the \W{http://nsis.sourceforge.net/nightly/nsis.zip}{nightly build}. The nightly build is automatically generated every night from source code in CVS.
diff --git a/Docs/src/callback.but b/Docs/src/callback.but
index 6a3a98b..d4fdff0 100644..100755
--- a/Docs/src/callback.but
+++ b/Docs/src/callback.but
@@ -77,13 +77,13 @@ Example:
\c Function .onMouseOverSection
\c FindWindow $R0 "#32770" "" $HWNDPARENT
-\c GetDlgItem $R0 $R0 1043 ; description item
+\c GetDlgItem $R0 $R0 1043 ; description item (must be added to the UI)
\c
\c StrCmp $0 0 "" +2
-\c SendMessage $R0 ${WM_SETTEXT} 0 "first section description"
+\c SendMessage $R0 ${WM_SETTEXT} 0 "STR:first section description"
\c
\c StrCmp $0 1 "" +2
-\c SendMessage $R0 ${WM_SETTEXT} 0 "second section description"
+\c SendMessage $R0 ${WM_SETTEXT} 0 "STR:second section description"
\c FunctionEnd
\S3{onrebootfailed} .onRebootFailed
diff --git a/Docs/src/chm_config.but b/Docs/src/chm_config.but
index 906a034..e75f6ad 100644..100755
--- a/Docs/src/chm_config.but
+++ b/Docs/src/chm_config.but
@@ -18,7 +18,7 @@
\preamble Check \W{http://nsis.sourceforge.net/}{http://nsis.sf.net} for news, information, support, examples, tutorials and more.
-\preamble Quick links:\\<br\\>\W{http://nsis.sourceforge.net/support/faq/}{FAQ} - A list of frequently asked questions\\<br\\>\W{http://nsis.sourceforge.net/archive/}{NSIS Archive} - Examples, functions, tutorials, plug-ins, software, more\\<br\\>\W{http://forums.winamp.com/forumdisplay.php?forumid=65}{Forum} - Post questions or discuss NSIS features
+\preamble Quick links:\\<br\\>\W{http://nsis.sourceforge.net/support/faq/}{FAQ} - A list of frequently asked questions\\<br\\>\W{http://nsis.sourceforge.net/wiki/}{NSIS Wiki} - Examples, functions, tutorials, plug-ins, software and more\\<br\\>\W{http://forums.winamp.com/forumdisplay.php?forumid=65}{Forum} - Post questions or discuss NSIS features
\copyright Copyright (C) 1999-2005 Nullsoft, Inc.
diff --git a/Docs/src/chmlink.js b/Docs/src/chmlink.js
index fff80ab..fff80ab 100644..100755
--- a/Docs/src/chmlink.js
+++ b/Docs/src/chmlink.js
diff --git a/Docs/src/compiler.but b/Docs/src/compiler.but
index b22f844..4ab1945 100644..100755
--- a/Docs/src/compiler.but
+++ b/Docs/src/compiler.but
@@ -8,7 +8,7 @@ These commands are similar to the C preprocessor in terms of purpose and functio
\c 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.
+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 \R{addincludedir}{!addincludedir} for more information.
\c !include WinMessages.nsh
\c !include Library.nsh
@@ -75,7 +75,7 @@ On POSIX platforms, !execute will use system() just like \R{system}{!system}.
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"'
+\c !packhdr "$%TEMP%\exehead.tmp" '"C:\Program Files\UPX\upx.exe" "$%TEMP%\exehead.tmp"'
\S1{system} !system
diff --git a/Docs/src/compilerflags.but b/Docs/src/compilerflags.but
index 4407c2c..4407c2c 100644..100755
--- a/Docs/src/compilerflags.but
+++ b/Docs/src/compilerflags.but
diff --git a/Docs/src/config.but b/Docs/src/config.but
index 040de9d..6431d02 100644..100755
--- a/Docs/src/config.but
+++ b/Docs/src/config.but
@@ -14,6 +14,6 @@
\preamble Check \W{http://nsis.sourceforge.net/}{http://nsis.sf.net} for news, information, support, examples, tutorials and more.
-\preamble Quick links:\\<br\\>\W{http://nsis.sourceforge.net/support/faq/}{FAQ} - A list of frequently asked questions\\<br\\>\W{http://nsis.sourceforge.net/archive/}{NSIS Archive} - Examples, functions, tutorials, plug-ins, software, more\\<br\\>\W{http://forums.winamp.com/forumdisplay.php?forumid=65}{Forum} - Post questions or discuss NSIS features
+\preamble Quick links:\\<br\\>\W{http://nsis.sourceforge.net/support/faq/}{FAQ} - A list of frequently asked questions\\<br\\>\W{http://nsis.sourceforge.net/wiki/}{NSIS Wiki} - Examples, functions, tutorials, plug-ins, software and more\\<br\\>\W{http://forums.winamp.com/forumdisplay.php?forumid=65}{Forum} - Post questions or discuss NSIS features
\copyright Copyright (C) 1999-2005 Nullsoft, Inc. \ No newline at end of file
diff --git a/Docs/src/credits.but b/Docs/src/credits.but
index 9f39e85..59ee5c6 100644..100755
--- a/Docs/src/credits.but
+++ b/Docs/src/credits.but
@@ -106,6 +106,8 @@ Arabic - \e{asdfuae, Rami Kattan}
Belarusian - \e{Sitnikov Vjacheslav}
+Bosnian - \e{Salih CAVKIC}
+
Breton - \e{Korvigello\uF9 An Drouizig}
Bulgarian - \e{Asparouh Kalyandjiev, Plamen Penkov}
@@ -146,6 +148,8 @@ Japanese - \e{Dnanako, Takahiro Yoshimura}
Korean - \e{dTomoyo, linak, koder}
+Kurdish - \e{Erdal Ronahi}
+
Latvian - \e{Valdis Griíis, Kristaps Meòìelis}
Lithuanian - \e{NorCis, Vytautas Krivickas, Danielius Scepanskis}
diff --git a/Docs/src/defines.but b/Docs/src/defines.but
index d5cb7e4..d5cb7e4 100644..100755
--- a/Docs/src/defines.but
+++ b/Docs/src/defines.but
diff --git a/Docs/src/file.but b/Docs/src/file.but
index f4d805d..f4d805d 100644..100755
--- a/Docs/src/file.but
+++ b/Docs/src/file.but
diff --git a/Docs/src/flowcontrol.but b/Docs/src/flowcontrol.but
index 747465f..73307c3 100644..100755
--- a/Docs/src/flowcontrol.but
+++ b/Docs/src/flowcontrol.but
@@ -299,4 +299,4 @@ Compares (case insensitively) str1 to str2. If str1 and str2 are equal, Gotos ju
\c StrCmp $0 "a string" 0 +3
\c DetailPrint '$$0 == "a string"'
\c Goto +2
-\c DeteailPrint '$$0 != "a string"'
+\c DetailPrint '$$0 != "a string"'
diff --git a/Docs/src/functions.but b/Docs/src/functions.but
index c1c54fd..c1c54fd 100644..100755
--- a/Docs/src/functions.but
+++ b/Docs/src/functions.but
diff --git a/Docs/src/generalpurpose.but b/Docs/src/generalpurpose.but
index ee2dcaf..ee2dcaf 100644..100755
--- a/Docs/src/generalpurpose.but
+++ b/Docs/src/generalpurpose.but
diff --git a/Docs/src/headers.but b/Docs/src/headers.but
new file mode 100755
index 0000000..09b56c0
--- /dev/null
+++ b/Docs/src/headers.but
@@ -0,0 +1,2506 @@
+\A{headers} Useful Headers
+
+
+\H{filefunc} File Functions Header
+
+
+\S1{} Introduction
+
+Include header:
+
+\c !include "FileFunc.nsh"
+
+
+Include function "GetFileExt" for install and "GetParent" for uninstall:
+
+\c !insertmacro GetFileExt
+\c !insertmacro un.GetParent
+
+
+Call functions:
+
+\c Section Install
+\c ${GetFileExt} "C:\My Downloads\Index.html" $R0
+\c ; $R0="html"
+\c SectionEnd
+
+\c Section un.Install
+\c ${un.GetParent} "C:\My Downloads\Index.html" $R0
+\c ; $R0="C:\My Downloads"
+\c SectionEnd
+
+
+\S1{} Locate
+
+\b Find files, directories and empty directories with mask and size options.
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${Locate} "[Path]" "[Options]" "Function"
+
+\c "[Path]" ; Disk or Directory
+\c ;
+\c "[Options]" ; /L=[FD|F|D|DE|FDE]
+\c ; /L=FD - Locate Files and Directories (default)
+\c ; /L=F - Locate Files only
+\c ; /L=D - Locate Directories only
+\c ; /L=DE - Locate Empty Directories only
+\c ; /L=FDE - Locate Files and Empty Directories
+\c ; /M=[mask]
+\c ; /M=*.* - Locate all (default)
+\c ; /M=*.doc - Locate Work.doc, 1.doc ...
+\c ; /M=Pho* - Locate PHOTOS, phone.txt ...
+\c ; /M=win???.exe - Locate winamp.exe, winver.exe ...
+\c ; /M=winamp.exe - Locate winamp.exe only
+\c ; /S=No:No[B|K|M|G]
+\c ; /S= - Don't locate file size (faster) (default)
+\c ; /S=0:0B - Locate only files of 0 Bytes exactly
+\c ; /S=5:9K - Locate only files of 5 to 9 Kilobytes
+\c ; /S=:10M - Locate only files of 10 Megabyte or less
+\c ; /S=1G - Locate only files of 1 Gigabyte or more
+\c ; /G=[1|0]
+\c ; /G=1 - Locate with subdirectories (default)
+\c ; /G=0 - Locate without subdirectories
+\c ; /B=[0|1]
+\c ; /B=0 - Banner isn't used (default)
+\c ; /B=1 - Banner is used. Callback when function
+\c ; start to search in new directory
+\c "Function" ; Callback function when found
+\c
+\c Function "Function"
+\c ; $R9 "path\name"
+\c ; $R8 "path"
+\c ; $R7 "name"
+\c ; $R6 "size" ($R6="" if directory, $R6="0" if file with /S=)
+\c
+\c ; $R0-$R5 are not used (save data in them).
+\c ; ...
+\c
+\c Push $var ; If $var="StopLocate" Then exit from function
+\c FunctionEnd
+
+\\<b\\>Note:\\</b\\>
+\\<br\\>-Error flag if disk or directory isn't exist
+\\<br\\>-Error flag if syntax error
+
+
+\\<b\\>Example (Find one file):\\</b\\>
+
+\c Section
+\c ${Locate} "C:\ftp" "/L=F /M=RPC DCOM.rar /S=1K" "Example1"
+\c ; 'RPC DCOM.rar' file in 'C:\ftp' with size 1 Kb or more
+\c
+\c IfErrors 0 +2
+\c MessageBox MB_OK "Error" IDOK +2
+\c MessageBox MB_OK "$$R0=$R0"
+\c SectionEnd
+\c
+\c Function Example1
+\c StrCpy $R0 $R9
+\c ; $R0="C:\ftp\files\RPC DCOM.rar"
+\c
+\c MessageBox MB_YESNO '$R0$\n$\nFind next?' IDYES +2
+\c StrCpy $0 StopLocate
+\c
+\c Push $0
+\c FunctionEnd
+
+\\<b\\>Example (Write founded in text file):\\</b\\>
+
+\c Section
+\c GetTempFileName $R0
+\c FileOpen $R1 $R0 w
+\c ${Locate} "C:\ftp" "/S=:2M /G=0" "Example2"
+\c ; folders and all files with size 2 Mb or less
+\c ; don't scan subdirectories
+\c FileClose $R1
+\c
+\c IfErrors 0 +2
+\c MessageBox MB_OK "Error" IDOK +2
+\c Exec '"notepad.exe" "$R0"'
+\c SectionEnd
+\c
+\c Function Example2
+\c StrCmp $R6 '' 0 +3
+\c FileWrite $R1 "Directory=$R9$\r$\n"
+\c goto +2
+\c FileWrite $R1 "File=$R9 Size=$R6 Mb$\r$\n"
+\c
+\c Push $0
+\c FunctionEnd
+
+\\<b\\>Example (Write founded in INI file):\\</b\\>
+
+\c Section
+\c GetTempFileName $R0
+\c ${Locate} "C:\ftp" "/L=F /S=0K" "Example3"
+\c ; all files in 'C:\ftp' with size detect in Kb
+\c
+\c IfErrors 0 +2
+\c MessageBox MB_OK "Error" IDOK +2
+\c Exec '"notepad.exe" "$R0"'
+\c SectionEnd
+\c
+\c Function Example3
+\c WriteINIStr $R0 "$R8" "$R7" "$R6 Kb"
+\c
+\c Push $0
+\c FunctionEnd
+
+\\<b\\>Example (Delete empty directories):\\</b\\>
+
+\c Section
+\c StrCpy $R2 0
+\c StrCpy $R3 0
+\c
+\c loop:
+\c StrCpy $R1 0
+\c ${Locate} "C:\ftp" "/L=DE" "Example4"
+\c IntOp $R3 $R3 + 1
+\c IntOp $R2 $R2 + $R1
+\c StrCmp $R0 StopLocate +2
+\c StrCmp $R1 0 0 loop
+\c
+\c IfErrors 0 +2
+\c MessageBox MB_OK 'error' IDOK +2
+\c MessageBox MB_OK '$R2 directories were removed$\n$R3 loops'
+\c SectionEnd
+\c
+\c Function Example4
+\c MessageBox MB_YESNOCANCEL 'Delete empty "$R9"?' IDNO end IDCANCEL cancel
+\c RMDir $R9
+\c IntOp $R1 $R1 + 1
+\c goto end
+\c
+\c cancel:
+\c StrCpy $R0 StopLocate
+\c
+\c end:
+\c Push $R0
+\c FunctionEnd
+
+\\<b\\>Example (Move all files into one folder):\\</b\\>
+
+\c Section
+\c StrCpy $R0 "C:\ftp" ;Directory move from
+\c StrCpy $R1 "C:\ftp2" ;Directory move into
+\c
+\c StrCpy $R2 0
+\c StrCpy $R3 0
+\c ${Locate} "$R0" "/L=F" "Example5"
+\c
+\c IfErrors 0 +2
+\c MessageBox MB_OK 'error' IDOK +4
+\c StrCmp $R3 0 0 +2
+\c MessageBox MB_OK '$R2 files were moved' IDOK +2
+\c MessageBox MB_OK '$R2 files were moved$\n$R3 files were NOT moved'
+\c SectionEnd
+\c
+\c Function Example5
+\c StrCmp $R8 $R1 +6
+\c IfFileExists '$R1\$R7' +4
+\c Rename $R9 '$R1\$R7'
+\c IntOp $R2 $R2 + 1
+\c goto +2
+\c IntOp $R3 $R3 + 1
+\c
+\c Push $0
+\c FunctionEnd
+
+\\<b\\>Example (Copy files with log):\\</b\\>
+
+\c Section
+\c StrCpy $R0 "C:\ftp" ;Directory copy from
+\c StrCpy $R1 "C:\ftp2" ;Directory copy into
+\c StrLen $R2 $R0
+\c
+\c GetTempFileName $0
+\c FileOpen $R3 $0 w
+\c ${Locate} "$R0" "/L=FDE" "Example6"
+\c FileClose $R3
+\c
+\c IfErrors 0 +2
+\c MessageBox MB_OK 'error'
+\c
+\c Exec '"notepad.exe" "$0"' ;view log
+\c SectionEnd
+\c
+\c Function Example6
+\c StrCpy $1 $R8 '' $R2
+\c
+\c StrCmp $R6 '' 0 +3
+\c CreateDirectory '$R1$1\$R7'
+\c goto end
+\c CreateDirectory '$R1$1'
+\c CopyFiles /SILENT $R9 '$R1$1'
+\c
+\c IfFileExists '$R1$1\$R7' 0 +3
+\c FileWrite $R3 "-old:$R9 -new:$R1$1\$R7 -success$\r$\n"
+\c goto +2
+\c FileWrite $R3 "-old:$R9 -new:$R1$1\$R7 -failed$\r$\n"
+\c
+\c end:
+\c Push $0
+\c FunctionEnd
+
+\\<b\\>Example (Recreate directory structure):\\</b\\>
+
+\c Section
+\c StrCpy $R0 "C:\ftp" ;Directory structure from
+\c StrCpy $R1 "C:\ftp2" ;Directory structure into
+\c StrLen $R2 $R0
+\c
+\c ${Locate} "$R0" "/L=D" "Example7"
+\c
+\c IfErrors 0 +2
+\c MessageBox MB_OK 'error'
+\c SectionEnd
+\c
+\c Function Example7
+\c StrCpy $1 $R9 '' $R2
+\c CreateDirectory '$R1$1'
+\c
+\c Push $0
+\c FunctionEnd
+
+\\<b\\>Example (Locate with banner - "NxS" plugin required):\\</b\\>
+
+\c Section
+\c nxs::Show /NOUNLOAD `$(^Name) Setup` /top `Setup searching something$\r$\nPlease wait... If you can..` /h 1 /can 1 /end
+\c ${Locate} "C:\WINDOWS" "/L=F /M=*.inf /B=1" "Example8"
+\c nxs::Destroy
+\c SectionEnd
+\c
+\c Function Example8
+\c StrCmp $R0 $R8 abortcheck
+\c StrCpy $R0 $R8
+\c nxs::Update /NOUNLOAD /sub "$R8" /pos 78 /end
+\c
+\c abortcheck:
+\c nxs::HasUserAborted /NOUNLOAD
+\c Pop $0
+\c StrCmp $0 1 0 +2
+\c StrCpy $0 StopLocate
+\c
+\c StrCmp $R9 '' end
+\c ;...
+\c
+\c end:
+\c Push $0
+\c FunctionEnd
+
+\S1{} GetSize
+
+\b Find the size of a file, files mask or directory.
+
+\b Find the sum of the files, directories and subdirectories.
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${GetSize} "[Path]" "[Options]" $var1 $var2 $var3
+
+\c "[Path]" ; Disk or Directory
+\c ;
+\c "[Options]" ; /M=[mask]
+\c ; /M=*.* - Find all (default)
+\c ; /M=*.doc - Find Work.doc, 1.doc ...
+\c ; /M=Pho* - Find PHOTOS, phone.txt ...
+\c ; /M=win???.exe - Find winamp.exe, winver.exe ...
+\c ; /M=winamp.exe - Find winamp.exe only
+\c ; /S=No:No[B|K|M|G]
+\c ; /S= - Don't find file size (faster) (default)
+\c ; /S=0:0B - Find only files of 0 Bytes exactly
+\c ; /S=5:9K - Find only files of 5 to 9 Kilobytes
+\c ; /S=:10M - Find only files of 10 Megabyte or less
+\c ; /S=1G - Find only files of 1 Gigabyte or more
+\c ; /G=[1|0]
+\c ; /G=1 - Find with subdirectories (default)
+\c ; /G=0 - Find without subdirectories
+\c ;
+\c $var1 ; Result1: Size
+\c $var2 ; Result2: Sum of files
+\c $var3 ; Result3: Sum of directories
+
+\\<b\\>Note:\\</b\\>
+\\<br\\>-Error flag if disk or directory isn't exist
+\\<br\\>-Error flag if syntax error
+
+
+\\<b\\>Example (1):\\</b\\>
+
+\c Section
+\c ; Find file size "C:\WINDOWS\Explorer.exe" in kilobytes
+\c
+\c ${GetSize} "C:\WINDOWS" "/M=Explorer.exe /S=0K /G=0" $0 $1 $2
+\c ; $0="220" Kb
+\c ; $1="1" files
+\c ; $2="" directories
+\c
+\c IfErrors 0 +2
+\c MessageBox MB_OK "Error"
+\c SectionEnd
+
+\\<b\\>Example (2):\\</b\\>
+
+\c Section
+\c ; Find folder size "C:\Installs\Reanimator\Drivers" in megabytes
+\c
+\c ${GetSize} "C:\Installs\Reanimator\Drivers" "/S=0M" $0 $1 $2
+\c ; $0="132" Mb
+\c ; $1="555" files
+\c ; $2="55" directories
+\c
+\c IfErrors 0 +2
+\c MessageBox MB_OK "Error"
+\c SectionEnd
+
+\\<b\\>Example (3):\\</b\\>
+
+\c Section
+\c ; Find sum of files and folders "C:\WINDOWS" (no subfolders)
+\c
+\c ${GetSize} "C:\WINDOWS" "/G=0" $0 $1 $2
+\c ; $0="" size
+\c ; $1="253" files
+\c ; $2="46" directories
+\c
+\c IfErrors 0 +2
+\c MessageBox MB_OK "Error"
+\c SectionEnd
+
+\S1{} DriveSpace
+
+\b Get total, occupied or free space of the drive.
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${GetSize} "[Drive]" "[Options]" $var
+
+\c "[Drive]" ; Disk to check
+\c ;
+\c "[Options]" ; /D=[T|O|F]
+\c ; /D=T - Total space (default)
+\c ; /D=O - Occupied space
+\c ; /D=F - Free space
+\c ; /S=[B|K|M|G]
+\c ; /S=B - size in Bytes (default)
+\c ; /S=K - size in Kilobytes
+\c ; /S=M - size in Megabytes
+\c ; /S=G - size in Gigabytes
+\c ;
+\c $var ; Result: Size
+
+\\<b\\>Note:\\</b\\>
+\\<br\\>-Error flag if disk isn't exist or not ready
+\\<br\\>-Error flag if syntax error
+
+
+\\<b\\>Example:\\</b\\>
+
+\c Section
+\c ${DriveSpace} "C:\" "/D=F /S=M" $R0
+\c ; $R0="2530" megabytes free on drive C:
+\c SectionEnd
+
+\S1{} GetDrives
+
+\b Find all available drives in the system.
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${GetDrives} "[Option]" "Function"
+
+\c "[Option]" ; [FDD+HDD+CDROM+NET+RAM]
+\c ; FDD Floppy Disk Drives
+\c ; HDD Hard Disk Drives
+\c ; CDROM CD-ROM Drives
+\c ; NET Network Drives
+\c ; RAM RAM Disk Drives
+\c ;
+\c ; [ALL]
+\c ; Find all drives by letter (default)
+\c ;
+\c "Function" ; Callback function when found
+\c
+\c Function "Function"
+\c ; $9 "drive letter" (a:\ c:\ ...)
+\c ; $8 "drive type" (FDD HDD ...)
+\c
+\c ; $R0-$R9 are not used (save data in them).
+\c ; ...
+\c
+\c Push $var ; If $var="StopGetDrives" Then exit from function
+\c FunctionEnd
+
+\\<b\\>Example1:\\</b\\>
+
+\c Section
+\c ${GetDrives} "FDD+CDROM" "Example1"
+\c SectionEnd
+\c
+\c Function Example1
+\c MessageBox MB_OK "$9 ($8 Drive)"
+\c
+\c Push $0
+\c FunctionEnd
+
+\\<b\\>Example2:\\</b\\>
+
+\c Section
+\c ${GetDrives} "ALL" "Example2"
+\c SectionEnd
+\c
+\c Function Example2
+\c MessageBox MB_OK "$9 ($8 Drive)"
+\c
+\c Push $0
+\c FunctionEnd
+
+\\<b\\>Example3 (Get type of drive):\\</b\\>
+
+\c Section
+\c StrCpy $R0 "D:\" ;Drive letter
+\c StrCpy $R1 "invalid"
+\c
+\c ${GetDrives} "ALL" "Example3"
+\c
+\c MessageBox MB_OK "Type of drive $R0 is $R1"
+\c SectionEnd
+\c
+\c Function Example3
+\c StrCmp $9 $R0 0 +3
+\c StrCpy $R1 $8
+\c StrCpy $0 StopGetDrives
+\c
+\c Push $0
+\c FunctionEnd
+
+\S1{} GetTime
+
+\b Get local time.
+
+\b Get file time (access, creation and modification).
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${GetTime} "[File]" "[Option]" $var1 $var2 $var3 $var4 $var5 $var6 $var7
+
+\c "[File]" ; Ignored if "L"
+\c ;
+\c "[Option]" ; [Options]
+\c ; L Local time
+\c ; A last Access file time
+\c ; C Creation file time
+\c ; M Modification file time
+\c ;
+\c $var1 ; Result1: day
+\c $var2 ; Result2: month
+\c $var3 ; Result3: year
+\c $var4 ; Result4: day of week name
+\c $var5 ; Result5: hour
+\c $var6 ; Result6: minute
+\c $var7 ; Result7: seconds
+
+\\<b\\>Note:\\</b\\>
+\\<br\\>-Error flag if file isn't exist
+\\<br\\>-Error flag if syntax error
+
+
+\\<b\\>Example (Get local time):\\</b\\>
+
+\c Section
+\c ${GetTime} "" "L" $0 $1 $2 $3 $4 $5 $6
+\c ; $0="01" day
+\c ; $1="04" month
+\c ; $2="2005" year
+\c ; $3="Friday" day of week name
+\c ; $4="16" hour
+\c ; $5="05" minute
+\c ; $6="50" seconds
+\c
+\c MessageBox MB_OK 'Date=$0/$1/$2 ($3)$\nTime=$4:$5:$6'
+\c SectionEnd
+
+\\<b\\>Example (Get file time):\\</b\\>
+
+\c Section
+\c ${GetTime} "$WINDIR\Explorer.exe" "C" $0 $1 $2 $3 $4 $5 $6
+\c ; $0="12" day
+\c ; $1="10" month
+\c ; $2="2004" year
+\c ; $3="Tuesday" day of week name
+\c ; $4="2" hour
+\c ; $5="32" minute
+\c ; $6="03" seconds
+\c
+\c IfErrors 0 +2
+\c MessageBox MB_OK "Error" IDOK +2
+\c MessageBox MB_OK 'Date=$0/$1/$2 ($3)$\nTime=$4:$5:$6'
+\c SectionEnd
+
+\S1{} GetFileAttributes
+
+\b Get attributes of file or directory.
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${GetFileAttributes} "[File]" "[Attributes]" $var
+
+\c "[File]" ; File or directory
+\c ;
+\c "[Attributes]" ; "ALL" (default)
+\c ; -all attributes of file combined with "|" to output
+\c ;
+\c ; "READONLY|HIDDEN|SYSTEM|DIRECTORY|ARCHIVE|
+\c ; DEVICE|NORMAL|TEMPORARY|SPARSE_FILE|REPARSE_POINT|
+\c ; COMPRESSED|OFFLINE|NOT_CONTENT_INDEXED|ENCRYPTED"
+\c ; -file must have specified attributes
+\c ;
+\c $var ; Result:
+\c ; $var=attr1|attr2|... (if used "ALL")
+\c ; $var=1 file has specified attributes
+\c ; $var=0 file has no specified attributes
+
+\\<b\\>Note:\\</b\\>
+\\<br\\>-Error flag if file isn't exist
+
+
+\\<b\\>Example1:\\</b\\>
+
+\c Section
+\c ${GetFileAttributes} "C:\MSDOS.SYS" "ALL" $R0
+\c ; $R0=READONLY|HIDDEN|SYSTEM|ARCHIVE
+\c SectionEnd
+
+\\<b\\>Example2:\\</b\\>
+
+\c Section
+\c ${GetFileAttributes} "C:\MSDOS.SYS" "SYSTEM|HIDDEN" $R0
+\c ; $R0=1
+\c SectionEnd
+
+\\<b\\>Example3:\\</b\\>
+
+\c Section
+\c ${GetFileAttributes} "C:\MSDOS.SYS" "NORMAL" $R0
+\c ; $R0=0
+\c SectionEnd
+
+\S1{} GetFileVersion
+
+\b Get version information from executable file.
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${GetFileVersion} "[Executable]" $var
+
+\c "[Executable]" ; Executable file (*.exe *.dll ...)
+\c $var ; Result: Version number
+
+\\<b\\>Note:\\</b\\>
+\\<br\\>-Error flag if file isn't exist
+\\<br\\>-Error flag if file isn't contain version information
+
+
+\\<b\\>Example:\\</b\\>
+
+\c Section
+\c ${GetFileVersion} "C:\ftp\program.exe" $R0
+\c ; $R0="1.1.0.12"
+\c SectionEnd
+
+\S1{} GetExeName
+
+\b Get installer filename (with valid case for Windows 9X/Me).
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${GetExeName} $var
+
+\\<b\\>Example:\\</b\\>
+
+\c Section
+\c ${GetExeName} $R0
+\c ; $R0="C:\ftp\program.exe"
+\c SectionEnd
+
+\S1{} GetExePath
+
+\b Get installer pathname ($EXEDIR with valid case for Windows 9X/Me).
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${GetExePath} $var
+
+\\<b\\>Example:\\</b\\>
+
+\c Section
+\c ${GetExePath} $R0
+\c ; $R0="C:\ftp"
+\c SectionEnd
+
+\S1{} GetParameters
+
+\b Get command line parameters.
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${GetParameters} $var
+
+\\<b\\>Example:\\</b\\>
+
+\c Section
+\c ${GetParameters} $R0
+\c ; $R0="[parameters]"
+\c SectionEnd
+
+\S1{} GetOptions
+
+\b Get options from command line parameters.
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${GetOptions} "[Parameters]" "[Option]" $var
+
+\c "[Parameters]" ; command line parameters
+\c ;
+\c "[Option]" ; option name
+\c ;
+\c $var ; Result: option string
+
+\\<b\\>Note:\\</b\\>
+\\<br\\>-First option symbol it is delimiter
+
+
+\\<b\\>Example1:\\</b\\>
+
+\c Section
+\c ${GetOptions} "/INSTDIR=Temp /SILENT=yes /ADMIN=qwerty" "/ADMIN=" $R0
+\c ;$R0=qwerty
+\c SectionEnd
+
+\\<b\\>Example2:\\</b\\>
+
+\c Section
+\c ${GetOptions} "-INSTDIR=C:\Program Files\Common Files -SILENT=yes" "-INSTDIR=" $R0
+\c ;$R0=C:\Program Files\Common Files
+\c SectionEnd
+
+\\<b\\>Example3:\\</b\\>
+
+\c Section
+\c ${GetOptions} '/SILENT=yes /INSTDIR="C:/Program Files/Common Files" /ADMIN=password' "/INSTDIR=" $R0
+\c ;$R0=C:/Program Files/Common Files
+\c SectionEnd
+
+\\<b\\>Example4:\\</b\\>
+
+\c Section
+\c ${GetOptions} `-SILENT=yes -INSTDIR='"C:/Program Files/Common Files"' -ADMIN=password` "-INSTDIR=" $R0
+\c ;$R0="C:/Program Files/Common Files"
+\c SectionEnd
+
+\S1{} GetRoot
+
+\b Get root directory.
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${GetRoot} "[FullPath]" $var
+
+\\<b\\>Example1:\\</b\\>
+
+\c Section
+\c ${GetRoot} "C:\Program Files\NSIS" $R0
+\c ; $R0="C:"
+\c SectionEnd
+
+\\<b\\>Example2:\\</b\\>
+
+\c Section
+\c ${GetRoot} "\\SuperPimp\NSIS\Source\exehead\Ui.c" $R0
+\c ; $R0="\\SuperPimp\NSIS"
+\c SectionEnd
+
+\S1{} GetParent
+
+\b Get parent directory.
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${GetParent} "[PathString]" $var
+
+\\<b\\>Example:\\</b\\>
+
+\c Section
+\c ${GetParent} "C:\Program Files\Winamp\uninstwa.exe" $R0
+\c ; $R0="C:\Program Files\Winamp"
+\c SectionEnd
+
+\S1{} GetFileName
+
+\b Get last part from directory path.
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${GetFileName} "[PathString]" $var
+
+\\<b\\>Example:\\</b\\>
+
+\c Section
+\c ${GetFileName} "C:\Program Files\Winamp\uninstwa.exe" $R0
+\c ; $R0="uninstwa.exe"
+\c SectionEnd
+
+\S1{} GetBaseName
+
+\b Get file name without extension.
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${GetBaseName} "[FileString]" $var
+
+\\<b\\>Example:\\</b\\>
+
+\c Section
+\c ${GetBaseName} "C:\ftp\program.exe" $R0
+\c ; $R0="program"
+\c SectionEnd
+
+\S1{} GetFileExt
+
+\b Get extention of file.
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${GetFileExt} "[FileString]" $var
+
+\\<b\\>Example:\\</b\\>
+
+\c Section
+\c ${GetFileExt} "C:\ftp\program.exe" $R0
+\c ; $R0="exe"
+\c SectionEnd
+
+\S1{} BannerTrimPath
+
+\b Trim string path for banner.
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${BannerTrimPath} "[PathString]" "[Option]" $var
+
+\c "[PathString]" ;
+\c ;
+\c "[Option]" ; [Length][A|B|C|D]
+\c ;
+\c ; Length -Maximum string length
+\c ; A -Trim center path (default)
+\c ; (C:\root\...\third path)
+\c ; If A mode not possible Then will be used B mode
+\c ; B -Trim right path
+\c ; (C:\root\second path\...)
+\c ; If B mode not possible Then will be used C mode
+\c ; C -Trim right string
+\c ; (C:\root\second path\third p...)
+\c ; D -Trim right string + filename
+\c ; (C:\root\second p...\third path)
+\c ; If D mode not possible Then will be used C mode
+\c ;
+\c $var ; Result: Trimmed path
+
+\\<b\\>Example:\\</b\\>
+
+\c Section
+\c ${BannerTrimPath} "C:\Server\Documents\Terminal\license.htm" "35A" $R0
+\c ;$R0=C:\Server\...\Terminal\license.htm
+\c SectionEnd
+
+\\<b\\>Example (Banner plugin):\\</b\\>
+
+\c !include "WinMessages.nsh"
+\c !include "FileFunc.nsh"
+\c !insertmacro Locate
+\c Section
+\c Banner::show /NOUNLOAD "Starting..."
+\c Banner::getWindow /NOUNLOAD
+\c Pop $R1
+\c ${Locate} "$WINDIR" "/L=F /M=*.* /B=1" "LocateCallback"
+\c Banner::destroy
+\c SectionEnd
+\c
+\c Function LocateCallback
+\c StrCmp $R0 $R8 code
+\c StrCpy $R0 $R8
+\c ${BannerTrimPath} "$R8" "38B" $R8
+\c GetDlgItem $1 $R1 1030
+\c SendMessage $1 ${WM_SETTEXT} 0 "STR:$R8"
+\c
+\c code:
+\c StrCmp $R9 '' end
+\c ;...
+\c
+\c end:
+\c Push $0
+\c FunctionEnd
+
+\\<b\\>Example (nxs plugin):\\</b\\>
+
+\c !include "FileFunc.nsh"
+\c !insertmacro Locate
+\c Section
+\c nxs::Show /NOUNLOAD `$(^Name) Setup`\
+\c /top `Setup searching something$\nPlease wait$\nIf you can...`\
+\c /h 1 /can 1 /end
+\c ${Locate} "$WINDIR" "/L=F /M=*.* /B=1" "LocateCallback"
+\c nxs::Destroy
+\c SectionEnd
+\c
+\c Function LocateCallback
+\c StrCmp $R0 $R8 abortcheck
+\c StrCpy $R0 $R8
+\c ${BannerTrimPath} "$R8" "55A" $R8
+\c nxs::Update /NOUNLOAD /sub "$R8" /pos 78 /end
+\c
+\c abortcheck:
+\c nxs::HasUserAborted /NOUNLOAD
+\c Pop $0
+\c StrCmp $0 1 0 +2
+\c StrCpy $0 StopLocate
+\c
+\c StrCmp $R9 '' end
+\c ;...
+\c
+\c end:
+\c Push $0
+\c FunctionEnd
+
+\S1{} DirState
+
+\b Check directory full, empty or not exist.
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${DirState} "[path]" $var
+
+\c "[path]" ; Directory
+\c $var ; Result:
+\c ; $var=0 (empty)
+\c ; $var=1 (full)
+\c ; $var=-1 (directory not found)
+
+\\<b\\>Example:\\</b\\>
+
+\c Section
+\c ${DirState} "$TEMP" $R0
+\c ; $R0="1" directory is full
+\c SectionEnd
+
+\S1{} RefreshShellIcons
+
+\b After changing file associations, you can call this function to refresh the shell immediatly.
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${RefreshShellIcons}
+
+\\<b\\>Example:\\</b\\>
+
+\c Section
+\c WriteRegStr HKCR "Winamp.File\DefaultIcon" "" "$PROGRAMFILES\Winamp\WINAMP.EXE,2"
+\c
+\c ${RefreshShellIcons}
+\c SectionEnd
+
+
+\H{textfunc} Text Functions Header
+
+
+\S1{} Introduction
+
+Include header:
+
+\c !include "TextFunc.nsh"
+
+
+Include function "LineRead" for install and "TrimNewLines" for uninstall:
+
+\c !insertmacro LineRead
+\c !insertmacro un.TrimNewLines
+
+
+Call functions:
+
+\c Section Install
+\c ${LineRead} "C:\a.log" "-1" $R0
+\c ; $R0="Last line$\r$\n"
+\c SectionEnd
+
+\c Section un.Install
+\c ${un.TrimNewLines} "Last line$\r$\n" $R0
+\c ; $R0="Last line"
+\c SectionEnd
+
+
+\S1{} LineFind
+
+\b Find specified lines in text file and edit or view this lines in callback function.
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${LineFind} "[File1]" "[File2|/NUL]" "[LineNumbers]" "Function"
+
+\c "[File1]" ; Input text file
+\c ;
+\c "[File2|/NUL]" ; [File2]
+\c ; Output text file
+\c ; If empty then File2=File1
+\c ; [/NUL]
+\c ; No output text file (only read File1)
+\c ;
+\c "[LineNumbers]" ; [No|-No|No:No|{No}|{-No}|{No:No}]
+\c ; 1:-1 all lines to change (default)
+\c ; 2 second line from start
+\c ; -3 third line from end
+\c ; 5:9 range of lines from 5 to 9
+\c ; {2} only second line from start to output
+\c ; {-3} only third line from end to output
+\c ; {5:9} only range of lines from 5 to 9 to output
+\c ;
+\c "Function" ; Callback function for specified lines
+\c
+\c Function "Function"
+\c ; $R9 current line
+\c ; $R8 current line number
+\c ; $R7 current line negative number
+\c ; $R6 current range of lines
+\c ; $R5 handle of a file opened to read
+\c ; $R4 handle of a file opened to write ($R4="" if "/NUL")
+\c
+\c ; you can use any string functions
+\c ; $R0-$R3 are not used (save data in them).
+\c ; ...
+\c
+\c Push $var ; If $var="StopLineFind" Then exit from function
+\c ; If $var="SkipWrite" Then skip current line (ignored if "/NUL")
+\c FunctionEnd
+
+\\<b\\>Note:\\</b\\>
+\\<br\\>-Error flag if input file isn't exists
+\\<br\\>-Error flag if output file path isn't exists
+\\<br\\>-Ranges must be specified on growth (2 4:5 9:-8 -5:-4 -2:-1)
+\\<br\\>-Output file will not be updated if no changes made.
+
+\\<b\\>Example1 (delete first two symbols):\\</b\\>
+
+\c Section
+\c ${LineFind} "C:\a.log" "C:\a-edited.log" "3:-1" "Example1"
+\c IfErrors 0 +2
+\c MessageBox MB_OK "Error"
+\c SectionEnd
+\c
+\c Function Example1
+\c ${TrimNewLines} '$R9' $R9
+\c StrCpy $R9 $R9 '' 2
+\c StrCpy $R9 '$R9$\r$\n'
+\c ;start from 3 line and delete first two symbols
+\c
+\c Push $0
+\c FunctionEnd
+
+\\<b\\>Example2 (show changed lines):\\</b\\>
+
+\c Section
+\c ${LineFind} "C:\a.log" "a.log" "{5:12 15 -6:-5 -1}" "Example2"
+\c IfErrors 0 +2
+\c MessageBox MB_OK "Error"
+\c SectionEnd
+\c
+\c Function Example2
+\c ${TrimNewLines} '$R9' $R9
+\c StrCpy $R9 "$R9 ~Changed line ($R8)~$\r$\n"
+\c
+\c Push $0
+\c FunctionEnd
+
+\\<b\\>Example3 (delete lines):\\</b\\>
+
+\c Section
+\c ${LineFind} "C:\a.log" "\logs\a.log" "2:3 10:-5 -3:-2" "Example3"
+\c IfErrors 0 +2
+\c MessageBox MB_OK "Error"
+\c SectionEnd
+\c
+\c Function Example3
+\c StrCpy $0 SkipWrite
+\c
+\c Push $0
+\c FunctionEnd
+
+\\<b\\>Example4 (insert lines):\\</b\\>
+
+\c Section
+\c ${LineFind} "C:\a.log" "" "10" "Example4
+\c IfErrors 0 +2
+\c MessageBox MB_OK "Error"
+\c SectionEnd
+\c
+\c Function Example4
+\c FileWrite $R4 "---First Line---$\r$\n"
+\c FileWrite $R4 "---Second Line ...---$\r$\n"
+\c
+\c Push $0
+\c FunctionEnd
+
+\\<b\\>Example5 (replace in file with count of changes - "WordFunc.nsh" required):\\</b\\>
+
+\c !include "WordFunc.nsh"
+\c !insertmacro WordReplace
+\c
+\c Section
+\c StrCpy $R0 0
+\c ${LineFind} "C:\a.log" "C:\logs\a.log" "1:-1" "Example5"
+\c IfErrors 0 +2
+\c MessageBox MB_OK "Error" IDOK +2
+\c MessageBox MB_OK "Changed lines=$R0"
+\c SectionEnd
+\c
+\c Function Example5
+\c StrCpy $1 $R9
+\c
+\c ${WordReplace} '$R9' ' ' '_' '+*' $R9
+\c
+\c StrCmp $1 $R9 +2
+\c IntOp $R0 $R0 + 1
+\c ;$R0 count of changed lines
+\c
+\c Push $0
+\c FunctionEnd
+
+\\<b\\>Example6 (line string to cut or delete):\\</b\\>
+
+\c Section
+\c ${LineFind} "\a.log" "C:\logs\a.log" "" "Example6"
+\c IfErrors 0 +2
+\c MessageBox MB_OK "Error" IDOK +2
+\c MessageBox MB_OK "Processed lines=$R1:$R2"
+\c SectionEnd
+\c
+\c Function Example6
+\c ;(Cut lines from a line to another line (also including that line))
+\c StrCmp $R0 finish stop
+\c StrCmp $R0 start finish
+\c StrCmp $R9 'Start Line$\r$\n' 0 skip
+\c StrCpy $R0 start
+\c StrCpy $R1 $R8
+\c goto code
+\c finish:
+\c StrCmp $R9 'Finish Line$\r$\n' 0 code
+\c StrCpy $R0 finish
+\c StrCpy $R2 $R8
+\c goto code
+\c skip:
+\c StrCpy $0 SkipWrite
+\c goto output
+\c stop:
+\c StrCpy $0 StopLineFind
+\c goto output
+\c
+\c ;;(Delete lines from a line to another line (also including that line))
+\c ; StrCmp $R0 finish code
+\c ; StrCmp $R0 start finish
+\c ; StrCmp $R9 'Start Line$\r$\n' 0 code
+\c ; StrCpy $R0 start
+\c ; StrCpy $R1 $R8
+\c ; goto skip
+\c ; finish:
+\c ; StrCmp $R9 'Finish Line$\r$\n' 0 skip
+\c ; StrCpy $R0 finish
+\c ; StrCpy $R2 $R8
+\c ; skip:
+\c ; StrCpy $0 SkipWrite
+\c ; goto output
+\c
+\c code:
+\c ;...
+\c
+\c output:
+\c Push $0
+\c FunctionEnd
+
+\\<b\\>Example7 (read lines):\\</b\\>
+
+\c Section
+\c ${LineFind} "C:\a.log" "/NUL" "1:-1" "Example7"
+\c IfErrors 0 +2
+\c MessageBox MB_OK "Error"
+\c SectionEnd
+\c
+\c Function Example7
+\c MessageBox MB_OKCANCEL '$$R9 "Line"=[$R9]$\n$$R8 "#" =[$R8]' IDOK +2
+\c StrCpy $0 StopLineFind
+\c
+\c Push $0
+\c FunctionEnd
+
+\S1{} LineRead
+
+\b Get line in file specified with number.
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${LineRead} "[File]" "[LineNumber]" $var
+
+\c "[File]" ; Input text file
+\c ;
+\c "[LineNumber]" ; [No|-No]
+\c ; 3 line number from start
+\c ; -5 line number from end
+\c ;
+\c $var ; Result: Line
+
+\\<b\\>Note:\\</b\\>
+\\<br\\>-Error flag if input file isn't exists
+\\<br\\>-Error flag if line number not found
+
+\\<b\\>Example:\\</b\\>
+
+\c Section
+\c ${LineRead} "C:\a.log" "-1" $R0
+\c ; $R0="Last line$\r$\n"
+\c SectionEnd
+
+\S1{} FileReadFromEnd
+
+\b Read text file from end line by line.
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${FileReadFromEnd} "[File]" "Function"
+
+\c "[File]" ; Input text file
+\c "Function" ; Callback function
+\c
+\c Function "Function"
+\c ; $9 current line
+\c ; $8 current line number
+\c ; $7 current line negative number
+\c
+\c ; $R0-$R9 are not used (save data in them).
+\c ; ...
+\c
+\c Push $var ; If $var="StopFileReadFromEnd" Then exit from function
+\c FunctionEnd
+
+\\<b\\>Note:\\</b\\>
+\\<br\\>-Error flag if input file isn't exists
+
+\\<b\\>Example1:\\</b\\>
+
+\c Section
+\c ${FileReadFromEnd} "C:\a.log" "Example1"
+\c
+\c IfErrors 0 +2
+\c MessageBox MB_OK "Error"
+\c SectionEnd
+\c
+\c Function Example1
+\c MessageBox MB_OKCANCEL '"Line"=[$9]$\n "#"=[$8]$\n "-#"=[$7]' IDOK +2
+\c StrCpy $0 StopFileReadFromEnd
+\c
+\c Push $0
+\c FunctionEnd
+
+\\<b\\>Example2 (Reverse text file):\\</b\\>
+
+\c Section
+\c GetTempFileName $R0
+\c FileOpen $R1 $R0 w
+\c ${FileReadFromEnd} "C:\a.log" "Example2"
+\c FileClose $R1
+\c
+\c IfErrors 0 +2
+\c MessageBox MB_OK "Error" IDOK +2
+\c Exec '"notepad.exe" "$R0"'
+\c SectionEnd
+\c
+\c Function Example2
+\c StrCmp $7 -1 0 +5
+\c StrCpy $1 $9 1 -1
+\c StrCmp $1 '$\n' +3
+\c StrCmp $1 '$\r' +2
+\c StrCpy $9 '$9$\r$\n'
+\c
+\c FileWrite $R1 "$9"
+\c
+\c Push $0
+\c FunctionEnd
+
+\S1{} LineSum
+
+\b Get sum of lines in text file.
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${LineSum} "[File]" $var
+
+\c "[File]" ; Input file
+\c $var ; Result: Sum of lines
+
+\\<b\\>Note:\\</b\\>
+\\<br\\>-Error flag if input file isn't exists
+
+\\<b\\>Example:\\</b\\>
+
+\c Section
+\c ${LineSum} "C:\a.log" $R0
+\c ; $R0="54"
+\c SectionEnd
+
+\S1{} FileJoin
+
+\b Join two files in one (File1 + File2 = File3).
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${FileJoin} "[File1]" "[File2]" "[File3]"
+
+\c "[File1]" ; Input File1
+\c "[File2]" ; Input File2
+\c "[File3]" ; Output File3
+\c ; If [File3]="" Then add [File2] to [File1]
+
+\\<b\\>Note:\\</b\\>
+\\<br\\>-Error flag if input files aren't exists
+\\<br\\>-Error flag if output file path isn't exists
+
+\\<b\\>Example1 (Join: a.log + b.log = Z.log):\\</b\\>
+
+\c Section
+\c ${FileJoin} "C:\a.log" "C:\logs\b.log" "C:\Z.log"
+\c SectionEnd
+
+\\<b\\>Example2 (Add: a.log + b.log = a.log):\\</b\\>
+
+\c Section
+\c ${FileJoin} "C:\a.log" "C:\logs\b.log" "C:\a.log"
+\c SectionEnd
+
+\S1{} TextCompare
+
+\b Compare two text files.
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${TextCompare} "[File1]" "[File2]" "[Option]" "Function"
+
+\c "[File1]" ; File1 Compare these lines
+\c "[File2]" ; File2 Compare with these lines
+\c "[Options]" ; (line-by-line):
+\c ; FastDiff Compare line N (File1) with line N (File2)
+\c ; Call function if Different lines found
+\c ; FastEqual Compare line N (File1) with line N (File2)
+\c ; Call function if Equal lines found
+\c ; (line number independent):
+\c ; SlowDiff Compare line N (File1) with all lines (File2)
+\c ; Call function if line N (File1) Different
+\c ; SlowEqual Compare line N (File1) with all lines (File2)
+\c ; Call function if line N (File1) Equal
+\c "Function" ; Callback function
+\c
+\c Function "Function"
+\c ; $9 "Line File1"
+\c ; $8 "Line number"
+\c ; $7 "Line File2" (empty if SlowDiff)
+\c ; $6 "Line number" (empty if SlowDiff)
+\c
+\c ; $R0-$R9 are not used (save data in them).
+\c ; ...
+\c
+\c Push $var ; If $var="StopTextCompare" Then exit from function
+\c FunctionEnd
+
+\\<b\\>Note:\\</b\\>
+\\<br\\>-Error flag if File1 or File2 isn't exist
+\\<br\\>-Error flag if syntax error
+
+\\<b\\>Example (Different or Equal):\\</b\\>
+
+\c Section
+\c StrCpy $R0 ''
+\c ${TextCompare} "C:\1.txt" "C:\2.txt" "FastDiff" "Example1"
+\c IfErrors 0 +2
+\c MessageBox MB_OK "Error" IDOK +4
+\c
+\c StrCmp $R0 NotEqual 0 +2
+\c MessageBox MB_OK "Files differ" IDOK +2
+\c MessageBox MB_OK "Files identical"
+\c SectionEnd
+\c
+\c Function Example1
+\c StrCpy $R0 NotEqual
+\c StrCpy $0 StopTextCompare
+\c
+\c Push $0
+\c FunctionEnd
+
+\\<b\\>Example (Compare line-by-line - Different):\\</b\\>
+
+\c Section
+\c StrCpy $R0 'Text1.txt'
+\c StrCpy $R1 'Text2.txt'
+\c
+\c GetTempFileName $R2
+\c FileOpen $R3 $R2 w
+\c FileWrite $R3 "$R0 | $R1$\r$\n"
+\c ${TextCompare} "$R0" "$R1" "FastDiff" "Example2"
+\c IfErrors 0 +2
+\c MessageBox MB_OK "Error" IDOK +2
+\c
+\c Exec "notepad.exe $R2"
+\c FunctionEnd
+\c
+\c Function Example2
+\c FileWrite $R3 '$8=$9'
+\c FileWrite $R3 '$6=$7$\r$\n'
+\c
+\c Push $0
+\c FunctionEnd
+
+\\<b\\>Example (Compare line-by-line - Equal):\\</b\\>
+
+\c Section
+\c StrCpy $R0 'Text1.txt'
+\c StrCpy $R1 'Text2.txt'
+\c
+\c GetTempFileName $R2
+\c FileOpen $R3 $R2 w
+\c FileWrite $R3 "$R0 | $R1$\r$\n"
+\c ${TextCompare} "$R0" "$R1" "FastEqual" "Example3"
+\c IfErrors 0 +2
+\c MessageBox MB_OK "Error" IDOK +2
+\c
+\c Exec "notepad.exe $R2"
+\c FunctionEnd
+\c
+\c Function Example3
+\c FileWrite $R3 '$8|$6=$9'
+\c
+\c Push $0
+\c FunctionEnd
+
+\\<b\\>Example (Compare all lines - Different):\\</b\\>
+
+\c Section
+\c StrCpy $R0 'Text1.txt'
+\c StrCpy $R1 'Text2.txt'
+\c
+\c GetTempFileName $R2
+\c FileOpen $R3 $R2 w
+\c FileWrite $R3 "$R0 | $R1$\r$\n"
+\c ${TextCompare} "$R0" "$R1" "SlowDiff" "Example4"
+\c IfErrors 0 +2
+\c MessageBox MB_OK "Error" IDOK end
+\c
+\c FileWrite $R3 "$\r$\n$R1 | $R0$\r$\n"
+\c ${TextCompare} "$R1" "$R0" "SlowDiff" "Example4"
+\c FileClose $R3
+\c IfErrors 0 +2
+\c MessageBox MB_OK "Error" IDOK end
+\c
+\c Exec "notepad.exe $R2"
+\c
+\c end:
+\c FunctionEnd
+\c
+\c Function Example4
+\c FileWrite $R3 '$8=$9'
+\c
+\c Push $0
+\c FunctionEnd
+
+\\<b\\>Example (Compare all lines - Equal):\\</b\\>
+
+\c Section
+\c StrCpy $R0 'Text1.txt'
+\c StrCpy $R1 'Text2.txt'
+\c
+\c GetTempFileName $R2
+\c FileOpen $R3 $R2 w
+\c FileWrite $R3 "$R0 | $R1$\r$\n"
+\c ${TextCompare} "$R0" "$R1" "SlowEqual" "Example5"
+\c IfErrors 0 +2
+\c MessageBox MB_OK "Error" IDOK +2
+\c
+\c Exec "notepad.exe $R2"
+\c FunctionEnd
+\c
+\c Function Example5
+\c FileWrite $R3 '$8|$6=$9'
+\c
+\c Push $0
+\c FunctionEnd
+
+\\<b\\>Example (Show variables):\\</b\\>
+
+\c Section
+\c ${TextCompare} "C:\1.txt" "C:\2.txt" "FastDiff" "Example6"
+\c
+\c IfErrors 0 +2
+\c MessageBox MB_OK "Error"
+\c SectionEnd
+\c
+\c Function Example6
+\c MessageBox MB_OKCANCEL '$$9 "Line File1" =[$9]$\n$$8 "Line #" =[$8]$\n$$7 "Line File2" =[$7]$\n$$6 "Line #" =[$6]' IDOK +2
+\c StrCpy $0 StopTextCompare
+\c
+\c Push $0
+\c FunctionEnd
+
+\S1{} ConfigRead
+
+\b Read value from entry name in config file.
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${ConfigRead} "[File]" "[Entry]" $var
+
+\c "[File]" ; config file
+\c ;
+\c "[Entry]" ; entry name
+\c ;
+\c $var ; Result: Value
+
+\\<b\\>Note:\\</b\\>
+\\<br\\>-Error flag if file isn't exist
+
+\\<b\\>Example1:\\</b\\>
+
+\c Section
+\c ${ConfigRead} "C:\AUTOEXEC.BAT" "SET winbootdir=" $R0
+\c ;$R0=C:\WINDOWS
+\c SectionEnd
+
+\\<b\\>Example2:\\</b\\>
+
+\c Section
+\c ${ConfigRead} "C:\apache\conf\httpd.conf" "Timeout " $R0
+\c ;$R0=30
+\c SectionEnd
+
+\S1{} ConfigWrite
+
+\b Write value from entry name in config file.
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${ConfigWrite} "[File]" "[Entry]" "[Value]" $var
+
+\c "[File]" ; config file
+\c ;
+\c "[Entry]" ; entry name
+\c ;
+\c "[Value]" ; value name
+\c ; if "" then delete Entry
+\c ;
+\c $var ; Result:
+\c ; $var=CHANGED Value is written
+\c ; $var=DELETED Entry is deleted
+\c ; $var=ADDED Entry and Value are added
+\c ; $var=SAME Entry and Value already exist
+
+\\<b\\>Note:\\</b\\>
+\\<br\\>-Error flag if file isn't exist
+\\<br\\>-Error flag if file can't be opened
+
+\\<b\\>Example1:\\</b\\>
+
+\c Section
+\c ${ConfigWrite} "C:\AUTOEXEC.BAT" "SET winbootdir=" "D:\WINDOWS" $R0
+\c ;$R0=CHANGED
+\c SectionEnd
+
+\\<b\\>Example2:\\</b\\>
+
+\c Section
+\c ${ConfigWrite} "C:\apache\conf\httpd.conf" "Timeout " "30" $R0
+\c ;$R0=SAME
+\c SectionEnd
+
+\\<b\\>Example3:\\</b\\>
+
+\c Section
+\c ${ConfigWrite} "C:\apache\conf\httpd.conf" "Timeout " "" $R0
+\c ;$R0=DELETED
+\c SectionEnd
+
+\S1{} FileRecode
+
+\b Recode text file from DOS to Windows format and vice-versa.
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${FileRecode} "[File]" "[Format]"
+
+\c "[File]" ;
+\c ;
+\c "[Format]" ; OemToChar -from DOS to Windows
+\c ; CharToOem -from Windows to DOS
+
+\\<b\\>Note:\\</b\\>
+\\<br\\>-Error flag if file isn't exist
+\\<br\\>-Error flag if syntax error
+
+\\<b\\>Example:\\</b\\>
+
+\c Section
+\c ${FileRecode} "C:\SCANDISK.LOG" "CharToOem"
+\c SectionEnd
+
+\S1{} TrimNewLines
+
+\b Trim newlines in a string.
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${TrimNewLines} "[string]" $var
+
+\c "[string]" ; Input string
+\c $var ; Result: String without '$\r' and '$\n' at the end
+
+\\<b\\>Example:\\</b\\>
+
+\c Section
+\c ${TrimNewLines} "Text line$\r$\n" $R0
+\c ; $R0="Text line"
+\c SectionEnd
+
+
+\H{wordfunc} Word Functions Header
+
+
+\S1{} Introduction
+
+Include header:
+
+\c !include "WordFunc.nsh"
+
+
+Include function "WordFind" for install and "WordReplace" for uninstall:
+
+\c !insertmacro WordFind
+\c !insertmacro un.WordReplace
+
+
+Call functions:
+
+\c Section Install
+\c ${WordFind} "A--H---S" "-" "+2" $R0
+\c ; $R0="H"
+\c SectionEnd
+
+\c Section un.Install
+\c ${un.WordReplace} "A--H---S" "-" "x" "+3*" $R0
+\c ; $R0="A--HxS"
+\c SectionEnd
+
+
+\S1{} WordFind
+
+\b Multi-features string function.
+
+\c Strings:
+\c "[word+1][delimiter][word+2][delimiter][word+3]..."
+\c "[delimiter][word+1][delimiter][word+2][delimiter]..."
+\c "[delimiter][delimiter][word+1][delimiter][delimiter][delimiter]..."
+\c "...[word-3][delimiter][word-2][delimiter][word-1]"
+\c "...[delimiter][word-2][delimiter][word-1][delimiter]"
+\c "...[delimiter][delimiter][word-1][delimiter][delimiter][delimiter]"
+
+\\<b\\>Syntax: \\</b\\>
+
+\c ${WordFind} "[string]" "[delimiter]" "[E][options]" $var
+
+\c "[string]" ;[string]
+\c ; input string
+\c "[delimiter]" ;[delimiter]
+\c ; one or several symbols
+\c "[E][options]" ;[options]
+\c ; +number : word number from start
+\c ; -number : word number from end
+\c ; +number} : delimiter number from start
+\c ; all space after this
+\c ; delimiter to output
+\c ; +number{ : delimiter number from start
+\c ; all space before this
+\c ; delimiter to output
+\c ; +number}} : word number from start
+\c ; all space after this word
+\c ; to output
+\c ; +number{{ : word number from start
+\c ; all space before this word
+\c ; to output
+\c ; +number{} : word number from start
+\c ; all space before and after
+\c ; this word (word exclude)
+\c ; +number*} : word number from start
+\c ; all space after this
+\c ; word to output with word
+\c ; +number{* : word number from start
+\c ; all space before this
+\c ; word to output with word
+\c ; # : sum of words to output
+\c ; * : sum of delimiters to output
+\c ; /word : number of word to output
+\c ;
+\c ;[E]
+\c ; with errorlevel output
+\c ; IfErrors:
+\c ; $var=1 delimiter not found
+\c ; $var=2 no such word number
+\c ; $var=3 syntax error (Use: +1,-1},#,*,/word,...)
+\c ;[]
+\c ; no errorlevel output (default)
+\c ; If some errors found then (result=input string)
+\c ;
+\c $var ;output (result)
+
+\\<b\\>Note:\\</b\\>
+\\<br\\>-Accepted numbers 1,01,001,...
+
+\\<b\\>Example (Find word by number):\\</b\\>
+
+\c Section
+\c ${WordFind} "C:\io.sys C:\Program Files C:\WINDOWS" " C:\" "-02" $R0
+\c ; $R0="Program Files"
+\c SectionEnd
+
+\\<b\\>Example (Delimiter exclude):\\</b\\>
+
+\c Section
+\c ${WordFind} "C:\io.sys C:\logo.sys C:\WINDOWS" "sys" "-2}" $R0
+\c ; $R0=" C:\logo.sys C:\WINDOWS"
+\c SectionEnd
+
+\\<b\\>Example (Sum of words):\\</b\\>
+
+\c Section
+\c ${WordFind} "C:\io.sys C:\logo.sys C:\WINDOWS" " C:\" "#" $R0
+\c ; $R0="3"
+\c SectionEnd
+
+\\<b\\>Example (Sum of delimiters):\\</b\\>
+
+\c Section
+\c ${WordFind} "C:\io.sys C:\logo.sys C:\WINDOWS" "sys" "*" $R0
+\c ; $R0="2"
+\c SectionEnd
+
+\\<b\\>Example (Find word number):\\</b\\>
+
+\c Section
+\c ${WordFind} "C:\io.sys C:\Program Files C:\WINDOWS" " " "/Files" $R0
+\c ; $R0="3"
+\c SectionEnd
+
+\\<b\\>Example ( \}\} ):\\</b\\>
+
+\c Section
+\c ${WordFind} "C:\io.sys C:\logo.sys C:\WINDOWS" " " "+2}}" $R0
+\c ; $R0=" C:\WINDOWS"
+\c SectionEnd
+
+\\<b\\>Example ( \{\} ):\\</b\\>
+
+\c Section
+\c ${WordFind} "C:\io.sys C:\logo.sys C:\WINDOWS" " " "+2{}" $R0
+\c ; $R0="C:\io.sys C:\WINDOWS"
+\c SectionEnd
+
+\\<b\\>Example ( *\} ):\\</b\\>
+
+\c Section
+\c ${WordFind} "C:\io.sys C:\logo.sys C:\WINDOWS" " " "+2*}" $R0
+\c ; $R0="C:\logo.sys C:\WINDOWS"
+\c SectionEnd
+
+\\<b\\>Example (Get parent directory):\\</b\\>
+
+\c Section
+\c StrCpy $R0 "C:\Program Files\NSIS\NSIS.chm"
+\c ; "C:\Program Files\NSIS\Include\"
+\c ; "C:\\Program Files\\NSIS\\NSIS.chm"
+\c
+\c ${WordFind} "$R0" "\" "-2{*" $R0
+\c ; $R0="C:\Program Files\NSIS"
+\c ; "C:\\Program Files\\NSIS"
+\c SectionEnd
+
+\\<b\\>Example (Coordinates):\\</b\\>
+
+\c Section
+\c ${WordFind} "C:\io.sys C:\logo.sys C:\WINDOWS" ":\lo" "E+1{" $R0
+\c ; $R0="C:\io.sys C"
+\c IfErrors end
+\c
+\c StrLen $0 $R0 ; $0 = Start position of word (11)
+\c StrLen $1 ':\lo' ; $1 = Word leght (4)
+\c ; StrCpy $R0 $R1 $1 $0 ; $R0 = :\lo
+\c
+\c end:
+\c SectionEnd
+
+\\<b\\>Example (With errorlevel output):\\</b\\>
+
+\c Section
+\c ${WordFind} "[string]" "[delimiter]" "E[options]" $R0
+\c
+\c IfErrors 0 end
+\c StrCmp $R0 1 0 +2 ; errorlevel 1?
+\c MessageBox MB_OK 'delimiter not found' IDOK end
+\c StrCmp $R0 2 0 +2 ; errorlevel 2?
+\c MessageBox MB_OK 'no such word number' IDOK end
+\c StrCmp $R0 3 0 +2 ; errorlevel 3?
+\c MessageBox MB_OK 'syntax error'
+\c
+\c end:
+\c SectionEnd
+
+\\<b\\>Example (Without errorlevel output):\\</b\\>
+
+\c Section
+\c ${WordFind} "C:\io.sys C:\logo.sys" "_" "+1" $R0
+\c
+\c ; $R0="C:\io.sys C:\logo.sys" (error: delimiter "_" not found)
+\c SectionEnd
+
+\\<b\\>Example (If found):\\</b\\>
+
+\c Section
+\c ${WordFind} "C:\io.sys C:\logo.sys" ":\lo" "E+1{" $R0
+\c
+\c IfErrors notfound found
+\c found:
+\c MessageBox MB_OK 'Found' IDOK end
+\c notfound:
+\c MessageBox MB_OK 'Not found'
+\c
+\c end:
+\c SectionEnd
+
+\\<b\\>Example (If found 2):\\</b\\>
+
+\c Section
+\c ${WordFind} "C:\io.sys C:\logo.sys" ":\lo" "+1{" $R0
+\c
+\c StrCmp $R0 "C:\io.sys C:\logo.sys" notfound found ; error?
+\c found:
+\c MessageBox MB_OK 'Found' IDOK end
+\c notfound:
+\c MessageBox MB_OK 'Not found'
+\c
+\c end:
+\c SectionEnd
+
+\\<b\\>Example (To accept one word in string if delimiter not found):\\</b\\>
+
+\c Section
+\c StrCpy $0 'OneWord'
+\c StrCpy $1 1
+\c
+\c loop:
+\c ${WordFind} "$0" " " "E+$1" $R0
+\c IfErrors 0 code
+\c StrCmp $1$R0 11 0 error
+\c StrCpy $R0 $0
+\c goto end
+\c
+\c code:
+\c ; ...
+\c IntOp $1 $1 + 1
+\c goto loop
+\c
+\c error:
+\c StrCpy $1 ''
+\c StrCpy $R0 ''
+\c
+\c end:
+\c ; $R0="OneWord"
+\c SectionEnd
+
+\S1{} WordFind2X
+
+\b Find word between two delimiters.
+
+\c Strings:
+\c "[delimiter1][word+1][delimiter2][delimiter1][word+2][delimiter2]..."
+\c "[text][delimiter1][text][delimiter1][word+1][delimiter2][text]..."
+\c "...[delimiter1][word-2][delimiter2][delimiter1][word-1][delimiter2]"
+\c "...[text][delimiter1][text][delimiter1][word-1][delimiter2][text]"
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${WordFind2X} "[string]" "[delimiter1]" "[delimiter2]" "[E][options]" $var
+
+\c "[string]" ;[string]
+\c ; input string
+\c "[delimiter1]" ;[delimiter1]
+\c ; first delimiter
+\c "[delimiter2]" ;[delimiter2]
+\c ; second delimiter
+\c "[E][options]" ;[options]
+\c ; +number : word number from start
+\c ; -number : word number from end
+\c ; +number}} : word number from start all space
+\c ; after this word to output
+\c ; +number{{ : word number from end all space
+\c ; before this word to output
+\c ; +number{} : word number from start
+\c ; all space before and after
+\c ; this word (word exclude)
+\c ; +number*} : word number from start
+\c ; all space after this
+\c ; word to output with word
+\c ; +number{* : word number from start
+\c ; all space before this
+\c ; word to output with word
+\c ; # : sum of words to output
+\c ; /word : number of word to output
+\c ;
+\c ;[E]
+\c ; with errorlevel output
+\c ; IfErrors:
+\c ; $var=1 no words found
+\c ; $var=2 no such word number
+\c ; $var=3 syntax error (Use: +1,-1,#)
+\c ;[]
+\c ; no errorlevel output (default)
+\c ; If some errors found then (result=input string)
+\c ;
+\c $var ;output (result)
+
+\\<b\\>Example (1):\\</b\\>
+
+\c Section
+\c ${WordFind2X} "[C:\io.sys];[C:\logo.sys];[C:\WINDOWS]" "[C:\" "];" "+2" $R0
+\c ; $R0="logo.sys"
+\c SectionEnd
+
+\\<b\\>Example (2):\\</b\\>
+
+\c Section
+\c ${WordFind2X} "C:\WINDOWS C:\io.sys C:\logo.sys" "\" "." "-1" $R0
+\c ; $R0="logo"
+\c SectionEnd
+
+\\<b\\>Example (3):\\</b\\>
+
+\c Section
+\c ${WordFind2X} "C:\WINDOWS C:\io.sys C:\logo.sys" "\" "." "-1{{" $R0
+\c ; $R0="C:\WINDOWS C:\io.sys C:"
+\c SectionEnd
+
+\\<b\\>Example (4):\\</b\\>
+
+\c Section
+\c ${WordFind2X} "C:\WINDOWS C:\io.sys C:\logo.sys" "\" "." "-1{}" $R0
+\c ; $R0="C:\WINDOWS C:\io.sys C:sys"
+\c SectionEnd
+
+\\<b\\>Example (5):\\</b\\>
+
+\c Section
+\c ${WordFind2X} "C:\WINDOWS C:\io.sys C:\logo.sys" "\" "." "-1{*" $R0
+\c ; $R0="C:\WINDOWS C:\io.sys C:\logo."
+\c SectionEnd
+
+\\<b\\>Example (6):\\</b\\>
+
+\c Section
+\c ${WordFind2X} "C:\WINDOWS C:\io.sys C:\logo.sys" "\" "." "/logo" $R0
+\c ; $R0="2"
+\c SectionEnd
+
+\\<b\\>Example (With errorlevel output):\\</b\\>
+
+\c Section
+\c ${WordFind2X} "[io.sys];[C:\logo.sys]" "\" "];" "E+1" $R0
+\c ; $R0="1" ("\...];" not found)
+\c
+\c IfErrors 0 noerrors
+\c MessageBox MB_OK 'Errorlevel=$R0' IDOK end
+\c
+\c noerrors:
+\c MessageBox MB_OK 'No errors'
+\c
+\c end:
+\c SectionEnd
+
+\S1{} WordFind3X
+
+\b Find word, that contain string, between two delimiters.
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${WordFind3X} "[string]" "[delimiter1]" "[center]" "[delimiter2]" "[E][options]" $var
+
+\c "[string]" ;[string]
+\c ; input string
+\c "[delimiter1]" ;[delimiter1]
+\c ; first delimiter
+\c "[center]" ;[center]
+\c ; center string
+\c "[delimiter2]" ;[delimiter2]
+\c ; second delimiter
+\c "[E][options]" ;[options]
+\c ; +number : word number from start
+\c ; -number : word number from end
+\c ; +number}} : word number from start all space
+\c ; after this word to output
+\c ; +number{{ : word number from end all space
+\c ; before this word to output
+\c ; +number{} : word number from start
+\c ; all space before and after
+\c ; this word (word exclude)
+\c ; +number*} : word number from start
+\c ; all space after this
+\c ; word to output with word
+\c ; +number{* : word number from start
+\c ; all space before this
+\c ; word to output with word
+\c ; # : sum of words to output
+\c ; /word : number of word to output
+\c ;
+\c ;[E]
+\c ; with errorlevel output
+\c ; IfErrors:
+\c ; $var=1 no words found
+\c ; $var=2 no such word number
+\c ; $var=3 syntax error (Use: +1,-1,#)
+\c ;[]
+\c ; no errorlevel output (default)
+\c ; If some errors found then (result=input string)
+\c ;
+\c $var ;output (result)
+
+\\<b\\>Example (1):\\</b\\>
+
+\c Section
+\c ${WordFind3X} "[1.AAB];[2.BAA];[3.BBB];" "[" "AA" "];" "+1" $R0
+\c ; $R0="1.AAB"
+\c SectionEnd
+
+\\<b\\>Example (2):\\</b\\>
+
+\c Section
+\c ${WordFind3X} "[1.AAB];[2.BAA];[3.BBB];" "[" "AA" "];" "-1" $R0
+\c ; $R0="2.BAA"
+\c SectionEnd
+
+\\<b\\>Example (3):\\</b\\>
+
+\c Section
+\c ${WordFind3X} "[1.AAB];[2.BAA];[3.BBB];" "[" "AA" "];" "-1{{" $R0
+\c ; $R0="[1.AAB];"
+\c SectionEnd
+
+\\<b\\>Example (4):\\</b\\>
+
+\c Section
+\c ${WordFind3X} "[1.AAB];[2.BAA];[3.BBB];" "[" "AA" "];" "-1{}" $R0
+\c ; $R0="[1.AAB];[3.BBB];"
+\c SectionEnd
+
+\\<b\\>Example (5):\\</b\\>
+
+\c Section
+\c ${WordFind3X} "[1.AAB];[2.BAA];[3.BBB];" "[" "AA" "];" "-1{*" $R0
+\c ; $R0="[1.AAB];[2.BAA];"
+\c SectionEnd
+
+\\<b\\>Example (6):\\</b\\>
+
+\c Section
+\c ${WordFind3X} "[1.AAB];[2.BAA];[3.BBB];" "[" "AA" "];" "/2.BAA" $R0
+\c ; $R0="2"
+\c SectionEnd
+
+\\<b\\>Example (With errorlevel output):\\</b\\>
+
+\c Section
+\c ${WordFind3X} "[1.AAB];[2.BAA];[3.BBB];" "[" "XX" "];" "E+1" $R0
+\c ; $R0="1" ("[...XX...];" not found)
+\c
+\c IfErrors 0 noerrors
+\c MessageBox MB_OK 'Errorlevel=$R0' IDOK end
+\c
+\c noerrors:
+\c MessageBox MB_OK 'No errors'
+\c
+\c end:
+\c SectionEnd
+
+\S1{} WordReplace
+
+\b Replace or delete word from string.
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${WordReplace} "[string]" "[word1]" "[word2]" "[E][options]" $var
+
+\c "[string]" ;[string]
+\c ; input string
+\c "[word1]" ;[word1]
+\c ; word to replace or delete
+\c "[word2]" ;[word2]
+\c ; replace with (if empty delete)
+\c "[E][options]" ;[options]
+\c ; +number : word number from start
+\c ; -number : word number from end
+\c ; +number* : word number from start multiple-replace
+\c ; -number* : word number from end multiple-replace
+\c ; + : replace or delete all founded
+\c ; +* : multiple-replace all founded
+\c ; {} : if exists replace or delete all delimiters
+\c ; from edges (no errorlevel output)
+\c ; {}* : if exists multiple-replace all delimiters
+\c ; from edges (no errorlevel output)
+\c ;
+\c ;[E]
+\c ; with errorlevel output
+\c ; IfErrors:
+\c ; $var=1 word to replace or delete not found
+\c ; $var=2 no such word number
+\c ; $var=3 syntax error (Use: +1,-1,+1*,-1*,+,+*,{},{}*)
+\c ;[]
+\c ; no errorlevel output (default)
+\c ; If some errors found then (result=input string)
+\c ;
+\c $var ;output (result)
+
+\\<b\\>Example (replace):\\</b\\>
+
+\c Section
+\c ${WordReplace} "C:\io.sys C:\logo.sys C:\WINDOWS" "SYS" "bmp" "+2" $R0
+\c ; $R0="C:\io.sys C:\logo.bmp C:\WINDOWS"
+\c SectionEnd
+
+\\<b\\>Example (delete):\\</b\\>
+
+\c Section
+\c ${WordReplace} "C:\io.sys C:\logo.sys C:\WINDOWS" "SYS" "" "+" $R0
+\c ; $R0="C:\io. C:\logo. C:\WINDOWS"
+\c SectionEnd
+
+\\<b\\>Example (multiple-replace 1):\\</b\\>
+
+\c Section
+\c ${WordReplace} "C:\io.sys C:\logo.sys C:\WINDOWS" " " " " "+1*" $R0
+\c ; +1* or +2* or +3* or +4* or +5* or +6*
+\c ; $R0="C:\io.sys C:\logo.sys C:\WINDOWS"
+\c SectionEnd
+
+\\<b\\>Example (multiple-replace 2):\\</b\\>
+
+\c Section
+\c ${WordReplace} "C:\io.sys C:\logo.sysSYSsys C:\WINDOWS" "sys" "bmp" "+*" $R0
+\c ; $R0="C:\io.bmp C:\logo.bmp C:\WINDOWS"
+\c SectionEnd
+
+\\<b\\>Example (multiple-replace 3):\\</b\\>
+
+\c Section
+\c ${WordReplace} "sysSYSsysC:\io.sys C:\logo.sys C:\WINDOWSsysSYSsys" "sys" "|" "{}*" $R0
+\c ; $R0="|C:\io.sys C:\logo.sys C:\WINDOWS|"
+\c SectionEnd
+
+\\<b\\>Example (With errorlevel output):\\</b\\>
+
+\c Section
+\c ${WordReplace} "C:\io.sys C:\logo.sys" "sys" "bmp" "E+3" $R0
+\c ; $R0="2" (no such word number "+3")
+\c
+\c IfErrors 0 noerrors
+\c MessageBox MB_OK 'Errorlevel=$R0' IDOK end
+\c
+\c noerrors:
+\c MessageBox MB_OK 'No errors'
+\c
+\c end:
+\c SectionEnd
+
+\S1{} WordAdd
+
+\b Add words to string1 from string2 if not exist or delete words if exist.
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${WordAdd} "[string1]" "[delimiter]" "[E][options]" $var
+
+\c "[string1]" ;[string1]
+\c ; string for addition or removing
+\c "[delimiter]" ;[delimiter]
+\c ; one or several symbols
+\c "[E][options]" ;[options]
+\c ; +string2 : words to add
+\c ; -string2 : words to delete
+\c ;
+\c ;[E]
+\c ; with errorlevel output
+\c ; IfErrors:
+\c ; $var=1 delimiter is empty
+\c ; $var=3 syntax error (use: +text,-text)
+\c ;[]
+\c ; no errorlevel output (default)
+\c ; If some errors found then (result=input string)
+\c ;
+\c $var ;output (result)
+
+\\<b\\>Example (add):\\</b\\>
+
+\c Section
+\c ${WordAdd} "C:\io.sys C:\WINDOWS" " " "+C:\WINDOWS C:\config.sys" $R0
+\c ; $R0="C:\io.sys C:\WINDOWS C:\config.sys"
+\c SectionEnd
+
+\\<b\\>Example (delete):\\</b\\>
+
+\c Section
+\c ${WordAdd} "C:\io.sys C:\logo.sys C:\WINDOWS" " " "-C:\WINDOWS C:\config.sys C:\IO.SYS" $R0
+\c ; $R0="C:\logo.sys"
+\c SectionEnd
+
+\\<b\\>Example (add to one):\\</b\\>
+
+\c Section
+\c ${WordAdd} "C:\io.sys" " " "+C:\WINDOWS C:\config.sys C:\IO.SYS" $R0
+\c ; $R0="C:\io.sys C:\WINDOWS C:\config.sys"
+\c SectionEnd
+
+\\<b\\>Example (delete one):\\</b\\>
+
+\c Section
+\c ${WordAdd} "C:\io.sys C:\logo.sys C:\WINDOWS" " " "-C:\WINDOWS" $R0
+\c ; $R0="C:\io.sys C:\logo.sys"
+\c SectionEnd
+
+\\<b\\>Example (No new words found):\\</b\\>
+
+\c Section
+\c ${WordAdd} "C:\io.sys C:\logo.sys" " " "+C:\logo.sys" $R0
+\c StrCmp $R0 "C:\io.sys C:\logo.sys" 0 +2
+\c MessageBox MB_OK "No new words found to add"
+\c SectionEnd
+
+\\<b\\>Example (No words deleted):\\</b\\>
+
+\c Section
+\c ${WordAdd} "C:\io.sys C:\logo.sys" " " "-C:\config.sys" $R0
+\c StrCmp $R0 "C:\io.sys C:\logo.sys" 0 +2
+\c MessageBox MB_OK "No words found to delete"
+\c SectionEnd
+
+\\<b\\>Example (With errorlevel output):\\</b\\>
+
+\c Section
+\c ${WordAdd} "C:\io.sys C:\logo.sys" "" "E-C:\logo.sys" $R0
+\c ; $R0="1" (delimiter is empty "")
+\c
+\c IfErrors 0 noerrors
+\c MessageBox MB_OK 'Errorlevel=$R0' IDOK end
+\c
+\c noerrors:
+\c MessageBox MB_OK 'No errors'
+\c
+\c end:
+\c SectionEnd
+
+\S1{} WordInsert
+
+\b Insert word in string.
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${WordInsert} "[string]" "[delimiter]" "[word]" "[E][options]" $var
+
+\c "[string]" ;[string]
+\c ; input string
+\c "[delimiter]" ;[delimiter]
+\c ; one or several symbols
+\c "[word]" ;[word]
+\c ; word to insert
+\c "[E][options]" ;[options]
+\c ; +number : word number from start
+\c ; -number : word number from end
+\c ;
+\c ;[E]
+\c ; with errorlevel output
+\c ; IfErrors:
+\c ; $var=1 delimiter is empty
+\c ; $var=2 wrong word number
+\c ; $var=3 syntax error (Use: +1,-1)
+\c ;[]
+\c ; no errorlevel output (default)
+\c ; If some errors found then (result=input string)
+\c ;
+\c $var ;output (result)
+
+\\<b\\>Example (1):\\</b\\>
+
+\c Section
+\c ${WordInsert} "C:\io.sys C:\WINDOWS" " " "C:\logo.sys" "-2" $R0
+\c ; $R0="C:\io.sys C:\logo.sys C:\WINDOWS"
+\c SectionEnd
+
+\\<b\\>Example (2):\\</b\\>
+
+\c Section
+\c ${WordInsert} "C:\io.sys" " " "C:\WINDOWS" "+2" $R0
+\c ; $R0="C:\io.sys C:\WINDOWS"
+\c SectionEnd
+
+\\<b\\>Example (3):\\</b\\>
+
+\c Section
+\c ${WordInsert} "" " " "C:\WINDOWS" "+1" $R0
+\c ; $R0="C:\WINDOWS "
+\c SectionEnd
+
+\\<b\\>Example (With errorlevel output):\\</b\\>
+
+\c Section
+\c ${WordInsert} "C:\io.sys C:\logo.sys" " " "C:\logo.sys" "E+4" $R0
+\c ; $R0="2" (wrong word number "+4")
+\c
+\c IfErrors 0 noerrors
+\c MessageBox MB_OK 'Errorlevel=$R0' IDOK end
+\c
+\c noerrors:
+\c MessageBox MB_OK 'No errors'
+\c
+\c end:
+\c SectionEnd
+
+\S1{} StrFilter
+
+\b Convert string to uppercase or lowercase.
+
+\b Set symbol filter.
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${StrFilter} "[string]" "[options]" "[symbols1]" "[symbols2]" $var
+
+\c "[string]" ;[string]
+\c ; input string
+\c ;
+\c "[options]" ;[+|-][1|2|3|12|23|31][eng|rus]
+\c ; + : covert string to uppercase
+\c ; - : covert string to lowercase
+\c ; 1 : only Digits
+\c ; 2 : only Letters
+\c ; 3 : only Special
+\c ; 12 : only Digits + Letters
+\c ; 23 : only Letters + Special
+\c ; 31 : only Special + Digits
+\c ; eng : English symbols (default)
+\c ; rus : Russian symbols
+\c ;
+\c "[symbols1]" ;[symbols1]
+\c ; symbols include (not changeable)
+\c ;
+\c "[symbols2]" ;[symbols2]
+\c ; symbols exclude
+\c ;
+\c $var ;output (result)
+
+\\<b\\>Note:\\</b\\>
+\\<br\\>-Error flag if syntax error
+\\<br\\>-Same symbol to include & to exclude = to exclude
+
+\\<b\\>Example (UpperCase):\\</b\\>
+
+\c Section
+\c ${StrFilter} "123abc 456DEF 7890|%#" "+" "" "" $R0
+\c ; $R0="123ABC 456DEF 7890|%#"
+\c SectionEnd
+
+\\<b\\>Example (LowerCase):\\</b\\>
+
+\c Section
+\c ${StrFilter} "123abc 456DEF 7890|%#" "-" "ef" "" $R0
+\c ; $R0="123abc 456dEF 7890|%#"
+\c SectionEnd
+
+\\<b\\>Example (Filter1):\\</b\\>
+
+\c Section
+\c ${StrFilter} "123abc 456DEF 7890|%#" "2" "|%" "" $R0
+\c ; $R0="abcDEF|%" ;only Letters + |%
+\c SectionEnd
+
+\\<b\\>Example (Filter2):\\</b\\>
+
+\c Section
+\c ${StrFilter} "123abc 456DEF 7890|%#" "13" "af" "4590" $R0
+\c ; $R0="123a 6F 78|%#" ;only Digits + Special + af - 4590
+\c SectionEnd
+
+\\<b\\>Example (Filter3):\\</b\\>
+
+\c Section
+\c ${StrFilter} "123abc 456DEF 7890|%#" "+12" "b" "def" $R0
+\c ; $R0="123AbC4567890" ;only Digits + Letters + b - def
+\c SectionEnd
+
+\\<b\\>Example (Filter4):\\</b\\>
+
+\c Section
+\c ${StrFilter} "123abcÀÁÂ 456DEFãäå 7890|%#" "+12rus" "ä" "ãå" $R0
+\c ; $R0="123ÀÁÂ456ä7890" ;only Digits + Letters + ä - ãå
+\c SectionEnd
+
+\\<b\\>Example (English + Russian Letters):\\</b\\>
+
+\c Section
+\c ${StrFilter} "123abcÀÁÂ 456DEFãäå 7890|%#" "2rus" "" "" $R0
+\c ; $R0="ÀÁÂãäå" ;only Russian Letters
+\c ${StrFilter} "123abcÀÁÂ 456DEFãäå 7890|%#" "2" "$R0" "" $R0
+\c ; $R0="abcÀÁÂDEFãäå" ;only English + Russian Letters
+\c SectionEnd
+
+\\<b\\>Example (Word Capitalize):\\</b\\>
+
+\c Section
+\c Push "_01-PERPETUOUS_DREAMER__-__THE_SOUND_OF_GOODBYE_(ORIG._MIX).MP3_"
+\c Call Capitalize
+\c Pop $R0
+\c ; $R0="_01-Perpetuous_Dreamer__-__The_Sound_Of_Goodbye_(Orig._Mix).mp3_"
+\c
+\c ${WordReplace} "$R0" "_" " " "+*" $R0
+\c ; $R0=" 01-Perpetuous Dreamer - The Sound Of Goodbye (Orig. Mix).mp3 "
+\c
+\c ${WordReplace} "$R0" " " "" "{}" $R0
+\c ; $R0="01-Perpetuous Dreamer - The Sound Of Goodbye (Orig. Mix).mp3"
+\c SectionEnd
+\c
+\c Function Capitalize
+\c Exch $R0
+\c Push $0
+\c Push $1
+\c Push $2
+\c
+\c ${StrFilter} '$R0' '-eng' '' '' $R0
+\c ${StrFilter} '$R0' '-rus' '' '' $R0
+\c
+\c StrCpy $0 0
+\c
+\c loop:
+\c IntOp $0 $0 + 1
+\c StrCpy $1 $R0 1 $0
+\c StrCmp $1 '' end
+\c StrCmp $1 ' ' +5
+\c StrCmp $1 '_' +4
+\c StrCmp $1 '-' +3
+\c StrCmp $1 '(' +2
+\c StrCmp $1 '[' 0 loop
+\c IntOp $0 $0 + 1
+\c StrCpy $1 $R0 1 $0
+\c StrCmp $1 '' end
+\c
+\c ${StrFilter} '$1' '+eng' '' '' $1
+\c ${StrFilter} '$1' '+rus' '' '' $1
+\c
+\c StrCpy $2 $R0 $0
+\c IntOp $0 $0 + 1
+\c StrCpy $R0 $R0 '' $0
+\c IntOp $0 $0 - 2
+\c StrCpy $R0 '$2$1$R0'
+\c goto loop
+\c
+\c end:
+\c Pop $2
+\c Pop $1
+\c Pop $0
+\c Exch $R0
+\c FunctionEnd
+
+\S1{} VersionCompare
+
+\b Compare version numbers.
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${VersionCompare} "[Version1]" "[Version2]" $var
+
+\c "[Version1]" ; First version
+\c "[Version2]" ; Second version
+\c $var ; Result:
+\c ; $var=0 Versions are equal
+\c ; $var=1 Version1 is newer
+\c ; $var=2 Version2 is newer
+
+\\<b\\>Example:\\</b\\>
+
+\c Section
+\c ${VersionCompare} "1.1.1.9" "1.1.1.01" $R0
+\c ; $R0="1"
+\c SectionEnd
+
+\S1{} VersionConvert
+
+\b Convert version in the numerical format which can be compared.
+
+\\<b\\>Syntax:\\</b\\>
+
+\c ${VersionConvert} "[Version]" "[CharList]" $var
+
+\c "[Version]" ; Version
+\c ;
+\c "[CharList]" ; List of characters, which will be replaced by numbers
+\c ; "abcdefghijklmnopqrstuvwxyz" (default)
+\c ;
+\c $var ; Result: converted version
+
+\\<b\\>Note:\\</b\\>
+\\<br\\>-Converted letters are separated with dot
+\\<br\\>-If character is non-digit and not in list then it will be converted to dot
+
+\\<b\\>Example1:\\</b\\>
+
+\c Section
+\c ${VersionConvert} "9.0a" "" $R0
+\c ; $R0="9.0.01"
+\c
+\c ${VersionConvert} "9.0c" "" $R1
+\c ; $R1="9.0.03"
+\c
+\c ${VersionCompare} "$R0" "$R1" $R2
+\c ; $R2="2" version2 is newer
+\c SectionEnd
+
+\\<b\\>Example2:\\</b\\>
+
+\c Section
+\c ${VersionConvert} "0.15c-9m" "" $R0
+\c ; $R0="0.15.03.9.13"
+\c
+\c ${VersionConvert} "0.15c-1n" "" $R1
+\c ; $R1="0.15.03.1.14"
+\c
+\c ${VersionCompare} "$R0" "$R1" $R2
+\c ; $R2="1" version1 is newer
+\c SectionEnd
+
+\\<b\\>Example3:\\</b\\>
+
+\c Section
+\c ${VersionConvert} "0.15c+" "abcdefghijklmnopqrstuvwxyz+" $R0
+\c ; $R0="0.15.0327"
+\c
+\c ${VersionConvert} "0.15c" "abcdefghijklmnopqrstuvwxyz+" $R1
+\c ; $R1="0.15.03"
+\c
+\c ${VersionCompare} "$R0" "$R1" $R2
+\c ; $R2="1" version1 is newer
+\c SectionEnd
diff --git a/Docs/src/history.but b/Docs/src/history.but
index d7845e6..b9add5e 100644..100755
--- a/Docs/src/history.but
+++ b/Docs/src/history.but
@@ -1,5 +1,54 @@
\A{history} Changelog and Release Notes
+\H{v2.08} 2.08
+
+Released on July 23rd, 2005
+
+\S1{v2.08-rn} Release Notes
+
+\b The Archive has been replaced with a \W{http://nsis.sourceforge.net/wiki/}{Wiki}. The new Wiki allows everyone to edit all pages so there's no longer need to hunt for the original author. It also allows everyone to upload plug-ins and not just administrators. And as if that's not enough, it looks better and provides easier and more feature-rich syntax.
+
+\S1{v2.08-cl} Changelog
+
+\S2{} Major Changes
+
+\b Added Instructor's \R{headers}{header files of useful functions}
+
+\b \R{library}{Library} improvements: ordered registration after reboot, smaller RegTool and separate process for each registration to avoid conflicts (thanks stb)
+
+\S2{} Minor Changes
+
+\b Added Bosnian and Kurdish translations
+
+\b Added per-user nsisconf.nsh file in %APPDATA% or $HOME, depending on the platform (\W{http://sourceforge.net/tracker/index.php?func=detail&group_id=22049&atid=373087&aid=1223041}{patch #1223041})
+
+\b Documentation improvements and fixes (including \W{http://sourceforge.net/tracker/index.php?func=detail&group_id=22049&atid=373085&aid=1202495}{bug #1202495}, \W{http://sourceforge.net/tracker/index.php?func=detail&group_id=22049&atid=373085&aid=1227610}{bug #1227610},
+\W{http://sourceforge.net/tracker/index.php?func=detail&group_id=22049&atid=373085&aid=1238686}{bug #1238686}, \W{http://sourceforge.net/tracker/index.php?func=detail&group_id=22049&atid=373087&aid=1225167}{patch #1225167}, \W{http://sourceforge.net/tracker/?group_id=22049&atid=373088&func=detail&aid=1240601}{RFE #1240601})
+
+\b Fixed _?= being ignored, if the uninstaller path is not quoted and is separated with only space from _?=
+
+\b Fixed \R{library}{Library} failing on paths with spaces (\W{http://sourceforge.net/tracker/index.php?func=detail&group_id=22049&atid=373085&aid=1234283}{bug #1234283})
+
+\b Fixed UpgradeDLL compilation error (\W{http://sourceforge.net/tracker/index.php?func=detail&group_id=22049&atid=373085&aid=1230336}{bug #1230336})
+
+\b Improved French, Ukrainian and Luxembourgish translation
+
+\b Made \R{rmdir}{RMDir} set the error flag, if passed an invalid directory path (\W{http://sourceforge.net/tracker/index.php?func=detail&group_id=22049&atid=373085&aid=1227553}{bug #1227553})
+
+\b Made uninstallers copy themselves into a subdirectory of the temporary directory to avoid DLLs left in the temporary directory from being loaded by the uninstaller (\W{http://sourceforge.net/tracker/index.php?func=detail&group_id=22049&atid=373087&aid=1214319}{patch #1214319})
+
+\b Missing \R{langstring}{LangString} warning now uses the language name, if possible
+
+\b zip2exe: fixed restriction of extraction path length and updated to \W{http://www.zlib.net/}{zlib} 1.2.3 (\W{http://sourceforge.net/tracker/index.php?func=detail&group_id=22049&atid=373085&aid=1226381}{bug #1226381})
+
+\S2{} Build System
+
+\b Added linker script to assure correct order of sections when building using GNU tools
+
+\b Added \c{test} target
+
+\b UIs are now built from source
+
\H{v2.07} 2.07
Released on June 20th, 2005
diff --git a/Docs/src/int.but b/Docs/src/int.but
index df5d7b4..df5d7b4 100644..100755
--- a/Docs/src/int.but
+++ b/Docs/src/int.but
diff --git a/Docs/src/intro.but b/Docs/src/intro.but
index b6f0774..a64505f 100644..100755
--- a/Docs/src/intro.but
+++ b/Docs/src/intro.but
@@ -30,7 +30,7 @@ You can choose between three different integrated compression method (ZLib, BZip
\\<b\\>Script based\\</b\\>
-Unlike other systems that can only generate installers based on a list of files and registry keys, NSIS has a powerful scripting language. This script language is designed for installers and has commands that help you to perform many installation tasks. You can easily add custom logic and handle different upgrades, version checks and more. On the \W{http://nsis.sourceforge.net/nsisarchive/}{NSIS Archive Page} you can find a lot more.
+Unlike other systems that can only generate installers based on a list of files and registry keys, NSIS has a powerful scripting language. This script language is designed for installers and has commands that help you to perform many installation tasks. You can easily add custom logic and handle different upgrades, version checks and more. On the \W{http://nsis.sourceforge.net/wiki/}{NSIS Wiki} you can find a lot more.
\\<b\\>Multiple languages in one installer\\</b\\>
diff --git a/Docs/src/jumps.but b/Docs/src/jumps.but
index 9b94eed..9b94eed 100644..100755
--- a/Docs/src/jumps.but
+++ b/Docs/src/jumps.but
diff --git a/Docs/src/labels.but b/Docs/src/labels.but
index 2888637..2888637 100644..100755
--- a/Docs/src/labels.but
+++ b/Docs/src/labels.but
diff --git a/Docs/src/langs.but b/Docs/src/langs.but
index a5b8313..a5b8313 100644..100755
--- a/Docs/src/langs.but
+++ b/Docs/src/langs.but
diff --git a/Docs/src/library.but b/Docs/src/library.but
index 6ae3a55..1c966cc 100644..100755
--- a/Docs/src/library.but
+++ b/Docs/src/library.but
@@ -260,7 +260,7 @@ To ask the user for a reboot if required, use the Modern UI with a Finish page o
\c !insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\msvbvm60.dll"
\c !insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\oleaut32.dll"
\c !insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\olepro32.dll"
-\c !insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\comcat32.dll"
+\c !insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\comcat.dll"
\c !insertmacro UnInstallLib DLL SHARED NOREMOVE "$SYSDIR\asycfilt.dll"
\c !insertmacro UnInstallLib TLB SHARED NOREMOVE "$SYSDIR\stdole2.tlb"
\c
diff --git a/Docs/src/license.but b/Docs/src/license.but
index c2c6f7c..c2c6f7c 100644..100755
--- a/Docs/src/license.but
+++ b/Docs/src/license.but
diff --git a/Docs/src/log.but b/Docs/src/log.but
index cdd95a4..cdd95a4 100644..100755
--- a/Docs/src/log.but
+++ b/Docs/src/log.but
diff --git a/Docs/src/misc.but b/Docs/src/misc.but
index 386d020..386d020 100644..100755
--- a/Docs/src/misc.but
+++ b/Docs/src/misc.but
diff --git a/Docs/src/modernui.but b/Docs/src/modernui.but
index ab7db36..ab7db36 100644..100755
--- a/Docs/src/modernui.but
+++ b/Docs/src/modernui.but
diff --git a/Docs/src/nsis.hhp b/Docs/src/nsis.hhp
index 128d976..128d976 100644..100755
--- a/Docs/src/nsis.hhp
+++ b/Docs/src/nsis.hhp
diff --git a/Docs/src/pages.but b/Docs/src/pages.but
index 4fcb0e9..4fcb0e9 100644..100755
--- a/Docs/src/pages.but
+++ b/Docs/src/pages.but
diff --git a/Docs/src/plugin.but b/Docs/src/plugin.but
index 3b6271a..3b6271a 100644..100755
--- a/Docs/src/plugin.but
+++ b/Docs/src/plugin.but
diff --git a/Docs/src/reboot.but b/Docs/src/reboot.but
index 2388ff5..2388ff5 100644..100755
--- a/Docs/src/reboot.but
+++ b/Docs/src/reboot.but
diff --git a/Docs/src/registry.but b/Docs/src/registry.but
index 5f1b614..5f1b614 100644..100755
--- a/Docs/src/registry.but
+++ b/Docs/src/registry.but
diff --git a/Docs/src/script.but b/Docs/src/script.but
index 2193c3c..7adf43e 100644..100755
--- a/Docs/src/script.but
+++ b/Docs/src/script.but
@@ -61,7 +61,7 @@ It is also possible to put newlines, tabs etc. in a string using $\\r, $\\n, $\\
\\<b\\>Variables\\</b\\>
-Variables start with $. User variables should be declared and are case-sensitive.
+Variables start with $. User variables should be declared.
\c Var MYVAR
\c
diff --git a/Docs/src/sec.but b/Docs/src/sec.but
index 1150d20..1150d20 100644..100755
--- a/Docs/src/sec.but
+++ b/Docs/src/sec.but
diff --git a/Docs/src/sections.but b/Docs/src/sections.but
index 86efc32..86efc32 100644..100755
--- a/Docs/src/sections.but
+++ b/Docs/src/sections.but
diff --git a/Docs/src/silent.but b/Docs/src/silent.but
index d24e36d..d24e36d 100644..100755
--- a/Docs/src/silent.but
+++ b/Docs/src/silent.but
diff --git a/Docs/src/stack.but b/Docs/src/stack.but
index 4d612df..4d612df 100644..100755
--- a/Docs/src/stack.but
+++ b/Docs/src/stack.but
diff --git a/Docs/src/string.but b/Docs/src/string.but
index b87125b..b87125b 100644..100755
--- a/Docs/src/string.but
+++ b/Docs/src/string.but
diff --git a/Docs/src/tutorial.but b/Docs/src/tutorial.but
index 6961003..bc157a6 100644..100755
--- a/Docs/src/tutorial.but
+++ b/Docs/src/tutorial.but
@@ -10,7 +10,7 @@ NSIS compiles all of the files and the installation script into one executable f
\H{tutscriptfiles} Script Files
-To create a NSIS installer, you first have to write a NSIS script. A NSIS script is just a regular text file with a special syntax. You can edit scripts with every text editor. It's recommended you use a text editor that shows line numbers because NSIS uses line numbers to indicate where errors lie, and to warn you about where errors might lie. An editor that supports syntax highlighting is also recommended. You can download editors made especially for NSIS and files for syntax highlighting at the \W{http://nsis.sf.net/archive/}{NSIS Archive}.
+To create a NSIS installer, you first have to write a NSIS script. A NSIS script is just a regular text file with a special syntax. You can edit scripts with every text editor. It's recommended you use a text editor that shows line numbers because NSIS uses line numbers to indicate where errors lie, and to warn you about where errors might lie. An editor that supports syntax highlighting is also recommended. You can download editors made especially for NSIS and files for syntax highlighting at the \W{http://nsis.sf.net/wiki/}{NSIS Wiki}.
In a NSIS script every line is treated as a command. If your command is too long for one line you can use a back-slash - '\\' - at the end of the line. The compiler will treat the new line as an addition to the previous line and will not expect a new command. For example:
@@ -128,7 +128,7 @@ After calling the function, the variables contain the same value as before. Note
\S2{tutdebug} Debugging Scripts
-The more you work with NSIS the more complex the scripts will become. This will increase the potential of mistakes, especially when dealing with lots of variables. There are a few possibilities to help you debugging the code. To display the contents of variables you should use \R{messagebox}{MessageBoxes} or \R{detailprint}{DetailPrint}. To get a brief overview about all variables you should use the plugin \W{http://nsis.sourceforge.net/archive/viewpage.php?pageid=140}{Dumpstate}. By default all actions of the Installer are printed out in the Log Window. You can access the log if you right-click in the Log Window and select "Copy Details To Clipboard". There is also a way to write it directly to a file, see \R{dumplogtofile}{here}.
+The more you work with NSIS the more complex the scripts will become. This will increase the potential of mistakes, especially when dealing with lots of variables. There are a few possibilities to help you debugging the code. To display the contents of variables you should use \R{messagebox}{MessageBoxes} or \R{detailprint}{DetailPrint}. To get a brief overview about all variables you should use the plugin \W{http://nsis.sourceforge.net/wiki/DumpState}{DumpState}. By default all actions of the Installer are printed out in the Log Window. You can access the log if you right-click in the Log Window and select "Copy Details To Clipboard". There is also a way to write it directly to a file, see \R{dumplogtofile}{here}.
\S1{compilercommands} Compiler Commands
@@ -191,7 +191,7 @@ Every plug-in's function has its own requirements when it comes to parameters, s
The plug-ins that NSIS knows of are listed at the top of the output of the compiler. NSIS searches for plug-ins in the \L{../Plugins/}{Plugins folder} under your NSIS directory and lists all of their available functions. You can use \R{addplugindir}{!addplugindir} to tell NSIS to search in other directories too.
-The NSIS distribution already included many plug-ins. \L{../Docs/InstallOptions/Readme.html}{InstallOptions} is a popular plug-in that allows you to create custom pages, in combination with the NSIS Page commands (See \R{pages}{Pages}). The \L{../Docs/StartMenu/Readme.txt}{Startmenu plug-in} provides a page that allows the user to choose a Start Menu folder. There are a lot of plug-ins for different purposes, have a look at the \L{../Docs/}{Docs folder} for help files and examples. You can find additional plug-ins on-line: \W{http://nsis.sf.net/archive/}{NSIS Archive}.
+The NSIS distribution already included many plug-ins. \L{../Docs/InstallOptions/Readme.html}{InstallOptions} is a popular plug-in that allows you to create custom pages, in combination with the NSIS Page commands (See \R{pages}{Pages}). The \L{../Docs/StartMenu/Readme.txt}{Startmenu plug-in} provides a page that allows the user to choose a Start Menu folder. There are a lot of plug-ins for different purposes, have a look at the \L{../Docs/}{Docs folder} for help files and examples. You can find additional plug-ins on-line: \W{http://nsis.sf.net/wiki/}{NSIS Wiki}.
You can also create a plug-in yourself. C/C++ and Delphi header files are already available, see Contrib/ExDLL in the source code package for a basic plug-in example. Source code of included plug-ins can also be found in the source code package.
diff --git a/Docs/src/ui.but b/Docs/src/ui.but
index eed32c7..dc918a0 100644..100755
--- a/Docs/src/ui.but
+++ b/Docs/src/ui.but
@@ -4,7 +4,7 @@
Makes the installer window visible and brings it to the top of the window list. If an application was executed that shows itself in front of the installer, a BringToFront would bring the installer back in focus.
-Recent Windows versions restrict the setting of foreground windows. If the user if working with another application during installation, the user may be notifed using a different method.
+Recent Windows versions restrict the setting of foreground windows. If the user is working with another application during installation, the user may be notifed using a different method.
\S2{createfont} CreateFont
@@ -25,7 +25,7 @@ You can get the current font used by NSIS using the ^Font and ^FontSize \R{langs
Adds the string "user_message" to the details view of the installer.
-\c DeteailPrint "this message will show on the installation window"
+\c DetailPrint "this message will show on the installation window"
\S2{enablewindow} EnableWindow
@@ -45,7 +45,7 @@ Enables or disables mouse and keyboard input to the specified window or control.
Searches for a window. Behaves like the win32 FindWindowEx(). Searches by windowclass (and/or windowtitle if specified). If windowparent or childafter are specified, the search will be restricted as such. If windowclass or windowtitle is specified as "", they will not be used for the search. If the window is not found, the user variable returned is 0. To accomplish old-style FindWindow behavior, use FindWindow with SendMessage.
\c FindWindow $0 "#32770" "" $HWNDPARENT
-\c FIndWindow $0 "my window class" "my window title"
+\c FindWindow $0 "my window class" "my window title"
\S2{getdlgitem} GetDlgItem
diff --git a/Docs/src/uninstall.but b/Docs/src/uninstall.but
index af26d39..af26d39 100644..100755
--- a/Docs/src/uninstall.but
+++ b/Docs/src/uninstall.but
diff --git a/Docs/src/usage.but b/Docs/src/usage.but
index 6fc463a..6b93e04 100644..100755
--- a/Docs/src/usage.but
+++ b/Docs/src/usage.but
@@ -1,4 +1,6 @@
-\C{usage} MakeNSIS Usage
+\C{cmdlineusage} Command Line Usage
+
+\H{usage} MakeNSIS Usage
NSIS installers are generated by using the 'MakeNSIS' program to compile a NSIS script (.NSI) into an installer executable.
The NSIS development kit installer sets up your computer so that you can compile a .nsi file by simply right-clicking on it in explorer, and selecting 'compile'.
@@ -7,7 +9,7 @@ If you want to use MakeNSIS on the command line, the syntax of the makensis comm
\c makensis [option | script.nsi | - [...]]
-\H{usagereference} Options
+\S1{usagereference} Options
\b /LICENSE displays a keen license page.
@@ -31,13 +33,13 @@ If you want to use MakeNSIS on the command line, the syntax of the makensis comm
\b Specifying a dash (-) for the script name will tell makensis to use the standard input as a source.
-\H{usagenotes} Notes
+\S1{usagenotes} Notes
\b Parameters are processed by order. \c{makensis /Ddef script.nsi} is not the same as \c{makensis script.nsi /Ddef}.
\b If multiple scripts are specified, they are treated as one concatenated script.
-\H{usageexamples} Examples
+\S1{usageexamples} Examples
Basic usage:
@@ -58,3 +60,34 @@ Change script behavior:
Parameters order:
\c makensis /XSection sectioncontents.nsi /XSectionEnd
+
+\H{installerusage} Installer Usage
+
+Generated installers and uninstallers accept a few options on the command line. These options give the user a bit more control over the installation process.
+
+\S1{} Common Options
+
+\b /NCRC disables the CRC check, unless \c{\R{acrccheck}{CRCCheck} force} was used in the script.
+
+\b /S runs the installer or uninstaller silently. See \k{silent} for more information.
+
+\b /D sets the default installation directory (\R{varother}{$INSTDIR}), overriding \R{ainstalldir}{InstallDir} and \R{ainstalldirregkey}{InstallDirRegKey}. It must be the last parameter used in the command line and must not contain any quotes, even if the path contains spaces.
+
+\S1{} Uninstaller Specific Options
+
+\b _?= sets $INSTDIR. It also stops the uninstaller from copying itself to the temporary directory and running from there. It can be used along with \R{execwait}{ExecWait} to wait for the uninstaller to finish. It must be the last parameter used in the command line and must not contain any quotes, even if the path contains spaces.
+
+\S1{} Examples
+
+\c installer.exe /NCRC
+
+\c installer.exe /S
+
+\c installer.exe /D=C:\Program Files\NSIS
+
+\c installer.exe /NCRC /S /D=C:\Program Files\NSIS
+
+\c uninstaller.exe /S _?=C:\Program Files\NSIS
+
+\c # uninstall old version
+\c ExecWait '"$INSTDIR\uninstaller.exe" /S _?=$INSTDIR'
diff --git a/Docs/src/usection.but b/Docs/src/usection.but
index 55f4490..55f4490 100644..100755
--- a/Docs/src/usection.but
+++ b/Docs/src/usection.but
diff --git a/Docs/src/usefulfunc.but b/Docs/src/usefulfunc.but
index 3071ccc..b74443d 100644..100755
--- a/Docs/src/usefulfunc.but
+++ b/Docs/src/usefulfunc.but
@@ -444,4 +444,4 @@ Put the following code in your \R{oninit}{.onInit function}:
\H{morefuncs} More
-You can find more useful scripts at \W{http://nsis.sourceforge.net/archive/}{the NSIS Archive}, \W{http://forums.winamp.com/forumdisplay.php?s=&forumid=65}{the NSIS forum} and \W{http://nsis.sourceforge.net/}{NSIS development page}. \ No newline at end of file
+You can find more useful scripts at \W{http://nsis.sourceforge.net/wiki/}{the NSIS Wiki}, \W{http://forums.winamp.com/forumdisplay.php?s=&forumid=65}{the NSIS forum} and \W{http://nsis.sourceforge.net/}{NSIS development page}. \ No newline at end of file
diff --git a/Docs/src/usefulinfos.but b/Docs/src/usefulinfos.but
index 2e80bff..027600a 100644..100755
--- a/Docs/src/usefulinfos.but
+++ b/Docs/src/usefulinfos.but
@@ -2,7 +2,7 @@
\H{errorlevels}Error Levels
-Like other applications installers made by NSIS return error levels as a result of their execution. Checking the error level can be useful if you call an NSIS installer from another application or installer.
+Like other applications, installers made by NSIS return error levels as a result of their execution. Checking the error level can be useful if you call an NSIS installer from another application or installer.
\b 0 - Normal execution (no error)
@@ -73,7 +73,7 @@ If both NoModify and NoRepair are set to 1, the button displays "Remove" instead
Some install processes are required to call functions contained inside third party DLLs. A prime example of this is when installing a Palm(TM) conduit.
\\<b\\>Some background about System.dll\\</b\\> \\<br\\>
-The System.dll plug-in (by Brainsucker) enables calling of external DLLs by providing the 'Call' function. There are a number of other functions provided by System.dll, but they will not be covered here. For more details about the other functions, lock the doors, take the phone off the hook, screw your head on *real* tight and head on over to the Contrib/System directory and read the docs there.
+The System.dll plug-in (by Brainsucker) enables calling of external DLLs by providing the 'Call' function. There are a number of other functions provided by System.dll, but they will not be covered here. For more details about the other functions, lock the doors, take the phone off the hook, screw your head on *real* tight and head on over to the \L{../Docs/System/System.html}{System readme}.
\\<u\\>Data Types\\</u\\> \\<br\\>
System.dll recognises the following data types:
@@ -212,7 +212,7 @@ Good Luck!
This function will dump the log of the installer (installer details) to a file of your choice. I created this function for Afrow_UK who requested a way to dump the log to a file in \W{http://forums.winamp.com/showthread.php?s=&threadid=125431}{this forum thread}.
-To use it push a file name and call it. It will dump the log to the file specified. For example:
+To use it, push a file name and call it. It will dump the log to the file specified. For example:
\c GetTempFileName $0
diff --git a/Docs/src/var.but b/Docs/src/var.but
index ad278e0..3d54fa1 100644..100755
--- a/Docs/src/var.but
+++ b/Docs/src/var.but
@@ -1,18 +1,24 @@
\H{variables} Variables
-All variables are global and can be used in Sections or Functions.
+All variables are global and can be used in Sections or Functions. Note that, by default, variables are limited to 1024 characters. To extend this limit, \R{build}{build NSIS} with a bigger value of NSIS_MAX_STRLEN in Source/exehead/config.h or use the \W{http://nsis.sourceforge.net/download/specialbuilds/}{special build}.
\S1{varuser} User Variables
\e{$VARNAME}
-User variables can be declared with the \R{var}{Var} command. You can use these variables to store values, work with string manipulation etc. Unlike constants these variables are case-sensitive.
+User variables can be declared with the \R{var}{Var} command. You can use these variables to store values, work with string manipulation etc.
\S2{var} Var
\c var_name
-Declare a user variable. Allowed characters for variables names: [a-z][A-Z][0-9] and '_'.
+Declare a user variable. Allowed characters for variables names: [a-z][A-Z][0-9] and '_'. Variables cannot be declared in sections or functions.
+
+\c Var example
+\c
+\c Function testVar
+\c StrCpy $example "example value"
+\c FunctionEnd
\S1{varother} Other Writable Variables