Skip to content

qtnc/lua2exe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lua2exe

What is lua2exe ?

As his name suggests, lua2exe convert a serie of lua scripts into a standalone executable. The generated executable still need lua shared library, lua54.dll on windows.

How to use lua2exe ?

To make an executable out of your lua scripts, just run lua2exe and specifiy which scripts to embed.

For example :
lua2exe -o myprog.exe script1.lua script2.lua script3.lua
will generate myprog.exe out of script1.lua, script2.lua and script3.lua.

Only the first script given will be run when the generated executable starts. In our case script1.lua. Other embedded scripts can be called by using require().

If script1.lua above calls script2.lua and script3.lua via require(), you don't need to specify them on the command line. Lua2exe automatically checks for require() calls and embeds required scripts in the generated executable, too. It does it recursively. It also checks for Lua C libraries and copy the corresponding DLLs in the same directory as the generated executable.

How it works ?

The scripts given to lua2exe are compiled and compressed, then finally appended to the end of a base executable image to form a single executable embedding the scripts. The base image is quite similar to the lua interpreter, except that it doesn't includes the interactive mode.

At startup, the list of embedded files is fetched from the executable itself, and the first embedded script is loaded and run.

Important note: lua code in generated executables is compiled and compressed, not emcrypted ! It means that you have absolutely no protection against decompilation and reverse engineering of produced executables.

Building

You can build with the makefile or with luarocks.

Naturally, you must have built Lua before building Lua2exe. Lua interpreter and library must be present in the relevant system paths.

The new version of Lua2exe uses LZ4 as compression engine. You must first build LZ4 before Lua2exe.

The script [lua2exe.lua] is used to build Lua2exe itself. This script requires luafilesystem, which you can find on Luarocks. Luafilesystem is automatically downloaded and built if you build with luarocks.

About

lua2exe, pack lua scripts into an executable

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors