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 -- Posted via http://www.ruby-forum.com/.
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" On 2/14/06, Joerg Diekmann <joergd@pobox.com> wrote:> 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 > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
On 2/14/06, Joerg Diekmann <joergd@pobox.com> wrote:> 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.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
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 ... :-) Ian Harding 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"-- Posted via http://www.ruby-forum.com/.
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 Harding 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"-- Posted via http://www.ruby-forum.com/.
> > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060214/fe20a7b4/attachment.html
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. On 2/14/06, Joerg Diekmann <joergd@pobox.com> wrote:> 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 ... :-) > > > Ian Harding 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" > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Ah right ok. Maybe it was done in the ini.rb file that tar2rubyscript uses ... Ian Harding 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.-- Posted via http://www.ruby-forum.com/.