Clone
5
Lua installation on windows
Foué edited this page 2026-01-04 19:16:44 +01:00

Install Lua on windows

There are two methods, one is (almost) automatic, and the other is more manual.

"automatic" install

Lua for windows

Download the "Lua for windows" exe from TBD.

Then install it in C:\lua.

Visual Studio Code Build tools

Install it.

"manual" install

msys2

Install msys2 app.

In the msys shell execute the following commands

pacman -S mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-make tar

add msys path in the environment

C:\msys64\ucrt64\bin

lua

copy lua somewhere

wget https://www.lua.org/ftp/lua-5.4.7.tar.gz

compile it

tar -xvzf lua-5.4.7.tar.gz

cd lua-5.4.7/

mingw32-make mingw

copy the files in lua dir (here C:\lua)

mkdir /c/lua/include
cp src/*.exe src/*.dll /c/lua/`
cp -v src/lapi.h src/lauxlib.h src/lua.h src/luaconf.h src/lualib.h /c/lua/include/

add lua path in the env

C:\lua

Luarocks

download luarocks from github

extract it and from the cmd shell call the following command (to be installed in c:\luarocks here)

./install.bat /MW /P "C:\luarocks"

It will ask for admin rights.

Add luarocks path in the env

C:\luarocks