Reference/Var

From NSIS Wiki
Jump to navigationJump to search

Var

[/GLOBAL] var_name

Declare a user variable. Allowed characters for variables names: [a-z][A-Z][0-9] and '_'. All defined variables are global, even if defined in a section or a function. To make this clear, variables defined in a section or a function must use the /GLOBAL flag. The /GLOBAL flag is not required outside of sections and functions.

Var example
 
Function testVar
  Var /GLOBAL example2
 
  StrCpy $example "example value"
  StrCpy $example2 "another example value"
FunctionEnd

Command introduced with NSIS v2.0