Salesforce

Command Line Options (Magic xpa 4.x)

« Go Back

Information

 
Created BySalesforce Service User
Approval Process StatusPublished
Objective
Description

Command Line Options (Magic xpa 4.x)

The Magic.ini file contains the configuration settings for Magic xpa. You can update these settings from the Studio in the Environment dialog box (Options > Settings > Environment) or directly change them in the file.

Sometimes you may need to have different configuration files (Magic.ini) or you may want to override only a few settings. This can be done by using command line parameters. This is usually set in the Target field of the Windows shortcut.

These settings can be used for both the Studio and the Runtime engines.

The Command Line values are essentially temporary and are only in effect for the session duration. When starting the Studio with command line values, these values will be seen in the Environment dialog box.

Syntax for Magic command line parameters

The syntax for Magic xpa command line parameters is as follows:

Magic xpa .exe [/EnvironmentSetting=Value1] [/EnvironmentSetting =Value2] [/EnvironmentSetting …] [/ini=Value] [@filename] [-ver]

where: Magic xpa .exe is either the Studio file (MgxpaStudio.exe) or the Runtime file (MgxpaRuntime.exe).

  • The square brackets indicate optional parameters. Do not use them as part of the syntax.

  • In Windows, the parameters can either be prefixed with a slash (/) or a hyphen (-). In other operating systems, only a hyphen can be used.

  • Items in a command line file must each exist on a single line.

The sections below describe each section of the syntax.

Environment settings

You can override any of the Magic xpa environment settings that are written in the Magic.ini file by specifying them as command line arguments.

When using an environment setting value as a parameter, you use the following syntax:

[/EnvironmentSetting=Value]

where:

EnvironmentSetting

The environment setting identifier, as specified in the Magic.ini file. The environment setting name can contain a file section name. If a section name is specified, then the EnvironmentSetting parameter is localized to that section. If no section name is specified, the [MAGIC_ENV] section is assumed by default.

=

The separator between parameter identifier and its value. No spaces are allowed between the parameter, separator and value.

Value

The value to be assigned to the EnvironmentSetting parameter. Specify any of the valid values.

You can either search for the identifier in the Magic.ini file or you can look for it in the Help. For each environment setting Help topic, you'll see a line with the following text: Magic.ini and Command Line name: with the identifier.

For example, in /DeploymentMode=B, DeploymentMode is the value listed in the Deployment Mode topic and B means that you want Magic xpa to open in Background mode.

When you want to include a comma (,), backslash (\), plus sign (+), percent sign (%) or equal sign (=) as an actual value in your command line text, it should be preceded by a \ character. Alternatively, you can use a pair of single quote marks (') preceding and following the value to instruct Magic xpa to accept the value as is. In this way, you can include a backslash as an actual value.

You can also use the operating system's environment settings values as part of the values sent to Magic xpa. For example, to pass the terminal operating system environment value to Magic xpa using the command line, use the following: MgxpaStudio.exe /terminal=%terminal%.

You can also store several of these settings in a file and load the file as an additional settings file as detailed below.

The following are command line examples:

  • MgxpaStudio.exe /DefaultProject = d:\Program Files\MSE\Magic xpa x.x\Projects\myproject.edp

    This command starts the Magic xpa Studio and automatically opens the specified project.

  • MgxpaStudio.exe /[MAGIC_LOGICAL_NAMES]Drive=C:

    This command starts the Magic xpa Studio and sets the Logical Name Drive to C:. If the Logical Name Drive is not found in the [MAGIC_LOGICAL_NAMES] section of the Magic.ini file, a new temporary Logical Name will be created for the duration of the Magic xpa session.

  • MgxpaStudio.exe /DefaultProject = d:\Program Files\MSE\Magic xpa x.x\Projects\myproject.edp /[MAGIC_LOGICAL_NAMES]Drive=C:

    This command combines the command line parameters shown in the two examples above.

INI File

If you have various configurations, you can define various Magic.ini files, each for a different configuration of the Magic xpa installation. You can then use Command Line options to start Magic xpa using any of these files.

When you want to load a settings file that is different than the default Magic.ini file, use the following syntax:.

[/ini=Value]

where:

Value = the name of the settings file that you want to start Magic xpa with.

For example: MgxpaStudio.exe /ini=mydef.ini

See also: How Do I Define the Location of the .ini?

Additional INI content

Sometimes you may want to have a single settings file for several projects and define different values to only some of the settings, for example to the database connection or logical names. You do this by specifying an additional settings file to load. This file will contain a set of environment settings and their values, in the same way they are written in the command line.

If the same setting appears in both the regular settings file and the additional settings file, Magic xpa will use the information from the additional .ini file and not from the Magic.ini file. If you make any changes to these settings from the Magic xpa Studio while in Runtime, the changes will be saved to the Magic.ini file and not to the additional .ini file.

You define an additional settings file using the @filename parameter. The syntax is:

Magic xpa .exe @filename

where:

Magic xpa .exe = Either the Studio file (MgxpaStudio.exe) or the Runtime file (MgxpaRuntime.exe).

filename = The location of the additional settings file that you want to use.

For example: MgxpaRuntime.exe @c:\Magicxpa\FrenchMagic.ini

The Magic xpa Runtime will read the regular Magic.ini file and then it will read the FrenchMagic.ini file in the c:\Magicxpa folder.

The content of the file follows the rules described above for command line parameters. Different options should be on different lines in the file.

You can place an asterisk (*) at the beginning of a path value to instruct Magic xpa to take the entire value until the end of the line, ignoring special characters, including not interpreting the backslash (\) character as an escape character.

The following is an example of file content:

/[MAGIC_ENV]ColorDefinitionFile=usrclr2.eng

/[MAGIC_LOGICAL_NAMES]TEMP=*C:\temp\

Refer to: How Do I Add Additional .ini Settings?

Retrieving the Magic executable version

[-ver]

You can retrieve information about the Magic xpa version (as seen in the Help->About screen) by running the Studio or Runtime engine with the -ver parameter. For example: Mgxparuntime.exe -ver. The result will be saved in a file named mgxpaver.txt in the Magic xpa installation folder. Since version: 2.5

Reference
Attachment 
Attachment