Set an environment variable for the LaunchBox root path every time LB or BB are started

Issue #5309 new
Bruno created an issue

Suggestion: when LB or BB are started, set an environment variable on the system to point to LB’s top-level/root folder (where the executables are) with an absolute path.

The value of the absolute path would change any time the whole LB folder structure is moved. Thus the environment variable always points to the correct folder.

Example variable name: LaunchBox_ROOT

If there are usable/important folders within LB’s root that may change structure in the future, consider also creating environment variables for those, such as ThirdParty folder, or ScummVM folder specifically, etc..

Reasoning:

Relative paths are great when you know exactly where you’re starting and where something is so you can reference something else - but a batch file using such paths isn’t portable between systems where someone else may place that batch file in an arbitrary location.

Being able to always have a reference to the top of the Launchbox path hierarchy gives a lot more freedom to access parts of the LB distribution that won’t change from system to system, from a batch file that can itself be placed anywhere.

With this variable it’s possible to write a batch file to, for example, reference the included ScummVM executable and keep it functional regardless of where it’s stored. Great when someone puts parts of their game collection on a different drive.

Comments (0)

  1. Log in to comment