Common / Shared Startup Scripts

How do I run a common startup script, for any installed version?

Solution

There are a few ways to let the Analyzer see your startup script. This discussion assumes you have multiple version of the software installed, and you want a central startup script to be the one always used.

Common Directory 'shared'

This method uses a common directory called 'shared', located at the same level as the version's root. For example: If your full software path is
/the/path/to/insight/Insight_V1234/bin/run-insight
then you must provide the 'shared' directory as
/the/path/to/insight/shared

Under that shared directory, you may have 'plugins' and 'config', but you must have for this method is 'scripts'. Inside the shared/scripts/ directory, you must name your script as 'startup.tcl'. Then, it will be sourced automatically when the Analyzer starts.

Env Var INSIGHT_PROJPATHS

This environment variable can be a list of paths, colon-delimited, that are alternate locations for the directories 'scripts', 'config', and 'plugins'. For this method, you need to have the directory 'scripts' one level below a path specified in INSIGHT_PROJPATHS. For example:

INSIGHT_PROJPATHS=/the/path/to/MyProjDir:/the/path/to/MyOtherDir

Script file /the/path/to/MyProjDir/scripts/startup.tcl will be sourced automatically.

Env Var INSIGHT_FLOW_DIR

Similar to INSIGHT_PROJPATHS, but the behaviour is baked into the inbuilt startup.tcl installed with the software. This environment variable can be single path. For this method, you need to have your own startup.tcl script in that path. For example:

INSIGHT_FLOW_DIR=/the/path/to/MyFlowDir

Script file /the/path/to/MyFlowDir/startup.tcl will be sourced automatically.

Launch Command

When starting Analyzer, you can specify any startup script. For example:

run-insight -run=MyOwnScript.tcl

Cumulative Effect

The Analyzer will look for all of the above startup.tcl scripts. If you use multiple methods, the effect is cumulative. For example: You could have a shared/scripts/startup.tcl, and in addition use the -run=MyOwnScript.tcl. In such case, Analyzer will first load the default (installed) startup.tcl, then shared/scripts/startup.tcl, then MyOwnScript.tcl.