CD-ROM Mastering Checklist Revised

From DAVIDK@ASYMETRIX.COMMon Jun 26 10:48:51 1995
Date: Mon, 26 Jun 1995 09:55:00 PDT
From: David Kester 
Reply to: Asymetrix 'Toolbook' product discussions
     
To: Multiple recipients of list TOOLB-L 
Subject: Re: making CD-ROM
The 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.

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.

  1. Although not required, in the first stages of development you can eliminate some future problems by setting up the final directory structure for the application .
    1. Decide on the directory structure for the CD-ROM during the specification phase of the project.
    2. Setup that same directory structure off the root drive of the development machines hard drive.
  2. Finish your application without any modifications to the CDMediaPath and HDMediaPath properties.
    1. Make sure the application works on the development machines.
    2. Make a backup of the book files.
  3. Package the media.
    1. From the Tools Menu choose Package Media.
    2. From the Package Media Dialog choose Media Paths.
    3. From the set Media Paths dialog box set the Media Paths to for both the HARD DISK and CD-ROM by using the Remove Path button.
    4. Click the OK button. This will return you to the Media Packager Dialog box.
    5. Choose START.
    6. At this point either the Choose Package Option dialog box or the Find Media File dialog box will be displayed.
    7. The Find Media File 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.
      1. The Choose Package Option dialog box will tell you that the file is in neither the CD nor HD media paths.
        1. Always click the ADD button.
        2. When asked which media path to add the path of the file to select CD-ROM check box and de-select the hard drive check box.
      2. At this point the media is packaged.
      3. Save the book and test it now.
        1. If the testing fails go to the backup of the backup copy of the book file and repeat step 2.
  4. You need to create the dynamic reference to the CD drive. To do this, place the following handlers into the book script:
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

  1. Setup 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.
At this point the media will need to be put on the CD-ROM in order to test the application on the hard drive.

Dave Kester


It bears mentioning that David's method is really overkill if both the book and the media are on the CD. I'd recommend skipping David's 4th step altogether and just set CDMediaPath to (BookPath). Dynamically setting it defeats the purpose of this feature. I've shipped/prepared many CD's using this successfully. His code is necessary if the book is on the hard-drive and the media is on the CD.

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-1305
Revised 10/25/95
brianp@u.washington.edu (Brian Parkhurst)
University of Washington
Box 357260
Seattle, WA 98195-7260
206/543-9175