keplerproject/luarocks — pull request #126 by ignacio (2013-04-21 21:44:15+00:00)
Title: Windows installer does not honor /INC /BIN /LIB flags

This won't work:

```bat
install /P c:\LuaRocks /INC d:\trunk_git\packages\Lua5.1\include /LIB d:\trunk_git\packages\Lua5.1\lib /BIN d:\trunk_git\packages\Lua5.1\bin
````

However this will do:

```bat
install /P c:\LuaRocks /LUA c:\some_existing_dir /INC d:\trunk_git\packages\Lua5.1\include /LIB d:\trunk_git\packages\Lua5.1\lib /BIN d:\trunk_git\packages\Lua5.1\bin
````

Unless /LUA flag is supplied and points to an existing directory, none of *INC*, *LIB* and *BIN* will be honored.

Fixing this should be easy. If all three of *INC*, *LIB* and *BIN* are supplied, use them and don't go looking around in other places.

However, batch files are way too limited. Adding the fix would involve repeating a lot of code. CMD doesn't have functions does it?

How about just using Lua to write the install script and then embedding it, along with maybe luafilesystem (if it turns out to be needed) in an executable? There are lots of options to deliver scripts as executables, it would allow us to drop that script (that is becoming hard to mantain).

@Tieske you were the last one that needed to fight with it. What do you think?