<< | Page list | >>
Notes about NSIS (used by Joost's and Uwe's installers)
- Install NSIS, start at http://nsis.sourceforge.net/Main_Page
and follow the instructions of the ReadmePackage.txt
- NSIS' manual is installed together with NSIS, have a look at
its start menu entry.
1. Miscellanous notes and questions regarding NSIS
1.1 Difference between $XXX and ${XXX}
${XXX}
inserts a compile-time definition (constant).
$XXX
is a variable.
What's the difference between using ${FALSE} and $FALSE if 'FALSE' had been a variable?
Joost: These two are totally different: ${FALSE} is a compile-time definition, $FALSE is a run-time variable
1.2 What does ${StrStr}
do?
What does ${StrStr}
do?
Joost: It includes the StrStr function from the StrFunc header file.
Chr: I'm guessing it's from "StrFunc.nsh"?
1.3 Name of macros and functions?
Is it ok to have a macro with the same name as a function?
Yes.
1.4 Placement of macros and functions
More of a general question. Why not place the code of a function/macro pair next to each other?
Joost: Macros should be above the code that uses it (works on compile-time). Functions can be anywhere. But here it is possible to move it.
1.5 Continuing a string definition across a line
Example of breaking a string across a line:
;Debug info
!insertmacro MUI_HEADER_TEXT "Debugging LyX" "The events you have chosen \
are being logged."
Who is the line continuation treated here? What happens with the extra whie tspace?
Joost: I think the whitespace before the second line is ignored.
1.6 Variables
2. Notes about some specific NSIS instructions
2.1 Exch
It's really not that complicated.
exch
- exchanges the two top elements on the stack with each other
exch $var
- exchanges the content of $var with whatever is at the top of the stack.
exch <n>
- exchanges the top element of the stack with then <n>+1:th element
of the stack, i.e. exch 1
does the same as exch
.
2.2 The command SetDetailsPrint
SetDetailsPrint textonly
DetailPrint "Debug log:"
SetDetailsPrint listonly
These three commands sets aspects of the log window (textonly, listonly), and prefaces the log text with "Debug log:".
2.3 Label and statemen on the same line?
Is it possible to write a label and a statement on the same line? e.g. no_debug: Quit
?
Joost: No.
2.4 Command line parameters
From the code:
!insertmacro GetParameters
;Command line parameters
Call GetParameters
Pop $Parameters
(maybe something more is needed to do the above?)
Q27. Will $Parameters be a single string with the entire command line? (No arrays I guess?)
Joost: Yes.
2.5 Calling Windows API
;Keep the log window outside the screen to ensure that there
;will be no flickering
Push "user32::SetWindowPos(i $HWNDPARENT, i 0, i -32000, i -32000, \
i 0, i 0, i ${SWP_NOSIZE})"
CallInstDLL "$EXEDIR\System.dll" Call
In the code above, with stuff like "i 0
", the 'i' means integer. So it's an integer with the value 0.
Does NSIS parse the string during execution and invoke the function (System.dll) with the proper arguments?
Joost: Yes.
Category: Development, Windows, Windows Installer, NSIS