Overview

The process for building a multi-book title is slightly different from the process for building a single-book title.

·To build a multi-book Viewer title:

1.Set up a directory structure appropriate for your title.

2.Create a BAG.INI file for the title.

3.Create a project (.MVP) file for each book in the title.

4.Build each .MVB file that will appear in the title.

5.Create the .IND file for all of the .MVB files in the title.

The following sections examine each of these steps in more detail.

Setting Up Directories

First, create a directory structure to fit the structure of your title. The following illustration shows one possible structure:

This title consists of three .MVB files: DICT.MVB, ENCYCL.MVB, and THES.MVB. All of these titles share the DICT.IND index file. (The index file must have the same name as one of the .MVB files in the title.)

As shown in the illustration, the WRITGUID project directory is created as a subdirectory of the directory where you installed Viewer. The WRITGUID subdirectory contains the three .MVP files for the three books in the title. You will also create a single BAG.INI file for the entire project and place this file in the WRITGUID directory.

WRITGUID also has a subdirectory for each book in the title. Each book sub-directory, in turn, has four subdirectories for the different file types used in the book: TEXT for topic (.RTF) files, BITMAPS for bitmap (.BMP, .DIB, and .SHG) files, SOUNDS for sound (.WAV) files, and ANIMAT for animation (.MMM) files.

The remainder of this section assumes you've created topic and multimedia files and put them in the appropriate subdirectories for each book.

Note that, for this sample, references to multimedia files in the topic files must include a path relative to the project directory—not the directory for the individual book. For example, if you have a file named BACH.WAV in the \WRITGUID\ENCYCL\WAV directory, and you want to put that file in an embedded audio window, the filename would appear as shown in the following example:

{ewl mvaudio, ViewerAudio, encycl.wav}

Building a BAG.INI File

Once you've set up the directory structure for a multi-book title, you can create the BAG.INI file for the title. The BAG.INI file is required.

The following is a sample BAG.INI file for the title in the previous illustration:

[bag.ini]
groupcount=3
group1=dict
group2=encycl
group3=thes

[dict]
Indexfile=dict.ind
Title=Microsoft Dictionary
Near=5

[encycl]
Indexfile=dict.ind
Title=Microsoft Encyclopedia

[thes]
Indexfile=dict.ind
Title=Microsoft Thesaurus

Summary: [bag.ini] Section

As in the single-book example, the [bag.ini] section specifies information for the entire title. It includes the following information:

The number of sections in the file, which is also the number of books in the title (groupcount). The sample has three books, so groupcount is 3.

The names of the sections for individual books later in the file. Group1 gives the section name for the dictionary (“dict”), group2 gives the section name for the encyclopedia (“encycl”), and group3 gives the section name for the thesaurus (“thes”).

Summary: Book Sections

The sections for individual books ([dict], [encycl], and [thes]) follow the [bag.ini] section. The individual book sections give the same information as in the single-book example:

The name of the search index file (Indexfile) for the book. The index file is DICT.IND for all three books. (As noted earlier, the index must have the same name as one of the books in the title.)

The book title (Title). The title for the [dict] section is “Microsoft Dictionary,” for the [encycl] section is “Microsoft Encyclopedia,” and for the [thes] section is “Microsoft Thesaurus.” These titles are used in dialog boxes for the Search command button. Titles should be a maximum of 40 characters long.

The [dict] section also includes a Near value for the title. This value is used for the NEAR operator in search queries. In this title, NEAR is 5. (Omit this entry to use the default value of 8 for NEAR.) The Near entry goes in the [dict] section because the title's index file is named DICT.IND. In general, Near entries go in the BAG.INI section with the same name as the index file.

Creating Project Files for Each Book

Once you've created the BAG.INI file, you can create a project file for each book in the title. As shown in the previous illustration, you create all project files in the WRITGUID directory—the main directory for the title.

Summary: [OPTIONS] Section

To ensure that the build program can find all the files it needs, the ROOT and BMROOT options in each project file must specify paths relative to the project directory. For example, in DICT.MVP, these options would look like this:

[OPTIONS]
ROOT=C:\VIEWER\WRITGUID\DICT
BMROOT=.\DICT\BITMAPS

Notice the following two points:

The ROOT option gives a full path to specify the root directory for files in DICT.MVB. This root directory is the DICT subdirectory of the project directory \VIEWER\WRITGUID.

The BMROOT option gives the bitmap root for DICT.MVB relative to the project directory \VIEWER\WRITGUID. The full path for the bitmap root would be \VIEWER\WRITGUID\DICT\BITMAPS.

Summary: [FILES] Section

Similarly, the relative paths in the [FILES] section of each project file must refer to the project directory. For example, if the topic files for the Microsoft Dictionary were named TOPICS_A.RTF, TOPICS_B.RTF, and so on, the [FILES] section of DICT.MVP would look like this:

[FILES]
.\TEXT\TOPICS_A.RTF
.\TEXT\TOPICS_B.RTF
.
.
.

Summary: [BAGGAGE] Section

Finally, you must insert a reference to the BAG.INI file in the [BAGGAGE] section of each project file. If you specified a ROOT option in the [OPTIONS] section, give a full path to BAG.INI, as shown in the following example:

[BAGGAGE]
c:\viewer\writguid\bag.ini

Building Individual Books

If you set up your project files as described in the previous section, you should be able to build each book just as you would for a single-book title. Simply change to the project directory and enter the MVC command for the book you're building.

For example, to build DICT.MVB, you would do the following:

1.Change to the \VIEWER\WRITGUID project directory using the following command:

cd \viewer\writguid

2.Enter an MVC command to build the book:

mvc dict

Repeat this process for each of the three .MVP files in the project. All the .MVB files you create will end up in the project directory (in this example, in \VIEWER\WRITGUID).

Building the Index

Once you've built .MVB files for all of the books in the title, you can create the index file for the title. You use the BUILDDOC command with the /M option to create the index.

As described earlier, the index file for the title in the example is named DICT.IND. To create this index file, you must enter the following BUILDDOC command:

builddoc /m dict

The /m option is not case-sensitive, so you can enter it as /M if you wish.