Saturday, March 10, 2007

Developing Desktop Ruby Apps for Windows

It seems that a large portion of the Ruby community is either LINUX or Mac OS-based. And Ruby's 'Killer App' is a web development framework (Ruby on Rails). So you can be forgiven for not realizing that you can use Ruby to develop solid desktop applications for Microsoft Windows, complete with a native Windows look-and-feel GUI.

Every tool has its Pros and Cons, its Fanboys and Detractors. For what it's worth, here's a brief overview of the tools I consider essential...

RUBY: One-Click Ruby Installer
The One-Click Ruby Installer will probably meet your needs for a painless Ruby installation that includes most of the Ruby libraries you'll need starting out. It includes the SciTE Text Editor (my code editor of choice) and the WIN32OLE library, essential for COM automation.

DATABASE: SQLite
SQLite is fast, light, and powerful -- and requires zero-configuration. Download the DLL file, install the sqlite-ruby gem and you're ready to deal with datasets both large and small. You can even embed the small SQLite3.DLL file in your RubyScript2Exe-compiled executable file.

GUI TOOLKIT: wxRuby
I've been using wxRuby (version 0.6) for about a year now, and am pleased with the results. My GUI needs are fairly modest (buttons, list and combo boxes, textboxes, etc.) and my user interfaces are virtually identical to those produced by Microsoft Visual Studio. For best results, be sure to de-couple your GUI code from your back-end code, to ensure optimal GUI responsiveness and the ability to easily replace GUIs in the future. Write your GUI code by hand, or use the (separate but free) wxFormBuilder tool to design your interface and export it to an XML document that wxRuby can load.

COMPILER: RubyScript2Exe
See my earlier post, Distributing Ruby Apps on Windows, for further details on this essential tool.

INSTALLER: Inno Setup
Once you have your application packaged up into an executable, you'll want to provide your users with a simple means for installing it (and perhaps other files) on their PCs, creating Start menu icons, etc. Inno Setup handles all of this, is easily configurable, and gives your Windows application a professional, polished installation package.

I hope you find the information above, and this Ruby on Windows weblog in general, to be helpful.

Thanks for stopping by!

Digg my article

6 comments:

Anonymous said...

Out of interest, have you tried vruby for the GUI layer?

http://www.threeweb.ad.jp/~nyasu/vruby/vrproject-e.html

David Mullet said...

I haven't tried vruby yet, but I plan to. I worked with Python and the wxPython GUI library before coming to Ruby, so wxRuby felt the most familiar to me.

andre said...

Nice Article,thanks for sharing

Unknown said...

Thanks for the info! How do you find wxRuby in comparison to wxPython? Have you encountered many bugs or missing features?

Anonymous said...

Check out this article, it takes an interesting approach to developing cross-platform desktop apps in Ruby..

http://blog.niqos.com/articles/2007/09/18/ruby-on-the-desktop

Anonymous said...

thank you ..
it is complete overview of developing and installation of ruby applications for windows platform..