Hello,
Currently it is not easy to use rubyscript2exe to make an EXE
containing a ruby-gtk2 application on win32.
on the ruby-gnome2 site, there is a HOWTO:
http://ruby-gnome2.sourceforge.jp/hiki.cgi?tips_rubyscript2exe
But it is really complicated, requires touching your ruby directory,
your ruby application, and personally I didn’t succeed in making it
work. I wanted to update that page, adding a second solution I managed
to make work. Here is the text that I wrote for the Hiki (before I
realised I need a login to write on it):
== rubyscript2exe on Windows, solution 2
Another solution is to copy all the needed files inside the temporary
directory created by rubyscript2exe, each time the application starts.
You put all the needed GTK files and folders in a subfolder of your
source code, and copy those files in the rubyscript2exe directory at
startup. That way, you don’t have to touch your ruby installation or
make it possible to run your ruby program from any folder.
Let’s create a “run_dep” folder under the folder where you have the
source code of your application.
In that folder, copy the etc/, lib/ and share/ from your GTK
installation. The GTK installation is in c:\gtk or C:\Program
Files\Common Files\GTK\2.0. You can safely remove the “doc” and
“gtk-doc” subfolders of the “share”, to save some space.
In share\locale, you can remove the locales you don’t need if you want,
to save more space (locales take ~20Mb). You can remove all the contents
of the share\locale folder if you want, the english/US is always
shipped.
For me, I could also remove *.lib in lib (10Mb), and lib\locale (15Mb).
Then, add the following lines at the start of your main .rb file:
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.
Regenerate your application, and run the exe… it should work now!
In the end, to ship my application I need 6Mb exe and 1.26Mb “run_dep”,
plus the glade files. And it seems no GTK installation is needed on the
target computer!
If someone thinks it's a useful addtion to the Hiki, could someone
add it (or give me a password)? Thanks!
emmanuel
Using Tomcat but need to do more? Need to support web services,
security?
Get stuff done quickly with pre-integrated technology to make your job
easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642