However, both approaches have notable limitations.
srlua:
- Can only package a single .lua file
- Requires manual compilation
luastatic:
- Linux-only
In addition, neither of them provides automatic dependency analysis.
Therefore, I (or, Claude Opus 4.5, haha) wrote luainstaller, similar in spirit to PyInstaller by name and design, wraps both tools and adds automatic dependency analysis and single-file packaging. It also ships with precompiled srlua binaries, working out of the box on both Windows and Linux.
Getting started is straightforward:
pip install luainstaller
For example, suppose you have a.lua, which depends on b.lua, and b.lua depends on c.lua. There is no need to manually analyze dependencies or merge scripts into a single .lua file for srlua. You simply run:
luainstaller build a.lua
and it produces a standalone binary with no external dependencies.
You do not even need to use the command line. Running:
luainstaller-gui
launches a simple GUI built with Tkinter that covers the basic functionality.
luainstaller can also be used as a Python library. It supports additional parameters, a logging system based on SimpSave, selectable engines (precompiled Lua 5.1.5 for Windows and Linux, both 32-bit and 64-bit, as well as Lua 5.4.8), and more. Detailed usage is documented on GitHub.
Tested on Windows 11 and Fedora 43.
Limitations: only pure Lua scripts are supported. Dynamic module loading is not supported, as dependency analysis is based on a simple static approach.