Setting an environment variable

From ARToolworks support library

Jump to: navigation, search

Main Page > ARToolKit Professional > Configuring video capture in ARToolKit Professional > Setting an environment variable

Environment variables can be used to specify configuration information to software. Here is how to set them persistently on different operating systems.

Windows

On the left hand side of the window, you will see the environment variable name, and on the right hand side the variables value.

Variables can be set either just for the current user or system-wide for all users. Windows stores system-wide environment variables in the registry, as a string under the key HKLM\System\CurrentControlSet\Control\Session Manager\Environment


Mac OS X

  1. Environment variables can be set from a Terminal window.
  2. From a terminal window, type the following lines, replacing "NAME" with the environment variable name and "VALUE" with its value:
echo "NAME=VALUE; export NAME" >> ~/.profile
echo "setenv NAME VALUE" >> ~/.cshrc
defaults write ~/.MacOSX/environment NAME -string "VALUE"; plutil -convert xml1 ~/.MacOSX/environment.plist

The first line sets the environment for users with users with sh or bash as their shell, the second for users with csh or tcsh as their shell, and the third for programs launched by the Finder (including Xcode).

Linux

  1. Environment variables can be set from a Terminal window.
  2. From a terminal window, type the following lines, replacing "NAME" with the environment variable name and "VALUE" with its value:
echo "NAME=VALUE; export NAME" >> ~/.profile
echo "setenv NAME VALUE" >> ~/.cshrc

The first line sets the environment for users with users with sh or bash as their shell, the second for users with csh or tcsh as their shell.