[wxruby-users] wxRuby & RubyScript2exe

Matthew Webb bmatthew1 at blueyonder.co.uk
Thu Mar 27 21:15:03 EDT 2008


Alex Fenton wrote:
> Matthew Webb wrote:
>   
>> I've got wxruby (1.9.5) & rubyscript2exe (0.5.3) installed & I'm using 
>> Windows Vista.
>>
>> I'm trying to use rubyscript2exe to turn one of the wxruby sample 
>> programs into an .exe.
>>
>> The sample is in the controls folder & is called controls.rb.
>>
>> I use 'rubyscript2exe controls.rb --rubyscript2exe-verbose' to 
>> "compile" it.
>>
>> But when I try to run it I get the following error:
>>
>> Bitmap file does not exist: 
>> C:\Users\Matthew\eee\eee.controls.exe.4\app/icons/list.xpm (ArgumentError)
>>     
> The problem is that the bitmap file isn't included in the bundled-up 
> package that rubyscript2exe creates and later unpacks when the .exe is run.
>
> The simple way is to manually tell rubyscript2exe to add the .xpm file 
> to the bundle. To do this, add a constant to the beginning of the file 
> with an array of files that should be included.
>
> RUBYSCRIPT2EXE.dlls = [ 'icons/list.xpm', ... ]
>
> (Or it might be RUBYSCRIPT2EXE.libs = [...]
> I can't remember and can't test it right now. See 
> http://www.erikveen.dds.nl/rubyscript2exe/#3.3.1 )
>
> A more complex but perhaps better way for bigger apps is to build the 
> .exe as normal, then distribute it and the icons packaged up as a zip, a 
> tar, or using an installer like NSIS.
>
> Then, at runtime, test if the application is running from within 
> rubyscript2exe, find out where it's installed, and load image files from 
> that location. Wx::ArtProvider can also help here. An example of this 
> approach below - see the part where it sets WEFT_SHAREDIR
>
> http://weft-qda.rubyforge.org/svn/trunk/weft-qda/weft-qda.rb
>
> alex
>
>
>
>
>
>
>
> _______________________________________________
> wxruby-users mailing list
> wxruby-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/wxruby-users
>
>
>
>   
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20080328/8e984c10/attachment.html 


More information about the wxruby-users mailing list