Зачем конвертировать LUA в EXE?
Distributing a .lua script to users without a Lua installation requires bundling the runtime with the script. Packaging to .exe presents the tool as a normal Windows application and removes any dependency on Lua being installed on the target machine.
Способы конвертации LUA в EXE
srlua FREE
Run glue.exe lua.exe yourscript.lua output.exe to bundle the script with a stripped Lua runtime into a self-contained .exe. Scripts that require native C libraries still need those .dll files placed alongside the executable.
luastatic FREE
Run luastatic yourscript.lua liblua.a -I/path/to/lua/include to statically link the script and its Lua dependencies into a native executable. Requires LuaRocks and a C compiler such as MinGW.
Об этих форматах
Файл LUA - это исходный код, написанный на Lua, легковесном языке сценариев, созданном в 1993 году. Любой редактор кода (VS Code, Notepad++) открывает его для чтения или редактирования.…
Открыть детали .LUA →Файл EXE - это исполняемая программа для Windows. В Windows дважды щелкните по нему, чтобы запустить. На Mac или Linux используйте CrossOver или Wine - EXE не запускаются нативно вне…
Открыть детали .EXE →Качество и на что обратить внимание
- srlua embeds the original Lua source inside the
.exe; the script can be extracted with a hex editor. luastatic compiles to native code and is harder to reverse, though not impossible. - External Lua modules and native
.dllfiles are not bundled automatically by srlua and must be distributed alongside the.exe. - luastatic on Linux or macOS produces an ELF or Mach-O binary, not a
.exe. Build on the target platform to get the correct binary type.
Часто задаваемые вопросы
Does the target machine need Lua installed to run the .exe?
What is the difference between srlua and luastatic?
Can I bundle a script that uses external libraries?
.dll files to be placed next to the .exe.