home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD Mania - The Perfect Multimedia Fun Pak!
/
cdmania.iso
/
wfsound.bak
< prev
next >
Wrap
Text File
|
1997-07-09
|
21KB
|
855 lines
'**************************************************************************
'* CD Mania Install Script
'* version 1.3 CD by Aaron Wallace (c) 1990-1997 PCSoftInc
'**************************************************************************
'' Define DEBUG for script 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 WHICHINST = 800
CONST APPHELP = 900
CONST WHICHINSTHLP = 910
CONST SETOWNER = 1000
CONST TESTSOUND = 1100
CONST INSTALLDRV = 1200
CONST SOUNDPLAYED = 1300
CONST WAITDLG = 1400
CONST EXITREBOOT = 1500
CONST WHICHVOICE = 1600
CONST BBD1 = 5000
CONST BBD2 = 5010
CONST BBD3 = 5020
CONST BBD4 = 5030
CONST BBD5 = 5040
CONST BBD6 = 5050
CONST SOUNDSDLG = 5200
CONST TAPPSDLG = 5300
CONST VOICESDLG = 5400
CONST CUSTINST = 6200
CONST TOOBIG = 6300
CONST BADPATH = 6400
'' For message boxes
CONST MB_YESNO=4
CONST MB_RETRYCANCEL=5
CONST IDNO=7
CONST IDYES=6
CONST IDRETRY=4
CONST IDCANCEL=2
''Bitmap ID
CONST LOGO = 1
''File Types
CONST BASEFILES = 1
CONST TAPPFILES = 2
CONST SOUNDFILES = 3
CONST VOICEFILES = 4
CONST MAX_TYPES = 4
''Install directories, etc.
GLOBAL DEST$ ''Default destination directory.
GLOBAL WINDRIVE$ ''Windows drive letter.
GLOBAL CUIDLL$ ''CUI DLL
GLOBAL WINDIR$ ''Windows directory
GLOBAL SYSDIR$ ''System directory
GLOBAL WININI$ ''"win.ini"
GLOBAL SYSINI$ ''GetWindowsDir() + "system.ini"
'' User info
GLOBAL OWNER$ '' Product registered owner
GLOBAL WORKPLACE$ '' Company or such
''Install item lists
GLOBAL BASE$ ''List of base files
GLOBAL TAPPS$ ''List of all talking apps
GLOBAL SOUNDS$ ''List of all sounds.
GLOBAL VOICES$ ''List of available voices
GLOBAL BASEINST$ ''List of base files to install
GLOBAL TAPPSINST$ ''List of Talking Apps to install
GLOBAL SOUNDSINST$ ''List of sounds to install
GLOBAL VOICESINST$ ''List of voices to install
''Custom Install list symbol names
GLOBAL BASENEEDS$ ''Option list costs per drive
GLOBAL TAPPNEEDS$
GLOBAL SOUNDNEEDS$
GLOBAL VOICENEEDS$
GLOBAL EXTRACOSTS$ ''List of extra costs to add per drive
''Custom Install dialog list symbol names
GLOBAL CHECKSTATES$ ''List of check box values
GLOBAL STATUSTEXT$ ''List of values to initialize status items
GLOBAL DRIVETEXT$ ''Drive space info, etc.
'' Install DSOUND
GLOBAL INSTDSOUND%
'' Customize product
GLOBAL CUSTOMIZE%
'' Test sound hardware
GLOBAL DOTEST%
GLOBAL WFSFOUND%
GLOBAL CUSTINSTALL%
'' Which type of install to perform, by default
GLOBAL DEFINSTOPT$
''Progman titles
GLOBAL WFSAPP$ ''Name of WFS app
''Win.ini [PCSoftInc ] install code
GLOBAL INSTDIR$
''Space requirements
GLOBAL FITS% '' > 0 if everything fits
DECLARE SUB RecalcOptFiles (ftype%)
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
DECLARE FUNCTION GetWindowsVersionCorrectly& ()
DECLARE FUNCTION MakeVer& (x as integer, y as integer)
DECLARE FUNCTION StringInList (s$, y$) AS INTEGER
DECLARE FUNCTION sndPlaySound LIB "MMSYSTEM.DLL" (f$, fl%) AS INTEGER
DECLARE FUNCTION GetModuleHandle LIB "KERNEL" (f$) AS INTEGER
DECLARE SUB Ctl3dRegister LIB "WFSUI.DLL" (f%)
DECLARE SUB Ctl3dAutoSubclass LIB "WFSUI.DLL" (f%)
DECLARE SUB Ctl3dUnregister LIB "WFSUI.DLL" (f%)
DECLARE SUB RemoveSectionFiles (dest$, sect$)
DECLARE SUB RemDirectory (d$)
DECLARE FUNCTION HasSoundDriver() AS INTEGER
DECLARE SUB SendProgmanCommand LIB "CUI.DLL" (s$)
DECLARE SUB KillFiles LIB "CUI.DLL" (s$)
'' These are defined in wfs.inc (product-specific)
DECLARE SUB SetProductTitles
DECLARE FUNCTION InfFile() AS STRING
DECLARE FUNCTION MakeInstDir(D$) AS STRING
DECLARE SUB AddInfSectionNames (BASE$, TAPPS$, SOUNDS$, VOICES$, BASEINST$, TAPPSINST$, SOUNDSINST$, VOICESINST$)
DECLARE SUB RecalcPath
DECLARE SUB AddOptFilesToCopyList (ftype%)
DECLARE SUB SetDriveStatus
DECLARE SUB AddOptFiles
DECLARE SUB ConfigureApps
DECLARE SUB AddBillboards
DECLARE SUB DoUninstall
'' This is where it all begins!
INIT:
CUIDLL$ = "cui.dll"
DEFINSTOPT$ = "1"
INSTDSOUND% = 0
CUSTOMIZE% = -1
DOTEST% = -1
SetProductTitles
HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
SetBitmap CUIDLL$, LOGO
'' We don't do Windows 3.0...
If GetWindowsVersionCorrectly() < MakeVer(3, 10) Then
i% = DoMsgBox("This product requires Windows version 3.10 or greater", WFSAPP$, MB_OK)
GOTO DONEFINIFIN
End If
'' We don't want these DLLs to be loaded quite yet...
LookAround:
IF GetModuleHandle("SNDAPI") OR GetModuleHandle("WFSABOUT") THEN
i% = DoMsgBox("Please quit all other PCSoftInc products before continuing with Setup.", WFSAPP$, MB_RETRYCANCEL)
IF i% = IDRETRY THEN
GOTO LookAround
ELSEIF i% = IDCANCEL THEN
GOTO DONEFINIFIN
END IF
END IF
HCUI% = GetModuleHandle("CUI")
Ctl3dRegister(HCUI%)
Ctl3dAutoSubclass(HCUI%)
''Find location of INF file and create a default dest. dir
szInf$ = GetSymbolValue("STF_SRCINFPATH")
IF szInf$ = "" THEN
szInf$ = GetSymbolValue("STF_CWDDIR") + InfFile()
END IF
'' Load the INF file
ReadInfFile szInf$
'' Construct default strings
WINDIR$ = GetWindowsDir()
SYSDIR$ = GetWindowsSysDir()
WININI$ = "win.ini"
SYSINI$ = MakePath(WINDIR$, "system.ini")
'' Construct the default install path
WINDRIVE$ = MID$(WINDIR$, 1, 1)
DEST$ = MakeInstDir(WINDRIVE$)
'' Setup install symbols
BASE$ = "Base Files"
TAPPS$ = "Talking Apps"
SOUNDS$ = "Sounds"
VOICES$ = "Voices"
BASEINST$ = "Base Files Inst"
TAPPSINST$ = "Talking Apps Inst"
SOUNDSINST$ = "Sounds Inst"
VOICESINST$ = "Voices Inst"
SetSymbolValue BASE$, ""
SetSymbolValue TAPPS$, ""
SetSymbolValue SOUNDS$, ""
SetSymbolValue VOICES$, ""
''Set up symbols for the initial install dialog
RADIODEFAULT$ = "Radio Default"
''Set up symbols for the custom install dialog
CHECKSTATES$ = "CheckItemsState"
STATUSTEXT$ = "StatusItemsText"
DRIVETEXT$ = "DriveStatusText"
FOR i% = 1 TO 4 STEP 1
AddListItem CHECKSTATES$, "ON"
NEXT i%
FOR i% = 1 TO 4 STEP 1
AddListItem STATUSTEXT$, ""
NEXT i%
FOR i% = 1 TO 7 STEP 1
AddListItem DRIVETEXT$, ""
NEXT i%
ReplaceListItem DRIVETEXT$, 7, DEST$
''Disk cost list symbols
BASENEEDS$ = "BaseNeeds"
TAPPNEEDS$ = "TAppNeeds"
SOUNDNEEDS$ = "SoundNeeds"
VOICENEEDS$ = "VoiceNeeds"
EXTRACOSTS$ = "ExtraCosts"
FOR i% = 1 TO 26 STEP 1
AddListItem EXTRACOSTS$, "0"
NEXT i%
''Configure lists of installable files
AddInfSectionNames BASE$, TAPPS$, SOUNDS$, VOICES$, BASEINST$, TAPPSINST$, SOUNDSINST$, VOICESINST$
'$IFDEF DEBUG
i% = SetSizeCheckMode(scmOnIgnore) '' could use scmOff; def = scmOnFatal
'$ENDIF ''DEBUG
'' Ask which voice to use
'' See if users want an easy install, custom install, or no install...
WHICHVOICE:
SetSymbolValue "RadioDefault", "1"
sz$ = UIStartDlg(CUIDLL$, WHICHVOICE, "FRadioDlgProc", WHICHINSTHLP, HELPPROC$)
''sz$ is the button the user pressed; RADIODEFAULT$ is the option selected
IF sz$ = "EXIT" THEN
GOSUB ASKQUIT
GOTO WHICHVOICE
ELSEIF sz$ = "CONTINUE" THEN
sz$ = GetSymbolValue("ButtonChecked")
IF sz$ = "1" THEN
UIPop 1
INSTSNDDIR$ = MakePath(GetSymbolValue("STF_SRCDIR"), "sounds\install\simmons")
GOTO WELCOME
ELSEIF sz$ = "2" THEN
UIPop 1
INSTSNDDIR$ = MakePath(GetSymbolValue("STF_SRCDIR"), "sounds\install\sultry")
GOTO WELCOME
ELSEIF sz$ = "3" THEN
UIPop 1
INSTSNDDIR$ = MakePath(GetSymbolValue("STF_SRCDIR"), "sounds\install\harold")
GOTO WELCOME
END IF
END IF
GOTO WHICHVOICE