home *** CD-ROM | disk | FTP | other *** search
Wrap
'* Visual Reality Setup '************************************************************************** '$DEFINE DEBUG ''Define for script development/debugging '$INCLUDE 'setupapi.inc' '$INCLUDE 'msdetect.inc' ''Dialog ID's CONST WELCOME = 100 CONST ASKQUIT = 200 CONST DESTPATH = 300 CONST EXITFAILURE = 400 CONST EXITQUIT = 600 CONST EXITSUCCESS = 700 CONST OPTIONS = 800 CONST APPHELP = 900 CONST CUSTINST = 6200 CONST BADPATH = 6400 CONST EYESFILES = 1 CONST TUTORFILES = 2 CONST PLAYBACKFILES = 3 CONST IMAGEFILES = 4 CONST MODELFILES = 5 CONST FONTFILES = 6 CONST CATAFILES = 7 CONST RLIVEBB = 6401 CONST VFONTBB = 6402 CONST VIMAGEBB = 6403 CONST VMODELBB = 6404 CONST VCATABB = 6405 CONST ANIPLAY = 6406 CONST WELCOMEBB = 6407 CONST SSCENESBB = 6408 ''Bitmap ID CONST LOGO = 1 GLOBAL DEST$ ''Default destination directory. GLOBAL DESTEYES$ ''Default destination directory. GLOBAL DESTIMAGE$ ''Default destination directory. GLOBAL DESTMODEL$ ''Default destination directory. GLOBAL DESTFONT$ ''Default destination directory. GLOBAL DESTCATA$ ''Default destination directory. GLOBAL WINDIR$ ''Default destination directory. GLOBAL WINSYSDIR$ ''Default destination directory. GLOBAL EXECOPT$ ''Option selection from OptFiles1 option dialog. GLOBAL TUTOROPT$ ''Option selection from OptFiles2 option dialog. GLOBAL DOEYES$ ''Option selection to install the executable and config files. GLOBAL DOTUTORIAL$ ''Option selection to install tutorials. GLOBAL DOPLAYBACK$ ''Option selection to install tutorials. GLOBAL DOIMAGE$ ''Option selection to install tutorials. GLOBAL DOMODEL$ ''Option selection to install tutorials. GLOBAL DOFONT$ ''Option selection to install Visual Font. GLOBAL DOCATA$ ''Option selection to install tutorials. GLOBAL CUIDLL$ ''Dialog list symbol names GLOBAL CHECKIN$ GLOBAL CHECKOUT$ DECLARE SUB Install DECLARE SUB Cleanup(path$) DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING DECLARE FUNCTION OnWindowsNT LIB "INIUPD.DLL" AS INTEGER DECLARE FUNCTION VflatdPresent LIB "iniupd.DLL" AS INTEGER DECLARE FUNCTION FShowWindow LIB "mscuistf.dll" (arg1%) AS INTEGER INIT: Tmp% = FShowWindow( HwndFrame ) CUIDLL$ = "mscuistf.dll" ''Custom user interface dll HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure SetBitmap CUIDLL$, LOGO SetTitle "Visual Reality Setup" szInf$ = GetSymbolValue("STF_SRCINFPATH") IF szInf$ = "" THEN szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF" END IF ReadInfFile szInf$ DEST$ = "C:\VREAL" '$IFDEF DEBUG i% = SetSizeCheckMode(scmOnIgnore) '' could use scmOff; def = scmOnFatal WinDrive$ = MID$(GetWindowsDir, 1, 1) IF IsDriveValid(WinDrive$) = 0 THEN i% = DoMsgBox("Windows drive ('"+WinDrive$+"') is not a valid drive.", "DEBUG", MB_TASKMODAL+MB_ICONHAND+MB_OK) GOTO QUIT END IF '$ENDIF ''DEBUG WELCOME: sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$) IF sz$ = "CONTINUE" THEN UIPop 1 ELSE GOSUB ASKQUIT GOTO WELCOME END IF w% = GetScreenWidth h% = GetScreenHeight IF OnWindowsNT() THEN i% = DoMsgBox("This setup of Visual Reality cannot run on Windows NT.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND) ERROR STFERR GOTO QUIT END IF IF w% < 800 THEN i% = DoMsgBox("display driver must be running at a minimum 800 x 600 x 256 colors resolution. Run windows setup to change your display driver", "SETUP FATAL ERROR", MB_TASKMODAL+MB_ICONHAND+MB_OK) ERROR STFERR GOTO QUIT ENDIF IF h% < 600 THEN i% = DoMsgBox("display driver must be running at a minimum 800 x 600 x 256 colors resolution. Run windows setup to change your display driver", "SETUP FATAL ERROR", MB_TASKMODAL+MB_ICONHAND+MB_OK) ERROR STFERR GOTO QUIT ENDIF i% = Has87MathChip IF i% = 0 THEN i% = DoMsgBox("Setup could not find a MATH COPROCESSOR", "SETUP FATAL ERROR", MB_TASKMODAL+MB_ICONHAND+MB_OK) ERROR STFERR GOTO QUIT ENDIF GETPATH: SetSymbolValue "EditTextIn", DEST$ SetSymbolValue "EditFocus", "END" GETPATHL1: sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$) DEST$ = GetSymbolValue("EditTextOut") IF sz$ = "CONTINUE" THEN IF IsDirWritable(DEST$) = 0 THEN GOSUB BADPATH GOTO GETPATHL1 END IF UIPop 1 ELSEIF sz$ = "REACTIVATE" THEN GOTO GETPATHL1 ELSEIF sz$ = "BACK" THEN UIPop 1 GOTO WELCOME ELSE GOSUB ASKQUIT GOTO GETPATH END IF DESTEYES$ = DEST + "\EYES" DESTIMAGE$= DEST + "\VIMAGE" DESTMODEL$= DEST + "\VMODEL" DESTFONT$ = DEST + "\VFONT" DESTCATA$ = DEST + "\VCATA" ''CustInst list symbols CHECKIN$ = "CheckItemsIn" CHECKOUT$ = "CheckItemsOut" FOR i% = 1 TO 7 STEP 1 AddListItem CHECKIN$, "ON" NEXT i% CUSTINST: sz$ = UIStartDlg(CUIDLL$, OPTIONS, "FCheckDlgProc", APPHELP, HELPPROC$) IF sz$ = "CONTINUE" THEN UIPop 1 GOTO CHECKOPTIONS ELSEIF sz$ = "PATH" THEN GOTO GETPATH ELSEIF sz$ = "CHK1" THEN ' RecalcOptFiles APPFILES ' SetDriveStatus GOTO CUSTINST ELSEIF sz$ = "CHK2" THEN ' RecalcOptFiles OPTFILES1 ' SetDriveStatus GOTO CUSTINST ELSEIF sz$ = "CHK3" THEN ' RecalcOptFiles OPTFILES2 ' SetDriveStatus GOTO CUSTINST ELSE GOSUB ASKQUIT GOTO CUSTINST END IF CHECKOPTIONS: DOEYES$ = "NO" DOTUTORIAL$ = "NO" DOPLAYBACK$ = "NO" DOIMAGE$ = "NO" DOMODEL$ = "NO" DOFONT$ = "NO" DOCATA$ = "NO" op1$ = GetListItem ( CHECKOUT$, EYESFILES) IF op1$ = "ON" THEN DOEYES$ = "YES" ENDIF op2$ = GetListItem ( CHECKOUT$, TUTORFILES) IF op2$ = "ON" THEN DOTUTORIAL$ = "YES" ENDIF op3$ = GetListItem ( CHECKOUT$, PLAYBACKFILES) IF op3$ = "ON" THEN DOPLAYBACK$ = "YES" ENDIF op4$ = GetListItem ( CHECKOUT$, IMAGEFILES) IF op4$ = "ON" THEN DOIMAGE$ = "YES" ENDIF op5$ = GetListItem ( CHECKOUT$, MODELFILES) IF op5$ = "ON" THEN DOMODEL$ = "YES" ENDIF op6$ = GetListItem ( CHECKOUT$, FONTFILES) IF op6$ = "ON" THEN DOFONT$ = "YES" ENDIF op7$ = GetListItem ( CHECKOUT$, CATAFILES) IF op7$ = "ON" THEN DOCATA$ = "YES" ENDIF INSTALLIT: WINDIR$ = GetWindowsDir() WINSYSDIR$ = GetWindowsSysDir() IF DoesIniKeyExist(WINDIR$ + "system.ini", "386Enh" , "PageOverCommit") = 0 THEN CreateSysIniKeyValue WINDIR$ + "system.ini" , "386Enh" , "PageOverCommit" , "20" , cmoOverwrite ENDIF IF DoesIniKeyExist(WINDIR$ + "system.ini", "386Enh" , "EMMExclude") = 0 THEN CreateSysIniKeyValue WINDIR$ + "system.ini" , "386Enh" , "EMMExclude" , "a000-ffff" , cmoOverwrite ENDIF Install QUIT: ON ERROR GOTO ERRQUIT IF ERR = 0 THEN dlg% = EXITSUCCESS ELSEIF ERR = STFQUIT THEN dlg% = EXITQUIT ELSE dlg% = EXITFAILURE END IF QUITL1: Cleanup(DEST$) sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "") IF sz$ = "REACTIVATE" THEN GOTO QUITL1 END IF UIPop 1 END ERRQUIT: i% = DoMsgBox("Setup sources were corrupted, call 818 883-7900!", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND) END BADPATH: sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "") IF sz$ = "REACTIVATE" THEN GOTO BADPATH END IF UIPop 1 RETURN ASKQUIT: sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "") IF sz$ = "EXIT" THEN UIPopAll ERROR STFQUIT ELSEIF sz$ = "REACTIVATE" THEN GOTO ASKQUIT ELSE UIPop 1 END IF RETURN '** '** Purpose: '** Builds the copy list and performs all installation operations. '** Arguments: '** none. '** Returns: '** none. '************************************************************************* SUB Install STATIC SrcDir$ = GetSymbolValue("STF_SRCDIR") + "VREAL" CreateDir DEST$, cmoNone IF DOEYES$ = "YES" THEN CreateDir DESTEYES$, cmoNone CreateDir DESTEYES$ + "\CONFIG", cmoNone ENDIF IF DOTUTORIAL$ = "YES" THEN CreateDir DESTEYES$, cmoNone CreateDir DESTEYES$ + "\TUTOR", cmoNone CreateDir DESTEYES$ + "\TUTOR\TUTOR1", cmoNone CreateDir DESTEYES$ + "\TUTOR\TUTOR3", cmoNone CreateDir DESTEYES$ + "\TUTOR\TUTOR4", cmoNone CreateDir DESTEYES$ + "\TUTOR\TUTOR5", cmoNone CreateDir DESTEYES$ + "\TUTOR\TUTOR6", cmoNone CreateDir DESTEYES$ + "\TUTOR\TUTOR7", cmoNone CreateDir DESTEYES$ + "\TUTOR\TUTOR8", cmoNone CreateDir DESTEYES$ + "\TUTOR\TUTOR9", cmoNone CreateDir DESTEYES$ + "\TUTOR\TUTOR10", cmoNone CreateDir DESTEYES$ + "\TUTOR\TUTOR11", cmoNone CreateDir DESTEYES$ + "\TUTOR\TUTOR12", cmoNone ENDIF IF DOPLAYBACK$ = "YES" THEN CreateDir DESTEYES$, cmoNone CreateDir DESTEYES$ + "\PLAYBACK", cmoNone ENDIF IF DOIMAGE$ = "YES" THEN CreateDir DEST$ + "\VIMAGE", cmoNone CreateDir DEST$ + "\VCATA", cmoNone ENDIF IF DOMODEL$ = "YES" THEN CreateDir DEST$ + "\VMODEL", cmoNone ENDIF IF DOFONT$ = "YES" THEN CreateDir DEST$ + "\VFONT", cmoNone ENDIF IF DOCATA$ = "YES" THEN CreateDir DEST$ + "\VCATA", cmoNone ENDIF AddToBillboardList CUIDLL$, WELCOMEBB, "WelcomeDlgProc", 5 AddToBillboardList CUIDLL$, RLIVEBB, "WelcomeDlgProc", 12 AddToBillboardList CUIDLL$, VFONTBB, "WelcomeDlgProc", 12 AddToBillboardList CUIDLL$, VIMAGEBB,"WelcomeDlgProc", 12 AddToBillboardList CUIDLL$, VMODELBB,"WelcomeDlgProc", 12 AddToBillboardList CUIDLL$, VCATABB, "WelcomeDlgProc", 12 AddToBillboardList CUIDLL$, ANIPLAY, "WelcomeDlgProc", 12 AddToBillboardList CUIDLL$, SSCENESBB,"WelcomeDlgProc", 12 IF DOEYES$ = "YES" THEN AddSectionFilesToCopyList "EYES", SrcDir$, DESTEYES$ AddSectionFilesToCopyList "CONFIG", SrcDir$, DESTEYES$ + "\CONFIG" AddSectionFilesToCopyList "VFW Runtime", SrcDir$, WINSYSDIR$ AddSectionFilesToCopyList "OLE2", SrcDir$, WINSYSDIR$ AddSectionFilesToCopyList "ACM Drivers", SrcDir$, WINSYSDIR$ AddSectionFilesToCopyList "AVI Codecs", SrcDir$, WINSYSDIR$ ENDIF IF DOTUTORIAL$ = "YES" THEN AddSectionFilesToCopyList "TUTOR", SrcDir$, DESTEYES$ + "\TUTOR" AddSectionFilesToCopyList "TUTOR0", SrcDir$, DESTEYES$ + "\TUTOR" AddSectionFilesToCopyList "TUTOR1", SrcDir$, DESTEYES$ + "\TUTOR\TUTOR1" AddSectionFilesToCopyList "TUTOR3", SrcDir$, DESTEYES$ + "\TUTOR\TUTOR3" AddSectionFilesToCopyList "TUTOR4", SrcDir$, DESTEYES$ + "\TUTOR\TUTOR4" AddSectionFilesToCopyList "TUTOR5", SrcDir$, DESTEYES$ + "\TUTOR\TUTOR5" AddSectionFilesToCopyList "TUTOR6", SrcDir$, DESTEYES$ + "\TUTOR\TUTOR6" AddSectionFilesToCopyList "TUTOR7", SrcDir$, DESTEYES$ + "\TUTOR\TUTOR7" AddSectionFilesToCopyList "TUTOR9", SrcDir$, DESTEYES$ + "\TUTOR\TUTOR9" AddSectionFilesToCopyList "TUTOR8", SrcDir$, DESTEYES$ + "\TUTOR\TUTOR8" AddSectionFilesToCopyList "TUTOR10", SrcDir$, DESTEYES$ + "\TUTOR\TUTOR10" AddSectionFilesToCopyList "TUTOR11", SrcDir$, DESTEYES$ + "\TUTOR\TUTOR11" AddSectionFilesToCopyList "TUTOR12", SrcDir$, DESTEYES$ + "\TUTOR\TUTOR12" ENDIF IF DOIMAGE$ = "YES" THEN AddSectionFilesToCopyList "VIMAGE", SrcDir$, DESTIMAGE$ ENDIF IF DOMODEL$ = "YES" THEN AddSectionFilesToCopyList "VMODEL", SrcDir$, DESTMODEL$ ENDIF IF DOPLAYBACK$ = "YES" THEN AddSectionFilesToCopyList "MPlayer", SrcDir$, WinDir$ AddSectionFilesToCopyList "VPLAYER", SrcDir$, DESTEYES$ + "\PLAYBACK" AddSectionFilesToCopyList "Animator", SrcDir$, DESTEYES$ + "\PLAYBACK" ENDIF IF DOCATA$ = "YES" THEN AddSectionFilesToCopyList "VC", SrcDir$, DESTCATA$ ENDIF IF DOFONT$ = "YES" THEN AddSectionFilesToCopyList "VFONT", SrcDir$, DESTFONT$ ENDIF CopyFilesInCopyList IF DOEYES$ = "YES" THEN SetRestartDir WINDIR$ CreateIniKeyValue WINDIR$ + "system.ini", "Drivers", "VIDC.MSVC", "msvidc.drv", cmoOverwrite IF VflatdPresent() = 0 THEN CreateSysIniKeyValue WINDIR$ + "system.ini", "386Enh", "device", "dva.386", cmoOverwrite END IF CreateIniKeyValue WINDIR$ + "system.ini", "Drivers", "VIDC.CVID", "iccvid.drv", cmoOverwrite CreateIniKeyValue WINDIR$ + "system.ini", "Drivers", "VIDC.IV31", "indeov.drv", cmoOverwrite CreateIniKeyValue WINDIR$ + "system.ini", "Drivers", "VIDC.MRLE", "MSRLE.drv", cmoOverwrite I% = DoesIniKeyExist (WINDIR$ + "system.ini", "Drivers", "VIDC.RT21") IF I% = 0 THEN CreateIniKeyValue WINDIR$ + "system.ini", "Drivers", "VIDC.RT21", "indeov.drv", cmoOverwrite END IF CreateIniKeyValue WINDIR$ + "system.ini", "Drivers", "VIDC.YVU9", "indeov.drv", cmoOverwrite CreateIniKeyValue WINDIR$ + "WIN.INI", "mci extensions", "avi", "AVIVideo", cmoOverwrite CreateIniKeyValue WINDIR$ + "system.ini", "mci", "AVIVideo", "mciavi.drv", cmoOverwrite CreateIniKeyValue WINDIR$ + "system.ini", "Drivers", "WaveMapper", "msacm.drv", cmoOverwrite CreateIniKeyValue WINDIR$ + "system.ini", "Drivers", "MSACM.msadpcm", "msadpcm.acm", cmoOverwrite CreateIniKeyValue WINDIR$ + "system.ini", "Drivers", "MSACM.imaadpcm", "imaadpcm.acm", cmoOverwrite CreateIniKeyValue WINDIR$ + "control.ini", "drivers.desc", "msacm.drv", "Microsoft Sound Mapper V2.00", cmoOverwrite CreateIniKeyValue WINDIR$ + "control.ini", "drivers.desc", "msadpcm.acm", "Microsoft ADPCM Codec V2.00", cmoOverwrite CreateIniKeyValue WINDIR$ + "control.ini", "drivers.desc", "imaadpcm.acm", "Microsoft IMA ADPCM Codec V2.00", cmoOverwrite Run ("regedit.exe /s " + MakePath(WINDIR$, "mplayer.reg")) Run ("regedit.exe /s " + MakePath(WinSysDir$, "OLE2.reg")) Run ("regedit.exe /s " + MakePath(WinSysDir$, "cleanup.reg")) ENDIF CreateProgmanGroup "Visual Reality", "", cmoNone ShowProgmanGroup "Visual Reality", 1, cmoNone IF DOEYES$ = "YES" THEN CreateProgmanItem "Visual Reality", "Renderize Live", DESTEYES$ + "\eyes.exe ", "", cmoOverwrite ENDIF IF DOMODEL$ = "YES" THEN CreateProgmanItem "Visual Reality", "Visual Model", DESTMODEL$ + "\vmodel.exe ", "", cmoOverwrite ENDIF IF DOIMAGE$ = "YES" THEN CreateProgmanItem "Visual Reality", "Visual Image", DESTIMAGE$ + "\vimage.exe ", "", cmoOverwrite ENDIF IF DOFONT$ = "YES" THEN CreateProgmanItem "Visual Reality", "Visual Font", DESTFONT$ + "\vfont.exe ", "", cmoOverwrite ENDIF IF DOCATA$ = "YES" THEN CreateProgmanItem "Visual Reality", "Visual Catalogue", DESTCATA$ + "\vc.exe ", "", cmoOverwrite ENDIF IF DOPLAYBACK$ = "YES" THEN CreateProgmanItem "Visual Reality", "Visual Player", DESTEYES$ + "\playback\vplayer.exe ", "", cmoOverwrite CreateProgmanItem "Visual Reality", "Animator", DESTEYES$ + "\playback\aawin.exe ", "", cmoOverwrite CreateProgmanItem "Visual Reality", "Media Player", WINDIR + "mplayer.exe ", "", cmoOverwrite ENDIF END SUB '** '** 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 SUB Cleanup (dest$) STATIC RemoveFile dest$ + "\vreal.mst", cmoNone RemoveFile dest$ + "\setup.inf", cmoNone RemoveFile dest$ + "\setup.lst", cmoNone RemoveFile dest$ + "\setup.exe", cmoNone RemoveFile dest$ + "\setupapi.inc", cmoNone RemoveFile dest$ + "\msdetect.inc", cmoNone RemoveFile dest$ + "\mscomstf.dll", cmoNone RemoveFile dest$ + "\msinsstf.dll", cmoNone RemoveFile dest$ + "\msuilstf.dll", cmoNone RemoveFile dest$ + "\msshlstf.dll", cmoNone RemoveFile dest$ + "\mscuistf.dll", cmoNone RemoveFile dest$ + "\msdetstf.dll", cmoNone RemoveFile dest$ + "\iniupd.dll", cmoNone RemoveFile dest$ + "\_mstest.exe", cmoNone RemoveFile dest$ + "\_mssetup.exe", cmoNone END SUB