From DAVIDK@ASYMETRIX.COMMon Jun 26 10:48:51 1995 Date: Mon, 26 Jun 1995 09:55:00 PDT From: David KesterThe main problem with running an application off the CD-ROM is getting the media paths setup correctly. The following information should help in this problem.Reply to: Asymetrix 'Toolbook' product discussions To: Multiple recipients of list TOOLB-L Subject: Re: making CD-ROM
Setting up an application to run off of CD-ROM requires a few more steps than setting up a program to run off the hard drive. The following outline will guide you through this process.
There are four steps in setting up an application for CD-ROM: setup the directory structure for the CD, finish development, package the media, and create a dynamic reference to the CD-ROM drive in the application.
to handle createCDMediaPath
linkDLL sysToolBookDirectory & "tb30DOS.DLL"
STRING getCDDriveList()
STRING getFileOnlyList(STRING,STRING,STRING)
end
get setErrorMode(1)
allCDDrives = getCDDriveList()
cdDrive = checkCDDrive(allCDDrives)
step i from 1 to 3 -- 3 Tries.
if cdDrive = -1 -- Error, file not found.
request "The CD is required for this " \
&"program. Place it in the CD-ROM " \
&"drive now then press OK." \
with "OK" or "Quit"
if It = "Quit"
send exit
get setErrorMode(0)
break to system
end
pause 5 seconds -- Give CD-ROM time to \
-- read CD.
cdDrive = checkCDDrive(allCDDrives)
if i = 3 and cdDrive = -1
request "Unable to locate CD, " \
&"exiting."
get setErrorMode(0)
send exit
end
end
end
get setErrorMode(0)
-- The following line should be edited to reflect the
-- directory structure on your CD-ROM.
if cdDrive <> -1 -- No error, file found.
CDMediaPath of this book = cdDrive & \
":\mtb30\samples;" \
& cdDrive & ":\Video"
-- The following line is optional. This is to guarantee
-- that if a clip had HDMediaPath set instead of CDMediaPath
-- that it will be found on the CD ROM or the same path
-- structure that you defined for the CDMediaPath.
HDMediaPath of this book = CDMediaPath of this book
end
end
to get checkCDDrive allCDDrives
step i from 1 to textLineCount(allCDDrives)
currDrive = textLine i of allCDDrives
-- The following lines check for a specific file on
-- the CD-ROM. Change the filename and directory to
-- reflect your application.
get getFileOnlyList(currDrive \
& ":\mtb30\samples\*.tbk", "", "")
if It contains "cbt1" -- Change filename here.
return currDrive
end
end
return -1 -- Error, file not found.
end
to handle enterApplication
linkDLL "Kernel"
INT SetErrorMode(INT)
end
--Your other code can go here.
--Add the following line to the enterApplication handler.
send createCDMediaPath
--Your other code can go here.
end
The steps to building a book to run the media off the CD-ROM are
Dave Kester
During development, you should set both mmSearchHD and mmSearchCD of all of your clips to (BookPath). This way the media can be found during development and after it is pressed to CD. This of course assumes that you use the same directory structure for both.
While developing MTB CD apps, I generally have all of the media prepared prior to development. Then I burn a CD with just the media on it to save room on my hard drive and to guage performance. I then add the actual path to my CD drive to CDMediaPath. Then, before I press, I set CDMediaPath to only include (BookPath).
My 2 cents worth.
Tim Pearson, Senior Software Designer Kolibri Enterprises timp@halcyon.com / (206) 883-0697 / FAX: 883-1305Revised 10/25/95