I had my miktex 2.9 working fine with lualatex. I went in and somewhere modified some file so that I could add my own module paths. After upgrading some packages using the miktex upgrade tool my latex code can no longer find my lua modules. When I upgraded miktex said it needed to repair some miktex config file but I didn't realize at the time it was due to my modification.
lualatex does not use LUA_PATH for some reason. My lua library code works standalone just fine(printing package.path shows what is in LUA_PATH but not using lualatex).
I've tried modifying package.path using \directlua and it prints out correctly BUT my modules are still not found.
I've searched the complete miktex installation for lua path stuff and can't find anything. Not sure if the "repair" deleted the file I modified or what happened but nothing seems to work.
In any case, why doesn't lualatex use LUA_PATH? Is there any way to fix this?
The main thing to realize here is that everything worked before "upgrading"(I do not think I upgraded anything regarding lualatex though), everything works as expected using Lua For Windows, and it seems to be a path issue. It seems like it is almost surely an issue with LuaLatex and IIRC the reason I had to modify the path inside the the miktex installation dir was because I couldn't get LUA_PATH or package.path to work with lualatex in the first place
The hard coded solution(which will probably break after each upgrade) is to modify lualatex.ini and add additional paths BUT make sure to use forward slashes and to use two slashes at the end of the path. There is no need to add filenames to the end such as ?.lua like LUA_PATH. There still is the question of why lualatex does not use LUA_PATH.
Also, I am using winedt 6 which may use it's own environment where LUA_PATH does not exst...