How to do windows applications?

“Simon Strandgaard” qj5nd7l02@sneakemail.com schrieb im Newsbeitrag
news:pan.2003.09.18.20.36.56.418954@sneakemail.com

I am going to write a ruby application for a dog-school.
They train dogs, do statistics of the dogs, etc…
I use unix myself, but the application has to be available
on offline windows machines (so an online webservice doesn’t work).

I would prefer a platform independent solution; bundling
apache+mod_ruby+my future dog application. But I see many loose ends:
How to bundle these things together, so it will be
installed as one application ?

Why do you want to use a web server if the machines are offline anyway?
Why not just create a Ruby/Tk (or other GUI toolkit) application? If you
have a local network and need a centralized server then Ruby/Tk with DRB
might be an option, too. If you want to go for a web application IMHO
bundling is not so important since you will install it only on one
machine.

Question1: What modules do you use for windows applications ?

For web apps there’s plenty of template frameworks out there, eruby,
amrita, …

Question2: Any hints to a unix-man, which has to write a windows
application?

I’d say do it the same way as Unix applications: write it portable. Use
such things as File.join, File.basename, File.dirname, File::SEPARATOR,
File::PATH_SEPARATOR etc.

Cheers

robert

Simon Strandgaard wrote:

Why not just create a Ruby/Tk (or other GUI toolkit) application?

Question1: What modules do you use for windows applications ?

For web apps there’s plenty of template frameworks out there, eruby,
amrita, …

This doesn’t answer the question, what ruby-modules/frameworks do you use
for composing windows application ? How do you install it so it feels
like a typical windows application (installshield?) ?

I use a) whatever I need and b) what’s available. (That’s of course completely indepentent of the OS
anyway…)
I personally, don’t think a special kind of installer makes an application feel more like a typical
windows app. Many people don’t like that installer stuff anyway, and prefer to just place the
file(s) in a directory and run the program. That depends heavily on your customers “culture” and
back ground, of course.

Do you think about wrapping the app in something like exerb to produce a windows executable?
Then you might think about wrapping that into some installer in turn…
But I wouldn’t like it delivered that way. But I’m not a dog trainer.

Also the shebang concept does’nt work on windows, what do I have to do if
I want to make a ruby script executable ?

Just run it - like in “ruby killerapp”.
If the system’s set up appropriately it should recognize the .rb prefix and run the Ruby interpreter
automatically. What I think is that “How to fire up the program” is likely the most OS oriented
question you should encounter (part from trying “fork” and things on a Windows box).

The main part of the app however should be largely unrelated to the underlying OS - especially if
you do it in Ruby anyway.

Cheers,

Stephan

···

On Fri, 19 Sep 2003 11:24:55 +0200, Robert Klemme wrote:

I think you may set some stuff in WinRegistry to get this same effect,
but I can’t remember :frowning:
BTW, imo, it is far better to distribute a single installer with a
batch file or exe file that just execute ‘ruby myscript.rb’.
You should take a look at how FreeRIDE is distributed, maybe…

···

il Sat, 20 Sep 2003 13:30:24 +0200, Simon Strandgaard qj5nd7l02@sneakemail.com ha scritto::

Also the shebang concept does’nt work on windows, what do I have to do if
I want to make a ruby script executable ?

gabriele renzi wrote:

Also the shebang concept does’nt work on windows, what do I have to do if
I want to make a ruby script executable ?

I think you may set some stuff in WinRegistry to get this same effect,
but I can’t remember :frowning:
BTW, imo, it is far better to distribute a single installer with a
batch file or exe file that just execute ‘ruby myscript.rb’.
You should take a look at how FreeRIDE is distributed, maybe…

On Windows, FreeRIDE uses the NSIS installer:

NSIS Wiki

Curt

The PATHEXT system environment variable has a list of “executable”
extensions. You need also to set-up “Open with” for .rb and .rbw files
in “Folder Options\File Types” or unzip and merge the attachment into the
registry.

Yura.

rb.zip (449 Bytes)

···

-----Original Message-----
From: gabriele renzi [mailto:surrender_it@rc1.vip.ukl.yahoo.com]
Sent: September 20, 2003 13:24

il Sat, 20 Sep 2003 13:30:24 +0200, Simon Strandgaard > qj5nd7l02@sneakemail.com ha scritto::

Also the shebang concept does’nt work on windows, what do I have to do if
I want to make a ruby script executable ?

I think you may set some stuff in WinRegistry to get this same effect,
but I can’t remember :frowning: