How do I create an RBA Ruby Archive File?

Discussion in 'Ruby' started by Jayson Williams, Sep 18, 2007.

  1. 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 Williams, Sep 18, 2007
    #1
    1. Advertising

  2. Jayson Williams 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?

    --
    vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
     
    Joel VanderWerf, Sep 18, 2007
    #2
    1. Advertising

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


    On 9/18/07, Joel VanderWerf <> wrote:
    > Jayson Williams 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?
    >
    > --
    > vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
    >
    >
     
    Jayson Williams, Sep 18, 2007
    #3
  4. Jayson Williams 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.

    --
    vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
     
    Joel VanderWerf, Sep 18, 2007
    #4
  5. Jayson Williams

    David Mullet Guest

    David Mullet, Sep 19, 2007
    #5
  6. Jayson Williams, Sep 19, 2007
    #6
  7. 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

    On 9/18/07, Jayson Williams <> wrote:
    > Very nice...
    > Thanks
    >
    > On 9/18/07, David Mullet <> wrote:
    > > Jayson Williams 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
    > >
    > > --
    > > Posted via http://www.ruby-forum.com/.
    > >
    > >

    >
    >
     
    Jayson Williams, Sep 19, 2007
    #7
  8. Jayson Williams

    Jano Svitok Guest

    On 9/19/07, Jayson Williams <> wrote:
    > 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


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

    Jano
     
    Jano Svitok, Sep 19, 2007
    #8
  9. 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

    On 9/19/07, Jano Svitok <> wrote:
    > On 9/19/07, Jayson Williams <> wrote:
    > > 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

    >
    > Either use relative paths to your source file (i.e. to __FILE__) or
    > try stuff mentioned under g) in the erik's page.
    >
    > Jano
    >
    >
     
    Jayson Williams, Sep 19, 2007
    #9
  10. Jayson Williams

    David Mullet Guest

    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

    --
    Posted via http://www.ruby-forum.com/.
     
    David Mullet, Sep 20, 2007
    #10
  11. 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?

    On 9/19/07, David Mullet <> wrote:
    >
    > 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
    >
    > --
    > Posted via http://www.ruby-forum.com/.
    >
    >
     
    Jayson Williams, Sep 20, 2007
    #11
  12. Jayson Williams

    Alex Fenton Guest

    Jayson Williams 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
     
    Alex Fenton, Sep 24, 2007
    #12
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mauricio Fernández
    Replies:
    1
    Views:
    326
    Simon Strandgaard
    Aug 6, 2004
  2. Mauricio Fernández
    Replies:
    22
    Views:
    272
    Alexander Kellett
    Oct 7, 2004
  3. Premshree Pillai

    Ruby script archive

    Premshree Pillai, Jan 25, 2005, in forum: Ruby
    Replies:
    0
    Views:
    109
    Premshree Pillai
    Jan 25, 2005
  4. Dan Bikle
    Replies:
    2
    Views:
    160
    gabriele renzi
    Oct 26, 2005
  5. MoshiachNow
    Replies:
    2
    Views:
    289
    Ilya Zakharevich
    Oct 4, 2006
Loading...

Share This Page