<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Jay McGavren wrote:
<blockquote
cite="mid:839490bc0803281228g27ac6cd5j93c31954bb4c9f39@mail.gmail.com"
type="cite">
<pre wrap="">Matthew Webb wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Bitmap file does not exist:
C:\Users\Matthew\eee\eee.controls.exe.4\app/icons/list.xpm
(ArgumentError)
Do you have any ideas how I could solve this problem?
</pre>
</blockquote>
<pre wrap=""><!---->
The problem is that this script depends on an external file, which
rubyscript2exe doesn't include in the .exe (and therefore not in the
eee temp folder). You'll need to employ a little cleverness to
include the resource with the executable.
This page talks about including library files for another GUI
framework in the .exe, and should be adaptable for including resource
files:
<a class="moz-txt-link-freetext" href="http://ruby-gnome2.sourceforge.jp/hiki.cgi?tips_rubyscript2exe">http://ruby-gnome2.sourceforge.jp/hiki.cgi?tips_rubyscript2exe</a>
</pre>
<blockquote type="cite">
<pre wrap="">require 'rubyscript2exe'
require 'fileutils'
require 'pathname'
p0 = Pathname.new(RUBYSCRIPT2EXE.appdir)
root_runtime = p0.parent.to_s
begin
FileUtils.cp_r('run_dep/.', root_runtime)
rescue
end
Those lines copy all the files & folders inside the
"run_dep" folder to the folder where rubyscript2exe will
extract your application. The begin/rescue is needed
because that fails when you run your application the first
time in rubyscript2exe, to create the .exe.
</pre>
</blockquote>
<pre wrap=""><!---->
You'll of course need to modify the path referenced in the script such
that it points to the temp location that the resource gets
decompressed to.
BTW, overall wxRuby works *beautifully* with rubyscript2exe, which is
one of my favorite features about it.
-Jay McGavren
_______________________________________________
wxruby-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:wxruby-users@rubyforge.org">wxruby-users@rubyforge.org</a>
<a class="moz-txt-link-freetext" href="http://rubyforge.org/mailman/listinfo/wxruby-users">http://rubyforge.org/mailman/listinfo/wxruby-users</a>
</pre>
</blockquote>
Thanks for the advice, I placed the following code at the start of the
program...<br>
<br>
require 'rubyscript2exe'<br>
require 'fileutils'<br>
require 'pathname'<br>
<br>
p0 = Pathname.new(RUBYSCRIPT2EXE.appdir)<br>
root_runtime = p0.parent.to_s<br>
begin<br>
FileUtils.cp_r('run_dep/.', root_runtime)<br>
rescue<br>
end<br>
<br>
I changed this line from...<br>
<br>
icon_file = File.join( File.dirname(__FILE__), "mondrian.png")<br>
<br>
to...<br>
<br>
icon_file = File.join( File.dirname(RUBYSCRIPT2EXE.appdir),
"mondrian.png")<br>
<br>
Then I created a folder called 'run_dep' where the script was located
& I placed the icons in that folder.<br>
<br>
The script was "compiled" with 'rubyscript2exe minimal.rb
--rubyscript2exe-rubyw'<br>
<br>
When I executed it the icons loaded & the program worked.<br>
</body>
</html>