home *** CD-ROM | disk | FTP | other *** search
- '* Simply3D 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 BLOBFILES = 3
- CONST PLAYBACKFILES = 4
- CONST FONTFILES = 5
- CONST CATAFILES = 6
- CONST DEMOFILES = 7
- CONST VFWFILES = 8
-
- CONST RLIVEBB = 6401
- CONST VFONTBB = 6402
- CONST VCATABB = 6405
- CONST ANIPLAY = 6406
- CONST WELCOMEBB = 6407
- CONST SSCENESBB = 6408
- CONST WINBLOBBB = 6409
-
- ''Bitmap ID
- CONST LOGO = 1
-
- GLOBAL SRCDRIVE$ ''Default source drive.
- GLOBAL DEST$ ''Default destination directory.
- GLOBAL DESTEYES$ ''Default destination directory.
- GLOBAL DESTCATA$ ''Default destination directory.
- GLOBAL DESTFONT$ ''Default destination directory.
- GLOBAL DESTBLOB$ ''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 playbacks.
- GLOBAL DOFONT$ ''Option selection to install Visual Font.
- GLOBAL DOCATA$ ''Option selection to install Visual Catalogue.
- GLOBAL DODEMO$ ''Option selection to install demos.
- GLOBAL DOBLOB$ ''Option selection to install WinBlob.
- GLOBAL DOVFW$ ''Option selection to install Video for Windows.
- 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 "Simply 3D SuperPack CD-ROM Setup"
-
- szInf$ = GetSymbolValue("STF_SRCINFPATH")
- IF szInf$ = "" THEN
- szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
- END IF
-
- ReadInfFile szInf$
-
- DEST$ = "C:\SIMPLY3D"
-
- '$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 Simply 3D 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 resolution", "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 resolution", "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$ + "\EYESEZ"
- DESTFONT$ = DEST$ + "\VFONT"
- DESTCATA$ = DEST$ + "\VCATA"
- DESTBLOB$ = DEST$ + "\WINBLOB"
-
- ''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"
- DOFONT$ = "NO"
- DOCATA$ = "NO"
- DODEMO$ = "NO"
- DOBLOB$ = "NO"
- DOVFW$ = "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$, BLOBFILES)
- IF op3$ = "ON" THEN
- DOBLOB$ = "YES"
- ENDIF
- op4$ = GetListItem ( CHECKOUT$, PLAYBACKFILES)
- IF op4$ = "ON" THEN
- DOPLAYBACK$ = "YES"
- ENDIF
- op5$ = GetListItem ( CHECKOUT$, FONTFILES)
- IF op5$ = "ON" THEN
- DOFONT$ = "YES"
- ENDIF
- op6$ = GetListItem ( CHECKOUT$, CATAFILES)
- IF op6$ = "ON" THEN
- DOCATA$ = "YES"
- ENDIF
- op7$ = GetListItem ( CHECKOUT$, DEMOFILES)
- IF op7$ = "ON" THEN
- DODEMO$ = "YES"
- ENDIF
- op8$ = GetListItem ( CHECKOUT$, VFWFILES)
- IF op8$ = "ON" THEN
- DOVFW$ = "YES"
- ENDIF
-
- INSTALLIT:
-
- WINDIR$ = GetWindowsDir()
- WINSYSDIR$ = GetWindowsSysDir()
- CreateSysIniKeyValue WINDIR$ + "system.ini" , "386Enh" , "PageOverCommit" , "20" , cmoOverwrite
-
- 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
-
- SRCDRIVE$ = GetSymbolValue("STF_SRCDIR")
- SrcDir$ = GetSymbolValue("STF_SRCDIR") + "SIMPLY3D"
- 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
- ENDIF
-
- IF DOPLAYBACK$ = "YES" THEN
- CreateDir DESTEYES$, cmoNone
- CreateDir DESTEYES$ + "\PLAYBACK", cmoNone
- ENDIF
-
- IF DOFONTS$ = "YES" THEN
- CreateDir DEST$ + "\VFONT", cmoNone
- ENDIF
-
- IF DOCATA$ = "YES" THEN
- CreateDir DEST$ + "\VCATA", cmoNone
- ENDIF
-
- IF DOBLOB$ = "YES" THEN
- CreateDir DEST$ + "\WINBLOB", cmoNone
- ENDIF
-
- AddToBillboardList CUIDLL$, WELCOMEBB, "WelcomeDlgProc", 6
- AddToBillboardList CUIDLL$, RLIVEBB, "WelcomeDlgProc", 11
- AddToBillboardList CUIDLL$, WINBLOBBB,"WelcomeDlgProc",11
- AddToBillboardList CUIDLL$, VFONTBB, "WelcomeDlgProc", 11
- AddToBillboardList CUIDLL$, VCATABB, "WelcomeDlgProc", 11
- AddToBillboardList CUIDLL$, ANIPLAY, "WelcomeDlgProc", 11
- AddToBillboardList CUIDLL$, SSCENESBB,"WelcomeDlgProc",11
-
- IF DOEYES$ = "YES" THEN
- AddSectionFilesToCopyList "EYES", SrcDir$, DESTEYES$
- AddSectionFilesToCopyList "CONFIG", SrcDir$, DESTEYES$ + "\CONFIG"
- ENDIF
-
- IF DOVFW$ = "YES" THEN
- AddSectionFilesToCopyList "AVI Codecs", SrcDir$, WINSYSDIR$
- AddSectionFilesToCopyList "OLE2", SrcDir$, WINSYSDIR$
- AddSectionFilesToCopyList "VFW Runtime", SrcDir$, WINSYSDIR$
- AddSectionFilesToCopyList "ACM Drivers", SrcDir$, WINSYSDIR$
- ENDIF
-
- IF DOTUTORIAL$ = "YES" THEN
- AddSectionFilesToCopyList "TUTOR", 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 "TUTOR8", SrcDir$, DESTEYES$ + "\TUTOR\TUTOR8"
- AddSectionFilesToCopyList "TUTOR9", SrcDir$, DESTEYES$ + "\TUTOR\TUTOR9"
- ENDIF
-
- IF DOFONT$ = "YES" THEN
- AddSectionFilesToCopyList "VFONT", SrcDir$, DESTFONT$
- ENDIF
-
- IF DOCATA$ = "YES" THEN
- AddSectionFilesToCopyList "VC", SrcDir$, DESTCATA$
- ENDIF
-
- IF DOBLOB$ = "YES" THEN
- AddSectionFilesToCopyList "BLOB", SrcDir$, DESTBLOB$
- ENDIF
-
- IF DOPLAYBACK$ = "YES" THEN
- AddSectionFilesToCopyList "VPLAYER", SrcDir$, DESTEYES$ + "\PLAYBACK"
- AddSectionFilesToCopyList "Animator", SrcDir$, DESTEYES$ + "\PLAYBACK"
- AddSectionFilesToCopyList "MPlayer", SrcDir$, WinDir$
- ENDIF
-
- CopyFilesInCopyList
-
- IF DOVFW$ = "YES" THEN
- SetRestartDir WINDIR$
-
- 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.MSVC", "msvidc.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
-
- IF DOPLAYBACK$ = "YES" THEN
- Run ("regedit.exe /s " + MakePath(WINDIR$, "mplayer.reg"))
- END IF
-
- Run ("regedit.exe /s " + MakePath(WinSysDir$, "OLE2.reg"))
- Run ("regedit.exe /s " + MakePath(WinSysDir$, "cleanup.reg"))
- ENDIF
-
- CreateProgmanGroup "Simply 3D SuperPack", "", cmoNone
- ShowProgmanGroup "Simply 3D SuperPack", 1, cmoNone
- CreateProgmanItem "Simply 3D SuperPack", "User's Guide", DESTEYES$ + "\config\s3ddocs.exe ", DESTEYES$ + "\config\target.ico", cmoOverwrite
-
- IF DOEYES$ = "YES" THEN
- CreateProgmanItem "Simply 3D SuperPack", "Renderize Live EZ", DESTEYES$ + "\eyesez.exe ", "", cmoOverwrite
- ENDIF
- IF DOBLOB$ = "YES" THEN
- CreateProgmanItem "Simply 3D SuperPack", "WinBlobs for Windows 2.0", DESTBLOB$ + "\blobs.exe ", "", cmoOverwrite
- ENDIF
- IF DOFONT$ = "YES" THEN
- CreateProgmanItem "Simply 3D SuperPack", "Visual Font", DESTFONT$ + "\vfont.exe ", "", cmoOverwrite
- ENDIF
- IF DOCATA$ = "YES" THEN
- CreateProgmanItem "Simply 3D SuperPack", "Visual Catalogue", DESTCATA$ + "\vc.exe ", "", cmoOverwrite
- ENDIF
- IF DOPLAYBACK$ = "YES" THEN
- CreateProgmanItem "Simply 3D SuperPack", "Visual Player", DESTEYES$ + "\playback\vplayer.exe ", "", cmoOverwrite
- CreateProgmanItem "Simply 3D SuperPack", "Media Player", WINDIR + "mplayer.exe ", "", cmoOverwrite
- CreateProgmanItem "Simply 3D SuperPack", "Animator", DESTEYES$ + "\playback\aawin.exe ", "", cmoOverwrite
- ENDIF
- IF DODEMO$ = "YES" THEN
- CreateProgmanItem "Simply 3D SuperPack", "3D Demo Hard Disk", SRCDRIVE$ + "simply3d\mmdemo\simphd.exe ", "", cmoOverwrite
- CreateProgmanItem "Simply 3D SuperPack", "3D Demo CD-Rom", SRCDRIVE$ + "simply3d\mmdemo\simpcd.exe ", "", cmoOverwrite
- CreateProgmanItem "Simply 3D SuperPack", "3D Demo Loop", SRCDRIVE$ + "simply3d\mmdemo\simplp.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$ + "\vimage.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
-
-