home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Computer Arts Interactive 3
/
CARTS3.iso
/
utils
/
wing
/
wing.mst
< prev
next >
Wrap
Text File
|
1995-06-20
|
11KB
|
383 lines
'**************************************************************************
'* WinG Setup Program
'**************************************************************************
'$DEFINE DEBUG ''Define for script development/debugging
'$INCLUDE 'setupapi.inc'
''Dialog ID's
CONST WELCOME = 100
CONST ASKQUIT = 200
CONST DESTPATH = 300
CONST DESTPATH2 = 301
CONST EXITFAILURE = 400
CONST EXITQUIT = 600
CONST EXITSUCCESS = 700
CONST APPHELP = 900
CONST CHECK = 2500
CONST BADPATH = 6400
CONST RESTART = 1000
''File Types
CONST WING_RUNFILES = 1
CONST WING_BUILDFILES = 2
''Bitmap ID
CONST LOGO = 1
GLOBAL FILEDIALOG ''File path dialog ID
GLOBAL DEST$ ''Default destination directory.
GLOBAL CHECKSTATES$ ''Dialog list symbol names
GLOBAL WINDRIVE$ ''Windows drive letter.
GLOBAL TMPDEST$ '' tmpfile destination
GLOBAL bInstallDVA%
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
DECLARE FUNCTION GetRealWindowsSysDir AS STRING
DECLARE SUB UpdateWinG32 (szOrig$)
DECLARE FUNCTION OnWin3x LIB "setuphlp.DLL" AS INTEGER
DECLARE FUNCTION VflatdPresent LIB "setuphlp.DLL" AS INTEGER
DECLARE FUNCTION GetRealSystemDir LIB "setuphlp.DLL" (szDir$,cbBuf%) AS INTEGER
DECLARE FUNCTION RestartWindows LIB "setuphlp.DLL" AS INTEGER
DECLARE FUNCTION IsWin32FileNewer LIB "setuphlp.DLL" (szOrig$,szNew$) AS INTEGER
DECLARE SUB RenameFilePlease LIB "setuphlp.DLL" (szOrig$,szNew$)
INIT:
bInstallDVA% = 0
CUIDLL$ = "mscuistf.dll" ''Custom user interface dll
HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
SetBitmap CUIDLL$, LOGO
SetTitle "Microsoft WinG Setup"
szInf$ = GetSymbolValue("STF_SRCINFPATH")
IF szInf$ = "" THEN
szInf$ = GetSymbolValue("STF_CWDDIR") + "wing.inf"
END IF
ReadInfFile szInf$
WELCOME:
sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
IF sz$ = "CONTINUE" THEN
UIPop 1
ELSE
GOSUB ASKQUIT
GOTO WELCOME
END IF
CHECKSTATES$ = "CheckItemsIn"
AddListItem CHECKSTATES$, "ON"
' AddListItem CHECKSTATES$, "OFF"
AddListItem CHECKSTATES$, "ON"
CHECK:
sz$ = UIStartDlg(CUIDLL$, CHECK, "FCheckDlgProc", APPHELP, HELPPROC$)
IF sz$ = "CONTINUE" THEN
UIPop 1
ELSE
GOSUB ASKQUIT
GOTO CHECK
END IF
CHECKSTATES$ = "CheckItemsOut"
IF GetListItem(CHECKSTATES$, WING_RUNFILES) = "ON" THEN
SrcDir$ = GetSymbolValue("STF_SRCDIR")
DEST$ = GetWindowsSysDir
AddSectionFilesToCopyList "runtime", SrcDir$, DEST$
'
' only use DVA on Windows 3.x
'
IF OnWin3x() = 1 THEN
AddSectionFilesToCopyList "dva", SrcDir$, DEST$
IF VflatdPresent() = 0 THEN
CreateSysIniKeyValue GetWindowsDir + "system.ini", "386Enh", "device", GetWindowsSysDir+"dva.386", cmoOverwrite
bInstallDVA% = 1
END IF
END IF
DEST$ = GetRealWindowsSysDir
AddSectionFilesToCopyList "wing32", SrcDir$, DEST$
Dest1$ = MakePath(DEST$,"wing32.dll")
Dest2$ = MakePath(DEST$,"wing32.xxx")
RenameFilePlease Dest1$,Dest2$
CopyFilesInCopyList
UpdateWinG32 GetRealWindowsSysDir()
END IF
IF GetListItem(CHECKSTATES$, WING_BUILDFILES) = "ON" THEN
WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
DEST$ = WINDRIVE$ + ":\WING"
FILEDIALOG = DESTPATH2
GOSUB GETPATH
SrcDir$ = GetSymbolValue("STF_SRCDIR")
CreateDir DEST$, cmoVital
'' add devkit files to destination
' WinBug.exe taken out for first beta, maybe add it in later, and fix up .lyt file too!
'CreateDir MakePath(DEST$,"winbug"), cmoNone
'AddSectionFilesToCopyList "winbug", SrcDir$, MakePath(DEST$,"winbug")
CreateDir MakePath(DEST$,"bin"), cmoNone
AddSectionFilesToCopyList "runtime", SrcDir$, MakePath(DEST$,"bin")
AddSectionFilesToCopyList "wing32", SrcDir$, MakePath(DEST$,"bin")
Dest1$ = MakePath(DEST$,"bin\wing32.dll")
Dest2$ = MakePath(DEST$,"bin\wing32.xxx")
RenameFilePlease Dest1$,Dest2$
AddSectionFilesToCopyList "bin", SrcDir$, MakePath(DEST$,"bin")
AddSectionFilestoCopyList "readme", SrcDir$, DEST$
CreateDir MakePath(DEST$,"include"), cmoNone
AddSectionFilesToCopyList "include", SrcDir$, MakePath(DEST$,"include")
CreateDir MakePath(DEST$,"help"), cmoNone
AddSectionFilesToCopyList "help", SrcDir$, MakePath(DEST$,"help")
CreateDir MakePath(DEST$,"lib"), cmoNone
AddSectionFilesToCopyList "lib", SrcDir$, MakePath(DEST$,"lib")
GOSUB ADDSAMPLEFILESTOLIST
CopyFilesInCopyList
UpdateWinG32 MakePath( DEST$, "bin" )
GOSUB ADDGROUP
END IF
QUIT:
ON ERROR GOTO ERRQUIT
IF ERR = 0 THEN
dlg% = EXITSUCCESS
ELSEIF ERR = STFQUIT THEN
dlg% = EXITQUIT
ELSE
dlg% = EXITFAILURE
END IF
QUITL1:
if dlg% = EXITSUCCESS AND bInstallDVA% = 1 then
sz$ = UIStartDlg(CUIDLL$, RESTART, "FInfoDlgProc", APPHELP, HELPPROC$)
UIPop 1
IF sz$ = "CONTINUE" THEN
rc% = RestartWindows
ENDIF
endif
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 555-1212!", "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
GETPATH:
SetSymbolValue "EditTextIn", DEST$
SetSymbolValue "EditFocus", "END"
GETPATHL1:
sz$ = UIStartDlg(CUIDLL$, FILEDIALOG, "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 CHECK
ELSE
GOSUB ASKQUIT
GOTO GETPATH
END IF
RETURN
ADDSAMPLEFILESTOLIST:
SamplePath$ = MakePath(DEST$,"samples")
CreateDir SamplePath$, cmoNone
' Add doggie example program
sample$ = "doggie"
CreateDir MakePath(SamplePath$,sample$), cmoNone
AddSectionFilesToCopyList sample$, SrcDir$, MakePath(SamplePath$,sample$)
' Add cube example program
sample$ = "cube"
CreateDir MakePath(SamplePath$,sample$), cmoNone
AddSectionFilesToCopyList sample$, SrcDir$, MakePath(SamplePath$,sample$)
' Add utils example code
sample$ = "utils"
CreateDir MakePath(SamplePath$,sample$), cmoNone
AddSectionFilesToCopyList sample$, SrcDir$, MakePath(SamplePath$,sample$)
' Add timewing example program
sample$ = "timewing"
CreateDir MakePath(SamplePath$,sample$), cmoNone
AddSectionFilesToCopyList sample$, SrcDir$, MakePath(SamplePath$,sample$)
' Add halftone example program
sample$ = "halftone"
CreateDir MakePath(SamplePath$,sample$), cmoNone
AddSectionFilesToCopyList sample$, SrcDir$, MakePath(SamplePath$,sample$)
' Add palanim example program
sample$ = "palanim"
CreateDir MakePath(SamplePath$,sample$), cmoNone
AddSectionFilesToCopyList sample$, SrcDir$, MakePath(SamplePath$,sample$)
' Other sample programs go here
RETURN
ADDGROUP:
SamplePath$ = MakePath(DEST$,"samples")
proggroup$ = "WinG SDK"
CreateProgmanGroup proggroup$, "", cmoNone
path$ = MakePath( DEST$, "help\wing.hlp" )
CreateProgmanItem proggroup$, "WinG Help", "winhelp "+path$, "", cmoOverwrite
path$ = MakePath( DEST$, "bin\wingbug.exe" )
CreateProgmanItem proggroup$, "WinG Bug Reporting Tool", path$, "", cmoOverwrite
path$ = MakePath( SamplePath$,"doggie\doggie.exe")
CreateProgmanItem proggroup$, "Doggie", path$, "", cmoOverwrite
path$ = MakePath( SamplePath$,"cube\cube.exe")
CreateProgmanItem proggroup$, "Cube