You are here: > Home > Support > ToolBook Knowledge Base

Knowledge Base

Printer Friendly
Developing an application to run exclusively from a CD.
Setting up an Multimedia ToolBook application to run totally from a CD-ROM requires a few more steps than preparing an application to run from a hard drive. The following outline will guide you through this process.

There are five steps to prepare an application for CD-ROM: set up the
directory structure for the CD, finish development, package the media, create a
reference to the CD-ROM drive with script, and save the book as an EXE file.

1. In the first stages of development you can eliminate some future problems by setting up the anticipated final directory structure for the application. Once you decide on the directory structure, develop your application with this directory structure off the hard drive's root directory.

2. Develop and finish your application. During this process, be sure to keep
backup copies of your book(s). Once you are sure the application works on the
development machines and has been thoroughly tested, proceed to the next step.

3. Package the media. From the Tools Menu choose Package Media. From the Package Media dialog box choose Media Paths. In the Set Media Paths dialog box set the media paths to none for both the hard disk and CD-ROM by using the Remove Path button. Click the OK button. This will return you to the Media Packager dialog box. Choose Start.

At this point either the Choose Package Option dialog box or the Find Media
File dialog box will be displayed. The Find Media File dialog will be displayed when the system can't find the file specified in the Clip Manager. In this case, use the Find Media File dialog box to find the file and select OK. The Choose Package Option dialog box will tell you that the file is in neither the CD nor HD media paths. Always click the Add button. When asked which media path to add the path of the file to select CD-ROM check box and deselect the hard drive check box.

At this point the media is packaged. Save the book and test it. If testing
fails use a backup copy of the book file and repeat step two.

4. You need to create the dynamic reference to the CD drive. In other words,
when the book first opens, it creates a CDMediaPath with the correct drive
letters. In this case, the correct drive letters will all refer to the drive
the main book is on. Add the following handlers to the book script.

to handle createCDMediaPath
cdDriveLetter = driveWithThisBook()

-- The following lines should be edited to reflect the
-- directory structure on your CD-ROM.

CDMediaPath of this book = \
cdDriveLetter & ":\mtb30\samples;" & \
cdDriveLetter & ":\Video"
end


to get driveWithThisBook
-- the name of a book is the full drive, path, and
-- filename of the book.
return first character of name of this book
end

to handle enterApplication
--Your other code can go here.

send createCDMediaPath

-- This optional line below is to guarantee that if a clip had HDMediaPath
-- set instead of CDMediaPath, 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

--Your other code can go here.
end

5. Save the book as an EXE file and put all the runtime files in the same
directory as your EXE file. Books saved as an EXE don't need the ToolBook runtime files installed on the hard drive. They will launch if the runtime is in the same directory as your EXE book. To save a book as an EXE, choose Save As EXE from the File menu. All the necessary runtime files are documented in FILELIST.WRI file that can be found in the ToolBook directory.


The steps to building a book to run completely from a CD-ROM are:

1. Set up the future CD-ROM directory structure on the hard drive prior to
beginning work.
2. Get the application working on the development machine.
3. Package the media.
4. Set the book script to dynamically build the CDMediaPath of the book.
5. Save the book as EXE and put the ToolBook runtime files in its directory.

At this point, everything can be put on the CD-ROM for testing.


OPENSCRIPT NOTICE
The OpenScript programming examples found in many articles may need modification in order to work in ToolBook 9.0 or higher, particularly if the article was written for an older version of ToolBook. To learn more, click here.

  Provide Anonymous Feedback About This Article