From: ptkwt@... (Phil Tomson) Date: 2003-12-18T12:36:55+09:00 Subject: Re: Running Ruby from a CD In article <4ciskqmget.fsf@scxw21.4sc>, Frank Schmitt wrote: >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 :-) 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