1
votes

Question related to Windows platform only.

I can't find documentation on how to approach this.

There are dozens of posts about this, yet most provide answers for mac/linux, most windows specific parts lead to dead links or README's that have no useful information.

How do I, for example, make an .exe of the code below? The intent being to share it with another windows user, so that when they click it...it automatically runs the program in command prompt or wherever .exe are supposed to run without them needing to have lua/luac installed on their system.

Or perhaps I'm missing the point here and you need lua/luac installed, otherwise you would need to convert to a program language that's already installed on everyones' windows systems like C...? Regardless I need something that works for the purpose described. Could I make a folder with lua.exe and luac.exe and input.lua and make an .exe that loads command prompt and runs the command to compile input.lua? new_folder: lua.exe, luac.exe, input.lua, run.exe

> --input.lua   
print("type ur name")   
name=io.read()   
print(#name)   
print("your name is " name)  
1
Do you really need lua-to-exe convertor? Try usual interpreter instead. Download Lua Binaries, unpack and run lua53.exe your_script.lua to run the script. - Egor Skriptunoff
I don't know what any of that means. Do I really need a lua-to-exe converter? I don't know, I'm just trying to make a lua program into an .exe. "Try usual interpreter instead" I don't know what that means....what usual interpreter? Command Prompt?Download Lua Binaries...I already have Lua installed. I want to share a program written in lua....so a windows user gets it, clicks it and it runs out of their command prompt or wherever, making it an exe is the way to do that no? - kite
Okay so my understanding now is luac is the usual 'interpreter' you are speaking of. Command Prompt is the shell to run them through. I'm still where I started though unless I can use luac to compile to exe....but I don't see anything saying I can. - kite

1 Answers

0
votes

I'm not aware of anything in wxlua that can compile a lua file into an executable. There is wxLuaFreeze executable that allows to concatenate a lua script to it to generate a new executable that will run that script when executed. See the documentation for details: http://wxlua.sourceforge.net/docs/wxlua.html#C7.3.