home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
VRML & 3D on the Web for Dummies
/
VRML4DMYZ.iso
/
pc
/
pc_stuff
/
build
/
caligari
/
truespc2
/
setup.mst
< prev
next >
Wrap
Text File
|
1993-11-18
|
8KB
|
264 lines
'**************************************************************************
'* trueSpace2 Setup 1.0
'**************************************************************************
'***'$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 APPHELP = 900
CONST BADPATH = 6400
CONST SMALLWIN = 2200
CONST RESTART = 2600
CONST RESTARTII = 2700
CONST PREP3DR = 5000
CONST POSRESTART = 7100
''Bitmap ID
CONST LOGO = 1
GLOBAL SizeReq& '' Total Disk Size required for installation
''File Types
GLOBAL WinDir$
GLOBAL WinSysDir$
GLOBAL WINDRIVE$ ''Windows Drive Letter.
GLOBAL DEST$ ''Default destination directory.
GLOBAL FROMDRIVE$ ''installation drive letter
GLOBAL HasMath% ''has math coprocessor
GLOBAL HasEMU% ''math emulator already installed
DECLARE SUB Install
DECLARE SUB EMUInstall
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
DECLARE SUB Reboot LIB "iniupd.dll"
DECLARE FUNCTION ExitWindowsExec LIB "User" (Exec$, Param$) AS INTEGER
DECLARE FUNCTION WinExec LIB "Kernel" (Cmd$, State%) AS INTEGER
INIT:
CUIDLL$ = "mscuistf.dll" ''Custom user interface dll
HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
SetBitmap CUIDLL$, LOGO
SetTitle "Caligari trueSpace2 Trial Version"
szInf$ = GetSymbolValue("STF_SRCINFPATH")
IF szInf$ = "" THEN
szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
END IF
ReadInfFile szInf$
WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
DEST$ = WINDRIVE$ + ":\truedemo"
WELCOME:
sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
IF sz$ = "CONTINUE" THEN
UIPop 1
ELSE
GOSUB ASKQUIT
GOTO WELCOME
END IF
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
SrcDir$ = GetSymbolValue("STF_SRCDIR")
WinDir$ = GetWindowsDir()
WinSysDir$ = GetWindowsSysDir()
FROMDRIVE$ = MID$(SrcDir$, 1, 1)
HasMath% = Has87MathChip()
AddSectionFilesToCopyList "Files", SrcDir$, DEST$
AddSectionFilesToCopyList "OBJECTS", SrcDir$, DEST$ + "\OBJECTS"
AddSectionFilesToCopyList "SCENES", SrcDir$, DEST$ + "\SCENES"
AddSectionFilesToCopyList "BUMPS", SrcDir$, DEST$ + "\BUMPS"
AddSectionFilesToCopyList "TEXTURES", SrcDir$, DEST$ + "\TEXTURES"
AddSectionFilesToCopyList "ENVIRMNT", SrcDir$, DEST$ + "\ENVIRMNT"
AddSectionFilesToCopyList "PROCSETS", SrcDir$, DEST$ + "\PROCSETS"
AddSectionFilesToCopyList "PLUGINS", SrcDir$, DEST$ + "\PLUGINS"
AddSectionFilesToCopyList "VBRUN", SrcDir$, WinDir$
IF HasMath% < 1 THEN
AddSectionFilesToCopyList "Emulator", SrcDir$, WinSysDir$
END IF
'' Check windrive diskspace
SizeReq& = GetCopyListCost ("","", "")
IF SizeReq& <> 0 THEN
GOSUB SMALLWIN
END
END IF
Install
'' If no emulator installed then no need to restart windows
IF HasMath% > 0 THEN
GOTO QUIT
ENDIF
sz$ = UIStartDlg(cuidll$, POSRESTART, "FInfo0DlgProc", 0, "")
UIPop 1
QUIT:
ON ERROR GOTO ERRQUIT
IF ERR = 0 THEN
dlg% = EXITSUCCESS
ELSEIF ERR = STFQUIT THEN
dlg% = EXITQUIT
ELSE
dlg% = EXITFAILURE
END IF
QUITL1:
sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO QUITL1
END IF
UIPop 1
Prog$ = FROMDRIVE$ + ":\install\3dr\install.exe WIN32S"
Sta% = 3
J% = WinExec (Prog$, Sta%)
END
ERRQUIT:
i% = DoMsgBox("An installation problem occured, please call Caligari Technical Support.", "Setup Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
END
ASKQUIT:
sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
IF sz$ = "EXIT" THEN
UIPopAll
'' ERROR STFQUIT
END
ELSEIF sz$ = "REACTIVATE" THEN
GOTO ASKQUIT
ELSE
UIPop 1
END IF
RETURN
SMALLWIN:
sz$ = UIStartDlg(CUIDLL$, SMALLWIN, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO SMALLWIN
END IF
UIPop 1
RETURN
BADPATH:
sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO BADPATH
END IF
UIPop 1
RETURN
'**
'** Purpose:
'** performs all installation operations.
'** Arguments:
'** none.
'** Returns:
'** none.
'*************************************************************************
SUB Install STATIC
CreateDir DEST$, cmoNone
CopyFilesInCopyList
IF HasMath% < 1 THEN
EMUInstall
END IF
CreateIniKeyValue "WIN.INI", "Extensions", "tsd", DEST$ + "\TRUESPAC.EXE ^.tsd", cmoOverwrite
CreateProgmanGroup "trueSpace", "", cmoNone
ShowProgmanGroup "trueSpace", 1, cmoNone
CreateProgmanItem "trueSpace", "trueSpace2", MakePath(DEST$,"truespac.exe"), "", cmoOverwrite
CreateProgmanItem "trueSpace", "Readme2", MakePath(DEST$,"readme20.wri"), "", cmoOverwrite
CreateProgmanItem "trueSpace", "Self-running Demo 1024x768", MakePath(DEST$,"dems1024.tsd"), "", cmoOverwrite
CreateProgmanItem "trueSpace", "Self-running Demo 800x600", MakePath(DEST$,"dems800.tsd"), "", cmoOverwrite
CreateProgmanItem "trueSpace", "QuickStart Demo 1024x768", MakePath(DEST$,"quicsta1.tsd"), "", cmoOverwrite
CreateProgmanItem "trueSpace", "QuickStart Demo 800x600", MakePath(DEST$,"quicsta8.tsd"), "", cmoOverwrite
CreateProgmanItem "trueSpace", "Shuttle 1024x768", MakePath(DEST$,"shtl1024.tsd"), "", cmoOverwrite
CreateProgmanItem "trueSpace", "Shuttle 800x600", MakePath(DEST$,"shtle800.tsd"), "", cmoOverwrite
CreateProgmanItem "trueSpace", "Fish 1024x768", MakePath(DEST$,"fish1.tsd"), "", cmoOverwrite
CreateProgmanItem "trueSpace", "Fish 800x600", MakePath(DEST$,"fish8.tsd"), "", cmoOverwrite
CreateProgmanItem "trueSpace", "trueSpace2 Help", "winhelp.exe " + MakePath(DEST$,"truespac.hlp"), "", cmoOverwrite
CreateProgmanItem "trueSpace", "KPT 2.0 Samples Help", "winhelp.exe " + MakePath(DEST$,"plugins\kpt20-sp.hlp"), "", cmoOverwrite
END SUB
'**
'** Purpose:
'** install math emulator in system.ini file
'** Arguments:
'** none.
'** Returns:
'** none.
'*************************************************************************
SUB EMUInstall STATIC
HasEMU% = DoesIniKeyExist("system.ini", "386Enh", "wemu")
IF HasEMU% < 1 THEN
CreateIniKeyValue WinDir$ + "system.ini", "386Enh", "wemu", "installed", cmoOverwrite
CreateSysIniKeyValue WinDir$ + "system.ini", "386Enh", "device", "wemu387.386", cmoOverwrite
END IF
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