Victor 'Zverok' Shepelev
10/12/2006 8:06:00 PM
Hi all.
The following text is something like "what I'd want to see". I'm going to do
this by myself... I'm going... some time.
So, if somebody would be impressed enough to do this by himself, I would say
no word against.
Goal
----
Obtain Windows executable (.exe) file from my Ruby script. I mean not to
pack all-all-all files and libraries into one huge file, but something like:
My-cool-app.exe
Lib/
*.so
Doc/
*.html
...and so on...
Why?
----
Not for obfuscation purposes.
Just to deploy my application to other computers without Ruby installed.
Why not .bat?
-------------
Of course, I can deploy ruby.exe, all *.so's, my-cool-app.rb and run.bat
with command "ruby my-cool-app.rb".
Bu I want .exe just for neatness. For Windows users only .exe programs are
"first-class" ones, when batch scripts (.bat or .cmd) looks like
"programmer's hack".
Why not RubyScript2Exe?
-----------------------
As far as I undrestand, .exe files created by RubyScript2Exe, are
dynamically unpacked to temporary folders, the way I personally dislike
(there are many possible problems).
OK, how?
--------
Suppose we have my-cool-app.rb, which uses some-library.rb and
some-other-library.so
Desired result would be:
My-cool-app.exe
Lib/
msvcr71-ruby19.dll <-- or other DLL for other rubies
some-other-library.so
Here my-cool-app.exe is ruby interperter + all *.rb files IN RESOURCES.
main() function inside my-cool-app.exe extracts my-cool-app.rb text from
resources and gives it to interpreter; also Kernel.require modified so that
libraries from exe resources can be require'd.
That's all.
Sounds reasonable, ha?
Thanks. And sorry for my English.
v.