[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

rubyscript2exe

Joe Van Dyk

6/21/2005 10:16:00 PM

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)

- BWidget -- Just needs the Tk extension installed.

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

Thanks,
Joe


12 Answers

Ryan Leavengood

6/21/2005 10:29:00 PM

0

Joe Van Dyk said:
>
> Is there any way I could pack all that stuff into one executable?

AFAIK, that is a big part of what rubyscript2exe does.

Ryan


Joe Van Dyk

6/21/2005 10:32:00 PM

0

On 6/21/05, Ryan Leavengood <mrcode@netrox.net> wrote:
> Joe Van Dyk said:
> >
> > Is there any way I could pack all that stuff into one executable?
>
> AFAIK, that is a big part of what rubyscript2exe does.
>
> Ryan

Yes. But I need to get the extra Tk extensions into the executable as well

Ryan Leavengood

6/21/2005 10:39:00 PM

0

Joe Van Dyk said:
>
> Yes. But I need to get the extra Tk extensions into the executable as
> well.

From http://www.erikveen.dds.nl/rubyscript2exe/...:

"To embed not only the Ruby bindings for TK, but TK itself as well, use
--rubyscript2exe-tk (experimental). It's probably a good idea to add exit
if defined?(REQUIRE2LIB) just before Tk.mainloop:

exit if defined?(REQUIRE2LIB)
Tk.mainloop"

Ryan



Joe Van Dyk

6/21/2005 10:45:00 PM

0

On 6/21/05, Ryan Leavengood <mrcode@netrox.net> wrote:
> Joe Van Dyk said:
> >
> > Yes. But I need to get the extra Tk extensions into the executable as
> > well.
>
> From http://www.erikveen.dds.nl/rubyscript2exe/...:
>
> "To embed not only the Ruby bindings for TK, but TK itself as well, use
> --rubyscript2exe-tk (experimental). It's probably a good idea to add exit
> if defined?(REQUIRE2LIB) just before Tk.mainloop:
>
> exit if defined?(REQUIRE2LIB)
> Tk.mainloop"
>
> Ryan

That doesn't seem to install the additional Tk extensions that are
required (like TkTable and BWidgets). Just the default Tk stuff.


Alex Fenton

6/21/2005 11:15:00 PM

0

Joe Van Dyk wrote:
> 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....

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

cheers
a

Joe Van Dyk

6/21/2005 11:18:00 PM

0

On 6/21/05, Alex Fenton <alex@deleteme.pressure.to> wrote:
> Joe Van Dyk wrote:
> > 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....
>
> This works well for me bundling a sqlite.dll (the core library, not the
> ruby bindings) into an executable
>

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. 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


Alex Fenton

6/22/2005 7:38:00 AM

0


> 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

Erik Veenstra

6/22/2005 1:39:00 PM

0

> > > Yes. But I need to get the extra Tk extensions into the
> > > executable as well.
> >
> > From http://www.erikve...rubyscript2exe/...:
> >
> > "To embed not only the Ruby bindings for TK, but TK itself
> > as well, use --rubyscript2exe-tk (experimental). It's
> > probably a good idea to add exit if defined?(REQUIRE2LIB)
> > just before Tk.mainloop:
> >
> > Ryan
>
> That doesn't seem to install the additional Tk extensions
> that are required (like TkTable and BWidgets). Just the
> default Tk stuff.

Have you tried to compile it without "exit if
defined?(REQUIRE2LIB)"? Sometimes a couple of requires are done
later on. But since your problem concerns DLL's, this probably
wouldn't help... Trying is cheap...

gegroet,
Erik V. - http://www.erikve...

Erik Veenstra

6/22/2005 1:44:00 PM

0

> > > Is there any way I could pack all that stuff into one
> > > executable?
> >
> > 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.erikve...rubyscript2exe/index.html#3.3....
> >
> > This works well for me bundling a sqlite.dll (the core
> > library, not the ruby bindings) into an executable
>
> 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.erikve...

Erik Veenstra

6/22/2005 1:54:00 PM

0

> 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.erikve...