[Variables] Section

 
In this section, you can define your own Variables. The variables are initialized at startup (when reading the configuration file).

Here is an example of a [Variables] section: [Variables] Name: MyAppVer; Type: static; Value: "version 1.0" Name: MyAppPath; Type: registry; Root: HKLM; Key: "Software\My Company\My App"; ValueName: "InstallPath"; Flags: ispath; DefaultValue: "%ProgramFiles%\MyApp" Name: ComputerName; Type: environment; EnvName: "COMPUTERNAME" Name: MyParam; Type: commandline; ParamName: "MyParam"; DefaultValue: "Cow" Name: Prompt; Type: prompt; PromptCaption: "My Tray Menu"; PromptText: "Please enter a message:"; DefaultValue: "Hello World"

The following is a list of the supported parameters:

NameREQ

Value

String

Description

The name of the variable.

Example

Name: MyVariable
TypeREQ

Value

static|registry|environment|commandline|prompt

Description

Tells AeTrayMenu what sort of variable you're creating. The following variable types are available:

Example

Type: static
Flags

Value

Flag list

Description

This parameter is a set of extra options. Multiple options may be used by separating them by spaces. The following options are supported:
ispath
Marks the variable as a path variable (see Variables for more information).

Example

Flags: ispath
Value

Value

String

Description

If the variable's type is "static", this parameter specifies the contents of the variable.

Example

Value: "my text here"
Root

Value

HKCR|HKCU|HKLM|HKU|HKCC

Description

For registry variables, this parameter specifies the root key.

Example

Root: HKCU
Key

Value

StringVAR

Description

For registry variables, this parameter specifies the subkey name.

Example

Key: "Software\My Company\My Program"
ValueName

Value

StringVAR

Description

For registry variables, this parameter specifies the name of the registry value to read. If this is blank, the "Default" value is read. The registry value's contents are automatically converted to a string.

Example

ValueName: "Version"
EnvName

Value

StringVAR

Description

For environment variables, this parameter specifies the name of the environment variable to read.

Example

EnvName: "PATH"
ParamName

Value

StringVAR

Description

For command-line variables, this parameter gives the name of the command-line parameter to read (case-insensitive). The command-line parameter should be in the form -name=value. See Command-line Parameters for more information.

Example

ParamName: "myparam"
PromptCaptionVAR

Value

String

Description

Contains the text in the caption bar of the message box that pops up when the prompt variable is encountered.

Example

PromptCaption: "My Tray Menu"
PromptTextVAR

Value

String

Description

Contains the message box text of the prompt that appears when the prompt variable is encountered.

Example

PromptText: "Please enter the message you want to send:"
DefaultValue

Value

StringVAR

Description

If you specify a default value, this value will be used if reading the variable's contents from the registry, the environment or the command-line fails (e.g. because the command-line parameter hasn't been specified, or the key doesn't exist). If reading the variable fails, and no default value has been given, AeTrayMenu will show an error message and exit at startup.

Example 1

DefaultValue: "%ProgramFiles%\MyApp"

Example 2

DefaultValue: ""
This example will cause any errors to be hidden from the user; if there is an error, the variable will be empty.

See also See Also
Variables