home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Jazz - A Multimedia History
/
JAZZ.BIN
/
setup.inf
< prev
next >
Wrap
Text File
|
1992-11-05
|
48KB
|
1,232 lines
;;*************Begin Title Specific Section***************************
;;
;; SetVariable (Variable, String)
;; ------------------------------
;; This command sets the variable named 'Variable' to the string
;; 'String'.
;;
;; Change this variable to be the name of the title.
;;
SetVariable (TitleName, "Jazz: A Multimedia History") ; Name of the title
;; Change this variable to be the basename of the title's MVB
;; file (i.e. the name of the MVB file without the .MVB
;; extension).
;;
SetVariable (TitleMVB, "JAZZ") ; Basename of the MVB file
;; Change this variable to be the subdirectory of the title
;; on the CD-ROM (i.e. where the MVB file is located). This
;; subdirectory will be in the Viewer directory on the CD-ROM,
;; where VIEWER.EXE and SETUP.EXE are located. Do not specify
;; the complete path for this subdirectory.
;;
SetVariable (TitleSrcDir, "\JAZZ\") ; Source subdirectory of the title
;;***************End Title Specific Section***************************
;;
;; GetCurPath (Variable)
;; ---------------------
;; This command sets the variable 'Variable' to the current path.
;; This is the full path of the directory in which SETUP.EXE was
;; started. A directory name ends in a backslash.
;;
GetCurPath (ViewerSrcDir) ; Source directory of the Viewer
SetVariable (ViewerSize, 1 000 000) ; Size of the Viewer files that will
; be copied over (measured in bytes)
SetVariable (ViewerDestDir, "C:\VIEWER\") ; Destination directory for
; the Viewer. Set default
; here.
;;
;; WindowTitle (Title)
;; -------------------
;; This command sets the title bar of all subsequent dialog windows to
;; the string 'Title'. The title string must be limited to 127
;; characters. The title bar can be changed before the first dialog
;; window is shown or at any later time using this command. By
;; default, the title for all dialog windows is "Setup".
;;
; Set the title of all dialog windows.
;
WindowTitle (<TitleName> " Setup")
; Set the instruction text used in the initial instructions window.
; Add Help instructions if the file SETUP.HLP exists.
;
SetVariable (InitialInstructions,
"Click on {\b OK} or press {\b Enter} to continue. "
"To abort the setup, click on the {\b Exit} button at the "
"bottom right corner of the screen, or press {\b F3}. ")
;;
;; IfFileExistsGoto (FileName, Label)
;; ----------------------------------
;; This command causes execution to jump to label 'Label' if the
;; specified file exists. This command can be used while the copy
;; progress bar is up, but if you do so then you should not check if a
;; file exists if that file has been created between the
;; 'OpenCopyProgress' and the 'IfFileExistsGoto'. The reason for this
;; is that 'OpenCopyProgress' will first step through all the copy and
;; branching commands until the 'CloseCopyProgress' command without
;; actually copying any files. This is done in order to find the
;; range for the copy progress bar. The 'IfFileExistsGoto' command
;; is typically used to see if you are reinstalling files.
;;
IfFileExistsGoto ("SETUP.HLP", AddHelpInstructions)
;;
;; Goto (Label)
;; ------------
;; This command will unconditionally cause execution to branch to the
;; label 'Label'.
;;
Goto (DisplayInitialMessage)
AddHelpInstructions:
SetVariable (InitialInstructions,
<InitialInstructions> "You can always obtain help by "
"clicking on the {\b Help} button or pressing {\b F1}. ")
;;
;; DisplayMessage (Text, Instructions)
;; -----------------------------------
;; This command displays the message 'Text' in a dialog box and the
;; instruction text 'Instructions' in the instructions window.
;; A single "OK" default push button at the bottom center of the
;; dialog is used to resume.
;;
; Display the initial message.
;
DisplayInitialMessage:
DisplayMessage (
"
This Setup program will install:
" <TitleName> "
and the Multimedia Viewer.
You will be prompted for the location for the
Multimedia Viewer. This will require about 1
Megabyte of disk space.",
<InitialInstructions>)
;;
;; GetFromWinIni (Variable, Section, Name, Default)
;; ------------------------------------------------
;; This command reads the WIN.INI file entry 'Name' under the section
;; 'Section' and sets the variable 'Variable' to the result. If the
;; specified section or entry were not found, then the specified
;; variable is set to the string 'Default'.
;;
; Determine if the Viewer has been installed before.
; If the WIN.INI file contains information on where the Viewer directory
; is located, then make that the default path to install the Viewer.
;
GetFromWinIni (ViewerDestDirTemp,
"Multimedia Viewer", "ViewerPath", "Undefined")
;;
;; IfEqualGoto (String1, String2, Label)
;; -------------------------------------
;; This command will do a case insensitive compare on the strings
;; 'String1' and 'String2' and branch to label 'Label' if they match.
;;
IfEqualGoto (<ViewerDestDirTemp>, "Undefined", PromptViewerDestDir)
SetVariable (ViewerDestDir, <ViewerDestDirTemp>)
AskAgain:
;;
;; PromptPath (Variable, Default, Message, ValidInstructions,
;; InvalidInstructions)
;; ----------------------------------------------------------
;; This command causes a dialog box to appear that prompts the user
;; for a path. The path is a directory that the setup script can use
;; to copy into, make, etc. The message 'Message' is shown at the top
;; of the dialog, and the default path is 'Default'. When PromptPath
;; is invoked, Setup checks that the default specified in the INF file
;; is a valid path on the user's machine.
;;
;; The PromptPath dialog can be in two states. Whenever the edit box
;; contains a valid path, the OK button is available and the
;; 'ValidInstructions' text is displayed in the instruction window.
;; Whenever the edit box contains an invalid path, the OK button is
;; grayed out and the 'InvalidInstructions' text is displayed in the
;; instruction window.
;;
;; All characters typed in the path edit box appear as upper case no
;; matter what the keyboard shift state is in. When the OK button is
;; enabled, the user can click on the OK button or press Enter, upon
;; which the path is placed in the variable 'Variable'. Before
;; returning the path however, PromptPath will translate all forward
;; slashes to back slashes and ensure that the path ends in a
;; back slash.
;;
; Ask for where the Multimedia Viewer should be installed.
;
PromptViewerDestDir:
PromptPath (ViewerDestDir, <ViewerDestDir>,
"Where should Setup install the Multimedia Viewer?",
"Modify the default path if necessary, and then click on {\b OK} or "
"press {\b Enter} to continue. ",
"The path is currently not valid. You must specify a drive "
"letter, a colon, and a directory from the root of the drive. ")
;;
;; GetWinPath (Variable)
;; ---------------------
;; This command sets the variable 'Variable' to the path of the
;; Windows directory. The directory name ends in a backslash.
;;
;;
; Don't allow Viewer to be installed in the Windows directory
;
GetWinSystemPath (SystemPath)
GetWinPath (WinPath)
IfNotEqualGoto (<ViewerDestDir>, <WinPath>, CheckSpace)
DisplayMessage (
"You cannot install the Viewer into the Windows directory. "
"Please enter another directory.",
"Click on {\b OK} or press {\b Enter} to enter another directory "
"for Viewer.")
Goto (PromptViewerDestDir)
;;
;; GetSpaceAvailable (Variable, Path)
;; ----------------------------------
;; This command finds the number of bytes available on the disk of
;; the full path 'Path', and sets the variable 'Variable' to the
;; string representation of this value. The value 0 is returned if
;; the specified volume does not exist or cannot be read.
;;
; Check if there is enough space to install the Viewer.
;
CheckSpace:
GetSpaceAvailable (SpaceAvailable, <ViewerDestDir>)
;;
;; IfLowerGoto (Number1, Number2, Label)
;; -------------------------------------
;; This command will compare 'Number1' and 'Number2', which are
;; strings interpreted as integers. If 'Number1' is lower than
;; 'Number2' then execution branches to 'Label'.
;;
IfLowerGoto (<ViewerSize>, <SpaceAvailable>, ViewerDestDirOK)
;;
;; AskYesNo (Variable, Default, Question, Instructions)
;; ----------------------------------------------------
;; This command displays the string 'Question' in a dialog box and the
;; instruction text 'Instructions' in the instruction window. The
;; dialog box has two buttons, labeled "Yes" and "No". The string
;; 'Default' should be either "Yes" or "No" to specify which button is
;; the default button. After a button is pushed, the variable
;; 'Variable' is set to the string "Yes" or the string "No" as
;; appropriate.
;;
AskYesNo (Prompt, "Yes",
"There may not be enough space to install the Multimedia Viewer. "
"Would you like to enter a new path for the files? ",
"Click on {\b Yes} or press {\b 'Y'} to enter a new path for the "
"Multimedia Viewer files.\par "
"Click on {\b No} or press {\b 'N'} to continue anyway.\par "
"Click on the {\b Exit} button or press {\b F3} to exit Setup. "
"You may wish to exit Setup and make some more space on your hard "
"disk. Run Setup again when there is enough space on your hard "
"disk. ")
IfEqualGoto (<Prompt>, "Yes", PromptViewerDestDir)
ViewerDestDirOK:
AskYesNo (AskAgain, "No",
"Would you like to change anything before proceeding with "
"the installation?",
"Click on {\b Yes} or press {\b 'Y'} to reenter options.\par "
"Click on {\b No} or press {\b 'N'} to proceed with installation. ")
IfEqualGoto (<AskAgain>, "Yes", AskAgain)
;;
;; MakePath (Path)
;; ---------------
;; This command causes the path 'Path' to be created if it does not
;; already exist. To make the path, MakePath creates any
;; subdirectories that do not already exist. If the path cannot be
;; created, then no error will be reported, as the problem will
;; normally be detected when Setup attempts to copy files to this
;; path.
;;
; Create the tree structure.
;
MakePath (<ViewerDestDir>)
;;
;; OpenCopyProgress (Message, Instructions)
;; ----------------------------------------
;; This command begins a file manipulation section. The command will
;; open a progress bar dialog with the message 'Message' and the
;; instruction text 'Instructions'. Following this command, only the
;; commands 'SetProgressBarMsg', 'PromptChangeDisk', 'CopyFile',
;; 'AppendFile', 'UpdateFile', 'TranslateFile', 'DeleteFile',
;; 'RenameFile', 'Goto', 'IfEqualGoto', 'IfNotEqualGoto', 'ErrorExit',
;; 'IfLowerGoto', 'IfHigherGoto', 'IfFileExistsGoto', 'Pause', and
;; 'MakePath' are allowed until the 'CloseCopyProgress' command is
;; reached. An error is reported and Setup is aborted if any other
;; commands are encountered while the progress bar is displayed.
;;
; Copy the files
;
OpenCopyProgress (
"Setup is copying the Multimedia Viewer runtime files.",
"Please wait while Setup is copying files.")
;;
;; CopyFile (Source, Destination, Size)
;; ------------------------------------
;; This command copies the file 'Source' to the file 'Destination'.
;; The current disk and directory will be that of the Setup
;; executable. Normally the files to copy will be in the same place
;; (although a volume change may be required---see PromptChangeDisk)
;; so a relative path is normally used for the source file name.
;; Normally variables are used to specify a complete destination file
;; name that depends on the user's path selection. Any directories
;; specified in the destination path must already exist---they are
;; normally created using the MakePath commands.
;;
;; The 'Size' field specifies the size of the source file. In order
;; to initialize the progress bar it is necessary to find the total
;; number of bytes to copy between the OpenCopyProgress command and
;; the CloseCopyProgress command. Since files may span several disks,
;; it would be impractical to obtain this size directly from the
;; source file. The size field is only required to maintain the
;; progress bar, and, although it need not be exact, it should be
;; close to reality to maintain the accuracy of the progress bar.
;;
;; If an error occurs (such as File Not Found, Read Error, Write
;; Error) then an error dialog is shown, at which point the user has
;; the option to Abort Setup, Retry the copy operation, or Ignore the
;; copy error. Selecting Abort has the same effect as pressing <F3>.
;; Selecting Retry causes the operation to be retried. Finally,
;; selecting Ignore causes copying to continue despite the error. The
;; latter option will likely result in an incomplete Setup. The
;; command 'IfIncompleteGoto' can be used subsequently to give the
;; user an appropriate message.
;;
;; Files compressed using the Windows SDK COMPRESS utility will
;; automatically be decompressed as they are being copied to the hard
;; disk.
;;
CopyFile ("FTENGINE.DLL", <ViewerDestDir> "FTENGINE.DLL", 50000)
CopyFile ("FTUI.DLL", <ViewerDestDir> "FTUI.DLL", 75000)
CopyFile ("MMP.DLL", <ViewerDestDir> "MMP.DLL", 200000)
CopyFile ("MVAFF.DLL", <ViewerDestDir> "MVAFF.DLL", 50000)
CopyFile ("MVAPI.DLL", <ViewerDestDir> "MVAPI.DLL", 10000)
CopyFile ("MVAUDDLG.DLL", <ViewerDestDir> "MVAUDDLG.DLL", 50000)
CopyFile ("MVAUDIO.DLL", <ViewerDestDir> "MVAUDIO.DLL", 10000)
CopyFile ("MVBMP.DLL", <ViewerDestDir> "MVBMP.DLL", 50000)
CopyFile ("QKHOOK.DLL", <ViewerDestDir> "QKHOOK.DLL", 10000)
CopyFile ("QUICKEYS.EXE", <ViewerDestDir> "QUICKEYS.EXE", 25000)
CopyFile ("QUICKEYS.HLP", <ViewerDestDir> "QUICKEYS.HLP", 25000)
CopyFile ("VIEWER.EXE", <ViewerDestDir> "VIEWER.EXE", 250000)
CopyFile ("AVI.EXE", <ViewerDestDir> "AVI.EXE", 20000)
CopyFile ("DISPDIB.DLL", <SystemPath> "DISPDIB.DLL", 10000)
CopyFile ("VER.DLL", <SystemPath> "VER.DLL", 80000)
CopyFile ("MCIAVI.DRV", <SystemPath> "MCIAVI.DRV", 50000)
CopyFile ("INDEO.DRV", <SystemPath> "INDEO.DRV", 20000)
CopyFile ("MSVIDC.DRV", <SystemPath> "MSVIDC.DRV", 20000)
CopyFile ("MSVIDEO.DLL", <SystemPath> "MSVIDEO.DLL", 20000)
CopyFile ("MPLAYER.EXE", <WinPath> "MPLAYER.EXE", 50000)
CopyFile ("MPLAYER.HLP", <WinPath> "MPLAYER.HLP", 25000)
CopyFile ("MPLAYER.REG", <WinPath> "MPLAYER.REG", 10000)
CopyFile ("MCIOLE.DLL", <WinPath> "MCIOLE.DLL", 10000)
;;
;; CloseCopyProgress ()
;; --------------------
;; This command closes the copy progress bar.
;;
CloseCopyProgress ()
;;*************Begin Title Specific Section***************************
;;
;; OpenProgmanProgress (Message, Instructions)
;; -------------------------------------------
;; This command begins a Program Manager installation section.
;; This command will put up a progress bar with the message 'Message'
;; and the instructions 'Instructions'. Following this command, only
;; the commands 'SetProgressBarMsg', 'OpenProgmanGroup', 'ErrorExit',
;; 'AddProgmanItem', 'Goto', 'IfEqualGoto', 'IfNotEqualGoto',
;; 'IfLowerGoto', 'IfHigherGoto', 'IfFileExistsGoto', and 'Pause' are
;; allowed until the 'CloseProgmanProgress' command is reached. An
;; error is reported and Setup is aborted if any other commands are
;; encountered while the progress bar is displayed.
;;
; Begin adding Progam Manager groups
;
OpenProgmanProgress (
"Setup is adding Program Manager groups.",
"Please wait while Setup adds {\b Program Manager} groups".)
;;
;; OpenProgmanGroup (Group[, DeleteFlag])
;; ---------------------------------------
;; This command will set up a DDE conversation with the Program
;; Manager and open the program group entitled 'Group'. If the
;; optional string 'Delete' is specified and is equal to "Delete",
;; then the specified group will be deleted if it exists, before it is
;; created. Normally this Delete flag is specified to create a new
;; program group, and is omitted to add to an existing group.
;;
;; The progress bar will display the words "Opening" followed by the
;; name of the ProgMan group. If OpenProgmanGroup fails then no error
;; is reported.
;;
; Add a specific Program Manager group.
;
OpenProgmanGroup (<TitleName>, Delete) ;; Add the group named after the title
;;
;; AddProgmanItem (Item, Command, IconFile, IconNumber)
;; ----------------------------------------------------
;; This command will add a new icon to the Program Manager group
;; opened by OpenProgmanGroup. The icon will have the title 'Item',
;; the command string 'Command', the icon file 'IconFile' and the
;; 0-based icon index within the icon file 'IconNumber'. Variables
;; can be used to specify a complete path for the command and icon
;; files that are dependent on the user's path choices.
;;
;; The progress bar will display the words "Adding" followed by the
;; item name. If AddProgramItem fails then no error is reported.
;;
AddProgmanItem (<TitleName>,<ViewerDestDir>"VIEWER.EXE "<ViewerSrcDir>"JAZZ\"<TitleMVB>".MVB",<ViewerSrcDir>"JAZZ\COMPTONS.ICO",0)
;;
;; CloseProgmanProgress ()
;; -----------------------
;; This command closes the ProgMan DDE conversation.
;;
CloseProgmanProgress ()
;;
;; AddToProfileIni (File, Tag, Name, Value)
;; ----------------------------------------
;; This command is identical to AddToWinIni, except that any profile
;; file can be used. This can be used to access the SYSTEM.INI file
;; and any other private profile files. No error is reported if this
;; operation fails.
;;
; Update VIEWER.INI.
;
AddToProfileIni ("VIEWER.INI", <TitleMVB>, "Path",
<ViewerSrcDir> <TitleSrcDir>)
AddToProfileIni ("VIEWER.INI", "Files", <TitleMVB> ".MVB",
<ViewerSrcDir> <TitleSrcDir>
",Please insert the " <TitleName> " CD in the CD-ROM drive")
;; 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",
"JAZZ", ; Basename of the MVB file
"Path", <ViewerSrcDir> <TitleSrcDir>)
;;***************End Title Specific Section***************************
;;
;; AddToWinIni (Tag, Name, Value)
;; ------------------------------
;; This command adds or modifies the WIN.INI file entry 'Name' under
;; the tag 'Tag' to equal the string 'Value'. No error is reported if
;; this operation fails.
;;
; Update WIN.INI.
;
AddToWinIni ("Multimedia Viewer", "ViewerPath", <ViewerDestDir>)
AddToWinIni ("Extensions", "mvb", "viewer.exe ^.mvb")
AddToWinIni ("MCI Extensions", "avi", "AVIVideo")
AddToProfileIni ("SYSTEM.INI","mci","AVIVideo","mciavi.drv")
AddToProfileIni ("SYSTEM.INI","drivers","VIDC.MSVC","msvidc.drv")
AddToProfileIni ("SYSTEM.INI","drivers","VIDC.RT21","indeo.drv")
AddToProfileIni ("MPLAYER.INI","options","AVIVideo","62")
AddToProfileIni ("MPLAYER.INI","devices","AVIVideo","350, Video for Windows")
AddToProfileIni ("EBAVI.INI",<TitleMVB>,"Path",<ViewerSrcDir>"JAZZ\VIDEO\")
;;
;; ModifyAutoexec (Path, Lib, Include, AskInstructions,
;; ReviewInstructions, SaveInstructions)
;; ----------------------------------------------------
;; This command ensures that the following environment variables in
;; the AUTOEXEC.BAT file are set:
;;
;; 1. the path 'Path' is present in the PATH variable
;; 2. the path 'Lib' is present in the LIB variable
;; 3. the path 'Include' is present in the INCLUDE variable
;;
;; If any of 'Path', 'Lib', or 'Include' is the null string (""),
;; then the corresponding environment variable is ignored.
;;
;; If an environment variable needs to be changed, a dialog window
;; is brought up. If all the required paths are already in the
;; current environment variables, then no dialog is shown. The
;; instruction window contains the instruction text 'AskInstructions'.
;;
;; If the default option to make the modifications is selected, then
;; the old AUTOEXEC.BAT file is saved to AUTOEXEC.BAK and the required
;; changes are made to the current AUTOEXEC.BAT file. Paths are added
;; to the beginning of the path list in the PATH, SET LIB, and
;; SET INCLUDE statements. If the statement to set the appropriate
;; environment variable is not present then the statement is added to
;; the end of the AUTOEXEC.BAT file. If the AUTOEXEC.BAT file is not
;; found, then a new AUTOEXEC.BAT file is created to contain these
;; new statements.
;;
;; If the option to review and edit the changes is chosen then the
;; following dialog is shown:
;;
;; The upper edit box shows the proposed changes to the AUTOEXEC.BAT
;; file and the lower edit box shows the current AUTOEXEC.BAT file
;; contents. The instruction window shows the instructon text
;; 'ReviewInstructions'. Any changes made to the upper edit box are
;; saved when the user clicks on the OK default button or presses
;; <Enter> to save the changes. The old AUTOEXEC.BAT is saved to the
;; file AUTOEXEC.BAK before the changes are made. The Cancel button
;; brings back the previous dialog.
;;
;; If the option to make the modifications later is chosen then the
;; following dialog is shown:
;;
;; Here the user can specify a file that will contain the
;; modifications made to the AUTOEXEC.BAT file. The instruction
;; window shows the instruction text 'SaveInstructions'. The default
;; filename is AUTOEXEC.NEW, but the user can changes this by editing
;; the file in the dialog box. To save the changes to the specified
;; file, the user clicks on the Save button or presses 'S' or Enter.
;; To not save the changes, the user clicks on the Don't Save button.
;; To return to the previous dialog, the user clicks on the Cancel
;; button or presses Esc.
;;
; Add the Viewer path to the PATH variable in the environment.
;
ModifyAutoexec (<ViewerDestDir>, "", "",
"Setup must now make some changes to your {\b AUTOEXEC.BAT} file. "
"Click on the desired option and click on {\b OK} to continue. With "
"the keyboard, use the arrow keys to select the desired option, and "
"then press {\b Enter} to continue.\par\par "
"{\b o} Select the first option to let Setup modify your "
"AUTOEXEC.BAT file\par "
"{\b o} Select the second option to view and change the changes "
"first\par "
"{\b o} Select the third option if you want to make the changes "
"yourself later on\par\par ",
"You can now view the proposed changes to the {\b AUTOEXEC.BAT} "
"file. If the changes were not made to your satisfaction, you can "
"modify the proposed batch file by editing the file in the top "
"window. Click on {\b OK} or press {\b Enter} to replace the "
"current batch file with the proposed one. To return to the "
"AUTOEXEC modification options dialog, click on {\b Cancel} or press "
"{\b Esc}.",
"Setup can save the proposed {\b AUTOEXEC.BAT} file to a file that "
"you specify. You will have to modify your own {\b AUTOEXEC.BAT} "
"file yourself and then reboot your computer in order for the Viewer "
"to function normally. To return to the AUTOEXEC modification "
"options dialog, click on {\b Cancel} or press {\b Esc}.")
; Assemble and display finished message
;;
;; IfIncompleteGoto (Label)
;; ------------------------
;; This command will branch to the label 'Label' if the installation
;; was incomplete. The installation is incomplete if there was an
;; error for any file that was copied to the hard disk and the user
;; specified to ignore the error. The installation is also incomplete
;; if the 'SetIncomplete' command was executed.
;;
IfIncompleteGoto (Incomplete)
SetVariable (Message,
"%nThe Setup program has successfully installed%n"
"the Multimedia Viewer and "<TitleName> ".%n%n")
Goto (CheckAutoexec)
Incomplete:
SetVariable (Message,
"Setup has finished, but the installation was incomplete. "
"You should correct any problems (such as insufficient disk "
"space, missing source files, or locked directories) and run "
"Setup again.%n%n")
CheckAutoexec:
;;
;; IfMustModifyGoto (Label)
;; ------------------------
;; This command will branch to the label 'Label' if Setup had to
;; modify the AUTOEXEC.BAT file, but the user chose to do the
;; modifications themselves later. The command will also branch
;; if the 'SetMustModify' command was executed.
;;
IfMustModifyGoto (MustModify)
;;
;; IfMustRebootGoto (Label)
;; ------------------------
;; This command will branch to the label 'Label' if Setup has
;; modified the AUTOEXEC.BAT file, and the user
;; must now reboot the computer. The command will also branch
;; if the 'SetMustReboot' command was executed.
;;
IfMustRebootGoto (MustReboot)
Goto (End)
MustModify:
SetVariable (Message,
<Message> "Remember to modify your AUTOEXEC.BAT file and reboot your "
"computer before using the Multimedia Viewer.%n%n")
Goto (End)
MustReboot:
SetVariable (Message,
<Message> "For the changes made by Setup to come into "
"effect, you must reboot your computer. To do this, you must first "
"exit Windows and then simultaneously hold down the Ctrl, Alt, and "
"Del keys. You must do this before using the Multimedia Viewer.%n%n")
End:
Execute("PROFDISP.EXE",1)
SetVariable (Message,
<Message> "%nThe advantages of being a registered user are numerous.%n"
"Please send in your Product Registration Card TODAY.")
DisplayMessage (<Message>,
"Click on {\b OK} or press {\b Enter} to return to the "
"Program Manager.")
;;
;; The following are other commands that Setup recognizes
;;
;;
;; IfNotEqualGoto (String1, String2, Label)
;; ----------------------------------------
;; This command will do a case insensitive compare on the strings
;; 'String1' and 'String2' and branch to 'Label' if they do not match.
;;
;; IfHigherGoto (Number1, Number2, Label)
;; --------------------------------------
;; This command will compare 'Number1' and 'Number2', which are
;; strings interpreted as long integers. If 'Number1' is higher
;; than 'Number2' then execution branches to 'Label'.
;;
;; Add (Variable, Number)
;; --------------------------
;; This command will add the value 'Number' to the old value of the
;; variable 'Variable', and store the result as the new value of
;; 'Variable'. Both the old value of 'Variable' and the string
;; 'Number' are interpreted as long integers.
;;
;; Subtract (Variable, Number)
;; -------------------------------
;; This command will subtract the value 'Number' from the old value
;; of the variable 'Variable', and store the result as the new value
;; of 'Variable'. Both the old value of 'Variable' and the string
;; 'Number' are interpreted as long integers.
;;
;; SetProgressBarMsg (Message)
;; ---------------------------
;; This command changes the progress bar message to 'Message'.
;; This is used to let the user know which group of files is currently
;; being copied.
;;
;; GetWinSystemPath (Variable)
;; ---------------------------
;; This command sets the variable 'Variable' to the path of the
;; Windows System directory. The directory name ends in a backslash.
;;
;; Confirm (Variable, Default, Text, Instructions)
;; -----------------------------------------------
;; This command behaves identically to the AskYesNo command, except
;; that it is used to confirm that the options that have been entered
;; are correct. The string 'Text' is normally built from the answers
;; to the other prompt commands.
;;
;; PromptChangeDisk (DiskLabel, File, Instructions)
;; ------------------------------------------------
;; This command pops up a dialog window requesting the user to insert
;; the disk labeled 'DiskLabel' into the current drive. When the user
;; clicks on the "OK" button or presses Enter, Setup checks to see
;; that the file with the given name exists. If the file does not
;; exist then Setup assumes that the wrong disk was inserted and the
;; dialog remains active. This is repeated until the file is found,
;; at which time the dialog box is removed and execution continues.
;;
;; UpdateFile (Source, Destination, Size)
;; --------------------------------------
;; This command is identical to the CopyFile command, except that if
;; the destination file exists then it will read the version number
;; of the source and the destination files and perform the copy only
;; if the version number of the source file is higher than that of the
;; destination file. The source file must not be compressed for this
;; to work.
;;
;; AppendFile (Source, Destination, Size)
;; --------------------------------------
;; This command is identical to the CopyFile command, except that the
;; source file is appended to the destination file. This command is
;; useful for copying files that span several volumes.
;;
;; Files compressed using the Windows SDK COMPRESS utility will
;; automatically be decompressed as they are being copied to the hard
;; disk.
;;
;; TranslateFile (Source, Destination, Size, Tag1, Replacement1,
;; Tag2, Replacement2, ...)
;; -------------------------------------------------------------
;; The TranslateFile command behaves just like the CopyFile command,
;; except that all strings enclosed in double angle brackets (<<...>>)
;; in the source file are treated as "tags" which, together with the
;; angle brackets, get replaced by the corresponding replacement
;; strings in the destination file.
;;
;; For instance, if the source file "SOURCE.BAT" contains the line
;;
;; set WinDir=<<WinDir>>
;;
;; and the following commands are used to copy the file
;;
;; GetWinPath (WindowsDir)
;; .
;; .
;; TranslateFile ("SOURCE.BAT", "DEST.BAT", 1000,
;; "WinDir", <WindowsDir>)
;;
;; then the file "DEST.BAT" will contain the following line:
;;
;; set WinDir=C:\WIN
;;
;; The tag can be up to 127 characters long. If the tag is not listed
;; with its replacement string then the tag and its angle brackets
;; will not be present in the destination file.
;;
;; The source file can be compressed. This command is not
;; particularly fast, so it is only suited for short files, like INI
;; files and BAT files.
;;
;; RenameFile (CurrentName, NewName)
;; ---------------------------------
;; This command renames the file specified by 'CurrentName' to
;; 'NewName'. No error is reported if this command fails.
;;
;; DeleteFile (FileName)
;; ---------------------
;; This command deletes the file specified by 'FileName', if this
;; file exists. No error is reported if this command fails.
;;
;; GetFromProfileIni (Variable, File, Tag, Name, Default)
;; ------------------------------------------------------
;; This command is identical to GetFromWinIni except that any profile
;; file can be used.
;;
;; Pause (Time)
;; ------------
;; This command will pause execution in the script file for the
;; specified number of milliseconds. This command can be used when
;; copying files or modifying the Program Manager groups in order to
;; give the user time to see what is happening.
;;
;; Execute (CommandString, DisplayType)
;; ------------------------------------
;; This command will launch the program specified in the string
;; 'CommandString'. Parameters can appear following the program name.
;; The argument 'DisplayType' determines whether the program window is
;; shown as hidden, normal, minimized, or maximized, as specified in
;; the following table:
;;
;; 'DisplayType' Effect
;; 0 Window appears hidden
;; 1 Window appears normal
;; 2 Window appears minimized
;; 3 Window appears maximized
;;
;; ErrorExit (Text)
;; ---------------------
;; This command forces Setup to exit after a fatal error. A message
;; box pops up with the message 'Text' explaining the error, and then
;; Setup ends.
;;
;; SendWinIniChange (Section)
;; --------------------------
;; This command broadcasts a WM_WININICHANGE message to all top-level
;; windows when changes have been made to the section 'Section' in
;; the Windows initialization file, WIN.INI. The section name does
;; not include the square brackets.
;;
;; SendDevModeChange (Device)
;; --------------------------
;; This command broadcasts a WM_DEVMODECHANGE message to all top-level
;; windows when changes have been made to the device-mode settings
;; of the device 'Device'.
;;
;; ParseField (Variable, String, FieldPosition)
;; --------------------------------------------
;; This command sets the variable 'Variable' to be the field specified
;; by the number 'FieldPosition' in the string 'String'. Fields are
;; separated by commas. The first field in a string is in position 1.
;; If the field position is out of bounds, or there is some other
;; kind of error, then 'Variable' is set to an empty string.
;;
;; For example,
;;
;; ParseField (Var1, "Position 1, Position 2", 2)
;;
;; would set the variable 'Var1' to be "Position 2".
;;
;; MidString (Variable, String, StartPos, Span)
;; --------------------------------------------
;; This command sets the variable 'Variable' to be a substring of the
;; string 'String'. The substring starts at position 'StartPos' in
;; the source string (which is 0-based) and is 'Span' characters long.
;; If there are not enough characters in the string at position
;; 'StartPos' to form the substring, then as many characters as
;; possible will be formed from that position onward. If 'StartPos'
;; is not within the string, a fatal error will result.
;;
;; OpenMessageBox (Text, Instructions)
;; -----------------------------------
;; This command displays the message 'Text' in a dialog box and the
;; instruction text 'Instructions' in the instructions window.
;; The dialog box remains until a 'CloseMessageBox' command is
;; issued. Other commands can occur in the setup script between the
;; 'OpenMessageBox' and 'CloseMessageBox' commands.
;;
;; CloseMessageBox ()
;; ------------------
;; This command closes a dialog box that was opened with the
;; 'OpenMessageBox' command.
;;
;; FileErrorBox (Variable, Message, File)
;; --------------------------------------
;; This command puts up a dialog to handle file errors. The dialog
;; box contains three buttons: Abort, Retry, and Ignore. Retry is
;; the default button. The box contains an error message 'Message'
;; followed by the file 'File' that is in question.
;;
;; If the Ignore button is pressed, the variable 'Variable' is set to
;; the string "Ignore". If the Retry button is pressed, 'Variable' is
;; set to "Retry". If the Abort button is pressed, a dialog box will
;; ask if the user wants to end Setup. If the user chooses Yes, then
;; Setup will end. If the user chooses No, then 'Variable' is set
;; to "Retry".
;;
;; SetIncomplete ()
;; ----------------
;; This command indicates that the installation was incomplete,
;; causing the 'IfIncompleteGoto' command to branch to the label
;; in its argument list.
;;
;; SetMustModify ()
;; ----------------
;; This command indicates that Setup had to modify the AUTOEXEC.BAT
;; file, but the user chose to do the modifications later. This will
;; cause the 'IfMustModifyGoto' command to branch to the label
;; in its argument list.
;;
;; SetMustReboot ()
;; ----------------
;; This command indicates that Setup has altered the system so that
;; the user must reboot the computer for these changes to come into
;; effect. This will cause the 'IfMustRebootGoto' command to branch
;; to the label in its argument list.
;;
;; EnumerateWinIni (Variable, Section)
;; -----------------------------------
;; This command enumerates the key names associated with the section
;; 'Section' of WIN.INI. The key names will be separated by commas,
;; and will be stored in the variable 'Variable'. If 'Section' does
;; not exist, or there is some other error, then 'Variable' will be
;; set to the empty string. Do not specify the brackets '[' and ']'
;; in 'Section'.
;;
;; EnumerateProfileIni (Variable, File, Section)
;; ---------------------------------------------
;; This command is identical to 'EnumerateWinIni' except that it
;; operates on any initialization file specified by the name 'File'.
;;
;;
;; Subroutines
;; -----------
;; Subroutines can be implemented in the Setup script using the
;; mechanism described as follows (an example subroutine call is
;; provided for the installation of PostScript fonts).
;;
;; A subroutine may require various input and output variables. The
;; input variables should be set before calling the subroutine. These
;; variables may be altered within the subroutine; do not expect them
;; to remain constant. After the subroutine returns, the output
;; variables contain the output values. A special variable,
;; 'Continuation', must also be set to contain the label at which
;; the execution resumes after the subroutine returns. Normally,
;; this label will be immediately after the subroutine call. The
;; subroutine call itself is made by a 'Goto' statement to the
;; subroutine's entry label.
;;
;; NOTE: All variables are global!
;;
;; The code for a subroutine requires certain statements. The
;; first statement should be a 'Goto' statement that skips over
;; the entire subroutine so that it will only be activated if it is
;; explicitly called. Thus, the last statement of the subroutine
;; should be a label to which the first 'Goto' jumps to. The second
;; statement in the subroutine should be the entry label of the
;; subroutine. The next to last statement of the subroutine should
;; be the statement 'Goto (<Continuation>)', which allows the
;; subroutine to return. For the example PostScript font installation
;; subroutine, the first and last lines are as follows:
;;
;;
;; Goto (subInstallPSFontEnd)
;; subInstallPSFont:
;; ;
;; ; {body of the subroutine}
;; ;
;; Goto (<Continuation>)
;; subInstallPSFontEnd:
;;
;;
;;
;; Subroutine Code: subInstallPSFont
;; ---------------------------------
;; This subroutine installs PostScript fonts which consist of a
;; Windows font metric table file (.PFM) and a PostScript font file
;; (.PFA) for each font.
;;
;; Subroutine entry label:
;; subInstallPSFont
;; Input variables:
;; MetricBase - base name of the Windows font metric table file
;; FontBase - base name of the PostScript font file
;; MetricPath - full pathname of metric file
;; FontPath - full pathname of font file
;; Output variables:
;; (none)
;; Continuation variable:
;; Continuation
;;
;; Skip over the subInstallPSFont subroutine. It will be activated
;; only if it is explicitly "called".
;;
Goto (subInstallPSFontEnd)
;; Begin the subInstallPSFont subroutine.
;;
subInstallPSFont:
; Local constant: Printer name. Used in dialog boxes.
;
SetVariable (ipfPrinterName, "PostScript")
; Local constant: Subroutine name. Used in error dialog boxes.
;
SetVariable (ipfSubroutineName, "subInstallPSFont")
; Local constant: Printer driver. Basename of the driver for which
; we are installing fonts.
;
SetVariable (ipfDriver, "PSCRIPT")
; Local constant: Destination directory for the metric and
; font files. We will put them into the Windows system directory.
;
GetWinSystemPath (ipfSystemPath)
OpenMessageBox (
"Setup is installing the " <ipfPrinterName> " font consisting of "
<MetricBase> " and " <FontBase> ".",
"Please wait while Setup installs " <ipfPrinterName> " fonts.")
; Check if the metric and font files exist.
;
ipfCheckMetricPath:
IfFileExistsGoto (<MetricPath>, ipfMetricExists)
FileErrorBox (ipfTmp , "The following file was not found:",
<MetricPath>)
IfEqualGoto (<ipfTmp>, "Retry", ipfCheckMetricPath)
SetIncomplete ()
Goto (ipfFinished)
ipfMetricExists:
ipfCheckFontPath:
IfFileExistsGoto (<FontPath>, ipfFontExists)
FileErrorBox (ipfTmp , "The following file was not found:",
<FontPath>)
IfEqualGoto (<ipfTmp>, "Retry", ipfCheckFontPath)
SetIncomplete ()
Goto (ipfFinished)
ipfFontExists:
; Enumerate the different printers. This information is found in the
; 'PrinterPorts' section of WIN.INI.
;
EnumerateWinIni (ipfPrinterPorts, "PrinterPorts")
IfNotEqualGoto (<ipfPrinterPorts>, "", ipfPrinterPortsOK)
DisplayMessage (<ipfSubroutineName> ": "
"There are no printers installed.%n%n"
"The " <ipfPrinterName> " font consisting of " <MetricBase>
" and " <FontBase> " was not installed.",
"")
SetIncomplete ()
Goto (ipfFinished)
ipfPrinterPortsOK:
; For each printer in the 'PrinterPorts' section, find out its
; associated printer information. For example, ipfPrinterInfo might
; be "PSCRIPT,LPT2:,15,45,COM2:,15,45". If the first field in the
; printer information matches the desired printer driver (ipfDriver),
; then install the fonts for each printer listed in the printer
; information.
;
SetVariable (ipfPortIndex, 1)
ipfPortLoop:
ParseField (ipfPrinter, <ipfPrinterPorts>, <ipfPortIndex>)
IfEqualGoto (<ipfPrinter>, "", ipfFinished) ; End port loop
GetFromWinIni (ipfPrinterInfo, "PrinterPorts", <ipfPrinter>, "NONE")
IfNotEqualGoto (<ipfPrinterInfo>, "NONE", ipfPrinterInfoOK)
DisplayMessage (<ipfSubroutineName> ": "
"There was an error reading the '" <ipfPrinter> "' entry in "
"the 'PrinterPorts' section of WIN.INI.%n%n",
"The " <ipfPrinterName> " font consisting of " <MetricBase>
" and " <FontBase> " may not be completely installed.",
"")
SetIncomplete ()
Goto (ipfPortInc)
ipfPrinterInfoOK:
ParseField (ipfDrv, <ipfPrinterInfo>, 1)
IfEqualGoto (<ipfDrv>, <ipfDriver>, ipfInstall)
ipfPortInc:
Add (ipfPortIndex, 1)
Goto (ipfPortLoop)
ipfInstall:
; Install the font for each PostScript printer
;
SetVariable (ipfIndex, 2)
ipfInstallLoop:
ParseField (ipfPrinterField, <ipfPrinterInfo>, <ipfIndex>)
IfEqualGoto (<ipfPrinterField>, "", ipfPortInc) ; End loop
MidString (ipfPort, <ipfPrinterField>, 0, 4) ; Assume port names are 4
; characters long
IfNotEqualGoto (<ipfPort>, "", ipfPortOK)
DisplayMessage (<ipfSubroutineName> ": "
"The WIN.INI file is defective.%n%n"
"The " <ipfPrinterName> " font consisting of " <MetricBase>
" and " <FontBase> " may not be completely installed.",
"")
SetIncomplete ()
Goto (ipfInstallInc)
ipfPortOK:
SetVariable (ppfContinuation, ipfInstallInc)
Goto (subPrinterPSFont)
ipfInstallInc:
Add (ipfIndex, 3)
Goto (ipfInstallLoop)
ipfFinished:
CloseMessageBox ()
; Return from subroutine
;
Goto (<Continuation>)
;; End of subInstallPSFont subroutine
;;
subInstallPSFontEnd:
;;
;; Subroutine Code: subPrinterPSFont
;; ---------------------------------
;; This subroutine installs PostScript fonts for each PostScript
;; printer that is installed. Each printer is identified by its
;; printer port (e.g. "LPT2"). This subroutine is called by the
;; subInstallPSFont subroutine.
;;
;; Subroutine entry label:
;; subPrinterPSFont
;; Input variables:
;; MetricBase - base name of the Windows font metric table file
;; FontBase - base name of the PostScript font file
;; MetricPath - full pathname of metric file
;; FontPath - full pathname of font file
;; ipfPort - printer port for the particular PostScript printer
;; ipfSystemPath - destination directory for the metric and font
;; files
;; ipfPrinter - printer type
;; Output variables:
;; (none)
;; Continuation variable:
;; ppfContinuation
;;
;; Skip over the subPrinterPSFont subroutine. It will be activated
;; only if it is explicitly "called".
;;
Goto (subPrinterPSFontEnd)
;; Begin the subPrinterPSFont subroutine.
;;
subPrinterPSFont:
; Local constant: Prefix for the WIN.INI section of this particular
; printer.
;
SetVariable (ppfPrefix, "PostScript,")
; Determine the destination paths of the metric and font files.
;
SetVariable (ppfMetricDest, <ipfSystemPath> <MetricBase>)
SetVariable (ppfFontDest, <ipfSystemPath> <FontBase>)
; Determine the value to store in the WIN.INI entry
;
SetVariable (ppfValue, <ppfMetricDest> "," <ppfFontDest>)
; Determine the section name of the printer, which is the section
; prefix and the printer port separated by a comma.
;
; For example, Section may be "PostScript,LPT2" for a PostScript
; printer connected to printer port #2.
;
SetVariable (ppfSection, <ppfPrefix> <ipfPort>)
; Determine the number of soft fonts already installed.
;
GetFromWinIni (ppfSoftFonts, <ppfSection>, "softfonts", 0)
; Check if the metric file or the font file has already been
; installed. The softfont index (ppfIndex) and the number of
; softfonts encountered (ppfCount) may not be the same since the
; softfonts may not be numbered consecutively.
;
SetVariable (ppfIndex, 1) ; softfont index
SetVariable (ppfCount, 1) ; number of softfonts encountered
ppfCheckLoop:
IfHigherGoto (<ppfCount>, <ppfSoftFonts>, ppfLook)
GetFromWinIni(ppfFontEntry, <ppfSection>, "softfont" <ppfIndex>, "NONE")
IfEqualGoto (<ppfFontEntry>, "NONE", ppfCheckInc) ; non-consecutive
IfEqualGoto (<ppfFontEntry>, <ppfValue>, ppfFinished) ; already installed
Add (ppfCount, 1)
ppfCheckInc:
Add (ppfIndex, 1)
Goto (ppfCheckLoop)
ppfLook:
; Look for the first empty slot to put in the new softfont entry
;
SetVariable (ppfLookIndex, 1)
ppfLookLoop:
IfHigherGoto (<ppfLookIndex>, <ppfSoftFonts>, ppfInstall)
GetFromWinIni(ppfFontEntry, <ppfSection>, "softfont" <ppfLookIndex>, "NONE")
IfEqualGoto (<ppfFontEntry>, "NONE", ppfInstall)
ppfLookInc:
Add (ppfLookIndex, 1)
Goto (ppfLookLoop)
ppfInstall:
; Update the softfont fields in the WIN.INI file.
; Notify Windows that the WIN.INI file has changed.
;
Add (ppfSoftFonts, 1)
AddToWinIni (<ppfSection>, "softfonts", <ppfSoftFonts>)
AddToWinIni (<ppfSection>, "softfont" <ppfLookIndex>, <ppfValue>)
SendWinIniChange (<ppfSection>)
ppfFinished:
; Copy the metric and font files. Do this in all cases since the
; metric and font files may have changed, although their names
; have not.
;
CopyFile (<MetricPath>, <ppfMetricDest>, 1)
CopyFile (<FontPath>, <ppfFontDest>, 1)
; Notify Windows that the font files for the printer driver have
; changed.
;
SendDevModeChange (<ipfPrinter>)
; Return from subroutine
;
Goto (<ppfContinuation>)
;; End of subPrinterPSFont subroutine
;;
subPrinterPSFontEnd: