Jump to content

Tutorial : How to manually set up Lua binaries manually on Windows


Recommended Posts

I posted these instructions on the Notepad++ page of the Creation Kit wiki, but for some reason I don't think it will ever be published. So I am posting them here (modified a bit) so anyone who has trouble setting it up may Google and find this page, or so people can link to it.

There are 2 ways to install Lua binaries (executables). One is the full installer that can be found here. However even when unchecking unneeded elements during the installation, unneeded elements will be installed. I like to install only what I need on my computer, so I wanted to install only the binaries required to run Lua scripts.

Note : Remember that the directory paths in this tutorial may be different on your computer. Modify them accordingly.

  1. Download Java binaries here : http://sourceforge.net/projects/luabinaries/files/5.2.1/Executables/ Download the appropriate binaries, depending on whether you are running Windows 32 bits or 64 bits.
  2. Extract the binaries. Keep the binaries in their directory.
  3. Optional : You can delete "luac52.exe" and "wlua52.exe" if what you want is only to run Lua scripts that other people have made. However, if you plan to write and compile Lua scripts in the future, you will need "luac52.exe", which is the Lua compiler.
  4. Rename "lua52.exe" to "lua.exe" (do NOT rename "lua52.dll"). This is for convenience, so you can type "lua" in the console to run a script and use the command lines in various tutorials without having to modify them. Otherwise, you would have to modify anything that says "lua" for "lua52" and type "lua52" in the console to run it.
  5. Optional, but recommended : Rename the directory to something more simple like "lua-5.2.1" or "Lua". "lua-5.2.1" will be used here.
  6. Move the "lua-5.2.1" directory to "C:\Program Files".
  7. Optional, but recommended : Open the "lua-5.2.1" directory and click an empty space in the address bar at the top of the window (which is next to the "Back" arrow button). The full path to the directory should appear. Copy it, you will need it for the next steps.

To add Lua to the environment path (required to be able to easily run it from the console and use it in applications like Notepad++) :

  • Right click on "Computer" (from the Start menu or elsewhere) and select "Properties".
  • In the left panel, click "Advanced system settings".
  • Click on "Environment Variables" at the bottom.
  • Under "User variables for [your username]" (NOT "System Variables". Do not touch that), there may or may not be a "PATH" variable listed.
    a) If there isn't one, click on "New...". In "Variable name", type "PATH" without quotes. In "Variable value", type "C:\Program Files\lua-5.2.1" without quotes.
    b) If there is one, double-click it and at the very end, add ";C:\Program Files\lua-5.2.1" without quotes. You HAVE to include the semicolon ( ; ).
  • Click "OK" on everything.

You should be set up. To test whether it works, type open the Start menu and type "cmd" in the search field. A console window should pop up. Type "lua" and hit enter. You should see ''Lua 5.2.1 Copyright © 1994-2012 Lua-org, PUC-Rio" appear.

If you see "'lua' is not recognized as an internal or external command, operable program or batch file.", then you did something wrong. Possible sources of the problem are :

  • You did not rename "lua52.exe" to "lua.exe". Try typing "lua52" in the console window. If it works, then you did not rename the executable properly.
  • You did not type the path properly in the environment variable.
  • You forgot the semicolon ( ; ) at step 4.b.

If everything else fails, you can always use the automated installer I linked above.

Edited by Garglion
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...