rubyscript2exe

J

Joe Van Dyk

Hi,

I have a GUI program written in Tk that I'd like to distribute using
rubyscript2exe.

However, the application uses a couple Tk extensions:

- TkTable -- needs to be installed and have a Ruby shared library
built for it (in ext/tk/lib/tkextlib/tktable)
=20
- BWidget -- Just needs the Tk extension installed.

Is there any way I could pack all that stuff into one executable?

Thanks,
Joe
 
A

Alex Fenton

Joe said:
I have a GUI program written in Tk that I'd like to distribute using
rubyscript2exe.

However, the application uses a couple Tk extensions:

- TkTable -- needs to be installed and have a Ruby shared library
built for it (in ext/tk/lib/tkextlib/tktable)

- BWidget -- Just needs the Tk extension installed.

Is there any way I could pack all that stuff into one executable?

Use Wx rather than Tk myself, so not sure exactly what form these
additional widgets come in. But, assuming they're .so / .dll files, they
can be bundled into the rubyscript2exe executable using the
environment variable RUBYSCRIPT2EXE_DLLS at "compile" time.

Erik's web page describing how to use the tool give a good description
and examples of using this.

http://www.erikveen.dds.nl/rubyscript2exe/index.html#3.3.1..Pragmas

This works well for me bundling a sqlite.dll (the core library, not the
ruby bindings) into an executable

cheers
a
 
J

Joe Van Dyk

=20
Use Wx rather than Tk myself, so not sure exactly what form these
additional widgets come in. But, assuming they're .so / .dll files, they
can be bundled into the rubyscript2exe executable using the
environment variable RUBYSCRIPT2EXE_DLLS at "compile" time.
=20
Erik's web page describing how to use the tool give a good description
and examples of using this.
=20
http://www.erikveen.dds.nl/rubyscript2exe/index.html#3.3.1..Pragmas
=20
This works well for me bundling a sqlite.dll (the core library, not the
ruby bindings) into an executable
=20

Yeah, I'm playing around with that, but haven't had much luck. :-(=20
I'm specifying two libraries to be included, libTktable2.9.so and
sysvipc.so. When I expand the resulting application, I see sysvipc.so
in the lib directory, but there's no evidence of libTktable.2.9.so.

Has anyone every tried bundling a Tk extension with Rubyscript2exe?

Thanks,
Jeo
 
L

Lothar Scholz

Hello Alex,


AF> Use Wx rather than Tk myself, so not sure exactly what form these
AF> additional widgets come in. But, assuming they're .so / .dll files, they
AF> can be bundled into the rubyscript2exe executable using the
AF> environment variable RUBYSCRIPT2EXE_DLLS at "compile" time.

At least BWidgets are pure TCL and this will not work as it would
require a patch to the TCL library to take the ruby scripts out of the
exe file instead from a file path specified by the TCL_PATH (or
whatever it's name is).

Such a program simply needs a normal installer exe file to do it
right. Inno Setup is a good program to produce this.
 
A

Alex Fenton

AF> Use Wx rather than Tk myself, so not sure exactly what form these
AF> additional widgets come in. But, assuming they're .so / .dll files, they
AF> can be bundled into the rubyscript2exe executable using the
AF> environment variable RUBYSCRIPT2EXE_DLLS at "compile" time.

At least BWidgets are pure TCL and this will not work as it would
require a patch to the TCL library to take the ruby scripts out of the
exe file instead from a file path specified by the TCL_PATH (or
whatever it's name is).

OK, thanks, that's interesting to know. Can be a bit difficult using an
installer (I've been using NullSoft's) with rubyscript2exe as the
actual path from which the ruby script is run is not the installed
directory (/usr/local/..., C:/program files/...).

Might be worth trying tar2rubyscript in combination with rubyscript2exe
in this situtation. First create the tar containing the whole directory
layout
needed, including the Tcl libraries, then make a rs2exe executable from
that so that the tar file can run without an installed ruby. This was the
author's suggested solution when I had a problem bundling .xpm icon
files that were required by an app.

cheers
a
 
E

Erik Veenstra

Is there any way I could pack all that stuff into one
Yeah, I'm playing around with that, but haven't had much
luck. :-( I'm specifying two libraries to be included,
libTktable2.9.so and sysvipc.so.

Which statements did you use? Did you see an error message when
RubyScript2Exe tried to copy the files? Have you tried
--rubyscript2exe-verbose?

Just a couple of questions...
When I expand the resulting application, I see sysvipc.so in
the lib directory, but there's no evidence of
libTktable.2.9.so.
--rubyscript2exe-verbose

Has anyone every tried bundling a Tk extension with
Rubyscript2exe?

You have...

gegroet,
Erik V. - http://www.erikveen.dds.nl/
 
E

Erik Veenstra

At least BWidgets are pure TCL and this will not work as it
would require a patch to the TCL library to take the ruby
scripts out of the exe file instead from a file path
specified by the TCL_PATH (or whatever it's name is).

This TCL_PATH is interesting. RubyScript2Exe is able to set
enviroment variables before running the application and to set
Ruby constants in the bootstrapping part of the application. If
some can tell me what the value has to be, or how to deduce it,
I can implement this.
Such a program simply needs a normal installer exe file to do
it right. Inno Setup is a good program to produce this.

The challenge is to let RubyScript2Exe do it itself...

gegroet,
Erik V. - http://www.erikveen.dds.nl/
 
L

Lothar Scholz

Hello Erik,

EV> The challenge is to let RubyScript2Exe do it itself...

This is only possible if you could emulate a complete file system and
add this to your running programm redirecting all file calls in
User32 and Kernel32. It's possible to do so because i remember some
C++ debugging tools that catched the API calls but i don't think its
worth the time spend. It's so easy to setup an installer.
 
E

Erik Veenstra

Such a program simply needs a normal installer exe file
This is only possible if you could emulate a complete file
system and add this to your running programm redirecting all
file calls in User32 and Kernel32.

From the above, I conclude that the pathes in the programs are
hard coded. Are they? Sure? Sounds ridiculous...

If the pathes are not hard coded, it should somehow be possible
to point them to the right places. Via environment variables,
configuration files, constants or whatsoever. That's why the
are not hard coded in the first place.

I hope for the latter...

gegroet,
Erik V. - http://www.erikveen.dds.nl/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top