Running Ruby from a CD

I’m looking into a contract to develop a license manager/installation tool
for a software CD. The CD has several different tools on it and allows
the user to install and use the software for a trial period. The license
manager/installation tool has to be able to determine if it’s a trial
license or a real license and it also has to allow the user to purchase a
real license (by going online) for any or all of the products on the CD.
Oh, and it has to work with both Linux (by interacting with the rpm
manager) and Windows (by interacting with the registry).

Currently they’ve done this tool in C++ and has no gui. The customer is
talking about an upgrade of the tool and a possible gui (and possibly
using Tk for the GUI). Of course, I’m
thinking that there might be a possiblility to use Ruby for this, but the
first problem is that Ruby isn’t installed everywhere. So then I got the
idea to run Ruby directly from the CD somehow - has anyone done this sort
of thing?

Also, since the same CD has to work on both Windows or Linux, I need to
have two Ruby’s installed. How would I determine which one to run?

Phil

ptkwt@aracnet.com (Phil Tomson) writes:

I’m looking into a contract to develop a license manager/installation tool
for a software CD. The CD has several different tools on it and allows
the user to install and use the software for a trial period. The license
manager/installation tool has to be able to determine if it’s a trial
license or a real license and it also has to allow the user to purchase a
real license (by going online) for any or all of the products on the CD.
Oh, and it has to work with both Linux (by interacting with the rpm
manager) and Windows (by interacting with the registry).

Currently they’ve done this tool in C++ and has no gui. The customer is
talking about an upgrade of the tool and a possible gui (and possibly
using Tk for the GUI). Of course, I’m
thinking that there might be a possiblility to use Ruby for this, but the
first problem is that Ruby isn’t installed everywhere. So then I got the
idea to run Ruby directly from the CD somehow - has anyone done this sort
of thing?

Also, since the same CD has to work on both Windows or Linux, I need to
have two Ruby’s installed. How would I determine which one to run?

I’d just put a setup.bat and a setup.sh file on the CD, which then calls
the ruby interpreter from the CD with the appropriate .rb file.
Of course, your user has to be clever enough to figure out whether to
execute setup.bat or setup.sh :slight_smile:

kind regards
frank

···


Frank Schmitt
4SC AG phone: +49 89 700763-0
e-mail: frankNO DOT SPAMschmitt AT 4sc DOT com

In article 4ciskqmget.fsf@scxw21.4sc,

ptkwt@aracnet.com (Phil Tomson) writes:

I’m looking into a contract to develop a license manager/installation tool
for a software CD. The CD has several different tools on it and allows
the user to install and use the software for a trial period. The license
manager/installation tool has to be able to determine if it’s a trial
license or a real license and it also has to allow the user to purchase a
real license (by going online) for any or all of the products on the CD.
Oh, and it has to work with both Linux (by interacting with the rpm
manager) and Windows (by interacting with the registry).

Currently they’ve done this tool in C++ and has no gui. The customer is
talking about an upgrade of the tool and a possible gui (and possibly
using Tk for the GUI). Of course, I’m
thinking that there might be a possiblility to use Ruby for this, but the
first problem is that Ruby isn’t installed everywhere. So then I got the
idea to run Ruby directly from the CD somehow - has anyone done this sort
of thing?

Also, since the same CD has to work on both Windows or Linux, I need to
have two Ruby’s installed. How would I determine which one to run?

I’d just put a setup.bat and a setup.sh file on the CD, which then calls
the ruby interpreter from the CD with the appropriate .rb file.
Of course, your user has to be clever enough to figure out whether to
execute setup.bat or setup.sh :slight_smile:

Turns out they’ve got seperate CDs for Windows and Linux, so it’s a
non-issue.

As an experiment I burned a CD witha Ruby intallation on it and in the
root directory of the CD I made a setup.bat that looks something like:

…\bin\ruby makebat.rb #creates a bat file in %TEMP% that sets up env vars
%TEMP%setenv.bat #sets up TCL and TK env vars Ruby needs
…\bin\ruby main.rb #starts a little Ruby/TK gui

makebat.rb just creates a batch file in %TEMP% to set the RUBY_TCL_LIB and
RUBY_TK_LIB env variables.

Then I tried it on a Windows box that didn’t have either Ruby or Tk
installed on it and it worked. Looks like a viable option.

Phil

···

Frank Schmitt invalid@see-signature.info wrote:

Hi,

···

At Thu, 18 Dec 2003 12:36:55 +0900, Phil Tomson wrote:

…\bin\ruby makebat.rb #creates a bat file in %TEMP% that sets up env vars
%TEMP%setenv.bat #sets up TCL and TK env vars Ruby needs
…\bin\ruby main.rb #starts a little Ruby/TK gui

makebat.rb just creates a batch file in %TEMP% to set the RUBY_TCL_LIB and
RUBY_TK_LIB env variables.

You can set those RUBY_(TCL|TK)_DLL variables before requiring
tcltklib even in main.rb.


Nobu Nakada

In article 200312180750.hBI7oH30004713@sharui.nakada.kanuma.tochigi.jp,

···

nobu.nokada@softhome.net wrote:

Hi,

At Thu, 18 Dec 2003 12:36:55 +0900, >Phil Tomson wrote:

…\bin\ruby makebat.rb #creates a bat file in %TEMP% that sets up env vars
%TEMP%setenv.bat #sets up TCL and TK env vars Ruby needs
…\bin\ruby main.rb #starts a little Ruby/TK gui

makebat.rb just creates a batch file in %TEMP% to set the RUBY_TCL_LIB and
RUBY_TK_LIB env variables.

You can set those RUBY_(TCL|TK)_DLL variables before requiring
tcltklib even in main.rb.

Yeah, that’s true; it would be much simpler. I think I did it the other
way because I also needed
to setup some other env vars that another app needed too, but maybe I can
get by without it.

Phil