Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

eTcl - standalone binary

27 views
Skip to first unread message

hae

unread,
Jan 21, 2009, 3:31:26 PM1/21/09
to
Hello,

is it possible to have an eTcl-kit that is a standalone application
like the starpack. I found the converter of a starkit to a eTcl-kit.
However I would like to have a single standalone app and not to have
to pass the .etc file to the eTcl binary.

Ruediger

Eric Hassold

unread,
Jan 21, 2009, 4:47:20 PM1/21/09
to
hae a écrit :

Hello,

You may simply concatenate the eTcl executable for target architecture
and kit for your application, and result will behave like starpack, that
is executable will execute Tcl application when launched. Under Win32,
this can be done with something like:

$ COPY /B etcl.exe + myapp.etk myapp.exe

or, on linux (like) systems:

$ cat etcl myapp.etk >> myapp ; chmod 755 myapp

BUT

Prefered way is to use wrap applet, part of eTcl. This wrap applet can
be used to either turn either a source tree or starkit into an eTcl kit
or wrapped executable.

Typical usage is (from system shell)
$ etcl -applet wrap ./myapp myapp.etk
where ./myapp is a directory containing your application.

Using the embedded 'wrap' applet, eTcl may also take care of stripping
comments, useless blanks, etc... from your code, to somehow obfuscate it
and make kit even smaller, by using '-compact true' option (default to
false) :
$ etcl -applet wrap -compact true ./myapp myapp.etk

Another useful option in batch mode is '-force', which will silently
replace target kit if it exists.

Last but not least (and this answers your question), you may also wrap
kit with executable, to distribute a single .exe file, using -runtime
option:

$ etcl -applet wrap -force -compact true -runtime etcl.exe \
./myapp myapp.exe

with etcl.exe path to executable to wrap with kit. If -runtime - (dash
as runtime name) is used, eTcl runtime used for wrapping will be used in
target executable (that is, target architecture == native architecture).

Beside this technical solution, please consider redistribution
conditions in license, especially for redistribution of mobile (Windows
Mobile or linux embedded) executable.

Regards,

Eric Hassold

-----
Eric Hassold
Evolane - http://www.evolane.com/

hae

unread,
Jan 22, 2009, 5:15:40 AM1/22/09
to Has...@evolane.com

Bonjour Eric,

wrapping to an .etk-file works. But wrapping with a -runtime doesn't.
The resulting file starts like a plain etcl and does not start my
application.

Here is my setup:

<dir>/ex1/ex1.tcl
<dir>/etcl.exe
<dir>/etcl-wrap.bat

----8<---- ex1/ex1.tcl ------8<--------
package require Tk

wm withdraw .

toplevel .x
label .x.l1 -text "Hallo Welt"
pack .x.l1

wm deiconify .x
----8<---- ex1/ex1.tcl ------8<--------

----8<--- etcl-wrap.bat -----8<--------
REM This works
REM etcl -applet wrap -compact true ./ex1 ex1.etk

REM This does not work
etcl -applet wrap -compact true -runtime etcl.exe ./ex1 ex1.exe

PAUSE
----8<--- etcl-wrap.bat -----8<--------

Eric Hassold

unread,
Jan 22, 2009, 6:13:58 PM1/22/09
to hae
hae wrote :

>
> Bonjour Eric,
>
> wrapping to an .etk-file works. But wrapping with a -runtime doesn't.
> The resulting file starts like a plain etcl and does not start my
> application.
>
> .....

> ----8<--- etcl-wrap.bat -----8<--------
> REM This works
> REM etcl -applet wrap -compact true ./ex1 ex1.etk
>
> REM This does not work
> etcl -applet wrap -compact true -runtime etcl.exe ./ex1 ex1.exe
>
> ----8<--- etcl-wrap.bat -----8<--------

Hello,

Are you using version 1.0.1? 1.0.0 had a bug in this wrapping code, so
please get sure you are using latest version.

Also, I have been reported a problem specific to Win32 platform, when
using relative path as argument of -runtime option. You may try to pass
an absolute path for runtime to embed, with something like:

SET ETCL="c:\program files\evolane\etcl\bin\etcl.exe"
%ETCL% -applet wrap -compact true -runtime %ETCL% ./ex1 ex1.exe

This should work around the problem, which will of course be fixed in
next release.

HTH

Regards,

Eric

0 new messages