Setting environment variables for configuration

Client side settings are stored in the GConfiguration.ini file, but can also be specified directly as environment variables.

In a central deployment scenario, you may need to standardize these settings and options for all users. You can either do this by distributing a standard copy of GConfiguration.ini (see Client-side configuration) or by setting up environment variables that match the settings.

The keys for the environment variables are constructed from the section names and keys of the settings in GConfiguration.ini.

Thus any entry in GConfiguration.ini can be overridden by an environment variable, where the key is constructed as follows:

GATEWAY_<INI-SECTION>_<KEY>

If both the environment variable and the corresponding key in the GConfiguration.ini file exist, precedence is given to the environment variable. For settings that are not enforced, values can be overridden on the Settings page in MI Materials Gateway.

When defining environment variables:
  • An environment variable value may refer to other environment variables. For example:

    GATEWAY_ConnectionSettings_LicenseServerAddres=%MI_SERVICELAYER%

    refers to the environment variable MI_SERVICELAYER, which is defined as:

    MI_SERVICELAYER=http://your.granta.server/mi_servicelayer/
  • Fixed strings and environment variables may be combined. For example, you can define:

    GATEWAY_ConnectionSettings_LicenseServerAddress=
    http://%MISERVER%.%MIDOMAIN%/mi_servicelayer/

    where MISERVER and MIDOMAIN are also environment variables.

  • On Windows, environment variables are not case sensitive.

For example, you can replicate the following GConfiguration.ini file settings:

[ConnectionSettings]
!LicenseServerAddress=http://your.granta.server/mi_servicelayer/
!Domain=mydomain

[System]
!AutoShutdownTimeout=31 

by defining the following environment variables:

GATEWAY_ConnectionSettings_LicenseServerAddress=http:// your.granta.server/mi_servicelayer/
GATEWAY_ConnectionSettings_DOMAIN=mydomain
GATEWAY_System_AutoShutdownTimeout=31