lua-users home
lua-l archive

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


i notice this in the lua source
...
/* default path */
#if defined(_WIN32)
#define LUA_ROOT "C:\\Program Files\\Lua51"
#define LUA_LDIR LUA_ROOT "\\lua"
#define LUA_CDIR LUA_ROOT "\\dll"
#define LUA_PATH_DEFAULT  \
  "?.lua;" LUA_LDIR "\\?.lua;" LUA_LDIR "\\?\\init.lua"
#define LUA_CPATH_DEFAULT "?.dll;" LUA_CDIR "\\?.dll"
#else
...
the LUA_ROOT is define as "C:\\Program Files\\Lua51"
The program files directory is not always in "C:\\Program Files"
lua should get it in the registry, the key is
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion"
the value name containing the path is "ProgramFilesDir"
(i got the regkey from Nullsoft Scriptable Install System source code).

i also have suggestion, lua should have its own key in the registry to store directory and file search information
EXAMPLE:
"HKEY_LOCAL_MACHINE\SOFTWARE\LUA51" "LPATH" = "?.lua;C:\LUA51\LUA\?.lua;"
"HKEY_LOCAL_MACHINE\SOFTWARE\LUA51" "CPATH" = "?.dll;C:\LUA51\DLL\?.dll;"
so that you dont need to recompile the source code to change the directory and file search scheme, just edit the registry


Do you Yahoo!?
Yahoo! Search presents - Jib Jab's 'Second Term'