Updated docs

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1739 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
rainwater 2002-11-15 18:45:47 +00:00
parent 277f4d1617
commit 584d3d2524
29 changed files with 228 additions and 222 deletions

View file

@ -1,48 +1,48 @@
\C{instattribs} Installer Attributes
\H{instattribs} Installer Attributes
\H{attribgen} General Attributes
\S1{attribgen} General Attributes
The commands below all adjust attributes of the installer. These attributes control how the installer looks and functions, including which pages are present in the installer, as what text is displayed in each part of each page, how the installer is named, what icon the installer uses, the default installation directory, what file it writes out, and more. Note that these attributes can be set anywhere in the file except in a Section or Function. With the exception of InstallDir, none of these attributes allow use of Variables other than $\\r and $\\n in their strings.
\\<b\\>Defaults are bold\\</b\\>
\S{aaddbrandingimage} AddBrandingImage
\S2{aaddbrandingimage} AddBrandingImage
\c (left|top) (width|height)
Adds a branding image on the top of the installer or on the left. Its size will be set according to the width/height specified, the installer width/height and the installer font. Because this depends on the installer font, you should put SetFont before AddBrandingImage.
\S{aallowrootdirinstall} AllowRootDirInstall
\S2{aallowrootdirinstall} AllowRootDirInstall
\c true|\\<b\\>false\\</b\\>
Controls whether or not installs are enabled to the root directory of a drive, or directly into a network share. Set to 'true' to change the safe behavior, which prevents users from selecting C:\\ or \\\\Server\\Share as an install (and later on, uninstall) directory. For additional directory selection page customizability, see .onVerifyInstDir (\k{onverifyinstdir}).
\S{aautoclosewindow} AutoCloseWindow
\S2{aautoclosewindow} AutoCloseWindow
\c true|\\<b\\>false\\</b\\>
Sets whether or not the install window automatically closes when completed. This is overrideable from a section using SetAutoClose.
\S{abggradient} BGGradient
\S2{abggradient} BGGradient
\c [\\<b\\>off\\</b\\>]|[topc botc [textcolor|notext]]
Specifies whether or not to use a gradient background window. If 'off', the installer will not show a background window, if no parameters are specified, the default black to blue gradient is used, and otherwise the top_color or bottom_color are used to make a gradient. Top_color and bottom_color are specified using the form RRGGBB (in hexadecimal, as in HTML, only minus the leading '#', since # can be used for comments). 'textcolor' can be specified as well, or 'notext' can be specified to turn the big background text off.
\S{abrandingtext} BrandingText
\S2{abrandingtext} BrandingText
\c [/LANG=lang_id] /TRIM(LEFT|RIGHT|CENTER) text
Sets the text that is shown (by default it is 'Nullsoft Install System vX.XX') in the bottom of the install window. Setting this to an empty string ("") uses the default; to set the string to blank, use " " (a space). If it doesn't matter to you, leave it the default so that everybody can know why the installer didn't suck. heh. Use /TRIMLEFT, /TRIMRIGHT or /TRIMCENTER to trim down the size of the control to the size of the string.
\S{acaption} Caption
\S2{acaption} Caption
\c [/LANG=lang_id] caption
Sets what the titlebars of the installer will display. By default, it is 'Name Setup', where Name is specified with the Name command (See \k{aname}). You can, however, override it with 'MyApp Installer' or whatever. If you specify an empty string (""), the default will be used (you can however specify " " to achieve a blank string)
\S{achangeui} ChangeUI
\S2{achangeui} ChangeUI
\c dialog ui_file.exe
@ -62,7 +62,7 @@ Replaces dialog (\e{IDD_LICENSE}, \e{IDD_DIR}, \e{IDD_SELCOM}, \e{IDD_INST}, \e{
\b \e{IDD_VERIFY} must contain \e{IDC_STR} (static).
\S{acheckbitmap} CheckBitmap
\S2{acheckbitmap} CheckBitmap
\c bitmap.bmp
@ -70,91 +70,91 @@ Specifies the bitmap with the images used for the checks of the component-select
This bitmap should have a size of 96x16 pixels and contain six 16x16 images for the different states (in order: selection mask, not checked, checked, greyed out, unchecked & read-only, checked & read-only). Use magenta as mask color (this area will be transparent).
\S{acompletedtext} CompletedText
\S2{acompletedtext} CompletedText
\c [/LANG=lang_id] [Completed text]
Replaces the default text ("Completed") that is printed at the end of the install if parameter is specified. Otherwise, the default is used.
\S{acomponenttext} ComponentText
\S2{acomponenttext} ComponentText
\c [/LANG=lang_id] [text] [subtext] [subtext2]
Specifies a string that is above the component list. This can be something that notifies the user what it is they are actually installing. Note that if no parameter is specified, or if the ComponentText command is omitted, then the component page will not be visible, and all of the sections will be installed. Note: if text is specified and non-empty and you leave subtext or subtext2 empty, the defaults will be used (to set one to blank, use a string like " "). empty strings mean default on subtext and subtext2. Likewise, if you wish to enable the component page, but don't want any text on the top line, set text to " ".
\S{acrccheck} CRCCheck
\S2{acrccheck} CRCCheck
\c \\<b\\>on\\</b\\>|off|force
Specifies whether or not the installer will perform a CRC on itself before allowing an install. Note that if the user uses /NCRC on the command line when executing the installer, and you didn't specify 'force', the CRC will not occur, and the user will be allowed to install a (potentially) corrupted installer.
\S{adetailsbuttontext} DetailsButtonText
\S2{adetailsbuttontext} DetailsButtonText
\c [/LANG=lang_id] [show details text]
Replaces the default details button text of "Show details", if parameter is specified (otherwise the default is used).
\S{adirshow} DirShow
\S2{adirshow} DirShow
\c \\<b\\>show\\</b\\>|hide
Specifies whether or not the user will see the directory selection page. Note that if 'hide' is specified, the installer will still check the validity of the installation path (using internal logic and .onVerifyInstDir if it is declared). If the path is deemed invalid, the directory page will be shown. To completely disable the Directory page (and install without prompting, even if a valid installation path is not available), specify DirText with no parameter (this might be useful if the installer installs everything into $SYSDIR or something like that).
\S{adirtext} DirText
\S2{adirtext} DirText
\c [/LANG=lang_id] [text] [subtext] [browse text]
Specifies a string that is above the directory selection area. If this command is not specified, or no parameter is specified, then the directory page is never visible to the user (even if DirShow show is specified). If subtext is specified and not empty, it overrides the default text above the path entry box ("Select the directory to install MyApp in:"). If browse button text is specified but not empty, it overrides the default browse button text ("Browse...").
\S{a} FileErrorText
\S2{a} FileErrorText
\c [/LANG=lang_id] [file error text]
Replaces the default text that comes up when a file cannot be written to. This string can contain a reference to $0, which is the filename ($0 is temporarily changed to this value). Example: "Can not write to file $\\r$\\n$0$\\r$\\ngood luck, bitch.".
\S{ainstallbuttontext} InstallButtonText
\S2{ainstallbuttontext} InstallButtonText
\c [/LANG=lang_id] [install button text]
If parameter is specified, overrides the default install button text (of "Install") with the specified text.
\S{ainstallcolors} InstallColors
\S2{ainstallcolors} InstallColors
\c /windows | foreground background
Sets the colors to use for the install info screen (the default is 00FF00 000000. Use the form RRGGBB (in hexadecimal, as in HTML, only minus the leading '#', since # can be used for comments). Note that if "/windows" is specified as the only parameter, the default windows colors will be used.
\S{ainstalldir} InstallDir
\S2{ainstalldir} InstallDir
\c definstdir
Sets the default installation directory is. See the 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.
\S{ainstalldirregkey} InstallDirRegKey
\S2{ainstalldirregkey} InstallDirRegKey
\c root_key subkey key_name
This attribute tells the installer to check a string in the registry, and use it for the install dir if that string is valid. If this attribute is present, it will override the InstallDir attribute if the registry key is valid, otherwise it will fall back to the InstallDir default. When querying the registry, this command will automatically remove any quotes. If the string ends in ".exe", it will automatically remove the filename component of the string (i.e. if the string is "C:\\program files\\poop\\poop.exe", it will know to use "C:\\program files\\poop"). For more advanced install directory configuration, set $INSTDIR in .onInit.
\S{ainstprogressflags} InstProgressFlags
\S2{ainstprogressflags} InstProgressFlags
\c [flag [...]]
Valid values for flag are "smooth" (smooth the progress bar) or "colored" (color the progress bar with the colors set by InstallColors. Examples: "InstProgressFlags" (default old-school windows look), "InstProgressFlags smooth" (new smooth look), "InstProgressFlags smooth colored" (colored smooth look whee).
\S{ainsttype} InstType
\S2{ainsttype} InstType
\c install_type_name | /NOCUSTOM | ([/LANG=lang_id] /CUSTOMSTRING=str)| /COMPONENTS.. ..ONLYONCUSTOM
Adds an install type to the install type list, or disables the custom install type. There can be as many as 8 types, each one specifying the name of the install. The first type is the default (generally 'Typical'). Each type is numbered, starting at 1. See SectionIn for information on how those numbers are used. If the /NOCUSTOM switch is specified, then the "custom" install type is disabled, and the user has to choose one of the pre-defined install types. Alternatively, if the /CUSTOMSTRING switch is specified, the parameter will override the "Custom" install type text. Alternatively, if the /COMPONENTSONLYONCUSTOM flag is specified, the component list will only be shown if the "Custom" install type is selected.
\S{alicensebkcolor} LicenseBkColor
\S2{alicensebkcolor} LicenseBkColor
\c color
Sets the background color of the license data. Color is specified using the form RRGGBB (in hexadecimal, as in HTML, only minus the leading '#', since # can be used for comments).
\S{alicensedata} LicenseData
\S2{alicensedata} LicenseData
\c [/LANG=lang_id] licdata.(txt|rtf)
@ -162,127 +162,127 @@ Specifies a text file or a RTF file to use for the license that the user can rea
If you make your license file a RTF file it is recommended you edit it with WordPad and not MS Word. Using WordPad will result in a much smaller file.
\S{alicensetext} LicenseText
\S2{alicensetext} LicenseText
\c [/LANG=lang_id] text [button_text]
Specifies a string that is above the license text. Omit this to not have a license displayed. If button_text is specified, it will override the default button text of "I Agree".
\S{aloadlanguagefile} LoadLanguageFile
\S2{aloadlanguagefile} LoadLanguageFile
\c lang_file.nlf
Loads a NLF (NSIS Language File) that will be used to create a string table for the specific language in that NLF.
\S{amiscbuttontext} MiscButtonText
\S2{amiscbuttontext} MiscButtonText
\c [/LANG=lang_id] [back button text] [next button text] [cancel button text] [close button text]
Replaces the default text strings for the four buttons (< Back, Next >, Cancel and Close). If parameters are omitted, the defaults are used.
\S{aname} Name
\S2{aname} Name
\c [/LANG=lang_id] name
Sets the name of the installer. The name is usually simply the product name such as 'MyApp' or 'CrapSoft MyApp'.
\S{aicon} Icon
\S2{aicon} Icon
\c path_to_icon.ico
Sets the icon of the installer.
\S{aoutfile} OutFile
\S2{aoutfile} OutFile
\c [path\]install.exe
Specifies the output file that the MakeNSIS should write the installer to. This is just the file that MakeNSIS writes, it doesn't affect the contents of the installer.
\S{aplugindir} PluginDir
\S2{aplugindir} PluginDir
\c directory
Causes the NSIS compiler to scan the given directory for Plugin DLLs.
\S{asetfont} SetFont
\S2{asetfont} SetFont
\c font_face_name font_size
Sets the installer font. Please remember that the font you choose must be present on the user's machine as well. Don't use rare fonts that only you have.
\S{ashowinstdetails} ShowInstDetails
\S2{ashowinstdetails} ShowInstDetails
\c \\<b\\>hide\\</b\\>|show|nevershow
Sets whether or not the details of the install are shown. Can be 'hide' to hide the details by default, allowing the user to view them, or 'show' to show them by default, or 'nevershow', to prevent the user from ever seeing them. Note that sections can override this using SetDetailsView.
\S{ashowuninstdetails} ShowUninstDetails
\S2{ashowuninstdetails} ShowUninstDetails
\c \\<b\\>hide\\</b\\>|show|nevershow
Sets whether or not the details of the uninstall are shown. Can be 'hide' to hide the details by default, allowing the user to view them, or 'show' to show them by default, or 'nevershow', to prevent the user from ever seeing them. Note that sections can override this using SetDetailsView.
\S{asilentinstall} SilentInstall
\S2{asilentinstall} SilentInstall
\c \\<b\\>normal\\</b\\>|silent|silentlog
Specifies whether or not the installer should be silent. If it is 'silent' or 'silentlog', all sections are installed quietly, with no screen output from the installer itself (MessageBoxes are still displayed on error, and the script can still display whatever it wants). Note that if this is set to 'normal' and the user runs the installer with /S on the command line, it will behave as if SilentInstall 'silent' was used. Note: see also LogSet (\k{logset}).
\S{asilentuninstall} SilentUnInstall
\S2{asilentuninstall} SilentUnInstall
\c \\<b\\>normal\\</b\\>|silent
Specifies whether or not the uninstaller should be silent. If it is 'silent' or 'silentlog', all sections are installed quietly, with no screen output from the installer itself (MessageBoxes are still displayed on error, and the script can still display whatever it wants). Note that if this is set to 'normal' and the user runs the installer with /S on the command line, it will behave as if SilentInstall 'silent' was used. Note: see also LogSet (\k{logset}).
\S{aspacetexts} SpaceTexts
\S2{aspacetexts} SpaceTexts
\c [/LANG=lang_id] [req text] [avail text]
If parameters are specified, overrides the space required and space available text ("Space required: " and "Space available: " by default). If 'none' is specified as the required text no space texts will be shown.
\S{asubcaption} SubCaption
\S2{asubcaption} SubCaption
\c [/LANG=lang_id] page_number subcaption
Overrides the subcaptions for each of the installer pages (0=": License Agreement",1=": Installation Options",2=": Installation Directory", 3=": Installing Files", 4=": Completed"). If you specify an empty string (""), the default will be used (you can however specify " " to achieve a blank string)
\S{auninstallbuttontext} UninstallButtonText
\S2{auninstallbuttontext} UninstallButtonText
\c [/LANG=lang_id] [button text]
Changes the text of the button that by default says "Uninstall" in the uninstaller. If no parameter is specified, the default text is used. See also WriteUninstaller (replaces UninstallEXEName).
\S{auninstallcaption} UninstallCaption
\S2{auninstallcaption} UninstallCaption
\c [/LANG=lang_id] caption
Sets what the titlebars of the uninstaller will display. By default, it is 'Name Uninstall', where Name is specified with the Name command. You can, however, override it with 'MyApp uninstaller' or whatever. If you specify an empty string (""), the default will be used (you can however specify " " to achieve a blank string)
\S{auninstallicon} UninstallIcon
\S2{auninstallicon} UninstallIcon
\c path_to_icon.ico
Sets the icon of the uninstaller.
\S{auninstallsubcaption} UninstallSubCaption
\S2{auninstallsubcaption} UninstallSubCaption
\c [/LANG=lang_id] page_number subcaption
Overrides the subcaptions for each of the uninstaller pages (0=": Confirmation",1=": Uninstalling Files",2=": Completed"). If you specify an empty string (""), the default will be used (you can however specify " " to achieve a blank string)
\S{auninstalltext} UninstallText
\S2{auninstalltext} UninstallText
\c [/LANG=lang_id] text [subtext]
Specifies the text on the first page of the uninstaller. If subtext is specified and not empty, it will replace the default secondary text on that page, "Uninstall from:".
\S{awindowicon} WindowIcon
\S2{awindowicon} WindowIcon
\c \\<b\\>on\\</b\\>|off
Sets whether or not the installer's icon is being displayed.
\S{axpstyle} XPStyle
\S2{axpstyle} XPStyle
\c on|\\<b\\>off\\</b\\>

View file

@ -1,14 +1,16 @@
\H{basicinstructions} Basic Instructions
\H{instr} Instructions
\S1{basicinstructions} Basic Instructions
The instructions that NSIS uses for scripting are sort of a cross between PHP and assembly. There are no real high level language constructs, but the instructions themselves are (for the most part) high level, and you have handy string capability (i.e. you don't have to worry about concatenating strings, etc). You essentially have 25 registers (20 general purpose, 5 special purpose), and a stack.
\S{delete} Delete
\S2{delete} Delete
\c [/REBOOTOK] file
Delete file (which can be a file or wildcard, but should be specified with a full path) from the target system. If /REBOOTOK is specified and the file cannot be deleted then the file is deleted when the system reboots -- if the file will be deleted on a reboot, the reboot flag will be set. The error flag is set if files are found and cannot be deleted. The error flag is not set from trying to delete a file that does not exist.
\S{file} File
\S2{file} File
\c [/nonfatal] [/a] ([/r] (file|wildcard) [...] | /oname=file.dat infile.dat)
@ -16,11 +18,11 @@ Adds file(s) to be extracted to the current output path ($OUTDIR).
\b Note that the output file name is $OUTDIR\\filename_portion_of_file.
\b If the /oname=X switch is used, the output name becomes $OUTDIR\\X. When using the /oname= switch, only one file can be specified, and the file name can contain variables (or a fully qualified path, i.e. $SYSDIR\\whatever.dll).
\b If the /oname=X switch is used, the output name becomes $OUTDIR\\X. When using the /oname= switch, only one file can be specified, and the file name can contain variables (or a fully qualified path, e.g. $SYSDIR\\whatever.dll).
\b Wildcards are supported.
\b If the /r switch is used, files and directories are added recursively. If is no trailing wildcard (i.e. File /r C:\\whatever\\mydir), then the whole tree of mydir will go in $OUTDIR\\mydir. To put it in $OUTDIR, use File /r C:\\whatever\\mydir\\*.*
\b If the /r switch is used, files and directories are added recursively. If is no trailing wildcard (e.g. File /r C:\\whatever\\mydir), then the whole tree of mydir will go in $OUTDIR\\mydir. To put it in $OUTDIR, use File /r C:\\whatever\\mydir\\*.*
\b If the /a switch is used, the attributes of the file(s) added will be preserved.
@ -28,37 +30,37 @@ Adds file(s) to be extracted to the current output path ($OUTDIR).
\b If the /nonfatal switch is used, a warning will be issued if no files found instead of an error.
\S{exec} Exec
\S2{exec} Exec
\c command
Execute the specified program and continue immediately. Note that the file specified must exist on the target system, not the compiling system. $OUTDIR is used for the working directory. The error flag is set if the process could not be launched. Note, if the command could have spaces, you may with to put it in quotes to delimit it from parameters. i.e.: Exec '"$INSTDIR\\command.exe" parameters'.
Execute the specified program and continue immediately. Note that the file specified must exist on the target system, not the compiling system. $OUTDIR is used for the working directory. The error flag is set if the process could not be launched. Note, if the command could have spaces, you may with to put it in quotes to delimit it from parameters. e.g.: Exec '"$INSTDIR\\command.exe" parameters'.
\S{execshell} ExecShell
\S2{execshell} ExecShell
\c action command [parameters] [SW_SHOWNORMAL | SW_SHOWMAXIMIZED | SW_SHOWMINIMIZED]
Execute the specified program using ShellExecute. Note that action is usually "open", "print", etc, but can be an empty string to use the default action. Parameters and the show type are optional. $OUTDIR is used for the working directory. The error flag is set if the process could not be launched.
\S{execwait} ExecWait
\S2{execwait} ExecWait
\c command [user_var(exit code)]
Execute the specified program and wait for the executed process to quit. See Exec for more information. If no output variable is specified ExecWait sets the error flag if the program executed returns a nonzero error code, or if there is an error. If an output variable is specified, ExecWait sets the variable with the exit code (and only sets the error flag if an error occurs; if an error occurs the contents of the user variable are undefined). Note, if the command could have spaces, you may with to put it in quotes to delimit it from parameters. i.e.: ExecWait '"$INSTDIR\\command.exe" parameters'
Execute the specified program and wait for the executed process to quit. See Exec for more information. If no output variable is specified ExecWait sets the error flag if the program executed returns a nonzero error code, or if there is an error. If an output variable is specified, ExecWait sets the variable with the exit code (and only sets the error flag if an error occurs; if an error occurs the contents of the user variable are undefined). Note, if the command could have spaces, you may with to put it in quotes to delimit it from parameters. e.g.: ExecWait '"$INSTDIR\\command.exe" parameters'
\S{rename} Rename
\S2{rename} Rename
\c [/REBOOTOK] source_file dest_file
Rename source_file to dest_file. Functions just like the Win32 API MoveFile, which means you can move a file from anywhere on the system to anywhere else, and you can move a directory to somewhere else on the same drive. If /REBOOTOK is specified, and the file cannot be overwritten, then the file is moved when the system reboots -- if the file will be moved on a reboot, the reboot flag will be set. The error flag is set if the file cannot be renamed (and /REBOOTOK is not used) or if the source file does not exist.
\S{rmdir} RMDir
\S2{rmdir} RMDir
\c [/r] directory
Remove the specified directory (which should be a full path). Without /r, the directory will only be removed if it is completely empty. If /r is specified, the directory will be removed recursively, so all directories and files in the specified directory will be removed. The error flag is set if the directory cannot be removed.
\S{reservefile} ReserveFile
\S2{reservefile} ReserveFile
\c [/nonfatal] [/r] file [file...]
@ -66,7 +68,7 @@ Reserves a file in the data block for later use. As files are added in the order
See File (\K{file}) for more information about the parameters.
\S{setoutpath} SetOutPath
\S2{setoutpath} SetOutPath
\c outpath

View file

@ -1,4 +1,4 @@
bin\halibut.exe config.but intro.but usage.but script.but attributes.but compilerflags.but pages.but sections.but basic.but registry.but generalpurpose.but flowcontrol.but file.but misc.but string.but stack.but int.but reboot.but uninstall.but log.but sec.but ui.but functions.but labels.but var.but usection.but callback.but compiler.but defines.but plugin.but history.but modernui.but usefulfunc.but license.but
bin\halibut.exe config.but intro.but usage.but script.but functions.but callback.but var.but labels.but pages.but attributes.but compilerflags.but sections.but usection.but basic.but registry.but generalpurpose.but flowcontrol.but file.but misc.but string.but stack.but int.but reboot.but log.but sec.but ui.but plugin.but compiler.but defines.but history.but modernui.but usefulfunc.but license.but
@copy Contents.html index.html
@copy index.html IndexPage.html
@copy *.html ..\\

View file

@ -1,10 +1,10 @@
\C{callbacks} Callback Functions
\S1{callbacks} Callback Functions
You can create callback functions which have special names, that will be called by the installer at certain points in the install. Below is a list of currently available callbacks:
\H{instcallbacks} Install Callbacks
\S2{instcallbacks} Install Callbacks
\S{onguiinit} .onGUIInit
\S3{onguiinit} .onGUIInit
This callback will be called just before the first page is loaded and the installer dialog is shown, allowing you to tweak the user interface.
@ -20,7 +20,7 @@ Example:
\c SetStaticBkColor $R0 0x00FFFFFF
\c FunctionEnd
\S{oninit} .onInit
\S3{oninit} .onInit
This callback will be called when the installer is nearly finished initializing. If the '.onInit' function calls Abort, the installer will quit instantly.
@ -42,7 +42,7 @@ or:
\c NoAbort:
\c FunctionEnd
\S{oninstfailed} .onInstFailed
\S3{oninstfailed} .onInstFailed
This callback is called when the user hits the 'cancel' button after the install has failed (if it could not extract a file, or the install script used the Abort command).
@ -52,7 +52,7 @@ Example:
\c MessageBox MB_OK "Better luck next time."
\c FunctionEnd
\S{oninstsuccess} .onInstSuccess
\S3{oninstsuccess} .onInstSuccess
This callback is called when the install was successful, right before the install window closes (which may be after the user clicks 'Close' if AutoCloseWindow is set to false).
@ -64,7 +64,7 @@ Example:
\c NoReadme:
\c FunctionEnd
\S{onmouseoversection} .onMouseOverSection
\S3{onmouseoversection} .onMouseOverSection
This callback is called whenever the mouse position over the sections tree has changed. This allows you to set a description for each section for example. The section id on which the mouse is over currently is stored, temporarily, in $0.
@ -81,11 +81,11 @@ Example:
\c SendMessage $R0 $\{WM_SETTEXT\} 0 "second section description"
\c FunctionEnd
\S{onselchange} .onSelChange
\S3{onselchange} .onSelChange
Called when the selection changes on the component page. Useful for using with SectionSetFlags and SectionGetFlags.
\S{onuserabort} .onUserAbort
\S3{onuserabort} .onUserAbort
This callback is called when the user hits the 'cancel' button, and the install hasn't already failed. If this function calls Abort, the install will not be aborted.
@ -97,7 +97,7 @@ Example:
\c NoCancelAbort:
\c FunctionEnd
\S{onverifyinstdir} .onVerifyInstDir
\S3{onverifyinstdir} .onVerifyInstDir
This callback enables control over whether or not an installation path is valid for your installer. This code will be called every time the user changes the install directory, so it shouldn't do anything crazy with MessageBox or the likes. If this function calls Abort, the installation path in $INSTDIR is deemed invalid.
@ -109,15 +109,15 @@ Example:
\c PathGood
\c FunctionEnd
\H{uninstcallbacks} Uninstall Callbacks
\S2{uninstcallbacks} Uninstall Callbacks
\S{unonguiinit} un.onGUIInit
\S3{unonguiinit} un.onGUIInit
This callback will be called just before the first page is loaded and the installer dialog is shown, allowing you to tweak the user interface.
Have a look at .onGUIInit (\K{onguiinit}) for an example.
\S{unonInit} un.onInit
\S3{unonInit} un.onInit
This callback will be called when the uninstaller is nearly finished initializing. If the 'un.onInit' function calls Abort, the uninstaller will quit instantly. Note that this function can verify and/or modify $INSTDIR if necessary.
@ -138,7 +138,7 @@ or:
\c found:
\c FunctionEnd
\S{unonuninstfailed} un.onUninstFailed
\S3{unonuninstfailed} un.onUninstFailed
This callback is called when the user hits the 'cancel' button after the uninstall has failed (if it used the Abort command or otherwise failed).
@ -148,7 +148,7 @@ Example:
\c MessageBox MB_OK "Better luck next time."
\c FunctionEnd
\S{unonuninstsuccess} un.onUninstSuccess
\S3{unonuninstsuccess} un.onUninstSuccess
This callback is called when the uninstall was successful, right before the install window closes (which may be after the user clicks 'Close' if AutoCloseWindow is set to false).
@ -158,7 +158,7 @@ Example:
\c MessageBox MB_OK "Congrats, it's gone."
\c FunctionEnd
\S{unonuserabort} un.onUserAbort
\S3{unonuserabort} un.onUserAbort
This callback is called when the user hits the 'cancel' button and the uninstall hasn't already failed. If this function calls Abort, the install will not be aborted.

View file

@ -1,50 +1,52 @@
\C{compcommands} Compiler Utility Commands
\C{comptime} Compile Time Commands
\S0{compcommands} Compiler Utility Commands
These commands are similar to the C preprocessor in terms of purpose and functionality. They allow file inclusion, conditional compilation, executable header packing, and processes execution during the build process. Note: none of these commands allow use of variables.
\H{include} !include
\S1{include} !include
\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).
\H{cd} !cd
\S1{cd} !cd
\c new_path
This command will change the compiler to the new directory, new_path. new_path can be relative or absolute.
\H{echo} !echo
\S1{echo} !echo
\c message
This command will echo a message to the user compiling the script.
\H{error} !error
\S1{error} !error
\c [message]
This command will issue an error to the script compiler and will stop execution of the script. You can also add a message to this error.
\H{packhdr} !packhdr
\S1{packhdr} !packhdr
\c tempfile command
This option makes the compiler an external EXE packer (such as Petite or UPX) to compress the executable header. Specify a temporary file name (such as "temp.dat") and a command line (such as "C:\\program files\\upx\\upx -9 temp.dat") to compress the header.
\H{system} !system
\S1{system} !system
\c command [compare comparevalue]
This command will execute 'command' using a call to system(), and if the return value compared (using 'compare') to 'comparevalue' is false, execution will halt. 'compare' can be '<' or '>' or '<>' or '=' or 'ignore'.
\H{warning} !warning
\S1{warning} !warning
\c [message]
This command will issue a warning to the script compiler. You can also add a message to this warning.
\H{verbose} !verbose
\S1{verbose} !verbose
\c level

View file

@ -1,32 +1,32 @@
\H{flags} Compiler Flags
\S1{flags} Compiler Flags
The following commands change how the compiler generates code and compresses data. These commands are valid anywhere in the script, and effect every line below where each one is placed (until overridden by another command).
\S{asetcompress} SetCompress
\S2{asetcompress} SetCompress
\c \\<b\\>auto\\</b\\>|force|off
This command sets the compress flag which is used by the installer to determine whether or not data should be compressed. Typically the SetCompress flag will effect the commands after it, and the last SetCompress command in the file also determines whether or not the install info section and uninstall data of the installer is compressed. If compressflag is 'auto', then files are compressed if the compressed size is smaller than the uncompressed size. If compressflag is set to 'force', then the compressed version is always used. If compressflag is 'off' then compression is not used (which can be faster). Note that this option has no effect on bzip2 installers (compression is always used on bzip2 installers).
\S{asetcompressor} SetCompressor
\S2{asetcompressor} SetCompressor
\c \\<b\\>zlib\\</b\\>|bzip2
This command sets the compression algorithm used to compress files/data in the installer. Options are ZLib or BZip2. ZLib (the default) uses deflate compression. This mode uses less memory at runtime and is faster. BZip2 compression is usually better for large installers, but it is slower and uses a lot more memory at runtime.
\S{asetdatablockoptimize} SetDatablockOptimize
\S2{asetdatablockoptimize} SetDatablockOptimize
\c \\<b\\>on\\</b\\>|off
This command tells the compiler whether or not to do datablock optimizations. Datablock optimizations have the compiler check to see if any data being added to the data block is already in the data block, and if so, it is simply referenced as opposed to added (can save a little bit of size). It is highly recommended to leave this option on.
\S{asetdatesave} SetDateSave
\S2{asetdatesave} SetDateSave
\c \\<b\\>on\\</b\\>|off
This command sets the file date/time saving flag which is used by the File command to determine whether or not to save the last write date and time of the file, so that it can be restored on installation. Valid flags are 'on' and 'off'. 'on' is the default.
\S{asetoverwrite} SetOverwrite
\S2{asetoverwrite} SetOverwrite
\c \\<b\\>on\\</b\\>|off|try|ifnewer

View file

@ -6,7 +6,7 @@
\cfg{xhtml-leaf-contains-contents}{true}
\cfg{xhtml-contents-depth-0}{1}
\cfg{xhtml-contents-depth-0}{3}
\cfg{xhtml-head-end}{<link rel="stylesheet" href="style.css" type='text/css' />}

View file

@ -1,4 +1,4 @@
\C{compdefines} Conditional Compilation
\S0{compdefines} Conditional Compilation
The compiler maintains a list of defined symbols, which can be defined using !define or the /D command line switch. These defined symbols can be used for conditional compilation (using !ifdef) or for symbol replacement (a simple form of macros). To replace a symbol with its value, use $\{SYMBOL\} (if SYMBOL is not defined, no translation will occur). The translation is first-come-first-served, meaning if you do:
@ -22,7 +22,7 @@ This command closes a block started with !ifdef or !ifndef.
\e{!else [ifdef|ifndef [...]]}
This command is the opposite of !ifdef (If 'gflag' is not globally defined, the lines contained will be compiled). Note that when using boolean operators (& or |), 'gflag' is treated as true if it is undefined. I.e. '!ifndef X | Y' means "if either X or Y is undefined" and '!ifndef X & Y' means "if X and Y are both undefined".
This command is the opposite of !ifdef (If 'gflag' is not globally defined, the lines contained will be compiled). Note that when using boolean operators (& or |), 'gflag' is treated as true if it is undefined. e.g. '!ifndef X | Y' means "if either X or Y is undefined" and '!ifndef X & Y' means "if X and Y are both undefined".
\e{!endif}
@ -34,7 +34,7 @@ Inserts the contents of a macro that was created with !macro. If the macro was c
\e{!macro macro_name [parameter][...]}
Creates a macro named 'macro_name'. All lines between the !macro and the !macroend will be saved. To insert the macro later on, use !insertmacro. Note that macros cannot contain other macro definitions (though they can insert other macros), or !ifdef/!else/!endif. !macro definitions can have one or more parameters defined. The parameters may be accessed the same way a !define would (i.e. $\{PARMNAME\}) from inside the macro.
Creates a macro named 'macro_name'. All lines between the !macro and the !macroend will be saved. To insert the macro later on, use !insertmacro. Note that macros cannot contain other macro definitions (though they can insert other macros), or !ifdef/!else/!endif. !macro definitions can have one or more parameters defined. The parameters may be accessed the same way a !define would (e.g. $\{PARMNAME\}) from inside the macro.
\e{!macroend}

View file

@ -1,60 +1,60 @@
\H{fileinst} File Instructions
\S1{fileinst} File Instructions
\S{FileClose} FileClose
\S2{FileClose} FileClose
\c handle
Closes a file handle opened with FileOpen.
\S{FileOpen} FileOpen
\S2{FileOpen} FileOpen
\c user_var(handle output) filename openmode
Opens a file named "filename", and sets the handle output variable with the handle. The openmode should be one of "r" (read) "w" (write, all contents of file are destroyed) or "a" (append, meaning opened for both read and write, contents preserved). In all open modes, the file pointer is placed at the beginning of the file. If the file cannot be opened, the handle output is set to empty, and the error flag is set.
\S{FileRead} FileRead
\S2{FileRead} FileRead
\c handle user_var(output) [maxlen]
Reads a string from a file opened with FileOpen. The string is read until either a newline (or carriage return newline pair) occurs, or until a null byte is read, or until maxlen is met (if specified). Strings are limited to 1024 characters. If the end of file is read and no more data is available, the output string will be empty, and the error flag will be set.
\S{FileReadByte} FileReadByte
\S2{FileReadByte} FileReadByte
\c handle user_var(output)
Reads a byte from a file opened with FileOpen. The byte is stored in the output as an integer (0-255). If the end of file is read and no more data is available, the output will be empty, and the error flag will be set.
\S{FileSeek} FileSeek
\S2{FileSeek} FileSeek
\c handle offset [mode] [user_var(new position)]
Seeks a file opened with FileOpen. If mode is omitted or specified as SET, the file is positioned to "offset". If mode is specified as CUR, then the file pointer is moved by offset. If mode is specified as END, the file pointer is set to a position relative to EOF. If the final parameter "new position" is specified, the new file position will be stored to that variable.
\S{FileWrite} FileWrite
\S2{FileWrite} FileWrite
\c handle string
Writes a string to a file opened with FileOpen. If an error occurs writing, the error flag will be set.
\S{FileWriteByte} FileWriteByte
\S2{FileWriteByte} FileWriteByte
\c handle string
Writes the integer interpretation of 'string' to a file opened with FileOpen. If an error occurs writing, the error flag will be set. Note that the low byte of the integer is used, i.e. writing 256 is the same as writing 0, etc.
\S{FindClose} FindClose
\S2{FindClose} FindClose
\c handle
Closes a search opened with FindFirst.
\S{FindFirst} FindFirst
\S2{FindFirst} FindFirst
\c user_var(handle output) user_var(filename output) filespec
Performs a search for 'filespec', placing the first file found in filename_output (a user variable). It also puts the handle of the search into handle_output (also a user variable). If no files are found, both outputs are set to empty, and the error flag is set. Best used with FindNext and FindClose. Note that the filename output is without path.
\S{FindNext} FindNext
\S2{FindNext} FindNext
\c handle user_var(filename_output)

View file

@ -1,40 +1,40 @@
\H{flowcontrol} Flow Control Instructions
\S1{flowcontrol} Flow Control Instructions
\S{abort} Abort
\S2{abort} Abort
\c user_message
Cancels the install, stops execution of script, and displays user_message in the status display. Note: you can use this from Callback Functions (\k{callbacks}) to do special things. Pages callbacks (\K{pages}) also uses Abort for special purposes.
\S{call} Call
\S2{call} Call
\c function_name | :label_name
Calls the function named function_name. If in the Uninstall section, Call can only be used with function names beginning with "un.". If the parameter starts with a ':' it will be treated as a label (so you can call to a label in your function - this is probably not going to be used most of the time).
\S{clearerrors} ClearErrors
\S2{clearerrors} ClearErrors
Clears the error flag.
\S{getcurrentaddress} GetCurrentAddress
\S2{getcurrentaddress} GetCurrentAddress
\c user_var(output)
Gets the address of the current instruction (the GetCurrentAddress) and stores it in the output user variable. This user variable then can be passed to Call or Goto.
\S{getfunctionaddress} GetFunctionAddress
\S2{getfunctionaddress} GetFunctionAddress
\c user_var(output) function_name
Gets the address of the function and stores it in the output user variable. This user variable then can be passed to Call or Goto. Note that if you Goto an address which is the output of GetFunctionAddress, your function will never be returned to (when the function you Goto'd to returns, you return instantly).
\S{getlabeladdress} GetLabelAddress
\S2{getlabeladdress} GetLabelAddress
\c user_var(output) label
Gets the address of the label and stores it in the output user variable. This user variable then can be passed to Call or Goto. Note that you may only call this with labels accessible from your function, but you can call it from anywhere (which is potentially dangerous). Note that if you Call the output of GetLabelAddress, code will be executed until it Return's (explicitly or implicitly at the end of a function), and then you will be returned to the statement after the Call.
\S{goto} Goto
\S2{goto} Goto
\c label_to_jump_to | +offset| -offset| user_var(target)
@ -44,41 +44,41 @@ If +offset or -offset is specified, jump is relative by offset instructions. Got
If a user variable is specified, jumps to absolute address (generally you will want to get this value from a function like GetLabelAddress. I Compiler flag commands and SectionIn aren't instructions so jumping over them has no effect.
\S{iferrors} IfErrors
\S2{iferrors} IfErrors
\c jumpto_iferror [jumpto_ifnoerror]
Checks and clears the error flag, and if it is set, it will goto jumpto_iferror, otherwise it will goto jumpto_ifnoerror. The error flag is set by other instructions when a recoverable error (such as trying to delete a file that is in use) occurs.
\S{iffileexists} IfFileExists
\S2{iffileexists} IfFileExists
\c file_to_check_for jump_if_present [jump_otherwise]
Checks for existence of file(s) file_to_check_for (which can be a wildcard, or a directory), and Gotos jump_if_present if the file exists, otherwise Gotos jump_otherwise. If you want to check to see if a file is a directory, use IfFileExists DIRECTORY\\*.*
\S{IfRebootFlag} IfRebootFlag
\S2{IfRebootFlag} IfRebootFlag
\c [jump_if_set] [jump_if_not_set]
Checks the reboot flag, and jumps to jump_if_set if the reboot flag is set, otherwise jumps to jump_if_not_set. The reboot flag can be set by Delete and Rename, or manually with SetRebootFlag.
\S{intcmp} IntCmp
\S2{intcmp} IntCmp
\c val1 val2 jump_if_equal [jump_if_val1_less] [jump_if_val1_more]
Compares two integers val1 and val2. If val1 and val2 are equal, Gotos jump_if_equal, otherwise if val1 < val2, Gotos jump_if_val1_less, otherwise if val1 > val2, Gotos jump_if_val1_more.
\S{intcmpu} IntCmpU
\S2{intcmpu} IntCmpU
\c val1 val2 jump_if_equal [jump_if_val1_less] [jump_if_val1_more]
Compares two unsigned integers val1 and val2. If val1 and val2 are equal, Gotos jump_if_equal, otherwise if val1 < val2, Gotos jump_if_val1_less, otherwise if val1 > val2, Gotos jump_if_val1_more. Performs the comparison as unsigned integers.
\S{messagebox} MessageBox
\S2{messagebox} MessageBox
\c mb_option_list messagebox_text [return_check jumpto] [return_check_2 jumpto_2]
Displays a MessageBox containing the text "messagebox_text". mb_option_list must be one or more of the following, delimited by |s (i.e. MB_YESNO|MB_ICONSTOP).
Displays a MessageBox containing the text "messagebox_text". mb_option_list must be one or more of the following, delimited by |s (e.g. MB_YESNO|MB_ICONSTOP).
\b \e{MB_OK} - Display with an OK button
@ -132,7 +132,7 @@ Return_check can be 0 (or empty, or left off), or one of the following:
If the return value of the MessageBox is return_check, the installer will Goto jumpto.
\S{return} Return
\S2{return} Return
Returns from a function or section.
@ -148,15 +148,15 @@ To send a string param, put STR: before the parameter, for example: "STR:Some st
Use /TIMEOUT=time_in_ms to specify the duration, in milliseconds, of the time-out period.
\S{quit} Quit
\S2{quit} Quit
Causes the installer to exit as soon as possible. After Quit is called, the installer will exit (no callback functions will get a chance to run).
\S{seterrors} SetErrors
\S2{seterrors} SetErrors
Sets the error flag.
\S{strcmp} StrCmp
\S2{strcmp} StrCmp
\c str1 str2 jump_if_equal [jump_if_not_equal]

View file

@ -1,4 +1,4 @@
\C{functions} Functions
\H{functions} Functions
Functions are like similar to Sections in that they contain zero or more instructions. Functions are not called by the installer directly, instead they are called from Sections using the Call instruction (Note: there are some special Callback Functions that can be called by the installer directly).

View file

@ -1,24 +1,24 @@
\H{generalpurpose} General Purpose Instructions
\S1{generalpurpose} General Purpose Instructions
\S{callinstdll} CallInstDLL
\S2{callinstdll} CallInstDLL
\c dllfile [/NOUNLOAD]
Function Calls a NSIS extension DLL. See Contrib\\ExDLL for an example of how to make one. Extension DLLs can access the stack and variables. Use /NOUNLOAD to force the installer to leave the DLL loaded.
\S{copyfiles} CopyFiles
\S2{copyfiles} CopyFiles
\c [/SILENT] [/FILESONLY] filespec_on_destsys destination_path [size_of_files_in_kb]
Copies files from the source to the destination on the installing system. Useful with $EXEDIR if you want to copy from installation media, or to copy from one place to another on the system. Uses SHFileOperation, so the user might see a status window of the copy operation if it is large (to disable this, use /SILENT). The last parameter specifies how big the copy is (in kilobytes), so that the installer can approximate the disk space requirements. On error, or if the user cancels the copy (only possible when /SILENT was omitted), the error flag is set. If /FILESONLY is specified, only files are copied.
\S{createdirectory} CreateDirectory
\S2{createdirectory} CreateDirectory
\c path_to_create
Creates (recursively if necessary) the specified directory.
\S{createshortcut} CreateShortCut
\S2{createshortcut} CreateShortCut
\c link.lnk target.file [parameters [icon.file [icon_index_number [start_options [keyboard_shortcut [description]]]]]]
@ -29,49 +29,49 @@ keyboard_shortcut should be in the form of 'flag|c' where flag can be a combinat
description should be the description of the shortcut, or comment as it is called under XP.
The error flag is set if the shortcut cannot be created (i.e. the path does not exist, or some other error).
\S{getdllversion} GetDLLVersion
\S2{getdllversion} GetDLLVersion
\c filename user_var(high dword output) user_var(low dword output)
Gets the version information from the DLL in "filename". Sets the user output variables with the high and low dwords of version information on success; on failure the outputs are empty and the error flag is set.
\S{getdllversionlocal} GetDLLVersionLocal
\S2{getdllversionlocal} GetDLLVersionLocal
\c localfilename user_var(high dword output) user_var(low dword output)
This is similar to GetDLLVersion, only it acts on the system building the installer (it actually compiles into two StrCpy commands). Sets the two output variables with the DLL version information of the DLL on the build system.
\S{getfiletime} GetFileTime
\S2{getfiletime} GetFileTime
\c filename user_var(high dword output) user_var(low dword output)
Gets the last write time of "filename". Sets the user output variables with the high and low dwords of the timestamp on success; on failure the outputs are empty and the error flag is set.
\S{getfiletimelocal} GetFileTimeLocal
\S2{getfiletimelocal} GetFileTimeLocal
\c localfilename user_var(high dword output) user_var(low dword output)
This is similar to GetFileTime, only it acts on the system building the installer (it actually compiles into two StrCpy commands). Sets the two output variables with the file timestamp of the file on the build system.
\S{getfullpathname} GetFullPathName
\S2{getfullpathname} GetFullPathName
\c [/SHORT] user_var(output) path_or_file
Assign to the user variable $x, the full path of the file specified. If the path portion of the parameter is not found, the error flag will be set and $x will be empty. If /SHORT is specified, the path is converted to the short filename form.
\S{gettempfilename} GetTempFileName
\S2{gettempfilename} GetTempFileName
\c user_var(output)
Assign to the user variable $x, the name of a temporary file. The file will have been created, so you can then overwrite it with what you please. The name of the temporary file is guaranteed to be unique. Delete the file when done with it.
\S{searchpath} SearchPath
\S2{searchpath} SearchPath
\c user_var(output) filename
Assign to the user variable $x, the full path of the file named by the second parameter. The error flag will be set and $x will be empty if the file cannot be found. Uses SearchPath() to search the system paths for the file.
\S{setfileattributes} SetFileAttributes
\S2{setfileattributes} SetFileAttributes
\c filename attribute1|attribute2|...
@ -93,13 +93,13 @@ Sets the file attributes of 'filename'. Valid attributes can be combined with |
The error flag will be set if the file's attributes cannot be set (i.e. the file doesn't exist, or you don't have the right permissions)
\S{regdll} RegDLL
\S2{regdll} RegDLL
\c dllfile [entrypoint_name]
Loads the specified DLL and calls DllRegisterServer (or entrypoint_name if specified). The error flag is set if an error occurs (i.e. it can't load the DLL, initialize OLE, find the entry point, or the function returned anything other than ERROR_SUCCESS (=0)).
\S{unregdll} UnRegDLL
\S2{unregdll} UnRegDLL
\c dllfile

View file

@ -1,12 +1,12 @@
\H{intinst} Integer Support
\S1{intinst} Integer Support
\S{IntFmt} IntFmt
\S2{IntFmt} IntFmt
\c user_var(output) format numberstring
Formats the number in "numberstring" using the format "format", and sets the output to user variable $x. Example format strings include "%08X" "%u"
\S{IntOp} IntOp
\S2{IntOp} IntOp
\c user_var(output) value1 OP [value2]

View file

@ -1,4 +1,4 @@
\C{labels} Labels
\S0{labels} Labels
Labels are the targets of Goto instructions, or of the various branching instructions (such as IfErrors, MessageBox, IfFileExists, and StrCmp). Labels must be within a Section or a Function. Labels are local in scope, meaning they are only accessible from within the Section or Function that they reside in.
To declare a label, simply do:

View file

@ -1,12 +1,12 @@
\H{installlog} Install Logging Instructions
\S1{installlog} Install Logging Instructions
\S{logset} LogSet
\S2{logset} LogSet
\c on|off
Sets whether install logging to $INSTDIR\\install.log will happen. Note that \e{NSIS_CONFIG_LOG} must be set in the installer configuration (it is not by default) to support this.
\S{logtext} LogText
\S2{logtext} LogText
\c text

View file

@ -1,13 +1,13 @@
\H{miscinst} Miscellaneous Instructions
\S1{miscinst} Miscellaneous Instructions
\S{setshellvarcontext} SetShellVarContext
\S2{setshellvarcontext} SetShellVarContext
\c current|all
Sets the context of $SMPROGRAMS and other shell folders. If set to 'current' (the default), the current user's shell folders are used. If set to 'all', the 'all users' shell folder is used. The all users folder may not be supported on all OSes. If the all users folder is not found, the current user folder will be used.
\S{sleep} Sleep
\S2{sleep} Sleep
\c sleeptime_in_ms
Pauses execution in the installer for sleeptime_in_ms milliseconds. sleeptime_in_ms can be a variable, i.e. "$0" or a number, i.e. "666".
Pauses execution in the installer for sleeptime_in_ms milliseconds. sleeptime_in_ms can be a variable, e.g. "$0" or a number, i.e. "666".

View file

@ -1,4 +1,4 @@
\C{plugindlls} Plugin DLLs
\S0{plugindlls} Plugin DLLs
The abilities of the NSIS scripting language can be extended by utilising functionality provided in a DLL file. Probably the best known example of this is the InstallOptions.dll bundled with every NSIS release.
@ -6,7 +6,7 @@ When the NSIS compiler starts it scans the plugins directory for DLLs and makes
During execution of the created installer if a plugin command is executed NSIS will unpack the necessary DLL to the $TEMP directory, push all of the arguments specified (right-to-left order), and then execute the DLL function. If the /NOUNLOAD option is specified the DLL will not be deleted until the installer exits or the next time you use the DLL without /NOUNLOAD.
\H{usingplug} Using Plugin Commands
\S1{usingplug} Using Plugin Commands
The following two examples both invoke the same plugin command. The first example shows the (still okay) syntax that scripts written for versions of NSIS earlier than 2.0a4 had to use, and the second is how it can be scripted more succinctly now. The newer syntax automatically handles packing & extraction of the DLL file, and stacks up arguments for you too.
@ -22,7 +22,7 @@ The following two examples both invoke the same plugin command. The first exampl
InstallOptions needs the name of it's ini file as a parameter to the dialog function so it has to be pushed onto the stack before the dialog call is made. Some plugin commands may not need any parameters on the stack, others might require two or three. To use a plugin command you will need to read the documentation for the plugin so that you know what parameters it's functions require, if any.
\H{disablingplug} Disabling Plugin Unloading
\S1{disablingplug} Disabling Plugin Unloading
CallInstDLL has an option not to unload the DLL after usage. To use it with the newer plugin command syntax just specify the first parameter as /NOUNLOAD. For example:

View file

@ -1,10 +1,10 @@
\H{rebootinst} Reboot Support
\S{rebootinst} Reboot Instructions
\S{Reboot} Reboot
\S2{Reboot} Reboot
Reboots the computer. Be careful with this one. If there is an error rebooting, this function sets the error flag and continues. If the reboot is successful, this instruction does not return.
\S{SetRebootFlag} SetRebootFlag
\S2{SetRebootFlag} SetRebootFlag
\c true|false

View file

@ -1,90 +1,90 @@
\H{registry} Registry, INI, File Instructions
\S1{registry} Registry, INI, File Instructions
\S{deleteinisec} DeleteINISec
\S2{deleteinisec} DeleteINISec
\c ini_filename section_name
Deletes the entire section [section_name] from ini_filename. If the section could not be removed from the ini file, the error flag is set.
\S{deleteinistr} DeleteINIStr
\S2{deleteinistr} DeleteINIStr
\c ini_filename section_name str_name
Deletes the string str_name from section [section_name] from ini_filename. If the string could not be removed from the ini file, the error flag is set.
\S{deleteregkey} DeleteRegKey
\S2{deleteregkey} DeleteRegKey
\c [/ifempty] root_key subkey
Deletes a registry key. If /ifempty is specified, the registry key will only be deleted if it has no subkeys (otherwise, the whole registry tree will be removed). Valid values for root_key are listed under WriteRegStr. The error flag is set if the key could not be removed from the registry (or if it didn't exist to begin with).
\S{deleteregvalue} DeleteRegValue
\S2{deleteregvalue} DeleteRegValue
\c root_key subkey key_name
Deletes a registry value. Valid values for root_key are listed under WriteRegStr. The error flag is set if the value could not be removed from the registry (or if it didn't exist to begin with).
\S{enumregkey} EnumRegKey
\S2{enumregkey} EnumRegKey
\c user_var(output) root_key subkey index
Set user variable $x with the name of the 'index'th registry key in root_key\\Subkey. Valid values for root_key are listed under WriteRegStr. Returns an empty string if there are no more keys, and returns an empty string and sets the error flag if there is an error.
\S{enumregvalue} EnumRegValue
\S2{enumregvalue} EnumRegValue
\c user_var(output) root_key subkey index
Set user variable $x with the name of the 'index'th registry value in root_key\\Subkey. Valid values for root_key are listed under WriteRegStr. Returns an empty string if there are no more values, and returns an empty string and sets the error flag if there is an error.
\S{expandenvstrings} ExpandEnvStrings
\S2{expandenvstrings} ExpandEnvStrings
\c user_var(output) string
Expands environment variables in "string" into the user variable $x. If error, the variable is set to empty, and the error flag is set.
\S{readenvstr} ReadEnvStr
\S2{readenvstr} ReadEnvStr
\c user_var(output) name
Reads from the environment string "name" and sets the value into the user variable $x. If there is an error reading the string, the user variable is set to empty, and the error flag is set.
\S{readinistr} ReadINIStr
\S2{readinistr} ReadINIStr
\c user_var(output) ini_filename section_name entry_name
Reads from entry_name in [section_name] of ini_filename and stores the value into user variable $x. The error flag will be set and $x will be assigned to an empty string if the entry is not found.
\S{readregdword} ReadRegDWORD
\S2{readregdword} ReadRegDWORD
\c user_var(output) root_key sub_key name
Reads a 32 bit DWORD from the registry into the user variable $x. Valid values for root_key are listed under WriteRegStr. The error flag will be set and $x will be set to an empty string ("" which is 0) if the DWORD is not present. If the value is present, but is not a DWORD, it will be read as a string and the error flag will be set.
\S{readregstr} ReadRegStr
\S2{readregstr} ReadRegStr
\c user_var(output) root_key sub_key name
Reads from the registry into the user variable $x. Valid values for root_key are listed under WriteRegStr. The error flag will be set and $x will be set to an empty string ("") if the string is not present. If the value is present, but is of type REG_DWORD, it will be read and converted to a string and the error flag will be set.
\S{writeinistr} WriteINIStr
\S2{writeinistr} WriteINIStr
\c ini_filename section_name entry_name value
Writes entry_name=value into [section_name] of ini_filename. The error flag is set if the string could not be written to the ini file.
\S{writeregbin} WriteRegBin
\S2{writeregbin} WriteRegBin
\c root_key subkey key_name valuedata
This command writes a block of binary data to the registry. Valid values for root_key are listed under WriteRegStr. Valuedata is in hexadecimal (i.e. DEADBEEF01223211151). The error flag is set if the binary data could not be written to the registry. If the registry key doesn't exist it will be created.
This command writes a block of binary data to the registry. Valid values for root_key are listed under WriteRegStr. Valuedata is in hexadecimal (e.g. DEADBEEF01223211151). The error flag is set if the binary data could not be written to the registry. If the registry key doesn't exist it will be created.
\S{writeregdword} WriteRegDWORD
\S2{writeregdword} WriteRegDWORD
\c root_key subkey key_name value
This command writes a dword (32 bit integer) to the registry (a user variable can be specified). Valid values for root_key are listed under WriteRegStr. The error flag is set if the dword could not be written to the registry. If the registry key doesn't exist it will be created.
\S{writeregstr} WriteRegStr
\S2{writeregstr} WriteRegStr
\c root_key subkey key_name value

View file

@ -1,4 +1,6 @@
\C{fileformat} Script File Format
\C{scriptref} Scripting Reference
\H{fileformat} Script File Format
A NSIS Script File (.nsi) is just a text file with a series of commands.

View file

@ -1,24 +1,24 @@
\H{secmanage} Section Management
\S1{secmanage} Section Management
\S{SectionSetFlags} SectionSetFlags
\S2{SectionSetFlags} SectionSetFlags
\c section_index section_flags
Sets the section's flags. The flag is a 32 bit integer. The low 30 bits represent whether the section is in the (as many as) 30 install types. The top bit (0x80000000) represents whether the section is currently enabled, and the second to top bit (0x40000000) represents whether or not the section is read-only. The error flag will be set if an out of range section is specified.
\S{SectionGetFlags} SectionGetFlags
\S2{SectionGetFlags} SectionGetFlags
\c section_index user_var(output)
Retrieves the section's flags. See above for a description of the flag. The error flag will be set if an out of range section is specified.
\S{SectionSetText} SectionSetText
\S2{SectionSetText} SectionSetText
\c section_index section_text
Sets the description for the section section_index. To set a subsection, you must use - at the beginning of the text. The error flag will be set if an out of range section is specified.
\S{SectionGetText} SectionGetText
\S2{SectionGetText} SectionGetText
\c section_index user_var(output)

View file

@ -1,4 +1,4 @@
\H{sections} Sections
\S1{sections} Sections
Each NSIS installer contains one or more Sections. Each These sections are created, modified, and ended with the following commands.
@ -8,34 +8,34 @@ Each NSIS installer contains one or more Sections. Each These sections are creat
\b If a section's name is 'Uninstall', then it is a special Uninstall Section.
\S{saddsize} AddSize
\S2{saddsize} AddSize
\c size_kb
Tells the installer that the current section needs an additional "size_kb" kilobytes of disk space. Only valid within a section (will have no effect outside of a section or in a function).
\S{ssection} Section
\S2{ssection} Section
\c [/e] [section_name] [section index output]
Begins and opens a new section. If section_name is empty, omitted, or begins with a -, then it is a required section and the user will not see it, nor have the option of disabling it. If the section name is 'Uninstall', then it is a special Uninstall Section. If section index output is specified, the parameter will be !defined with the section index (that can be used for SectionSetText etc. If the section name begins with a !, the section will be displayed as bold. If /e is present, the sub sections of the section will be expanded by default.
\S{ssectionend} SectionEnd
\S2{ssectionend} SectionEnd
This command closes the current open section.
\S{ssectionin} SectionIn
\S2{ssectionin} SectionIn
\c insttype_index [insttype_index] [RO]
This command specifies which Install Types (see InstType) the current section defaults to the enabled state in. Multiple SectionIn commands can be specified (they are combined). If you specify RO as a parameter, then the section will be Read-Only, meaning it will always be set to install.
\S{ssubsection} SubSection
\S2{ssubsection} SubSection
\c [/e] Caption
This command inserts a subsection. The subsection must be close with SubSectionEnd, and should contain 1 or more Sections. If the subsection name begins with a !, the subsection will be displayed as bold. If /e is present, the sub sections of the sub section will be expanded by default.
\S{ssubsectionend} SubSectionEnd
\S2{ssubsectionend} SubSectionEnd
Closes a subsection opened with SubSection.

View file

@ -1,18 +1,18 @@
\H{stackinst} Stack Support
\S1{stackinst} Stack Support
\S{Exch} Exch
\S2{Exch} Exch
\c [user_var] | stack_index
When no parameter is specified, exchanges the top two elements of the stack. When a parameter is specified and is a user variable, exchanges the top element of the stack with the parameter. When a parameter is specified and is a positive integer, the parameter specifies which item on the stack that the top of the stack is swapped with. If there are not enough items on the stack to accomplish the exchange, a fatal error will occur (to help you debug your code :).
\S{Pop} Pop
\S2{Pop} Pop
\c user_var(out)
Pops a string off of the stack into user variable $x. If the stack is empty, the error flag will be set.
\S{Push} Push
\S2{Push} Push
\c string

View file

@ -1,12 +1,12 @@
\H{stringinst} String Manipulation Instructions
\S1{stringinst} String Manipulation Instructions
\S{StrCpy} StrCpy
\S2{StrCpy} StrCpy
\c user_var(destination) str [maxlen] [start_offset]
Sets the user variable $x with str. Note that str can contain other variables, or the user variable being set (concatenating strings this way is possible, etc). If maxlen is specified, the string will be a maximum of maxlen characters (if maxlen is negative, the string will be truncated abs(maxlen) characters from the end). If start_offset is specified, the source is offset by it (if start_offset is negative, it will start abs(start_offset) from the end of the string).
\S{StrLen} StrLen
\S2{StrLen} StrLen
\c user_var(length output) str

View file

@ -1,74 +1,74 @@
\H{ui} User Interface Instructions
\S1{ui} User Interface Instructions
\S{BringToFront} BringToFront
\S2{BringToFront} BringToFront
Makes the installer window visible and brings it to the top of the window list (i.e. if a command was executed that shows itself in front of the installer, a BringToFront would bring the installer back in focus).
\S{createfont} CreateFont
\S2{createfont} CreateFont
\c user_var(handle output) face_name [height] [weight] [/ITALIC] [/UNDERLINE] [/STRIKE]
Creates a font and puts its handle into user_var. For more information about the different parameters have a look at \W{http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/fontext_8fp0.asp}{MSDN's page about the Win32 API function CreateFont()}.
\S{detailprint} DetailPrint
\S2{detailprint} DetailPrint
\c user_message
Adds the string "user_message" to the details view of the installer.
\S{findwindow} FindWindow
\S2{findwindow} FindWindow
\c user_var(hwnd output) windowclass [windowtitle] [windowparent] [childafter]
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.
\S{getdlgitem} GetDlgItem
\S2{getdlgitem} GetDlgItem
\c user_var(output) dialog item_id
Retrieves the handle of a control identified by item_id in the specified dialog box dialog. If you want to get the handle of a control on the inner dialog, first use FindWindow user_var(output) "#32770" "" $HWNDPARENT to get the handle of the inner dialog.
\S{hidewindow} HideWindow
\S2{hidewindow} HideWindow
Hides the installer.
\S{iswindow} IsWindow
\S2{iswindow} IsWindow
\c HWND jump_if_window [jump_if_not_window]
If HWND is a window, Gotos jump_if_window, otherwise, Gotos jump_if_not_window (if specified).
\S{sendmessage} SendMessage
\S2{sendmessage} SendMessage
\c HWND msg wparam lparam [user_var(return value)] [/TIMEOUT=time_in_ms]
Sends a message to HWND. If a user variable $x is specified as the last parameter, the return value of SendMessage will be stored to it. Note that when specifying 'msg' you must just use the integer value of the message. Here are a few example messages and their values:
\S{setautoclose} SetAutoClose
\S2{setautoclose} SetAutoClose
\c true|false
Overrides the default auto window-closing flag (specified for the installer using AutoCloseWindow, and false for the uninstaller). Specify 'true' to have the install window immediately disappear after the install has completed, or 'false' to make it require a manual close.
\S{setbrandingimage} SetBrandingImage
\S2{setbrandingimage} SetBrandingImage
\c [/IMGID=item_id_in_dialog] [/RESIZETOFIT] path_to_bitmap_file.bmp
Sets the current bitmap file displayed as the branding image. If no IMGID is specified, the first image control found will be used, or the image control created by AddBrandingImage. Note that this bitmap must be present on the user's machine. Use File first to put it there. If /RESIZETOFIT is specified the image will be automatically resized (very poorly) to the image control size. If you used AddBrandingImage you can get this size, by compiling your script and watching for AddBrandingImage output, it will tell you the size. SetBrandingImage will not work when called from .onInit!
\S{setdetailsview} SetDetailsView
\S2{setdetailsview} SetDetailsView
\c show|hide
Shows or hides the details, depending on which parameter you pass. Overrides the default details view, which is set via ShowInstDetails
\S{setdetailsprint} SetDetailsPrint
\S2{setdetailsprint} SetDetailsPrint
\c none|listonly|textonly|both|lastused
Sets mode at which commands print their status. None has commands be quiet, listonly has status text only added to the listbox, textonly has status text only printed to the status bar, and both enables both (the default). For extracting many small files, textonly is recommended (especially on win9x with smooth scrolling enabled).
\S{setstaticbkcolor} SetStaticBkColor
\S2{setstaticbkcolor} SetStaticBkColor
\c hwnd color

View file

@ -1,6 +1,6 @@
\H{uninst} Uninstaller Instructions
\S1{uninst} Uninstaller Instructions
\S{WriteUninstaller} WriteUninstaller
\S2{WriteUninstaller} WriteUninstaller
\c [Path\\]exename.exe

View file

@ -1,4 +1,4 @@
\C{UninstallSection} Uninstall Section
\S1{UninstallSection} Uninstall Section
A special Section named 'Uninstall' must be created in order to generate an uninstaller. This section should remove all files, registry keys, etc that were installed by the installer, from the system. Here is an example of a simple uninstall section:

View file

@ -3,8 +3,8 @@
\H{getparent} Get parent directory
\c ; GetParent
\c ; input, top of stack (i.e. C:\Program Files\Poop)
\c ; output, top of stack (replaces, with i.e. C:\Program Files)
\c ; input, top of stack (e.g. C:\Program Files\Poop)
\c ; output, top of stack (replaces, with e.g. C:\Program Files)
\c ; modifies no other variables.
\c ;
\c ; Usage:
@ -34,8 +34,8 @@
\H{trimnewlines} Trim newlines
\c ; TrimNewlines
\c ; input, top of stack (i.e. whatever$\r$\n)
\c ; output, top of stack (replaces, with i.e. whatever)
\c ; input, top of stack (e.g. whatever$\r$\n)
\c ; output, top of stack (replaces, with e.g. whatever)
\c ; modifies no other variables.
\c
\c Function TrimNewlines
@ -60,7 +60,7 @@
\c ; GetParameters
\c ; input, none
\c ; output, top of stack (replaces, with i.e. whatever)
\c ; output, top of stack (replaces, with e.g. whatever)
\c ; modifies no other variables.
\c
\c Function GetParameters

View file

@ -1,6 +1,6 @@
\C{var} Variables
\H{var} Variables
\H{var1} Modifiable variables used in Instructions
\S1{var1} Modifiable variables used in Instructions
\e{$INSTDIR}
@ -28,7 +28,7 @@ The command line of the installer. The format of the command line can be one of
The identifier of the language that is currently used. For example, English is 1033. You can change this variable in .onInit.
\H{var2} Constant Variables used in Instructions and InstallDir
\S1{var2} Constant Variables used in Instructions and InstallDir
\e{$PROGRAMFILES}
@ -82,7 +82,7 @@ The decimal HWND of the parent window.
Use to represent $.
\H{var3} Variables used Strings
\S1{var3} Variables used Strings
\e{$\\r}