lua-users home
lua-l archive

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


2010/1/12 RJP Computing <rjpcomputing@gmail.com>:
> On Tue, Jan 12, 2010 at 9:00 AM, Antonio Scuri <scuri@tecgraf.puc-rio.br>
> wrote:
>>
>>  In Lua for Windows there is only one subdir called clibs where all DLLs
>> are placed.
>>
>> Best,
>> scuri
>
> I completely agree. This has forces LfW to need to edit Windows PATH. I
> think this is not great and we would like to not need to mess with a users
> machine.

The modification you're asking for doesn't make Lua better, it makes
it more suited to your application (LfW). But changing the PATH
environment variable is not the only alternative.

In your situation I'd rather patch the lua.exe interpreter so that it
replaces the default C module searchers with a custom version that use
LOAD_WITH_ALTERED_SEARCH_PATH. The Lua dll stays intact, should it be
used by other applications (that may or may not use C modules from the
LfW install). Only the interpreter application has to know about the
specific way to load modules, and with a custom searcher that's
exactly the case.

And if you don't want to patch Lua, it's still possible to put that
searcher substition code in a LUA_INIT environment variable.