[wxruby-users] wxRuby & RubyScript2exe

Alex Fenton alex at pressure.to
Fri Mar 28 02:47:30 EDT 2008


Matthew Webb wrote:
> It would seem that the problem isn't 'list.xpm' not loading but 
> 'mondrian.ico' not loading.
>
> I've added the following two lines to the beginning of 'controls.rb'...
>
> require "rubyscript2exe"
> RUBYSCRIPT2EXE.bin = ["mondrian.ico"]
>
> When I run the .exe I get this error...
>
> Icon file does not exist: 
> C:\Users\Matthew\eee\eee.controls.exe.2\app/mondrian.ico (ArgumentError)
>
> It's really strange because 'mondrian.ico' is in the same folder as 
> 'Controls.rb' so I'd expect it to be found.
You've put it in the 'bin' dir of the package, but controls.rb is in the 
'app' dir. controls.rb loads the icon file like this:

Icon.new( File.join( File.dirname(__FILE__), "mondrian.ico"),
                  Wx::BITMAP_TYPE_ICO )

i.e. relative to its position. So it looks in the app dir, doesn't find 
it and gives the error you saw. You'll either need to put the icon file 
somewhere different in the bundle, or change that code.

You might find it helpful to unpack the bundle rubyscript2exe creates to 
see the directory structure. See the page for more details, but 
basically run it with the argument ---eee-justextract

alex



More information about the wxruby-users mailing list