This Windows batch/command file sets up the environment for using cm3, including: augmenting the PATH to find both the Microsoft Visual C binaries and the cm3 public repository for binaries; mangling the TEMP path to be a "short" path without embedded spaces; and setting several other environment variables useful for related command files, such as cm3Proj.CMD and startReactor.CMD.
Randy Coleburn, Senior Systems Engineer, Scientific Research Corporation
2300 Windy Ridge Parkway, Suite 400 South, Atlanta, GA 30339Author grants free use/modification/distribution of this batch/command file to anyone.
Author does not warrant this batch/command file. Use at your own risk.I can't promise to maintain this software, but if you have a problem or suggestion, you are welcome to send me an email at rcoleburn@mindspring.com
I will try to respond in a timely manner.
You must be running WindowsNT4SP6, Windows2000, or Windows XP with command extensions enabled; otherwise, this command file will fail.
Store this command file in the bin directory of your cm3 installation. Place a shortcut to this command file on your desktop, then modify its properties to put "cmd /k" at the front of the command line. Now, when you invoke this shortcut, you will get a windows command prompt window whose environment is set up for using cm3. You can also call this command file from a command prompt window at any time to set up the environment.
The CM3SetupCmdEnv.CMD file and cm3.exe must be in the bin directory of your cm3 installation. They are used by this command file.
The following five environment variables are setup automatically by the CM3SetupCmdEnv.CMD file:
CM3_ROOT is the root of the CM3 installation, typically "C:\cm3"
CM3_BIN is where the CM3 binaries are kept, typically "C:\cm3\bin"
CM3_PKG is the location of the public package repository, typically "C:\cm3\pkg"
CM3_DoneSetup indicates if this command file completed successfully.
REACTOR_HOME is where Reactor looks for the user's home folder.The following environment variables are used internally and are considered temporary:
CM3Setup_RP
CM3Setup_HP
CM3Setup_SavePromptThe following environment variables define the default locations. You can edit these in the section of the command file labeled "DEFAULT_LOCATIONS" to change the defaults.
CM3Setup_DefaultInstallRoot
CM3Setup_DefaultTemp
CM3Setup_DefaultVCSetup
Basic Usage:
cm3SetupCmdEnv [Help | Remarks | Undo | [Root [path]] [Home [path]]]
Optional Command Line Arguments:
HELP Display this summary of helpful information. HELP cannot be combined with other arguments. REMARKS Display useful remarks located at the beginning of this command file. REMARKS cannot be combined with other arguments. UNDO Indicates you want to undo the effects of the most recent invocation of this batch/command file. Note that mangling of the TEMP and TMP variables can not be undone. Consecutive invocations using UNDO is pointless, but won't hurt anything. UNDO cannot be combined with other arguments. ROOT path The optional "ROOT" argument indicates you want to specify the cm3 installation root. The "path" argument also is optional, but if given, should be the path to the cm3 installation root. If the "path" argument is omitted, a default will be used (typically C:\cm3). The "ROOT path" option is useful if you have multiple cm3 installation roots (e.g., different versions) and you want to switch between them, or if your installation is not in the default location. HOME path The optional "HOME" argument indicates you want to specify the location of the Reactor home folder for this user. The "path" argument also is optional, but if given, should be the path to the home folder. If the "path" argument is omitted, a default will be used, typically "%USERPROFILE%\ReactorHome". All keyword arguments are case-insensitive.
Examples:
cm3SetupCmdEnv cm3SetupCmdEnv UNDO cm3SetupCmdEnv HELP cm3SetupCmdEnv REMARKS cm3SetupCmdEnv ROOT path cm3SetupCmdEnv ROOT cm3SetupCmdEnv ROOT path HOME path cm3SetupCmdEnv ROOT HOME path cm3SetupCmdEnv HOME path cm3SetupCmdEnv HOME cm3SetupCmdEnv HOME path ROOT path cm3SetupCmdEnv HOME ROOT path cm3SetupCmdEnv ROOT path HOME cm3SetupCmdEnv ROOT HOME cm3SetupCmdEnv HOME path ROOT cm3SetupCmdEnv HOME ROOT
When completed successfully, the variable CM3_DoneSetup=TRUE is set. You can check this variable in other batch/command files to avoid calling CM3SetupCmdEnv.CMD again unnecessarily.