nsis.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Fri, 11 Dec 2015 10:03:50 +0200
changeset 1807 388f375d0964
parent 404 ce95fd596812
permissions -rw-r--r--
Specs.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
403
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     1
-*- mode: outline; coding: utf-8 -*-
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     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
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    13
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    14
* Variables.
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    15
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    16
Allowed chaacters for variable names: [a-z][A-Z][0-9] and '_'.
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    17
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    18
** Variable definition.
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    19
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    20
To declare variable:
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    21
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    22
  Var NAME
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    23
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    24
There are exist registers (predefined variable) through them passed args for
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    25
macros/functions/plug-ins:
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    26
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    27
  $0, $1, $2, $3, $4, $5, $6, $7, $8, $9, $R0, $R1, $R2, $R3, $R4, $R5, $R6, $R7, $R8, $R9
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    28
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    29
To assign value to variable use:
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    30
404
ce95fd596812 About strings in NSIS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 403
diff changeset
    31
  StrCpy $NAME STRING
403
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    32
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    33
To access to there value use such syntax:
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    34
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    35
  $NAME
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    36
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    37
** Language strings.
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    38
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    39
To declare multilingual string use:
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    40
404
ce95fd596812 About strings in NSIS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 403
diff changeset
    41
  LangString NAME LANGUAGE_ID STRING
403
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    42
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    43
For 'LANGUAGE_ID' use '${LANG_ENGLISH}', '${LANG_RUSSIAN}', etc.
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    44
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    45
To access to there value use such syntax:
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    46
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    47
  $(NAME)
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    48
404
ce95fd596812 About strings in NSIS.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 403
diff changeset
    49
*** Standard language strings.
403
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    50
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    51
You can see list of such var under Contrib\Language Files\*.nlf files, which
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    52
loaded by 'LoadLanguageFile'.
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    53
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    54
To access to there value use such syntax:
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    55
fa4c52109fd8 About NSIS variables.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    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}