[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [ANN] tekUI GUI toolkit for Windows released
- From: John Labenski <jlabenski@...>
- Date: Wed, 18 Mar 2009 14:58:31 -0400
On Wed, Mar 18, 2009 at 2:49 PM, Timm S. Mueller
> On Wed, 18 Mar 2009 18:35:27 +0100
> Ben Aurel <firstname.lastname@example.org> wrote:
>> One question not fully related to tekui: do you know a solution to
>> deploy a program in a single self executable .exe? Scripts and
>> interpreter in one exe?
> If I'm not mistaken, you need to find a way to convert your script (or
> bytecode) to a binary object, which can then be linked to your
> application. How this is best achieved is specific for your compiler or
> toolchain. Next, you use Lua's C API to create an interpreter state,
> and then lua_load() with an appropriate reader callback to load your
> initial script from memory. Finally, you can run it using lua_pcall().
wxLua builds an executable that allows scripts to be appended to it as
they are without any recompiling. You run a Lua program with the name
of the wxLuaFreeze executable and the name of your Lua script to be
appended and it generates some magic code placed at the end of the new
program. When the wxLuaFreeze executable is run it looks for the magic
at the end which tells it the length of the appended script and then
loads and runs that. It's simple and easy, but only works for single
file Lua programs. As they say, your mileage may vary.