author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Fri, 11 Dec 2015 10:03:50 +0200 | |
changeset 1807 | 388f375d0964 |
parent 404 | ce95fd596812 |
permissions | -rw-r--r-- |
403 | 1 |
-*- mode: outline; coding: utf-8 -*- |
2 |
||
404
ce95fd596812
About strings in NSIS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
403
diff
changeset
|
3 |
* Strings. |
ce95fd596812
About strings in NSIS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
403
diff
changeset
|
4 |
|
ce95fd596812
About strings in NSIS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
403
diff
changeset
|
5 |
String is a sequence of chars. To represent spaces enclose string in quotes. |
ce95fd596812
About strings in NSIS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
403
diff
changeset
|
6 |
To escape quote use $\. ${MACRO_NAME}, $(VAR_NAME) substituted with |
ce95fd596812
About strings in NSIS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
403
diff
changeset
|
7 |
macros/variable values. To escape $ use $$. |
ce95fd596812
About strings in NSIS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
403
diff
changeset
|
8 |
|
ce95fd596812
About strings in NSIS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
403
diff
changeset
|
9 |
MessageBox MB_OK "I'll be happy" ; this one puts a ' inside a string |
ce95fd596812
About strings in NSIS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
403
diff
changeset
|
10 |
MessageBox MB_OK 'And he said to me "Hi there!"' ; this one puts a " inside a string |
ce95fd596812
About strings in NSIS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
403
diff
changeset
|
11 |
MessageBox MB_OK `And he said to me "I'll be happy!"` ; this one puts both ' and "s inside a string |
ce95fd596812
About strings in NSIS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
403
diff
changeset
|
12 |
MessageBox MB_OK "$\"A quote from a wise man$\" said the wise man" ; this one shows escaping of quotes |
403 | 13 |
|
14 |
* Variables. |
|
15 |
||
16 |
Allowed chaacters for variable names: [a-z][A-Z][0-9] and '_'. |
|
17 |
||
18 |
** Variable definition. |
|
19 |
||
20 |
To declare variable: |
|
21 |
||
22 |
Var NAME |
|
23 |
||
24 |
There are exist registers (predefined variable) through them passed args for |
|
25 |
macros/functions/plug-ins: |
|
26 |
||
27 |
$0, $1, $2, $3, $4, $5, $6, $7, $8, $9, $R0, $R1, $R2, $R3, $R4, $R5, $R6, $R7, $R8, $R9 |
|
28 |
||
29 |
To assign value to variable use: |
|
30 |
||
404
ce95fd596812
About strings in NSIS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
403
diff
changeset
|
31 |
StrCpy $NAME STRING |
403 | 32 |
|
33 |
To access to there value use such syntax: |
|
34 |
||
35 |
$NAME |
|
36 |
||
37 |
** Language strings. |
|
38 |
||
39 |
To declare multilingual string use: |
|
40 |
||
404
ce95fd596812
About strings in NSIS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
403
diff
changeset
|
41 |
LangString NAME LANGUAGE_ID STRING |
403 | 42 |
|
43 |
For 'LANGUAGE_ID' use '${LANG_ENGLISH}', '${LANG_RUSSIAN}', etc. |
|
44 |
||
45 |
To access to there value use such syntax: |
|
46 |
||
47 |
$(NAME) |
|
48 |
||
404
ce95fd596812
About strings in NSIS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
403
diff
changeset
|
49 |
*** Standard language strings. |
403 | 50 |
|
51 |
You can see list of such var under Contrib\Language Files\*.nlf files, which |
|
52 |
loaded by 'LoadLanguageFile'. |
|
53 |
||
54 |
To access to there value use such syntax: |
|
55 |
||
56 |
$(^NAME) |
|
404
ce95fd596812
About strings in NSIS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
403
diff
changeset
|
57 |
|
ce95fd596812
About strings in NSIS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
403
diff
changeset
|
58 |
** Macros definition. |
ce95fd596812
About strings in NSIS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
403
diff
changeset
|
59 |
|
ce95fd596812
About strings in NSIS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
403
diff
changeset
|
60 |
To define macro variable: |
ce95fd596812
About strings in NSIS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
403
diff
changeset
|
61 |
|
ce95fd596812
About strings in NSIS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
403
diff
changeset
|
62 |
!define NAME STRING |
ce95fd596812
About strings in NSIS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
403
diff
changeset
|
63 |
|
ce95fd596812
About strings in NSIS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
403
diff
changeset
|
64 |
To access to there value use such syntax: |
ce95fd596812
About strings in NSIS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
403
diff
changeset
|
65 |
|
ce95fd596812
About strings in NSIS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
403
diff
changeset
|
66 |
${NAME} |