home *** CD-ROM | disk | FTP | other *** search
Wrap
'************************************************************************** '* Microsoft Multimedia Publishing Group Setup '* Microsoft Bookshelf CD-ROM Reference Library - 1992 Edition '* (c) 1992 Microsoft Corporation. All Rights Reserved. '************************************************************************** ''** disabled $DEFINE DEBUG ''Define for script development/debugging '$INCLUDE 'setupapi.inc' '$INCLUDE 'msdetect.inc' DECLARE FUNCTION WinExec LIB "kernel" (a$,b%) AS INTEGER DECLARE FUNCTION GetModuleHandle LIB "kernel" (a$) AS INTEGER DECLARE FUNCTION AddFontResource LIB "gdi" (a$) AS INTEGER DECLARE FUNCTION SendMessage LIB "user" (a%,b%,c%,d$) AS INTEGER DECLARE FUNCTION FAsyncAudio LIB "mscuistf.dll" AS INTEGER DECLARE FUNCTION IReplaceTbarBmpsIfDifferent LIB "tbar.dll" (a$,b$,c%) AS INTEGER ''SendMessage() IDs CONST WM_WININICHANGE = &H001A CONST WM_FONTCHANGE = &H001D CONST SW_SHOWMINIMIZED = 2 ''Dialog ID's CONST WINSPACE = 2000 CONST WINSPACE_HELP = 2050 CONST WELCOME = 100 CONST WELCOME_HELP = 150 CONST ASKEXIT = 200 CONST DESTPATH = 300 CONST DESTPATH_EXISTING = 305 CONST DESTPATH_HELP = 350 CONST NOLOCALSPACE = 1000 CONST NOLOCALSPACE_HELP = 1050 CONST INVALID_DIR = 1100 CONST TOOBIG = 900 CONST TOOBIG_HELP = 950 CONST OPTIONS_1 = 800 CONST OPTIONS_2 = 850 CONST OPTIONS_QK = 810 CONST OPTIONS_WW = 820 CONST EXITQUIT = 600 CONST EXITSUCCESS = 700 CONST EXITSUCCESS_30 = 750 CONST BLBD_REGISTER = 1300 CONST WORD_INI$ = "Microsoft Word 2.0" CONST BOOK_INI$ = "Bookshelf" CONST PROG_GRP$ = "Bookshelf - 1992" CONST CHECK_QK = 1 CONST CHECK_WW = 2 '' Size of how much space will be needed to instal base files. '' These estimates assuming 4k sector size on disk. CONST WIN_SIZE_K= 544 CONST WIN_SIZE = 544000 CONST WORD_SIZE = 180000 CONST BS_SIZE = 900000 CONST TOT_SIZE = WIN_SIZE + WORD_SIZE + BS_SIZE ''Bitmap ID CONST LOGO = 1 GLOBAL SRCDIR$ '' CD root path (location of setup.exe) GLOBAL WININI$ '' Fully-qualified path to WIN.INI GLOBAL DEST$ '' Default destination directory. GLOBAL WordDir$ '' Location of Winword.exe '************************************************************************** '************************************************************************** '** '** Multimedia Publishing Group - Setup Script '** '** Modify the following DEFINES and routines to customize setup '** for a specific product '** '************************************************************************** '************************************************************************** DECLARE SUB Install '' Modify for specific runtimes DECLARE SUB InstallFonts '' Modify for custom fonts DECLARE SUB CreateProgMan '' Modify for Program Groups/Items DECLARE SUB InstallQuicKeys '' Install quickeys. DECLARE SUB InstallWinWord '' Set DEFINE to enable/disable DECLARE SUB UpdateQuicKeys (szInifile$ , szOldBook$, szNewBook$, szDefault$) DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING '************************************************************************** '************************************************************************** '************************************************************************** '** General Installation Script '************************************************************************** INIT: CUIDLL$ = "mscuistf.dll" ''Custom user interface dll HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure NL$ = Chr$(13) + Chr$(10) '' Define newline TAB$ = Chr$(9) '' Define a tab '' Use bad exit as default untill you've done a clean setup dlg_EXIT% = EXITQUIT SetBitmap CUIDLL$, LOGO SetTitle "Setup for " + PROG_GRP$ SRCDIR$ = GetSymbolValue("STF_SRCDIR") WININI$ = MakePath(GetWindowsDir(),"WIN.INI") '' Read in file list from mpgsetup.inf szInf$ = GetSymbolValue("STF_SRCINFPATH") IF szInf$ = "" THEN szInf$ = GetSymbolValue("STF_CWDDIR") + "MPGSETUP.INF" END IF ReadInfFile szInf$ '' Add the files that will always be needed for the windows directory '' so that we can find out if there is enough space to install on '' the windows dir. AddSectionFilesToCopyList "BS92Sys", SRCDIR$, GetWindowsSysDir$ IF GetCopyListCost("","","") <> 0 THEN SPLITPATH GetWindowsSysDir$,DRIVE$,PATH$,FILENAME$,EXT$ '' Fill in the Dialogue box sz$ = "There is not enough space on the " + DRIVE$ + " drive to install Bookshelf." + NL$ sz$ = sz$ + "Setup must install some files in the Windows directory on this drive." + NL$ sz$ = sz$ + "Please remove some files to free " + Str$(WIN_SIZE_K) + "K of space, then run Setup again." i% = DoMsgBox(sz$ , "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND) UIPopAll END '' Exit Setup ENDIF '' Find out if Win 3.1 or above IF (GetWindowsMajorVersion() > 3) OR ((GetWindowsMajorVersion() = 3) AND (GetWindowsMinorVersion() >= 10)) THEN fWinThreeOne% = 1 ELSE fWinThreeOne% = 0 ENDIF '' Find out if we can integrate with WinWord 2.0. '' Must be Win 3.1 or higher. '' Find out if the Winword 2.0 section is in win.ini and if '' the key 'programdir' point to a valid dir and it isn't a on a '' network drive, we aren't going to support integrating with '' network versions of Winword. '' fWW% will be set to 0 if there is no valid version of Winword 2.0. fWW% = 0 IF (fWinThreeOne% <> 0) AND (DoesIniSectionExist(WININI$, WORD_INI$) <> 0) THEN WordDir$ = GetIniKeyString(WININI$, WORD_INI$, "programdir") IF WordDir$ <> "" THEN SPLITPATH WordDir$,DRIVE$,PATH$,FILENAME$,EXT$ IF (IsDriveNetwork(DRIVE$) <> 1) AND (DoesFileExist(MakePath(WordDir$,"WINWORD.EXE"),femExists) = 1) THEN fWW% = 1 ENDIF ENDIF ENDIF '' fQKrunning% will be set to 0 if it isn't QuickKeys isn't currently '' running fQKrunning% = GetModuleHandle("QUICKEYS") '' fMVrunning% will be set to 0 if it isn't Viewer isn't currently '' running '' Currently this doesn't find the Module for some reason????? '' Would have to change to a toolhelp.dll function to try to fix. '' Wont fix at this time. -- MikkyA fMVrunning% = GetModuleHandle("VIEWER") '' fWWrunning% will be set to 0 if it isn't Winword isn't currently '' running or if fWW% is 0. IF fWW% <> 0 THEN fWWrunning% = GetModuleHandle("MSWORD") ELSE fWWrunning% = 0 ENDIF IF (fQKrunning% <> 0) or (fWWrunning% <> 0) or (fMVrunning% <> 0) THEN AreRunning$ = "Setup must update or change some of the files used by the following application(s):" + NL$ IF fQKrunning% <> 0 THEN AreRunning$ = AreRunning$ + TAB$ + "- Viewer QuicKeys" +NL$ ENDIF IF fMVrunning% <> 0 THEN AreRunning$ = AreRunning$ + TAB$ + "- Multimedia Viewer" +NL$ ENDIF IF fWWrunning% <> 0 THEN AreRunning$ = AreRunning$ + TAB$ + "- Microsoft Word" +NL$ ENDIF AreRunning$ = AreRunning$ + NL$ + "Please close these application(s) and run Setup again." + NL$ i% = DoMsgBox(AreRunning$ , "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND) END '' Exit Setup ENDIF WELCOME: sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", WELCOME_HELP, HELPPROC$) IF sz$ = "CONTINUE" THEN UIPop 1 ELSE GOSUB ASKEXIT GOTO WELCOME END IF GETPATH: '** '** 'Search for existing Viewer installation '** DLG_VIEWER% = DESTPATH '' Look in win.ini for previous setup DEST$ = GetIniKeyString(WININI$,"Multimedia Viewer", "ViewerPath") IF DEST$ <> "" THEN DLG_VIEWER% = DESTPATH_EXISTING ELSE '' Look in path for Mvapi.dll DEST$ = FindTargetOnEnvVar("MVAPI.DLL", "PATH") IF DEST$ <> "" THEN SPLITPATH DEST$,DRIVE$,PATH$,FILENAME$,EXT$ DEST$ = DRIVE$ + PATH$ DLG_VIEWER% = DESTPATH_EXISTING '' Look in C:\viewer ELSEIF DoesFileExist("C:\VIEWER\MVAPI.DLL", femExists) = 1 THEN DEST$ = "C:\VIEWER" DLG_VIEWER% = DESTPATH_EXISTING ELSE '' No old version of viewer found LocalDrives$ = "LocalDrives" GetLocalHardDrivesList LocalDrives$ n% = GetListLength(LocalDrives$) FOR i% = 1 TO n% STEP 1 DRIVE$ = GetListItem(LocalDrives$,i%) Size& = GetFreeSpaceForDrive(DRIVE$) IF Size& > BS_SIZE THEN Dest_Drive$ = DRIVE$ GOTO FOUND_SPACE ENDIF NEXT i% '' Couldn't find any local Hard Drive with enough '' space for instaling bookshelf. Dest_Drive$ = "C" NOSPACE: sz$ = UIStartDlg(CUIDLL$, NOLOCALSPACE , "FEditDlgProc", NOLOCALSPACE_HELP, HELPPROC$) '' They want to continue anyway. IF sz$ = "CONTINUE" THEN UIPop 1 GOTO FOUND_SPACE ELSEIF sz$ = "REACTIVATE" THEN GOTO NOSPACE ELSE GOSUB ASKEXIT GOTO NOSPACE END IF FOUND_SPACE: DEST$ = Dest_Drive$ + ":\VIEWER" DLG_VIEWER% = DESTPATH ENDIF ENDIF SetSymbolValue "EditTextIn", DEST$ SetSymbolValue "EditFocus", "END" GETPATHL1: sz$ = UIStartDlg(CUIDLL$, DLG_VIEWER% , "FEditDlgProc", DESTPATH_HELP, HELPPROC$) DEST$ = GetSymbolValue("EditTextOut") IF sz$ = "CONTINUE" THEN IF IsDirWritable(DEST$) = 0 THEN dlg_WHAT_IS% = INVALID_DIR GOSUB WHAT_IS GOTO GETPATHL1 ENDIF '' Find out if there is enough disk space. Prev% = ShowWaitCursor() AddSectionFilesToCopyList "Viewer", SRCDIR$, DEST$ AddSectionFilesToCopyList "QuicKeys", SRCDIR$, DEST$ AddSectionFilesToCopyList "Bookshelf", SRCDIR$, DEST$ IF GetCopyListCost("","","") <> 0 THEN RestoreCursor Prev% '' Not enough space sz$ = UIStartDlg(CUIDLL$, TOOBIG , "FInfoDlgProc", 0, "") IF sz$ <> "BACK" THEN GOSUB ASKEXIT ENDIF '' clear list and put back the windows files ClearCopyList AddSectionFilesToCopyList "BS92Sys", SRCDIR$, GetWindowsSysDir$ UIPop 1 GOTO GETPATHL1 ENDIF '' Find out if we there is enough space to prompt for the WinWord 2.0 '' integration. IF fWW% <> 0 THEN AddSectionFilesToCopyList "BS92Word", SRCDIR$, WordDir$ IF GetCopyListCost("","","") <> 0 THEN '' Not enough space for integration. fWW% = 0 ENDIF '' clear list and put back all the other files ClearCopyList AddSectionFilesToCopyList "BS92Sys", SRCDIR$, GetWindowsSysDir$ AddSectionFilesToCopyList "Viewer", SRCDIR$, DEST$ AddSectionFilesToCopyList "QuicKeys", SRCDIR$, DEST$ AddSectionFilesToCopyList "Bookshelf", SRCDIR$, DEST$ ENDIF RestoreCursor Prev% UIPop 1 ELSEIF sz$ = "REACTIVATE" THEN GOTO GETPATHL1 ELSEIF sz$ = "BACK" THEN UIPop 1 GOTO WELCOME ELSE GOSUB ASKEXIT GOTO GETPATHL1 END IF '' Prompt for putting quickeys in startup group and maybe word integration '' Win31 needed for Startup group functionality IF fWinThreeOne% <> 0 THEN '' Initialize dlg box CheckItemsState$ = "CheckItemsState" AddListItem CheckItemsState$, "ON" dlg% = OPTIONS_1 IF fWW% <> 0 THEN dlg% = OPTIONS_2 AddListItem CheckItemsState$, "ON" ENDIF OPTIONS: sz$ = UIStartDlg(CUIDLL$, dlg% , "FCustInstDlgProc", 0, "") IF sz$ = "CONTINUE" THEN UIPop 1 ELSEIF sz$ = "REACTIVATE" THEN GOTO OPTIONS ELSEIF sz$ = "BTN1" THEN dlg_WHAT_IS% = OPTIONS_QK GOSUB WHAT_IS GOTO OPTIONS ELSEIF sz$ = "BTN2" THEN dlg_WHAT_IS% = OPTIONS_WW GOSUB WHAT_IS GOTO OPTIONS ELSEIF sz$ = "CHK1" THEN sz$ = GetListItem(CheckItemsState$, CHECK_QK) IF sz$ = "ON" THEN ReplaceListItem CheckItemsState$, CHECK_QK, "OFF" ELSEIF sz$ = "OFF" THEN ReplaceListItem CheckItemsState$, CHECK_QK, "ON" ENDIF GOTO OPTIONS ELSEIF sz$ = "CHK2" THEN sz$ = GetListItem(CheckItemsState$, CHECK_WW) IF sz$ = "ON" THEN ReplaceListItem CheckItemsState$, CHECK_WW, "OFF" ELSEIF sz$ = "OFF" THEN ReplaceListItem CheckItemsState$, CHECK_WW, "ON" ENDIF GOTO OPTIONS ELSE '' Exit, Cancel, or unknown button GOSUB ASKEXIT GOTO OPTIONS END IF '' Find out if they want winword integration IF fWW% <> 0 THEN sz$ = GetListItem(CheckItemsState$, CHECK_WW) IF sz$ <> "ON" THEN fWW% = 0 ELSE fWW% = 1 AddSectionFilesToCopyList "BS92Word", SRCDIR$, WordDir$ ENDIF ENDIF fQKStartup% = 0 sz$ = GetListItem(CheckItemsState$, CHECK_QK) IF sz$ = "ON" THEN fQKStartup% = 1 '' clear out of load= line in win.ini if there. Load$ = GetIniKeyString(WININI$, "windows", "load") l& = Instr(Ucase$(Load$), "QUICKEYS.EXE") IF l& <> 0 THEN '' Look upto quickeys for spaces lLastSpace& = 1 FOR l2& = 1 TO l& STEP 1 IF MID$(Load$,l2&,1) = " " THEN lLastSpace& = l2& ENDIF NEXT l2& '' Copy from start to last space and from end of quickeys.exe sz$ = MID$(Load$,1,lLastSpace& - 1) + MID$(Load$,l& + 12, LEN(Load$)) CreateIniKeyValue WININI$, "windows","load", sz$ , cmoOverwrite ENDIF ENDIF ENDIF ''***************************************************************** '' Install files, font, and update .ini files Install '' Modify progman. IF fQKStartup% <> 0 THEN CreateProgmanItem "StartUp" , "QuicKeys", MakePath(DEST$, "QUICKEYS.EXE"), "", cmoOverwrite ENDIF CreateProgMan IF fWW% <> 0 THEN InstallWinWord ENDIF ''***************************************************************** IF fWinThreeOne% <> 0 THEN dlg_EXIT% = EXITSUCCESS ELSE dlg_EXIT% = EXITSUCCESS_30 ENDIF QUIT: ON ERROR GOTO ERRQUIT sz$ = UIStartDlg(CUIDLL$, dlg_EXIT%, "FInfoDlgProc", 0, "") IF sz$ = "REACTIVATE" THEN GOTO QUIT ELSEIF sz$ = "BOOKSHELF" THEN RUN MakePath(DEST$, "VIEWER.EXE") + " BOOKS92.MVB", NOWAIT END IF UIPop 1 END ERRQUIT: i% = DoMsgBox("Setup sources were corrupted, call Microsoft Product Support Services at (206) 454-2030 for assistance.", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND) END ASKEXIT: sz$ = UIStartDlg(CUIDLL$, ASKEXIT, "FQuitDlgProc", 0, "") IF sz$ = "EXIT" THEN UIPopAll END '' Exit Setup ELSEIF sz$ = "REACTIVATE" THEN GOTO ASKEXIT ELSE UIPop 1 END IF RETURN WHAT_IS: sz$ = UIStartDlg(CUIDLL$, dlg_WHAT_IS%, "FInfoDlgProc", 0, "") IF sz$ = "REACTIVATE" THEN GOTO WHAT_IS END IF UIPop 1 RETURN '************************************************************************* '** '** Install '** ------- '** '** Purpose: '** Performs all installation operations. '** Arguments: '** none. '** Returns: '** none. '************************************************************************* SUB Install STATIC '' ASSERT DEST$ points to the selected drive to install viewer '' ASSERT the copy list has been filled in. CreateDir DEST$, cmoNone ''AddBlankToBillboardList 1024 AddToBillboardList "mscuistf.dll", BLBD_REGISTER, "FModelessDlgProc",2048 SetCopyGaugePosition 160, 20 CopyFilesInCopyList InstallFonts InstallQuicKeys '** '** Setup INI file settings '** '** Update the loaction of viewer CreateIniKeyValue WININI$, "Multimedia Viewer", "ViewerPath", DEST$, cmoOverwrite '** Create path to .MVBs on CD ViewerIni$ = MakePath(GetWindowsDir,"Viewer.ini") BookDir$ = MakePath(SRCDIR$,"BOOKS\") CreateIniKeyValue ViewerIni$, "Cquote92","Path", BookDir$, cmoOverwrite CreateIniKeyValue ViewerIni$, "BQuote92","Path", BookDir$, cmoOverwrite CreateIniKeyValue ViewerIni$, "WA92", "Path", BookDir$, cmoOverwrite CreateIniKeyValue ViewerIni$, "Encyc92", "Path", BookDir$, cmoOverwrite CreateIniKeyValue ViewerIni$, "Roget92", "Path", BookDir$, cmoOverwrite CreateIniKeyValue ViewerIni$, "Dict92", "Path", BookDir$, cmoOverwrite CreateIniKeyValue ViewerIni$, "Atlas92", "Path", BookDir$, cmoOverwrite CreateIniKeyValue ViewerIni$, "Books92", "Path", BookDir$, cmoOverwrite '** Create Title to .MVBs on CD for QuicKeys CreateIniKeyValue ViewerIni$, "Cquote92","Title", "Concise Columbia Quotations", cmoOverwrite CreateIniKeyValue ViewerIni$, "BQuote92","Title", "Bartlett's Familiar Quotations", cmoOverwrite CreateIniKeyValue ViewerIni$, "WA92", "Title", "The World Almanac 1992", cmoOverwrite CreateIniKeyValue ViewerIni$, "Encyc92", "Title", "Concise Columbia Encyclopedia", cmoOverwrite CreateIniKeyValue ViewerIni$, "Roget92", "Title", "Roget's II Electronic Thesaurus", cmoOverwrite CreateIniKeyValue ViewerIni$, "Dict92", "Title", "American Heritage Dictionary", cmoOverwrite CreateIniKeyValue ViewerIni$, "Atlas92", "Title", "Hammond Atlas", cmoOverwrite CreateIniKeyValue ViewerIni$, "Books92", "Title", "Microsoft Bookshelf 1992", cmoOverwrite '** Setup Multibook FTSearch index file CreateIniKeyValue ViewerIni$,"Cquote92","Indexfile","BOOKS92.IND",cmoOverwrite CreateIniKeyValue ViewerIni$,"BQuote92","Indexfile","BOOKS92.IND",cmoOverwrite CreateIniKeyValue ViewerIni$,"WA92", "Indexfile","BOOKS92.IND",cmoOverwrite CreateIniKeyValue ViewerIni$,"Encyc92","Indexfile","BOOKS92.IND",cmoOverwrite CreateIniKeyValue ViewerIni$,"Roget92","Indexfile","BOOKS92.IND",cmoOverwrite CreateIniKeyValue ViewerIni$,"Dict92", "Indexfile","BOOKS92.IND",cmoOverwrite CreateIniKeyValue ViewerIni$,"Atlas92","Indexfile","BOOKS92.IND",cmoOverwrite CreateIniKeyValue ViewerIni$,"Books92","Indexfile","BOOKS92.IND",cmoOverwrite '** Setup 'Near' default for FTSearch CreateIniKeyValue ViewerIni$, "Cquote92", "Near", "5", cmoOverwrite CreateIniKeyValue ViewerIni$, "BQuote92", "Near", "5", cmoOverwrite CreateIniKeyValue ViewerIni$, "WA92", "Near", "5", cmoOverwrite CreateIniKeyValue ViewerIni$, "Encyc92", "Near", "5", cmoOverwrite CreateIniKeyValue ViewerIni$, "Roget92", "Near", "5", cmoOverwrite CreateIniKeyValue ViewerIni$, "Dict92", "Near", "5", cmoOverwrite CreateIniKeyValue ViewerIni$, "Atlas92", "Near", "5", cmoOverwrite CreateIniKeyValue ViewerIni$, "Books92", "Near", "5", cmoOverwrite '** Setup 'Qflags' so that quickeys knows it can use both search and index on ' all of the books (Qflags=3). Omit Books92 because we don't wan't it in ' the quickeys list. CreateIniKeyValue ViewerIni$, "Cquote92", "Qflags", "3", cmoOverwrite CreateIniKeyValue ViewerIni$, "BQuote92", "Qflags", "3", cmoOverwrite CreateIniKeyValue ViewerIni$, "WA92", "Qflags", "3", cmoOverwrite CreateIniKeyValue ViewerIni$, "Encyc92", "Qflags", "3", cmoOverwrite CreateIniKeyValue ViewerIni$, "Roget92", "Qflags", "3", cmoOverwrite CreateIniKeyValue ViewerIni$, "Dict92", "Qflags", "3", cmoOverwrite CreateIniKeyValue ViewerIni$, "Atlas92", "Qflags", "3", cmoOverwrite '** Setup 'Disk not found' error message ErrStr$ = "Please insert the " + PROG_GRP$ + " CD." CreateIniKeyValue ViewerIni$, "Files", "Cquote92.MVB", BookDir$ + "," + ErrStr$, cmoOverwrite CreateIniKeyValue ViewerIni$, "Files", "BQuote92.MVB", BookDir$ + "," + ErrStr$, cmoOverwrite CreateIniKeyValue ViewerIni$, "Files", "WA92.MVB", BookDir$ + "," + ErrStr$, cmoOverwrite CreateIniKeyValue ViewerIni$, "Files", "Encyc92.MVB", BookDir$ + "," + ErrStr$, cmoOverwrite CreateIniKeyValue ViewerIni$, "Files", "Roget92.MVB", BookDir$ + "," + ErrStr$, cmoOverwrite CreateIniKeyValue ViewerIni$, "Files", "Dict92.MVB", BookDir$ + "," + ErrStr$, cmoOverwrite CreateIniKeyValue ViewerIni$, "Files", "Atlas92.MVB", BookDir$ + "," + ErrStr$, cmoOverwrite CreateIniKeyValue ViewerIni$, "Files", "Books92.MVB", BookDir$ + "," + ErrStr$, cmoOverwrite END SUB '************************************************************************* '** '** InstallWinWord '** ----------------- '** '** Purpose: '** Install special WinWord Integration files '** Arguments: '** none. '** Returns: '** none. '** Comments: '** '************************************************************************* SUB InstallWinWord STATIC '** Obtain INI settings ' ASSERT: Word 2.0 section exists in the INI file ' ASSERT: WordDir$ = valid path to winword.exe DotPath$ = GetIniKeyString(WININI$, WORD_INI$, "DOT-PATH") IF DotPath$ = "" THEN DotPath$ = WordDir$ CreateIniKeyValue WININI$, WORD_INI$, "DOT-PATH", WordDir, cmoOverwrite ENDIF IF (DoesFileExist(MakePath(DotPath$,"NORMAL.DOT"), femExists) = 1) AND (DoesFileExist(MakePath(DotPath$,"NORMAL.WAB"), femExists) = 0) THEN CopyFile MakePath(DotPath$,"NORMAL.DOT"), MakePath(DotPath$,"NORMAL.WAB"), cmoNone, 0 ENDIF '' Make a backup of toolbar bitmap. May be making a backup of '' a file just created from copylist. '' ASSERT: The toolbar bitmaps exist because they were in the copy list. IF DoesFileExist(MakePath(DotPath$,"V2TBAR.WAB"), femExists) = 0 THEN CopyFile MakePath(DotPath$,"V2TBAR.BMP"), MakePath(DotPath$,"V2TBAR.WAB"), cmoNone, 0 ENDIF i% = IReplaceTbarBmpsIfDifferent(MakePath(SRCDIR$,"VIEWER\BS92WORD\V2TBAR.BMP"), MakePath(DotPath$,"V2TBAR.BMP"), 25) IF DoesFileExist(MakePath(DotPath$,"82TBAR.WAB"), femExists) = 0 THEN CopyFile MakePath(DotPath$,"82TBAR.BMP"), MakePath(DotPath$,"82TBAR.WAB"), cmoNone, 0 ENDIF i% = IReplaceTbarBmpsIfDifferent(MakePath(SRCDIR$,"VIEWER\BS92WORD\82TBAR.BMP"), MakePath(DotPath$,"82TBAR.BMP"), 25) '** set INI file settings CreateIniKeyValue WININI$, WORD_INI$, "LoadToolbarBitmaps", "Yes", cmoOverwrite CreateIniKeyValue WININI$, BOOK_INI$, "SendToDlg", "1", cmoOverwrite CreateIniKeyValue WININI$, BOOK_INI$, "HelpFile", MakePath( SRCDIR$, "books\bs92word.hlp"), cmoOverwrite CreateIniKeyValue WININI$, BOOK_INI$, "Integration", "1", cmoOverwrite CreateIniKeyValue WININI$, BOOK_INI$, "LastQuote", "1", cmoOverwrite CreateIniKeyValue WININI$, BOOK_INI$, "ViewerPath", MakePath(DEST$,"VIEWER.EXE"), cmoOverwrite CreateIniKeyValue WININI$, BOOK_INI$, "BooksPath", MakePath( SRCDIR$, "books"), cmoOverwrite '** add macros to NORMAL.DOT (bookshlf.dot must have been copied to progdir) cmd$ = MakePath(WordDir$,"winword.exe" ) + " " + MakePath(WordDir$, "bookshlf.dot") + " /mwabSetup" ignore% = WinExec(cmd$,SW_SHOWMINIMIZED) END SUB '************************************************************************* '** '** InstallFonts '** ------------ '** '** Purpose: '** Install special Screen (raster) fonts '** Arguments: '** none. '** Returns: '** none. '** Comments: '** ensure that the font files are copied '** !!CAUTION!! at present, this only installs VGA fonts !!! '************************************************************************* SUB InstallFonts STATIC szKey$ = "Lucida Sans B 10,12,14" CreateIniKeyValue WININI$, "fonts", szKey$, "VGALSB.FON", cmoOverwrite szKey$ = "Lucida Sans B1 10,12,14" CreateIniKeyValue WININI$, "fonts", szKey$, "VGALSB1.FON", cmoOverwrite szKey$ = "Lucida Sans B2 10,12,14" CreateIniKeyValue WININI$, "fonts", szKey$, "VGALSB2.FON", cmoOverwrite szKey$ = "Symbol B" CreateIniKeyValue WININI$, "fonts", szKey$, "VGASB.FON", cmoOverwrite ignore% = AddFontResource(MakePath$(GetWindowsSysDir$, "VGALSB.fon")) ignore% = AddFontResource(MakePath$(GetWindowsSysDir$, "VGALSB1.fon")) ignore% = AddFontResource(MakePath$(GetWindowsSysDir$, "VGALSB2.fon")) ignore% = AddFontResource(MakePath$(GetWindowsSysDir$, "VGASB.fon")) '' make sure windows sees the font addition to WIN.INI ignore% = SendMessage (-1, WM_WININICHANGED, 0, "fonts") ignore% = SendMessage (-1, WM_FONTCHANGE, 0, "") END SUB '************************************************************************* '** '** InstallQuicKeys '** --------------- '** '** Purpose: '** Install QuicKeys in Startup Group [for Win 3.1 and higher] '** and in WIN.INI [windows] load= [for Win3.0] '** Arguments: '** none. '** Returns: '** none. '************************************************************************* SUB InstallQuickeys STATIC '** '** INI file settings '** '** QuicKey options ViewerIni$ = MakePath(GetWindowsDir,"Viewer.ini") CreateIniKeyValue ViewerIni$, "QuicKeys", "Open", "Minimize", cmoNone CreateIniKeyValue ViewerIni$, "QuicKeys", "Multiple", "False", cmoNone '** Key settings for each book '** using the definitions for each 1991 book if they exist UpdateQuicKeys ViewerIni$, "Cquote", "Cquote92", "Index;Ctrl-Shift-Alt-Q" UpdateQuicKeys ViewerIni$, "Bquote", "Bquote92", "Index;Ctrl-Shift-Alt-B" UpdateQuicKeys ViewerIni$, "WA91", "WA92", "Index;Ctrl-Shift-Alt-W" UpdateQuicKeys ViewerIni$, "Encyc", "Encyc92", "Index;Ctrl-Shift-Alt-E" UpdateQuicKeys ViewerIni$, "Roget", "Roget92", "Index;Ctrl-Shift-Alt-T" UpdateQuicKeys ViewerIni$, "Dict", "Dict92", "Index;Ctrl-Shift-Alt-D" UpdateQuicKeys ViewerIni$, "Atlas", "Atlas92", "Index;Ctrl-Shift-Alt-A" END SUB '************************************************************************* '** '** CreateProgman '** ------------- '** Purpose: '** Create Program Group for Bookshelf 1992 '** Arguments: '** none. '** Returns: '** none. '************************************************************************* SUB CreateProgMan STATIC Command$ = MakePath(DEST$, "VIEWER.EXE") + " " CreateProgmanGroup PROG_GRP$, "", cmoOverwrite ShowProgmanGroup PROG_GRP$, 1, cmoNone CreateProgmanItem PROG_GRP$, "Bookshelf '92", Command$ + "BOOKS92.MVB", MakePath(DEST$, "Books92.ico"), cmoOverwrite CreateProgmanItem PROG_GRP$, "Concise Quotes", Command$ + "CQUOTE92.MVB", MakePath(DEST$, "cquote92.ico"), cmoOverwrite CreateProgmanItem PROG_GRP$, "Bartlett's", Command$ + "BQUOTE92.MVB", MakePath(DEST$, "bquote92.ico"), cmoOverwrite CreateProgmanItem PROG_GRP$, "Encyclopedia", Command$ + "ENCYC92.MVB", MakePath(DEST$, "encyc92.ico"), cmoOverwrite CreateProgmanItem PROG_GRP$, "Dictionary", Command$ + "DICT92.MVB", MakePath(DEST$, "dict92.ico"), cmoOverwrite CreateProgmanItem PROG_GRP$, "Thesaurus", Command$ + "ROGET92.MVB", MakePath(DEST$, "roget92.ico"), cmoOverwrite CreateProgmanItem PROG_GRP$, "Atlas", Command$ + "ATLAS92.MVB", MakePath(DEST$, "atlas92.ico"), cmoOverwrite CreateProgmanItem PROG_GRP$, "1992 Almanac", Command$ + "WA92.MVB", MakePath(DEST$, "wa92.ico"), cmoOverwrite CreateProgmanItem PROG_GRP$, "Bookshelf Overview", Command$ + "-imenuHelpdemo " + MakePath(SRCDIR$, "BOOKS\BKS92.MVH"),MakePath(DEST$, "Overview.ico" ), cmoOverwrite CreateProgmanItem PROG_GRP$, "QuicKeys", MakePath(DEST$, "QUICKEYS.EXE"), "", cmoOverwrite CreateProgmanItem PROG_GRP$, "Bookshelf Read Me", "NOTEPAD.EXE " + MakePath(SRCDIR$, "README.TXT"), "", cmoOverwrite '' Install Works Demo ''** only install WinWorks demo on 386 or higher systems dwFlags& = GetWinFlags() IF (FAsyncAudio() <> 0) AND (dwFlags& AND WF_ENHANCED) THEN CreateProgmanItem PROG_GRP$, "Multimedia Works Demonstration", MakePath(SRCDIR$,"DEMO\workscbt.EXE") + " " + MakePath(SRCDIR$,"DEMO\demo386.les"), MakePath(SRCDIR$,"DEMO\demo.ICO"), cmoOverwrite ENDIF END SUB '************************************************************************* '** '** UpdateQuicKeys '** -------- '** Purpose: '** Update the from the old QuicKeys settings (if they exist). '** '** Arguments: '** szInifile$ - Location of viewer.ini file '** szOldBook$ - Bookshelf '91 book name '** szNewBook$ - Bookshelf '92 book name '** szDefault$ - Default setting if you can't find from last year '************************************************************************* SUB UpdateQuicKeys (szInifile$ , szOldBook$, szNewBook$, szDefault$) STATIC Key$ = GetIniKeyString(szInifile$, szOldBook$ , "QuicKey") IF Key$ = "" THEN Key$ = szDefault$ ENDIF '' Remove the whole section so that the old books don't '' appear in QuicKeys RemoveIniSection szInifile$, szOldBook$ , cmoNone CreateIniKeyValue szInifile$, szNewBook$ , "QuicKey", Key$, cmoNone END SUB '************************************************************************* '** '** MakePath '** -------- '** Purpose: '** Appends a file name to the end of a directory path, '** inserting a backslash character as needed. '** Arguments: '** szDir$ - full directory path (with optional ending "\") '** szFile$ - filename to append to directory '** Returns: '** Resulting fully qualified path name. '************************************************************************* FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING IF szDir$ = "" THEN MakePath = szFile$ ELSEIF szFile$ = "" THEN MakePath = szDir$ ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN MakePath = szDir$ + szFile$ ELSE MakePath = szDir$ + "\" + szFile$ END IF END FUNCTION