lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Yes, actually the only thing required is a properly set up LUA_PATH
environment variable. So you can distribute tools with the following
installation instructions:

- Install (unzip with subdirectories) all tools in a common directory,
e.g. C:\Program Files\Lua

- Associate the .lua extension with your lua executable using the
following command line:
C:\Program Files\Lua\lua.exe %*

- Set the environment variable LUA_PATH to
?;?.lua;C:\Program Files\Lua\?.lua

Which seems simple enough. Then the only requirement that remains is to
install each tool in a folder with some fixed name, so each tool could
do
  require "tools/someTool"
or
  require "thisTool/subModule"
Of course, fixed names could possibly lead to name clashes, as we know,
but that should happen very rarely, and could be avoided by installing
different sets of tools into different subfolders, and adding each to
LUA_PATH.

Ivan


Tomas wrote:

This works, but makes at least three assumptions:

- All of your Lua modules are installed in the same common folder
- You know in advance the name of that common folder, and have it set up
somewhere (e.g. in an environment variable LUA_PATH)

	I don't think these two assumptions above are problematic.
The libraries/applications don't need to know what is that folder.


- All module folders are named as the main modules inside them

	This is not mandatory.  But it simplifies the installation and
avoids name collisions.

	Tomas