# Mission statement: Ruby application for Windows

**URL:** <https://www.ruby-forum.com/t/mission-statement-ruby-application-for-windows/72619>\
**Category:** Ruby\
**Created:** [October 18, 2006, 10:39am UTC](https://www.ruby-forum.com/t/mission-statement-ruby-application-for-windows/72619 "2006-10-18T10:39:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Victor\_SZverokSS\_Sh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/f04885/32.png) [@Victor\_SZverokSS\_Sh](https://www.ruby-forum.com/u/Victor_SZverokSS_Sh)\
**Post date:** [October 18, 2006, 10:39am UTC](https://www.ruby-forum.com/t/mission-statement-ruby-application-for-windows/72619/1 "2006-10-18T10:39:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Victor\_SZverokSS\_Sh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/f04885/32.png) [@Victor\_SZverokSS\_Sh](https://www.ruby-forum.com/u/Victor_SZverokSS_Sh)\
**Post date:** [October 20, 2006, 7:30pm UTC](https://www.ruby-forum.com/t/mission-statement-ruby-application-for-windows/72619/2 "2006-10-20T19:30:48Z")

</div>

On 10/12/06, Victor Zverok S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> That’s all.
> 
> Sounds reasonable, ha?

So what you want is a hacked ruby interpreter that can read some stuff  
(like sources and command line arguments, possibly extra environment  
variables) from its resources. Once you get that you can pack your  
ruby script into the interpreter with a resource editor. Without  
packed arguments you could use it as a standard ruby interpreter.

That should not be too hard. But for me it is not cool enough to  
bother installing development stuff on a Windows box.

Thanks

Michal

---

<div class="post-metadata">

**Author:** ![Victor\_SZverokSS\_Sh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/f04885/32.png) [@Victor\_SZverokSS\_Sh](https://www.ruby-forum.com/u/Victor_SZverokSS_Sh)\
**Post date:** [October 21, 2006, 3:21pm UTC](https://www.ruby-forum.com/t/mission-statement-ruby-application-for-windows/72619/3 "2006-10-21T15:21:28Z")

</div>

> (like sources and command line arguments, possibly extra environment  
> variables) from its resources. Once you get that you can pack your  
> ruby script into the interpreter with a resource editor. Without  
> packed arguments you could use it as a standard ruby interpreter.

Yeah, I know. I just have no time to do it now ☹

> That should not be too hard. But for me it is not cool enough to  
> bother installing development stuff on a Windows box.

Question is: to bother WHO? I want to do some desktop utilities and put  
them  
onto my site (not for sale, but for fun). For typical Windows user it is  
a  
big difference between “just download and start the installer” and “for  
use  
this program, you must download and install Ruby (instructions) and  
those  
additional libraries (instructions)”.

> Michal

V.

---

<div class="post-metadata">

**Author:** ![Victor\_SZverokSS\_Sh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/f04885/32.png) [@Victor\_SZverokSS\_Sh](https://www.ruby-forum.com/u/Victor_SZverokSS_Sh)\
**Post date:** [October 21, 2006, 8:53pm UTC](https://www.ruby-forum.com/t/mission-statement-ruby-application-for-windows/72619/4 "2006-10-21T20:53:32Z")

</div>

Victor “Zverok” Shepelev wrote:

> ## 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…

Rubyscript2exe is the best approach to this right now. One day, there  
will be more options in Ruby for Windows programmers. Personally, I like  
rubyscript2exe rather well, but you’re right, like everything it is not  
perfect.

IMHO, Ruby has four areas that will be improved soon:

1. Performance =\> YARV will solve this.
2. Better Threads =\> YARV will solve this.
3. Unicode =\> m17n will solve this.
4. Better Native Windows Apps =\> ???

Once the Ruby Community addresses these issues, it’ll be awesome! Not  
that it isn’t awesome now. I will be happy when I can do everything in  
Ruby as easily as I can do them in Python. Personally, I enjoy using  
Ruby _much_ more than Python (it’s a much more user friendly language  
that isn’t so restrictive), but in Python I can do more things today. I  
think this will change soon.

Just my 2 cents.

Brad
