rjpcomputing / luaforwindows

Lua for Windows is a 'batteries included environment' for the Lua scripting language on Windows. NOTICE: Looking for maintainer.
2.88k stars 482 forks source link

Lightweight version of luaforwindows for embedding scenario #85

Closed fbuchinger closed 9 years ago

fbuchinger commented 9 years ago

Hi,

thanks or providing the luaforwindows distribution and taking out the pain of compiling the lua packages on windows! One question though: I like to embed a lightweight version of the luaforwindows distribution for performing calls to REST webservices and parsing their responses (JSON/XML). My main application would invoke the lua interpreter via command line.

So I am mainly interested embedding the lua interpreter + LuaSocket, LuaCurl, LuaXML, Date, stdlib, gzio, luaunit. Ideally, the total size of such a "minimal" distribution doesn't exceed 5 megabytes.

My questions:

rjpcomputing commented 9 years ago

@fbuchinger

Hi,

how can i remove unneeded libraries (e.g pdflib, sublua)? Is it enough to delete the dlls from the clibs folder? Or should i do this via luarocks commands?

Yes that is all you need to do then run the INNO Setup compiler. But you should go a step further and remove the docs, examples and utils that go along with the removed modules.

how can I find out about dependencies between the libraries (e.g. luacurl might require gzio)?

The best way is looking at the modules website. I have found no better way except to run examples. Also I don't know too many modules that don't make it clear they rely on another modules.

What about vcredist_x86.exe (Visual C runtime)? Is it required for such a distribution? Can/should I ship it or should I require it as an external dependency?

The current installer checks to see if it is installed and if not it:

  1. Look next to the installer for a file named vcredist_x86.exe.
  2. Download during install from this github repo.

To answer your question, I think externally so it only needs to be ran the first time and not for any updates. Also there are some rules about redistributing the runtime and I think it might restrict it, but I am not sure.

Hope this helps.

fbuchinger commented 9 years ago

Thanks for the hints! One question: can I also ship the Lua binaries without your installer, just by copying the approbriate dlls into the right subdirectories... or does your installer perform some special tasks I need to be aware of?

rjpcomputing commented 9 years ago

You may ship them alone. The installer just does things like register .lua files to run using lua.exe when double-clicked, but nothing special to Lua or the modules.