LUAINSTALLER(1)

NAME
luainstaller - Package Lua scripts into standalone, dependency-free native executables

SYNOPSIS
luainstaller [command] [options]
luainstaller-cli [command] [options]
luainstaller-gui

DESCRIPTION
luainstaller is an open-source Python library and command-line tool designed to package Lua (.lua) scripts into standalone, dependency-free native executable binaries. It provides automatic dependency analysis, a command-line interface, a GUI interface, and seamless integration with luastatic. Before using luainstaller, the following tools must be installed and available in your PATH:

lua The Lua interpreter from the official Lua website.

luarocks
    The Lua package manager (required for installing luastatic).

luastatic
    Install via: luarocks install luastatic.

gcc C compiler. On Linux it usually comes preinstalled. On Windows, MinGW is recommended.

WORKFLOW
The workflow of luainstaller consists of:

1.  Analyze the environment and detect required dynamic libraries.

2.  Recursively scan the entry script to build dependency analysis.

3.  Merge manually specified dependencies.

4.  Invoke luastatic to compile the entry script and its dependencies into a binary.

AUTOMATIC DEPENDENCY ANALYSIS
luainstaller supports automatic dependency extraction by matching the following require patterns:

require 'pkg'
require "pkg"
require('pkg')
require("pkg")
require([[pkg]])

Modules loaded via pcall(require, ...) are also recognized as dependencies. Dynamic or computed import names are not supported and will cause analysis failure. In such cases, disable automatic analysis and specify dependencies manually.

COMMANDS

  help
Display help message.

luainstaller help

  logs
Display stored logs (powered by SimpSave).

luainstaller logs [-limit N] [-asc]

    -limit
        Limit the number of output logs.

    -asc
        Display logs in chronological order (default: reverse order).

  analyze
Perform dependency analysis.

luainstaller analyze entry.lua [-max N] [--detail]

    -max
        Maximum number of dependencies (default: 36).

    --detail
        Show detailed analysis output.

  build
Compile the Lua script into a native executable.

luainstaller build entry.lua [-require a.lua,b.lua] [-max N] [-output PATH] [--manual] [--detail]

    entry.lua
        Entry script and starting point of dependency analysis.

    -require
        Manually specify dependency scripts (comma-separated).

    -max
        Maximum dependency analysis limit.

    -output
        Output binary path (Windows automatically appends .exe).

    --manual
        Disable automatic dependency analysis.

    --detail
        Enable verbose compilation output.

GUI USAGE
Launch the graphical interface:

luainstaller-gui

The GUI is implemented using Tkinter and provides basic functionality.

PYTHON API

  get_logs()
Return stored logs.

get_logs(limit=None, _range=None, desc=True) -> list[dict]

  analyze()
Perform dependency analysis.

analyze(entry: str, max_deps: int = 36) -> list[str]

  build()
Compile the Lua script.

build(entry: str,
      requires: list[str] | None = None,
      max_deps: int = 36,
      output: str | None = None,
      manual: bool = False) -> str

EXAMPLES

  Build using automatic dependency analysis
luainstaller hello.lua

  Manual dependency specification
luainstaller a.lua -require b.lua,c.lua --manual

  Custom dependency limit and output path
luainstaller test.lua -max 100 -output ../myProgram --detail

SEE ALSO
lua(1), luastatic(1), gcc(1)

AUTHOR
WaterRun <linzhangrun49@gmail.com>

LICENSE
LGPL-3.0-or-later