The special repack of "Lua for Windows" ⸺ 9000XZ noob-friendly limited edition!
This is meant to be used by people who want to compile Lua on Windows by themselves, but they don't know how-to... or perhaps you want to mess with Lua C API as quick as possible; wait no more.
The goal of this repack is to make it all dead-simple, so even a cavemen could do it as fast as possible without using any third-party programs!
With this repack, there are no pre-compiled binaries, you need to build/compile Lua from source.
Furtunately, this repack comes with several additions regarding the building/compiling phase, featuring:
- Written in pure Batch, no prerequisites at all (no external dependencies; other than either VS or Windows SDK)
- One-click Batch script to download and extract official Lua source code
- One-click Batch script to build/compile Lua (requires Visual Studio 2019 installed)
- One-click Batch script to install Lua, setting up system environment variables (requires admin privileges)
- Visual Studio 2019 solution with 3 main projects (to compile
lua.dll
/lua.exe
/luac.exe
individually)- Includes bonus project! Fully functional, simple Lua C embedding example.
-
Start by cloning this repository locally (requires git):
git clone https://github.com/Disseract/Lua-Windows-Repack Lua
- Or alternatively, you may download a ZIP archive and extract it on your computer.
-
Run download.bat file to download Lua source code.
-
Open the Lua version folder (5.3.6). At this point, verify that Lua source code has been downloaded, you should find it inside the
src
subfolder. -
Next, run build.bat file to compile Lua.
-
Last but not least, in case if you want to install this Lua version on your system, then run setup-env-vars.bat as administrator.
-
At this point, you are all done and you should be able to run
lua
/luac
from Terminal or command-line.
Also, if you want to play with Lua C API, a simple example project has been included.
- Open the solution (
vs2019\Lua.sln
) in Visual Studio 2019. - You will find an example project called
EmbeddingSample
in the Solution Explorer window. - Go ahead and build the solution, it will compile everything and you should find the binaries in the
5.3.6\bin
folder, as well as lib files which you will find in the5.3.6\lib
folder.
By running 5.3.6\bin\EmbeddingSample.exe
it will execute 5.3.6\lua\main.lua
Lua script, at which point you should see the hello world message displayed on the screen 😃