From 5dd33fff251fbd0476fe5837063f3662a70399f2 Mon Sep 17 00:00:00 2001 From: flizebogen Date: Thu, 27 Mar 2003 19:45:50 +0000 Subject: [PATCH] Updated Tutorial, typos and a few links git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2383 212acab6-be3b-0410-9dea-997c60f758d6 --- Docs/src/attributes.but | 2 +- Docs/src/functions.but | 2 +- Docs/src/tutorial.but | 37 +++++++++++++++++++++++++++++++++++++ Docs/src/ui.but | 4 ++-- Docs/src/var.but | 2 +- 5 files changed, 42 insertions(+), 5 deletions(-) diff --git a/Docs/src/attributes.but b/Docs/src/attributes.but index 440aa9ed..8fed407c 100644 --- a/Docs/src/attributes.but +++ b/Docs/src/attributes.but @@ -170,7 +170,7 @@ Specifies a string that is above the license text. Omit this to not have a licen \S2{alicenseforceselection} LicenseForceSelection -\c [/LANG=lang_id] (checkbox [accept_text] | radiobuttons [accept_text] [decline_text] | off) +\c [/LANG=lang_id] (checkbox [accept_text] | radiobuttons [accept_text] [decline_text] | \\off\\) Specifies if the displayed license must be accept explicit or not. This can be done either by a checkbox or by radiobuttons. By default the "next button" is disabled and will only be enabled if the checkbox is enabled or the right radio button is selected. If off is specified the "next button" is enabled by default. diff --git a/Docs/src/functions.but b/Docs/src/functions.but index 3066d4f1..5e75c829 100644 --- a/Docs/src/functions.but +++ b/Docs/src/functions.but @@ -1,6 +1,6 @@ \H{functions} Functions -Functions are like similar to Sections in that they contain zero or more instructions. User functions are not called by the installer directly, instead they are called from Sections using the Call instruction. Callback functions will be called by the installer when a certain event occurs. +Functions are similar to Sections in that they contain zero or more instructions. User functions are not called by the installer directly, instead they are called from Sections using the Call instruction. Callback functions will be called by the installer when a certain event occurs. Functions must be declared outside of Sections or other Functions. diff --git a/Docs/src/tutorial.but b/Docs/src/tutorial.but index 3e0a5b43..bece0f8c 100644 --- a/Docs/src/tutorial.but +++ b/Docs/src/tutorial.but @@ -73,6 +73,43 @@ Callback functions are called by the installer upon certain defined events such For more information about sections see \k{functions}. +\S1{tut-working-with-scripts} Working with Scripts + +\S2{tutVariables} Variables + +NSIS offers 20 Variables that can be used in any Section or Function. In addition there is a Stack, which can also be used for temporary storage. To access the stack use the commands \R{Push}{Push} and \R{Pop}{Pop}. Push adds a value to the stack, Pop removes one and sets the variable. For example, the value of $0 is 123. + +Now you are going to call the function bla: + +\c Function bla +\c +\c Push $0 ;123 added to the stack +\c +\c ...the function can use $0... +\c +\c Pop $0 ;Remove 123 from the stack and set $0 back to 123 +\c +\c FunctionEnd + +After calling the function, the variables contain the same value as before. Note the order when using multiple variables (last-in first-out): + +\c Function bla +\c +\c Push $0 +\c Push $1 +\c +\c ...code... +\c +\c Pop $1 +\c Pop $0 +\c +\c FunctionEnd + +\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 debuging 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}. Very useful if you force to close the installer automatically using \R{setautoclose}{SetAutoClose}. + + \S1{compilercommands} Compiler Commands Compiler commands will be executed on compile time on your computer. They can be used for conditional compilation, to include header files, to execute applications, to change the working directory and more. The most common usage is defines. Defines are compile time constants. You can define your product's version number and use it in your script. For example: diff --git a/Docs/src/ui.but b/Docs/src/ui.but index bc6d0a57..94fb9c00 100644 --- a/Docs/src/ui.but +++ b/Docs/src/ui.but @@ -60,7 +60,7 @@ Use /TIMEOUT=time_in_ms to specify the duration, in milliseconds, of the time-ou \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. +Overrides the default auto window-closing flag (specified for the installer using \R{aautoclosewindow}{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. \S2{setbrandingimage} SetBrandingImage @@ -72,7 +72,7 @@ Sets the current bitmap file displayed as the branding image. If no IMGID is spe \c show|hide -Shows or hides the details, depending on which parameter you pass. Overrides the default details view, which is set via ShowInstDetails +Shows or hides the details, depending on which parameter you pass. Overrides the default details view, which is set via \R{ashowinstdetails}{ShowInstDetails}. \S2{setdetailsprint} SetDetailsPrint diff --git a/Docs/src/var.but b/Docs/src/var.but index a37934ef..c70399b5 100644 --- a/Docs/src/var.but +++ b/Docs/src/var.but @@ -6,7 +6,7 @@ Note: All Variables provided by NSIS are case sensitive. \e{$INSTDIR} -The installation directory ($INSTDIR is modifiable using StrCpy, ReadRegStr, ReadINIStr, etc. - This could be used, for example, in the .onInit function to do a more advanced detection of install location). +The installation directory ($INSTDIR is modifiable using \R{StrCpy}{StrCpy}, \R{readregstr}{ReadRegStr}, \R{readinistr}{ReadINIStr}, etc. - This could be used, for example, in the .onInit function to do a more advanced detection of install location). \e{$OUTDIR}