Running Ruby from a CD

P

Phil Tomson

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
 
F

Frank Schmitt

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 :)

kind regards
frank
 
P

Phil Tomson

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 :)

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
 
N

nobu.nokada

Hi,

At Thu, 18 Dec 2003 12:36:55 +0900,
Phil said:
..\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.
 
P

Phil Tomson

Hi,

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


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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top