Launching a standalone Rails app


#1

Hi,

I’ve developed a standalone Rails app - using tar2rubyscript and
rubyscript2exe. The users aren’t going to understand that the’ll need to
open the browser and go to 127.0.0.1:3000 to view the app, after running
the exe.

I am wondering whether other people have tackled this problem in the
past, and how they went about solving it.

One way would be to write a ruby script to run the exe … parse the
results and once WEBrick has started off launch the default browser with
127.0.0.1:3000.
This would have to be multi-threaded though … not sure if this is
possible or not, and whether I can run shell commands from within ruby
(on XP)

Another solution would be to write something similar in C#. But that
would involve VisualStudio.

Or - a low-tech solution, run the exe, then dbl-click a batchfile that
starts up the default browser to the right addresss. So, a two step
process.

Anybody handled this situation before?

Thanks
Joerg


#2

I have used a similar program that popped up a window when executed
that had a single button on it saying something to the effect of “The
application is running and can be accessed at http://127.0.0.1:3000.
Click here to open it in your default browser”


#3

On 2/14/06, Joerg D. removed_email_address@domain.invalid wrote:

One way would be to write a ruby script to run the exe … parse the
starts up the default browser to the right addresss. So, a two step
process.

You could check out the NSIS - http://nsis.sourceforge.net/Main_Page

Create an installer and have it create shortcuts to
http://localhost:3000/. You might even be able to get it to find an
unused port.

Tony


#4

And that same program first launched the exe, and then the popup? Did
you only launch the popup once WEBrick was running? Did you parse the
WEBrick output to figure out once it had started? Did you use Ruby for
all this? Thanks for your help … :slight_smile:

Ian H. wrote:

I have used a similar program that popped up a window when executed
that had a single button on it saying something to the effect of “The
application is running and can be accessed at http://127.0.0.1:3000.
Click here to open it in your default browser”


#5

Ok got the installer working fine.
It’s just that ‘one-click’ solution when starting up the app (running
the exe, and launching the browser).

What libraries would I need to look at in Ruby to write this?

Ian H. wrote:

I have used a similar program that popped up a window when executed
that had a single button on it saying something to the effect of “The
application is running and can be accessed at http://127.0.0.1:3000.
Click here to open it in your default browser”


#6

I didn’t do anything, I was just a user. I doubleclicked on the .exe,
and the server started, and the dialog appeared. I could then either
use the supplied button, or open my own browser to access it. Closing
the dialog box killed the server. It was AOLServer in a starkit
package.


#7

Ah right ok.

Maybe it was done in the ini.rb file that tar2rubyscript uses …

Ian H. wrote:

I didn’t do anything, I was just a user. I doubleclicked on the .exe,
and the server started, and the dialog appeared. I could then either
use the supplied button, or open my own browser to access it. Closing
the dialog box killed the server. It was AOLServer in a starkit
package.


#8

One way would be to write a ruby script to run the exe … parse the
results and once WEBrick has started off launch the default browser with
127.0.0.1:3000.

Your exe is a ruby script compiled to exe isn’t it ? Could it fork the
explorer.exe process with the good url ? (just an idea)

HTH

Thibaut