The next part of SETUP.USA that you must customize is the part that tells Setup which files to install. This section of SETUP.USA actually performs the following steps:
1.Installs custom screen and printer fonts (if any).
2.Adds a Program Manager group for your title and adds the Viewer and title icons to the group.
3.Modifies the VIEWER.INI file for Viewer.
The section of SETUP.USA that installs screen fonts begins with the following lines:
;;*************Begin Title Specific Section***************************
;;====================================================================
;; OpenFontProgress (Message, Instructions)
;; ----------------------------------------
;; This command begins font installation...
If you don't use custom screen fonts in your title, simply delete the part of SETUP.USA from the lines shown above to the line containing the CloseFontProgress command. Then skip the next section, “Installing Printer Fonts.”
If your title uses custom fonts, you must modify the part of SETUP.USA that installs the screen fonts. The screen-font installation in SETUP.USA that you must change looks like this:
;; If your title needs to install screen fonts, load them here.
;; Otherwise, delete the 'LoadScreenFont' commands.
;;
; Modified Helv:
LoadScreenFont (<TitleSrcDir> "FONTS\MHELVB.FON") ; EGA font
LoadScreenFont (<TitleSrcDir> "FONTS\MHELVE.FON") ; VGA font
LoadScreenFont (<TitleSrcDir> "FONTS\MHELVF.FON") ; 8514/a font
Your SETUP.INF file must include a LoadScreenFont line for each screen font you install. Within the double quotes, enter the relative path of the font file on the CD-ROM. This path should begin with the subdirectory containing the fonts. In SETUP.USA, this directory is “USA\FONTS”. The “USA” node in this relative path is given by the variable <TitleSrcDir>, which contains the project source directory you specified earlier in the file. (See “Specifying Title File and Subdirectory Names,” earlier in this chapter.)
After Setup installs custom screen fonts, it must install the corresponding custom printer fonts. Currently, Viewer supports only PostScript printer fonts.
The section of SETUP.USA that installs printer fonts begins with the following lines:
;; If your title needs to install PostScript fonts, install them here.
;; For each PostScript font, duplicate the lines between "Begin
;; subroutine call" and "End subroutine call". Change the basenames
;; of the metric file and font file for each font. For each font,
;; change "Label1" both times it occurs to a unique label.
;; Otherwise, delete these lines.
For each printer font you install, you must make the following changes to SETUP.USA:
1.Specify the names of the font and metric files for the font and the paths in which you are installing those files.
2.Specify a label for the continuation line. The setup script tells SETUP.EXE to call a subroutine to perform the actual font installation, and the continuation line tells SETUP.EXE where to resume execution after it exits the subroutine.
The following sections describe the lines in SETUP.USA that perform each step. Remember that you must include these lines for each custom printer font you install.
Summary: Font Files and Directories
The lines that specify the font files and directories look like this:
;; Change the base name of the metric file.
;;
SetVariable (MetricBase, "MHELV.PFM") ; Basename of metric file (.PFM)
;; Change the base name of the font file.
;;
SetVariable (FontBase, "MHELV.PFA") ; Basename of font file (.PFA)
; Full path of metric file
SetVariable (MetricPath, <TitleSrcDir> "FONTS\" <MetricBase>)
; Full path of font file
SetVariable (FontPath, <TitleSrcDir> "FONTS\" <FontBase>)
In the first two SetVariable commands, substitute your custom font's metric-file name for “MHELV.PFM” and its font-file name for “MHELV.PFA.”
In the second two SetVariable commands, substitute the paths where you are installing font and metric files, respectively, for “FONTS\”. Don't give a full path; only give the path relative to the subdirectory with your .MVB files.
Summary: Label and Installation Subroutine
The following lines create a continuation label and call the routine that installs the font files:
;; Change the continuation label (this should be unique
;; for each font).
;;
SetVariable (Continuation, Label1) ; Set the 'Continuation' variable
Goto (subInstallPSFont) ; "Call" the subroutine
;; Change the continuation label to the one above. Thus,
;; this particular label will occur twice per installed
;; PostScript font.
;;
Label1: ; Resume execution
;; End subroutine call
Substitute any name you want for Label1 in the SetVariable command and on the line with the comment “Resume execution.” When it encounters to these lines, SETUP.EXE sets the continuation label, calls the subInstallPSFont subroutine to install fonts, and resumes execution at the line with the label “Label1:”.
Note:
To use the modified Helvetica font installed by SETUP.USA in Word for Windows, you must install the font in the Word font list. To do this, display the File menu, choose Printer Setup, select a PostScript printer, and choose OK.
After it installs custom fonts (if any), Setup creates a Program Manager group for your title. Setup uses the title name you defined at the beginning of the Setup script.
Setup fills in the information that Program Manager needs in order to display your title's icon and associates the icon with the title. If your title uses a custom icon rather than the standard Viewer icon, you must modify the following lines in SETUP.USA for your title:
AddProgmanItem (<TitleName>,
<ViewerDestDir> "VIEWER.EXE " <TitleMVB> ".MVB",
<ViewerSrcDir>
"USA\DIBS\USICO.ICO", ;; Change this to be the icon (ICO)
;; file for the title.
0)
For “USA\DIBS\USICO.ICO,” substitute the path of your title's icon file.
The filename in this example assumes your .ICO file is in the \USA\DIBS subdirectory of the Viewer directory (<ViewerDestDir>) on the CD-ROM. If the .ICO file is in a different directory, give the complete path within the set of double quotes after “.MVB”. For example, if the USICO.ICO file were in the path L:\ICONS\USICO.ICO on the CD-ROM, the lines in SETUP.INF would appear as follows:
AddProgmanItem (<TitleName>,
<ViewerDestDir> "VIEWER.EXE " <TitleMVB> ".MVB",
"L:\ICONS\USICO.ICO", ;; Change this to be the icon (ICO)
;; file for the title.
0)
Finally, Setup updates a text file named VIEWER.INI that Viewer uses internally to keep track of the different titles and search indexes installed on the users computer. The lines in SETUP.USA that you must modify appear as follows:
; Update VIEWER.INI.
.
.
.
;; For each of the other books in a multiple-book title, add
;; a VIEWER.INI section that is named after the basename of
;; that book's MVB file (which should be in the same directory
;; as the main title's MVB file).
;;
AddToProfileIni ("VIEWER.INI",
"tribes", ; Basename of the MVB file
"Path", <ViewerSrcDir> <TitleSrcDir>)
This part of SETUP.INF must include an AddToProfileIni command for each book (.MVB file) other than the main .MVB file in your title. In each AddToProfileIni command you add, substitute the .MVB filename for “tribes” in the preceding example.
As noted earlier in this chapter, the main .MVB file is the one with the same name as your title's index file. For example, the USA Tour sample title includes two .MVB files: USA.MVB and TRIBES.MVB. USA.MVB is the main .MVB file because the title's index file is named USA.IND. Thus, as shown in the preceding example, SETUP.USA has a AddToProfileIni command for the remaining .MVB file, TRIBES.MVB.
After you've made all the required changes to SETUP.USA, save it under the name SETUP.INF. Be sure to save the file as an ASCII (unformatted) file. Before running SETUP.EXE, you might want to clean up the SETUP.INF script. Much of the setup script in SETUP.USA contains annotations that begin with a tab followed by two semicolons (;;). You can remove these annotations for the SETUP.INF file you include with your title.