Как установить lua на windows 10

What is Lua ???

Lua is a powerful, efficient, lightweight, embeddable scripting language. It supports procedural programming, object-oriented programming, functional programming, data-driven programming, and data description.

In this Lua Tutorial we will Learn How to Install Lua on Windows 10 (Lua tutorial)

What is Lua Used For ?? Lua combines simple procedural syntax with powerful data description constructs based on associative arrays and extensible semantics. The Lua Interpreter is dynamically typed, runs by interpreting bytecode with a register-based virtual machine, and has automatic memory management with incremental garbage collection, making it ideal for configuration, scripting, and rapid prototyping.

However Lua Ide |Lua vs Python|Why to Choose Lua Lua has a deserved reputation for performance. To claim to be “as fast as Lua” is an aspiration of other scripting languages. Several benchmarks show Lua as the fastest language in the realm of interpreted scripting languages. Lua is fast not only in fine-tuned benchmark programs, but in real life too. Substantial fractions of large applications have been written in Lua.

Basic Steps (How to install Lua)

There are many simple steps to Download Lua and Install Lua on your Window10……

                                 Lets Start……..

Step 1:How to Install Lua on Windows 10 manually

Firstly, What you have to do is to Open your Browser and Write Lua on the Search Bar……

How to Install Lua on Windows 10 1

How to Install Lua on WIndows 10

Similarly Click on Lua :Getting Started to Download the Lua on your windows 10.

Moreover As you are watching in the figure below.

How to Install Lua on Windows 10 2

How to Install Lua

Similarly Now you will reached to the site from where yo will Install the Lua for your Windows 10

https://www.lua.org/start.html

However Above is the Link Address to download Lua

Moreover Below in the Figure you will understand better how it be done.

Similarly A new page of Lua.org will be open after clicking on the Installing Button.

However On the Lua.org page you will find
Lua Dist link to download Lua from Lua.org  Page.

Moreover you will understand by the Figure below

How to Install Lua on Windows 10 4

How to Install Lua

However On the next page you will see the options .

Moreover You have to Select the option which you want as illustrated in the figure below

However As I have Selected the option of Widows

How to Install Lua on WIndows 10 5

How to Install Lua on Windows

Similarly A Popup of Start Download will appear on your Screen

How to Install Lua on Windows 10 6

How to Install Lua

When You Click on the Start Download Button It will start downloading.

A downloading Popup will appear on your screen.

How to Install Lua for Windows 10 7

How to Install Lua

How to Install Lua | Step 2

In the Second Step What we have to do is to download the language .

Write Lua Language on the search bar of your search engine.

Select The Programming Language Lua Link to download the Language of Lua.

You can also use the link

https://www.lua.org/

Take a look on the Figure Below

How to install Lua on Windows 10 9

How to Install Lua

Below the context you will see option to download Lua Language in form of Link

On the next Page you have to Click on the binaries Option to Download the binary of Lua

How to Install Lua on Windows 10 11

How to install Lua

A download popup will display on your desktop.

Just Open the Downloaded File of Binaries. As Illustrated Below

How to Install Lua on Windows 10 12

How to Install Lua

Lua Tutorial :Learn how to Install Lua Step 3

Now You have a complete downloaded file of Lua and Lua Binaries.

  • Go to your system Downloads.
  • In Downloads Select the Compressed folder.
  • Unzip the Binaries Folder and extract all the Files .
  • You can see below how it be done.

How to Install Lua on Windows 10 13

How to Install Lua

Above the Binary Folder is Selected and Below is the File Extraction as shown in the figure below.

How to Install lua on windows 10 14

How to Install Lua

Now a Popup will be displayed on your screen which will extract the Files from the Folder.

Extraction process popup shown in the figure below

How to Install Lua on Windows 10 15

How to Install Lua

Installing Lua Tutorial| How to Install Lua on Windows 10 : Step 4

After the extraction you will find a extracted folder in the same list like you can see the picture below .

Point To Remember

Now here you have to Change the folder name which contains extracted files or if you dont want to change the folder name no Problem !!!

How to install Lua On Windows 10 17

How to Install Lua

Simply you have to copy the above folder in the C Directory.

Press Ctrl+C to copy the Folder.

How to Install Lua on Windows 10 19

How to Install Lua

Now Click on C Directory and past the copy folder or Press Ctrl+V.

Below the Popup show the process of copying Folder into C Directory

Step by Step Tutorial To Install Lua | Lua Tutorial :Step 5

  • Now Click on Lua Folder.
  • You will see bin Folder Click on it.
  • Now You have to copy the address from this bin
  • How to copy the address is shown in Figure below

How to Install Lua on Windows 10 22

How to Install Lua

Lua Installation Tutorial|How to Install Lua on Windows 10 : Step 5

In the previous step you copied the address

  • Go to you Desktop
  • Right Click on the ThisPc icon on the Desktop
  • You will see the small popup
  • Single Click on Properties Similarly and you are opening the properties of your desktop
  • Click on the Advanced system settings
  • See in Figure

How to Install Lua on Windows 10 23

How to Install Lua

How to Install Lua on Windows 10 :Step 6

After Click on the Advance System Settings A popup of System Properties will display on your Screen

Click on the Environment Variables as shown in the Figure

How to install Lua on Windows 10 24

How to install Lua

After Clicking on Environment Variables A Environmental Variable Popup will be displayed on your Screen

Click on the Path to Select the Path

Click on Edit Button to edit the path as Shown in Figure Below

How to Install Lua on Windows 10 25

How to Install Lua

Now A popup of Edit Environmental Variables will display on your Screen

Click on New Button to Edit /Paste your copied Path

How to install Lua on windows 26

How to install lua

For-instance This could be like this as shown in the picture below when to click on the New Button

Moreover Above in the circle of Picture you have to Paste the copied Address which we copied previously from Bin Folder in this Lua tutorial

How to Install lua on windows 10 27

How to Install Lua

Press the Ok Button to Finish it.

Congratulations!!!!!!!

Your Lua Installation on Windows 10 has been Completed Successfully

  • After installing Lua Successfully Most Importantly you should check that either your Lua and Binaries has been installed or not
  • How to check Lua successful installation is describe below

How to Check the Installation of Lua??????Step 7 How to Install Lua on windows 10

  • Go to the Windows Command Prompt
  • You can open it from Start manu / go to windows search and write command prompt
  • Command prompt will be open as shown below in the figure

How to Install  Lua on Windows 10 29

How to Install Lua
  • Open Command prompt from Start
  • Write Lua
  • Press Enter
  • Write Aslam
  • If the system gives you answer as shown in Figure below
  • It means your lua has been Installed Successfully
  • Press Enter
  • As shown Below

How to Install Lua on Windows 10 30

How to Install Lua

Thankyou !!!!

Learn How to install Lua on Windows 10

How to Install NetBeans Editor IDE 8.0.2 with C/C++ Pack

Learn How Install NetBeans Editor IDE 8.0.2 with Java EE Pack

Step By Step Guide to Install NetBeans Editor 8.0.2 IDE PHP PACK

How to Install UC Browser

Learn How to Install Opera Browser

Step by Step Guide to Install Google Chrome

Learn How to Install Mozilla Firefox

How to Install JDK 11 Latest Version For Windows 10

Learn How to Install Sql Server 2012

Related

  1. Download the latest Lua and LuaJIT sources

    • Create temporary folder for Lua sources.
      I assume you would use C:\Temp\ folder.

    • Visit Lua FTP webpage and download the latest Lua source archive, currently it is lua-5.4.3.tar.gz

    • Use suitable software (7-Zip, WinRar, WinZip or TotalCommander) to unpack the archive.
      Please note that with 7-Zip you have to unpack it twice: lua-5.4.3.tar.gz -> lua-5.4.3.tar -> lua-5.4.3\

    • Move unpacked Lua sources to C:\Temp\lua-5.4.3\

    • Visit «Git for Windows» latest release page and download the latest portable installer, currently it is PortableGit-2.31.1-64-bit.7z.exe

    • Run PortableGit installer.

    • Double-click the installed file git-cmd.exe, a console window will open.

    • Execute the following commands in this console window:
      cd /d C:\Temp\
      git clone https://luajit.org/git/luajit.git
      cd luajit
      git checkout v2.1

    • Close the console window.
      Now you have LuaJIT 2.1 sources in the folder C:\Temp\luajit\

    • You can uninstall «Git for Windows» application now.
      It’s portable, so just remove its folder.

  2. Build Lua and LuaJIT executables using MinGW64

    • Visit MSYS2 download page and download the latest MSYS2 installer, currently it is msys2-x86_64-20210419.exe

    • Run MSYS2 installer.
      It is recommended to install MSYS2 in the default destination folder C:\msys64\,
      but you may choose another path consisting of English letters without spaces

    • After installation is complete, a MSYS2 console window will open.
      Execute the following command in this MSYS2 console window:
      pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-make
      When asked Proceed with installation? [Y/n], answer Y and press Enter.

    • Close this MSYS2 console window and open a new one by clicking the MSYS2 MinGW 64-bit menu item in Windows Start menu.
      Execute the following commands in the new MSYS2 window:

      • Go to the location of Lua 5.4 sources:
        cd /c/Temp/lua-5.4.3/

      • Build Lua 5.4:
        mingw32-make mingw

      • Go to the location of LuaJIT sources:
        cd /c/Temp/luajit/

      • Build LuaJIT:
        mingw32-make CFLAGS=-DLUAJIT_ENABLE_LUA52COMPAT

    • Close the MSYS2 console window.

    • You can uninstall «MSYS2» application now at Control Panel -> Programs and Features.

  3. Install Lua and LuaJIT executables

    • Create folder for Lua executables.
      I assume you would use C:\Lua\ folder.

    • Install executable files:

      • Move 3 files: lua.exe, luac.exe and lua54.dll
        (sort files by «Date Modified» — these files are among the most recently modified)
        from C:\Temp\lua-5.4.3\src\ to C:\Lua\

      • Move 2 files: luajit.exe and lua51.dll
        from C:\Temp\luajit\src\ to C:\Lua\

    • Install jit.* modules (optional)
      Move the folder C:\Temp\luajit\src\jit\ to C:\Lua\lua\jit\

    • Install documentation (optional)
      Move and rename the folder C:\Temp\luajit\doc\ to C:\Lua\doc\LuaJIT\
      Move and rename the folder C:\Temp\lua-5.4.3\doc\ to C:\Lua\doc\Lua54\

    • You can remove Lua and LuaJIT sources now by deleting their temporary folders:
      C:\Temp\lua-5.4.3\
      C:\Temp\luajit\

    • Add Lua folder to PATH

      • Go to
        Control Panel -> System -> Advanced system settings -> Environment Variables

      • Edit variable Path and append ;C:\Lua to the end of its content.
        After that every new console window will understand luajit and lua commands.
        (Already opened console windows still have old copy of PATH without Lua folder in it)

  4. Make sure Lua works now.

    • Open new console window.
    • Type lua to run interactive Lua interpreter.
    • Press Ctrl+Z and Enter to exit.
    • Type luajit to run interactive LuaJIT interpreter.
    • Press Ctrl+Z and Enter to exit.

The directory tree looks like this:

C:\
  +-- Lua\
        +-- lua\             folder for Lua modules
        |     +-- jit\       subfolder for jit.* modules
        +-- doc\             folder for documentation
        |     +-- Lua54\     open manual.html with your browser
        |     +-- LuaJIT\    open running.html with your browser
        +-- lua.exe          Lua 5.4 executable
        +-- lua54.dll        Lua 5.4 DLL
        +-- luajit.exe       LuaJIT executable
        +-- lua51.dll        LuaJIT DLL

FAQ

How to open Windows console?

  • Press Win+R, type cmd, press Enter
    Win is the key between Left Ctrl and Left Alt.

How to open Control Panel?

  • Press Win+R, type control, press Enter

How do I run my Lua program?

  • Use your favorite text editor (or just Notepad) to create text file yourfile.lua with your Lua program inside.
    Open Windows console and type lua yourfile.lua to run the program.
    If you are in a different directory, you should provide full path: lua C:\path\to\yourfile.lua

How to make my Lua module available for my Lua program?

  • Copy your module file yourmodule.lua to the modules folder C:\Lua\lua\
    Now you can load your module by require("yourmodule") in any Lua program.

What does mingw32-make CFLAGS=-DLUAJIT_ENABLE_LUA52COMPAT mean?

  • This flag enables some Lua 5.2 features in LuaJIT,
    see file:///C:/Lua/doc/LuaJIT/extensions.html#lua52 in your browser for details.
    You can replace this command with simple mingw32-make to build strictly 5.1-compatible LuaJIT instead.

Every time I run Lua script an annoying console window pops up.
How to run a Lua script silently in the background?

  • You need windowless version of Lua binaries.
    Here are instructions on how to build wlua.exe and wluajit.exe

Lua crashes when I try to use a binary module (a Lua library written in C and provided as DLL file).
How do I determine whether some binary module is compatible with my Lua executable?

  • The following three conditions must be met:

    • Binary module must be written for the same Lua version.
      Lua 5.1, 5.2, 5.3 and 5.4 are four incompatible versions, and a binary module is designed to work only with one of them.
      For example, a module created for Lua 5.2 will not work with Lua 5.4.
      LuaJIT can work only with binary modules written for Lua 5.1.

    • Binary module DLL must have the same bitness (32 or 64) as the Lua/LuaJIT executable;
      otherwise module DLL will not be able to load.

    • Binary module DLL must depend on the same C runtime as the Lua/LuaJIT DLL;
      otherwise Lua may crash or behave incorrectly due to each C runtime library has its own heap memory and stdin/stdout handlers.
      In other words, both Lua executable and binary library must be built with the same tool.
      For example, if your module DLL was built with MSVC, it will be incompatible with Lua built with MinGW64.

    You can view bitness and C runtime of any DLL file with «Dependency Walker» application.
    So, before using a binary module you should do the following:

    1. read binary module’s documentation to learn which Lua version the module was written for;
    2. compare bitness and C runtime of the two DLL files: binary module DLL and Lua DLL.

Skip to content

Lua is a light script programming language. Mostly it’s used as embedded language in different areas: game dev, stock trading, etc.

In this article you will find how to install your Lua development environment on Windows 10.

Download and install Lua

I recommend you to use all-in-one Lua package from https://code.google.com/archive/p/luaforwindows/downloads. Download the last version from the list (at the moment it’s LuaForWindows_v5.1.4-46.exe). Also you need vcredist executable file ( vcredist_x86.4053.exe ).

Install vcredist first and Lua package after that. Use default settings during installation process.

Update environment paths

For proper work you need to update your environment variables. Go to Control Panel -> System -> Advanced system parameters -> Environment variables. Add following variables values:

LUA_CPATH = C:\Program Files (x86)\Lua\5.1\clibs\?.dll;C:\Program Files (x86)\Lua\5.1\clibs\luasql\?.dll

LUA_DEV = C:\Program Files (x86)\Lua\5.1 
 
LUA_PATH = C:\Program Files (x86)\Lua\5.1\lua\?.luac;C:\Program Files (x86)\Lua\5.1\lua\?.lua  

Editing code

You can use any text editor for writing Lua code. Default editor from all-in-one package is SciTE. I recommend you to use SciTE because it has code highlight and code debug features.

Let’s create your first Lua script. Run the editor and and just one line to a new file:

print "Hello from Lua!"

SciTE Lua Hello World

Save the file and run it from command line:

C:\lua>lua hello_world

You should see line

C:\lua>lua hello_world
Hello from Lua!

Lua Hellow world output

Here we are! Your Lua development environment is ready. Check other articles under “Lua” tag in my blog to know more Lua tips and tricks.

Follow these steps to install Lua 5.2.4 on Windows 10. These instructions are written for Windows 10, but the steps needed to install should be similar on older (and future) versions of Windows as well:

  1. To download Lua 5.2.4, visit https://sourceforge.net/projects/luabinaries/files/5.2.4/.
  2. Click on the Tools and Executables link.
  3. On a 32-bit version of Windows, click the lua-5.2.4_Win32_bin.zip link to start downloading Lua. On a 64-bit version of Windows, click the lua-5.2.4_Win64_bin.zip link to start downloading.
  4. Once the file is downloaded, unzip the file. Unzipping the downloaded file should create four new files: lua52.dll, lua52.exe, luac52.exe, and wlua52.exe.
  5. Create a new folder inside C:\Program Files ...

I’m new to Lua, and need to know how to install it on Windows?

I’ve tried and am unable to run the sample. When I try to compile it 100% success is shown, but when I click the run button it shows this error:

Can't find moai executable in any of the folders in PATH or MOAI_BIN:
C:\Program Files\moai, D:\Program Files\moai, C:\Program Files (x86)\moai, D:\Program Files (x86)\moai, C:\WINDOWS\system32, C:\WINDOWS, C:\WINDOWS\System32\Wbem, C:\moai-sdk\bin\win32\moai.exe, C:\moai-sdk/bin 

If anyone can help me on how to install Lua, thanks.

GoodClover's user avatar

asked May 22, 2013 at 11:55

sai's user avatar

5

Lua does not have a certified IDE or compiler to come with it. You usually run lua code from a lua command line / lua file which will handle the tasks you are attempting to create.

Downloading

Lua has a website where you can download their tools which will allow you to write and execute lua code: https://www.lua.org/download.html

Using lua console

After you download the file, put it in a file location anywhere on your computer, in order execute lua code; the first method is to open the lua console and simply type out your command: https://prnt.sc/ibw97h

Another method you can use, is make a .txt or .lua file, write your code in that, then you can drag and drop the file onto the lua console to execute it: https://prnt.sc/ibwa2f

Installing lua system wide

Add lua in the environment variables by adding the path from where it’s installed. After doing this you can open PowerShell and enter lua53.exe to open lua.

Additional details

Although these is what lua directly offers, there are other third party alternatives of compiling and executing lua code. Examples of these can be found if you search for them.

answered Feb 8, 2018 at 14:17

Hex's user avatar

HexHex

1351 silver badge12 bronze badges

1

The easiest way nowsday is using WinGet:

 winget install "Lua for Windows"

WinGet is default included in Windows 11. In previous Windows version, you could install it from Windows Store. It is very convenient.

answered Apr 14 at 16:09

YoungForest's user avatar

1

  • Как установить lua для windows
  • Как установить logitech g hub на windows 10
  • Как установить linux на установленной windows
  • Как установить linux с флешки вместо windows
  • Как установить linux на одном диске с windows