How do I create an RBA Ruby Archive File?

I am using rubyscript2exe to wrap an application. The problem is that
the files that are external to the ruby script are not getting wrapped
into the exe file. I think I need to create a RBA file first and then
wrap it using rubyscript2exe. Any suggestions?

Thanks

Jayson W. wrote:

I am using rubyscript2exe to wrap an application. The problem is that
the files that are external to the ruby script are not getting wrapped
into the exe file. I think I need to create a RBA file first and then
wrap it using rubyscript2exe. Any suggestions?

Are you certain that your program, when you run it with rubyscript2exe,
requires every library that it will eventually need?

Actual my problem is a bit more simple. I replaced the default Tk icon
with one I created. But when I wrap the application into an exe, the
exe version is dependent on the external icon file. If I remove the
icon file, my exe application will no longer run. I want to be able to
wrap the icon file along with the rest of the application.

Jayson W. wrote:

Actual my problem is a bit more simple. I replaced the default Tk icon
with one I created. But when I wrap the application into an exe, the
exe version is dependent on the external icon file. If I remove the
icon file, my exe application will no longer run. I want to be able to
wrap the icon file along with the rest of the application.

Sorry, I assumed you were talking about .rb files.

IIRC, you can use tar2rubyscript (from the same source as
rubyscript2exe) to wrap up non-ruby files.

Very nice…
Thanks

Jayson W. wrote:

I want to be able to wrap the icon file
along with the rest of the application.

I use the following method…

RUBYSCRIPT2EXE.bin = [“my_logo.ico”]

…as outlined here…

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

David

http://rubyonwindows.blogspot.com

On 9/19/07, Jayson W. [email protected] wrote:

Jayson

Either use relative paths to your source file (i.e. to FILE) or
try stuff mentioned under g) in the erik’s page.

Jano

Hi David,
When i use this method
RUBYSCRIPT2EXE.bin = [“my_logo.ico”]

What do I use as a reference to the Icon.
root = TkRoot.new
root.iconbitmap= ?
…on a whim I tried
root.iconbitmap = RUBYSCRIPT2EXE.bin.last
which runs as a ruby script but not after I wrap it as an exe

Jayson

I think I have figured out what the problem has been.

RUBYSCRIPT2EXE.bin=[‘my_icon.ico’] results in the file being placed in
the …/bin directory at execution time (makes sense).

The documentation says that RUBYSCRIPT2EXE.appdir points to the
…/bin directory.

require “rubyscript2exe”
RUBYSCRIPT2EXE.appdir ===> C:/bin
RUBYSCRIPT2EXE.appdir(“README”) ===> C:/bin/README
RUBYSCRIPT2EXE.appdir{Dir.pwd} ===> C:/bin

But as you might assume from the method name, RUBYSCRIPT2EXE.appdir
infact points to the …/app directory.

There is no method that I can see that references the bin directory,
but this is where all the bins and dlls go. Secondly, there is no
mehod for placing a file in the …/app folder, but this is the folder
that RUBYSCRIPT2EXE.appdir points to. The only solution I can come up
with is chopping off the app portion and adding bin

binDir = RUBYSCRIPT2EXE.appdir
3.times{binDir.chop!}
binDir += ‘bin’

Am I overthinking this. Seems like there must be a better way
Jayson

I work with wxRuby, not TK. In wxRuby, I set the icon with:

set_icon(Icon.new(‘my_icon.ico’))

No path, just the filename.

Then I include the line:

RUBYSCRIPT2EXE.bin=[‘my_icon.ico’]

That always works for me.

David

Thats interesting. In Tk, I have to tell the main window where the
my_icon.ico will be at execution time. I would like to know if this is
the norm, or am I taking the long route? You mentioned earlier that
in rubyscript2exe, that wxruby was getting copied twice into the exe,
causing the larger exe file. Do you know of any workarounds?

Jayson W. wrote:

Thats interesting. In Tk, I have to tell the main window where the
my_icon.ico will be at execution time. I would like to know if this is
the norm, or am I taking the long route? You mentioned earlier that
in rubyscript2exe, that wxruby was getting copied twice into the exe,
causing the larger exe file. Do you know of any workarounds?

After you’ve created the initial (oversize) executable:

  1. Extract the application with ‘application.exe --eee-justextract’

  2. You should now have a file called “app.eee” which is a manifest of
    all things that should be bundled into the .exe. Open this file and
    delete the line “bin/wxruby.so” (or possibly wxruby.bundle, on OS X)

  3. Repack the executable with ‘eee.exe app.eee newapplication.exe’

  4. Test that newapplication.exe runs

See here for more info:
http://www.erikveenstra.nl/rubyscript2exe/index.html#3.4.3

This works for me reducing a “nothing” app from about 9.7 to 4.7MB.
Still on the big side for simple apps, but not unreasonable for more
complex ones.

alex

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs