home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
1,000 Games
/
Disc2.iso
/
KIDS
/
MARTYDEM
/
MARTY2.MST
< prev
next >
Wrap
Text File
|
1995-12-04
|
10KB
|
361 lines
'$DEFINE DEBUG ''Define for script development/debugging
' This should set a flag if the command line /NO_CHECK was included
' This must occur before calling setupapi, or any command line args get
' lost
'$INCLUDE 'setupapi.inc'
'$INCLUDE 'msdetect.inc'
''Dialog ID's
CONST WELCOME = 100
CONST ASKQUIT = 200
CONST DESTPATH = 300
CONST EXITFAILURE = 400
CONST TOOBIG = 500
CONST EXITQUIT = 600
CONST EXITSUCCESS = 700
CONST EXITRESTART = 800
CONST APPHELP = 900
CONST MODEHELP = 904
CONST RUNSOUND = 6300
CONST BADPATH = 6400
CONST PATHEXISTS = 6500
CONST BADMODE = 7704
'' Some Constant Values for Maximized Install Window
CONST WS_VISIBLE =&H10000000
CONST WS_BORDER =&H00800000
CONST WS_CLIPCHILDREN =&H02000000
CONST GWL_STYLE = -16
CONST SW_SHOWMAXIMIZED = 3
'' End Maximized Window Install Constants
'' Bitmap ID
CONST LOGO = 1
GLOBAL DEST$ ''Default destination directory.
GLOBAL USERNAME$ ''User registration name.
GLOBAL COMPANYNAME$ ''Company Name
GLOBAL WINDIR$
GLOBAL WINSYSDIR$
GLOBAL WING1$
GLOBAL SrcDir$
GLOBAL INSTALLOPTION$
GLOBAL INIPATH$
GLOBAL RUNPATH$
GLOBAL bInstallDVA%
GLOBAL SPACENEEDED&
'' Global directory strings
WINDIR$ = GetWindowsDir()
WINSYSDIR$ = GetWindowsSysDir ()
'' Global Source Drive string
SrcDir$ = GetSymbolValue("STF_SRCDIR")
RestartDir$ = GetSymbolValue("STF_CWDDIR")
'' Global option and statistic variables
INSTALLOPTION$ = "CD"
SPACENEEDED& = 3663052
DECLARE SUB Install
DECLARE FUNCTION OnWin3x LIB "setuphlp.DLL" AS INTEGER
DECLARE FUNCTION ExitWindows LIB "user" (rc&, r%) AS INTEGER
DECLARE FUNCTION VflatdPresent LIB "setuphlp.DLL" AS INTEGER
'' Some Subroutine Declarations for Maximized Install Window
DECLARE FUNCTION ShowWindow LIB "user.exe" (hWnd%, iShow%) AS INTEGER
DECLARE FUNCTION SetWindowLong LIB "user.exe" (hWnd%, offset%, style&) AS LONG
'' End Declarations for Maximized Window Install
INIT:
'' This is where we set it to maximize the install window
hWnd%=HwndFrame()
i1&=SetWindowLong(hWnd%,GWL_STYLE,WS_VISIBLE+WS_BORDER+WS_CLIPCHILDREN)
j1%=ShowWindow(hWnd%,SW_SHOWMAXIMIZED)
'' End of Maximize stuff
CUIDLL$ = "mscuistf.dll" ''Custom user interface dll
HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
SetBitmap CUIDLL$, LOGO
SetTitle " Marty Mouse Online Demo Setup"
szInf$ = GetSymbolValue("STF_SRCINFPATH")
IF szInf$ = "" THEN
szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
END IF
ReadInfFile szInf$
WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
DEST$ = WINDRIVE$ + ":\MARTY"
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
i% = SetSizeCheckMode(scmOnIgnore) '' could use scmOff; def = scmOnFatal
'' This just tosses up a nice welcome screen
WELCOME:
ErrorSection$ = "Welcome"
sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", 0, "")
IF sz$ = "CONTINUE" THEN
UIPop 1
ELSE
GOSUB ASKQUIT
GOTO WELCOME
END IF
'' Check the Windows mode - if user isn't not in Enhanced mode, quit
CHECKMODE:
ErrorSection$ = "CheckMode"
i% = GetWindowsMode ()
IF i% < 2 THEN
sz$ = UIStartDLG(CUIDLL$, BADMODE, "FInfoDlgProc", MODEHELP, HELPPROC$)
IF sz$ = "CONTINUE" THEN
UIPop 1
ELSE
UIPop 1
GOSUB ASKQUIT
GOTO CHECKMODE
END IF
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 MID$(DEST$, LEN(DEST$), 1) = "\" THEN
DEST$ = MID$(DEST$,1,LEN(DEST$) - 1)
END IF
UIPop 1
' Check space requirements
IF IsDirWritable(DEST$) = 0 THEN
GOSUB BADPATH
GOTO GETPATHL1
END IF
' Check free space
IF GetFreeSpaceForDrive(MID$(DEST$,1,1)) < SPACENEEDED& THEN
GOSUB TOOBIG
GOTO GETPATHL1
END IF
' Make the empty directories
CreateDir DEST$, cmoNone
CreateDir DEST$ + "\ASSETS", cmoNone
CreateDir DEST$ + "\ASSETS\MUSIC", cmoNone
ELSEIF sz$ = "REACTIVATE" THEN
GOTO GETPATHL1
ELSEIF sz$ = "BACK" THEN
UIPop 1
GOTO WELCOME
ELSE
GOSUB ASKQUIT
GOTO GETPATH
END IF
ANNOUNCE:
ErrorSection$ = "Announce"
sz$ = UIStartDlg(CUIDLL$, APPHELP, "FInfoDlgProc", EXITQUIT, HELPPROC$)
IF sz$ = "CONTINUE" THEN
UIPop 1
ELSE
GOSUB ASKQUIT
GOTO ANNOUNCE
END IF
DOWING:
' This portion installs the DVA.386 driver on machines in Enhanced Mode
IF OnWin3x() = 1 THEN
IF VflatdPresent() = 0 THEN
sz$ = GetIniKeyString( WINDIR$ + "SYSTEM.INI", "386Enh", "device=dva.386" )
IF sz$ = "" THEN
CreateSysIniKeyValue GetWindowsDir + "system.ini", "386Enh", "device", "dva.386", cmoOverwrite
bInstallDVA% = 1
WING1$ = "WinG"
RemoveIniSection "WIN.INI", WING1$, CmoNone
ELSE
bInstallDVA% = 0
END IF
END IF
END IF
DOINSTALL:
Install
QUIT:
' ON ERROR GOTO ERRORSUB
' IF ERR = 0 THEN
' dlg% = EXITSUCCESS
IF ERR = STFQUIT THEN
dlg% = EXITQUIT
ELSEIF bInstallDVA% = 1 THEN
dlg% = EXITRESTART
ELSE
dlg% = EXITSUCCESS
END IF
QUITL1:
' If dva.386 was installed for WinG, Windows needs restarting.
IF dlg% = EXITQUIT THEN
sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO QUITL1
END IF
UIPop 1
GOTO DONE
END IF
IF dlg% = EXITRESTART THEN
sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfoDlgProc", 0, "")
UIPop 1
END IF
RUNPATH$ = DEST$
sz$ = UIStartDlg(CUIDLL$, RUNSOUND, "FInfo0DlgProc", 0, "")
UIPop 1
sz$ = RUNPATH$ + "\SSETUP.EXE " + RUNPATH$ + "\MARTY.INI"
RUN sz$
sz$ = UIStartDlg(CUIDLL$, EXITSUCCESS, "FInfoDlgProc", 0, "")
UIPop 1
DONE:
END
ERRORSUB:
GOTO QUIT
BADPATH:
sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO BADPATH
END IF
UIPop 1
RETURN
TOOBIG:
' Put up an information dialog which shows the free & needed statistics.
temp$ = "You need" + str$(SPACENEEDED&) + " bytes free to install this demo. "
temp2$ = "Free space on this disk is" + str$(GetFreeSpaceForDrive(MID$(DEST$,1,1)))
i% = DoMsgBox(temp$ + temp2$ + " bytes.", "Disk Space Information", MB_OK+MB_TASKMODAL+MB_ICONEXCLAMATION)
' Do the setup dialog stuff
sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO TOOBIG
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
'' RUNPATH$ = SrcDir$ + "MARTY"
RUNPATH$ = DEST$
ClearCopyList
'' The following line changed for online demo to install SOUNDMIX.INI
'' in the program directory. ***ATW*** 11/29/95
'' AddSectionFilesToCopyList "WINDOWS", SrcDir$, WINDIR$
AddSectionFilesToCopyList "SYSTEM", SrcDir$, WINSYSDIR$
AddSectionFilesToCopyList "EXEDIRFILES", SrcDir$, RUNPATH$
AddSectionFilesToCopyList "ASSETDIRFILES", SrcDir$, RUNPATH$ + "\ASSETS"
AddSectionFilesToCopyList "MIDIDIRFILES", SrcDir$, RUNPATH$ + "\ASSETS\MUSIC"
IF bInstallDVA% = 1 THEN
AddSectionFilesToCopyList "DVA", SrcDir$, WINSYSDIR$
END IF
'' Do the copy
CopyFilesInCopyList
'' MARTY.INI will be in the Windows directory, so set INIPATH$ to the
'' Windows path minus its ending \
'' But for the online demo, the INI files are in the program's directory,
'' so do this stuff to the program path for now. ***ATW*** 11/29/95
'' INIPATH$ = WINDIR$
INIPATH$ = RUNPATH$
IF MID$(INIPATH$, LEN(INIPATH$), 1) = "\" THEN
INIPATH$ = MID$(INIPATH$,1,LEN(INIPATH$) - 1)
END IF
INIPATH$ = RUNPATH$ + "\MARTY.INI"
CreateProgmanGroup "Maxis", "", cmoNone
ShowProgmanGroup "Maxis", 1, cmoNone
CreateProgmanItem "Maxis", "Marty Mouse", RUNPATH$ + "\MARTY.EXE", "", cmoOverwrite
CreateProgmanItem "Maxis", "Marty Sound Setup", RUNPATH$ + "\SSETUP.EXE " + INIPATH$, "", cmoOverwrite
CreateProgmanItem "Maxis", "Marty Mouse ReadMe", RUNPATH$ + "\README.WRI", "", cmoOverwrite
CreateProgmanItem "Maxis", "Maxis Technical Tips", RUNPATH$ + "\TECHTIP.WRI", "", cmoOverwrite
RemoveIniSection INIPATH$, "Sound Settings", CmoNone
RemoveIniSection INIPATH$, "Interactivity", CmoNone
RemoveIniSection INIPATH$, "SoundSetup", CmoNone
CreateIniKeyValue INIPATH$, "Sound Settings", "Input Gain", "255", cmoOverwrite
CreateIniKeyValue INIPATH$, "Sound Settings", "Music Volume", "128", cmoOverwrite
CreateIniKeyValue INIPATH$, "Sound Settings", "Sound Volume", "128",cmoOverwrite
CreateIniKeyValue INIPATH$, "Sound Settings", "Threshold", "5", cmoOverwrite
CreateIniKeyValue INIPATH$, "Interactivity", "Interactive", "1", cmoOverwrite
CreateIniKeyValue INIPATH$, "Interactivity", "Prompting", "1", cmoOverwrite
CreateIniKeyValue INIPATH$, "Interactivity", "Background Music", "1", cmoOverwrite
CreateIniKeyValue INIPATH$, "SoundSetup", "SoundOutputID", "0", cmoOverwrite
CreateIniKeyValue INIPATH$, "SoundSetup", "SoundInputID", "0", cmoOverwrite
CreateIniKeyValue INIPATH$, "SoundSetup", "AuxiliaryInputID", "none", cmoOverwrite
END SUB