home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1993-09-08 | 37.4 KB | 1,150 lines
''////////////////////////////////////// include files '$INCLUDE 'setupapi.inc' '$INCLUDE 'msdetect.inc' ''////////////////////////////////////// WINAPI declarations Declare Function ExitWindows% Lib "User" (dwReserved&, wReturnCode%) Declare Function WinHelp Lib "User" (hWnd%, lpHelpFile$, wCommand%, dwData) As Integer DECLARE FUNCTION ShowWindow LIB "user.exe" (hWnd%,iShow%) AS INTEGER DECLARE FUNCTION SetWindowLong LIB "user.exe" (hWnd%, offset%, style&) AS LONG DECLARE FUNCTION WinExec LIB "Kernel" (lpCmdLine$, nCmdShow%) AS INTEGER Declare Function MessageBox Lib "User" (hWnd%, lpText$, lpCaption$,wType%) As Integer Declare Function GetFreeSpace Lib "Kernel" (wFlags%) As Long Declare Function GetTempFileName Lib "Kernel" (cDriveLetter%, lpPrefixString$, wUnique%, lpTempFileName$) As Integer Declare Function FindWindow Lib "User" (lpClassName$, lpWindowNam$) As Integer ''////////////////////////////////////// WINAPI constants Const WS_VISIBLE = &H10000000 Const WS_CLIPCHILDREN = &H2000000 Const WS_BORDER = &H800000 Const SW_SHOWMAXIMIZED = 3 CONST GWL_STYLE =-16 Const MB_ICONQUESTION = &H20 Const MB_ICONEXCLAMATION = &H30 Const MB_ICONASTERISK = &H40 Const MB_ICONINFORMATION = MB_ICONASTERISK Const MB_OKCANCEL = &H1 Const MB_ABORTRETRYIGNORE = &H2 Const MB_YESNOCANCEL = &H3 Const MB_YESNO = &H4 Const MB_RETRYCANCEL = &H5 Const IDOK = 1 Const IDYES = 6 Const IDNO = 7 Const HELP_CONTEXT = &H1 Const HELP_QUIT = &H2 ''////////////////////////////////// check if Sound Impression is currently running findclass1$ = "EDITPARENT" findclass2$ = "AUDRKPARENT" findtitle$ = "Sound Impression" lookforsi1% = FindWindow (findclass1$,findtitle$) lookforsimin% = FindWindow (findclass2$,NULL) If lookforsi1% <> 0 or lookforsimin% <> 0 then runningstop% = MessageBox(hwnd%, "Sound Impression is running. Close it, then run Setup again.","Sound Impression Setup", MB_OK+MB_TASKMODAL+MB_ICONSTOP) if IDOK then STOP end if end if ''////////////////////////////////// script subroutines DECLARE SUB Install DECLARE SUB REMOVESI DECLARE SUB FINIS ON END FINIS ''///////////////////////////////// script function declarations DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING ''//////////////////////////////////////////CUI Dialog IDs CONST CPMESSAGE = 9999 CONST CPANNOUNCE = 5005 CONST DRVCHOICE = 5099 CONST PICKTASKX = 6000 CONST STATUSREPORTX = 6010 CONST DESTPATHX = 6020 CONST SIPATHX = 6025 CONST CARDLISTX = 6030 CONST CARDLISTXLNG = 6040 CONST BADPATHX = 6050 CONST ASKQUITX = 6060 CONST EXITFAILUREX = 6070 CONST EXITQUITX = 6080 CONST EXITSUCCESSX = 6090 CONST APPHELPX = 7000 CONST CPANNOUNCEX = 7007 CONST DRVCHOICEX = 7099 CONST PICKTASK = 8000 CONST STATUSREPORT = 8010 CONST DESTPATH = 8020 CONST SIPATH = 8025 CONST CARDLIST = 8030 CONST CARDLISTLNG = 8040 CONST BADPATH = 8050 CONST ASKQUIT = 8060 CONST EXITFAILURE = 8070 CONST EXITQUIT = 8080 CONST EXITSUCCESS = 8090 CONST APPHELP = 9000 ''///////////////////////////////// script globals GLOBAL CHECKAGAIN% GLOBAL DEST$ GLOBAL CARD$ GLOBAL CARDLOADLIST$ GLOBAL CARDPICK$ GLOBAL SELECTED$ GLOBAL szInf$ GLOBAL progshell$ GLOBAL STATS$ GLOBAL STATUSITEMS$ GLOBAL STATUSITEMSPICK$ GLOBAL STATPICK$ GLOBAL WINDIRECT$ GLOBAL winsysdir$ GLOBAL winsysini$ GLOBAL INI$ GLOBAL OPTCUR$ GLOBAL PATHNOW$ GLOBAL REMIMPRESSION$ GLOBAL SCRWID% GLOBAL DELETEFLAG$ GLOBAL SETUPOK$ GLOBAL WORKSTRING$ GLOBAL VIRTSTRING$ GLOBAL PERMSWAP$ GLOBAL TEMPSWAP$ GLOBAL MCIDRIVERS$ GLOBAL CARDDRIVERS$ GLOBAL findarial$ GLOBAL totop$ GLOBAL WAVEOFF$ GLOBAL MIDIOFF$ GLOBAL CDOFF$ GLOBAL CDD$ GLOBAL CDDRIVER$ GLOBAL MCISECT$ GLOBAL MCICD$ GLOBAL MCISEQ$ GLOBAL SEQ$ GLOBAL DRIVETIMER$ GLOBAL TIM$ GLOBAL WAVEDRV$ GLOBAL WAVEDRV1$ GLOBAL WAVEDRV2$ GLOBAL WAVEDRV3$ GLOBAL WAVEDRV4$ GLOBAL WAVEDRV5$ GLOBAL WAVEDRV6$ GLOBAL WAVEDRV7$ GLOBAL WAVEDRV8$ GLOBAL WAVEDRV9$ GLOBAL WAV$ GLOBAL MIDIDRV$ GLOBAL MIDIDRV1$ GLOBAL MIDIDRV2$ GLOBAL MIDIDRV3$ GLOBAL MIDIDRV4$ GLOBAL MIDIDRV5$ GLOBAL MIDIDRV6$ GLOBAL MIDIDRV7$ GLOBAL MIDIDRV8$ GLOBAL MIDIDRV9$ GLOBAL NOPERMSWAP$ GLOBAL TRUTYPKEY$ GLOBAL ARIALKEY$ ''////////////////////////////////////// Start INIT: ''////////////////////////////////////// read info file, do backdrop, set main variables HELPPROC$ = "FHelpDlgProc" WINDIRECT$ = GetWindowsDir() winsysdir$ = GetWindowsSysDir() winsysini$ = FindFileInTree("SYSTEM.INI",WINDIRECT$) CUIDLL$ = "cui_oem.dll" ''<<<<<<<<<<<< contains oem-specific logo CONST LOGO1 = 1 CONST LOGO2 = 2 mainWnd%=HwndFrame() w&=SetWindowLong(mainWnd%,GWL_STYLE,WS_VISIBLE+WS_BORDER+WS_CLIPCHILDREN) j%=ShowWindow(mainWnd%,SW_SHOWMAXIMIZED) SCRWID% = GetScreenWidth() If SCRWID% = 640 then SetBitmap CUIDLL$, LOGO1 else SetBitmap CUIDLL$, LOGO2 end if szInf$ = GetSymbolValue("STF_SRCINFPATH") IF szInf$ = "" THEN szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP2.INF" ''<<<<<<<<<<<< info file name (can change) END IF ReadInfFile szInf$ ''/////////////////////// establish Setup Help window position in win.ini helporig7$ = GetIniKeyString("win.ini","Windows Help","M_WindowPosition") If SCRWID% = 640 then CreateIniKeyValue "win.ini", "Windows Help", "M_WindowPosition", "[33,262,584,211,0]" , cmoOverwrite else CreateIniKeyValue "win.ini", "Windows Help", "M_WindowPosition", "[100,358,584,211,0]" , cmoOverwrite end if ''/////////////////////// set more local variables, do system analysis findarial$ = FindFileInTree("ARIAL.FOT",WINDIRECT$) progini$ = FindFileInTree("PROGMAN.INI",WINDIRECT$) progshell$ = GetIniKeyString(winsysini$,"boot","shell") MCISECT$ = lcase$("mci") MCICD$ = lcase$(rtrim$(ltrim$("cdaudio"))) MCISEQ$ = lcase$(rtrim$(ltrim$("sequencer"))) DRVSECT$ = lcase$("drivers") DRIVETIMER$ = lcase$(rtrim$(ltrim$("timer"))) MIDIDRV$ = lcase$(rtrim$(ltrim$("midi"))) MIDIDRV1$ = lcase$(rtrim$(ltrim$("midi1"))) MIDIDRV2$ = lcase$(rtrim$(ltrim$("midi2"))) MIDIDRV3$ = lcase$(rtrim$(ltrim$("midi3"))) MIDIDRV4$ = lcase$(rtrim$(ltrim$("midi4"))) MIDIDRV5$ = lcase$(rtrim$(ltrim$("midi5"))) MIDIDRV6$ = lcase$(rtrim$(ltrim$("midi6"))) MIDIDRV7$ = lcase$(rtrim$(ltrim$("midi7"))) MIDIDRV8$ = lcase$(rtrim$(ltrim$("midi8"))) MIDIDRV9$ = lcase$(rtrim$(ltrim$("midi9"))) m0% = DoesIniKeyExist(winsysini$,DRVSECT$,MIDIDRV$) m1% = DoesIniKeyExist(winsysini$,DRVSECT$,MIDIDRV1$) m2% = DoesIniKeyExist(winsysini$,DRVSECT$,MIDIDRV2$) m3% = DoesIniKeyExist(winsysini$,DRVSECT$,MIDIDRV3$) m4% = DoesIniKeyExist(winsysini$,DRVSECT$,MIDIDRV4$) m5% = DoesIniKeyExist(winsysini$,DRVSECT$,MIDIDRV5$) m6% = DoesIniKeyExist(winsysini$,DRVSECT$,MIDIDRV6$) m7% = DoesIniKeyExist(winsysini$,DRVSECT$,MIDIDRV7$) m8% = DoesIniKeyExist(winsysini$,DRVSECT$,MIDIDRV8$) m9% = DoesIniKeyExist(winsysini$,DRVSECT$,MIDIDRV9$) If m0% <> 0 then goto nextset elseif m1% <> 0 then goto nextset elseif m2% <> 0 then goto nextset elseif m3% <> 0 then goto nextset elseif m4% <> 0 then goto nextset elseif m5% <> 0 then goto nextset elseif m6% <> 0 then goto nextset elseif m7% <> 0 then goto nextset elseif m8% <> 0 then goto nextset elseif m9% <> 0 then goto nextset else SEQ$ = "no" end if nextset: WAVEDRV$ = lcase$(rtrim$(ltrim$("wave"))) WAVEDRV1$ = lcase$(rtrim$(ltrim$("wave1"))) WAVEDRV2$ = lcase$(rtrim$(ltrim$("wave2"))) WAVEDRV3$ = lcase$(rtrim$(ltrim$("wave3"))) WAVEDRV4$ = lcase$(rtrim$(ltrim$("wave4"))) WAVEDRV5$ = lcase$(rtrim$(ltrim$("wave5"))) WAVEDRV6$ = lcase$(rtrim$(ltrim$("wave6"))) WAVEDRV7$ = lcase$(rtrim$(ltrim$("wave7"))) WAVEDRV8$ = lcase$(rtrim$(ltrim$("wave8"))) WAVEDRV9$ = lcase$(rtrim$(ltrim$("wave9"))) w0% = DoesIniKeyExist(winsysini$,DRVSECT$,WAVEDRV$) w1% = DoesIniKeyExist(winsysini$,DRVSECT$,WAVEDRV1$) w2% = DoesIniKeyExist(winsysini$,DRVSECT$,WAVEDRV2$) w3% = DoesIniKeyExist(winsysini$,DRVSECT$,WAVEDRV3$) w4% = DoesIniKeyExist(winsysini$,DRVSECT$,WAVEDRV4$) w5% = DoesIniKeyExist(winsysini$,DRVSECT$,WAVEDRV5$) w6% = DoesIniKeyExist(winsysini$,DRVSECT$,WAVEDRV6$) w7% = DoesIniKeyExist(winsysini$,DRVSECT$,WAVEDRV7$) w8% = DoesIniKeyExist(winsysini$,DRVSECT$,WAVEDRV8$) w9% = DoesIniKeyExist(winsysini$,DRVSECT$,WAVEDRV9$) If w0% <> 0 then goto nextset2 elseif w1% <> 0 then goto nextset2 elseif w2% <> 0 then goto nextset2 elseif w3% <> 0 then goto nextset2 elseif w4% <> 0 then goto nextset2 elseif w5% <> 0 then goto nextset2 elseif w6% <> 0 then goto nextset2 elseif w7% <> 0 then goto nextset2 elseif w8% <> 0 then goto nextset2 elseif w9% <> 0 then goto nextset2 else WAV$ = "no" end if nextset2: timesys% = DoesIniKeyExist(winsysini$,DRVSECT$,DRIVETIMER$) if timesys% = 0 then TIM$ = "no" end if cdsys% = DoesIniKeyExist(winsysini$,MCISECT$,MCICD$) if cdsys% = 0 then CDD$ = "no" end if seqsys% = DoesIniKeyExist(winsysini$,MCISECT$,MCISEQ$) if seqsys% = 0 then SEQ$ = "no" end if szTemp$ = String$(144, 0) tempresult% = GetTempFileName(0, "tst", 0, szTemp$) workdir$ = Mid$(szTemp$,1,1) RemoveFile szTemp$,cmoForce wfree& = GetFreeSpaceForDrive(workdir$) wfreesz$ = str$(wfree&/10000) wfreedec$ = mid$(wfreesz$,len(wfreesz$)-1,2) wfreepredec$ = mid$(wfreesz$,1,len(wfreesz$)-2) If val(wfreepredec$) < 16 then WORKSTRING$ = "**** Free space on Windows drive " + "(" + workdir$ + "): " + wfreepredec$ + "." + wfreedec$ + " MB" else WORKSTRING$ = "OK. Free space on Windows drive " + "(" + workdir$ + "): " + wfreepredec$ + "." + wfreedec$ + " MB" end if vmem& = GetFreeSpace(0) vmemsz$ = str$(vmem&/10000) vmemdec$ = mid$(vmemsz$,len(vmemsz$)-1,2) vmempredec$ = mid$(vmemsz$,1,len(vmemsz$)-2) If val(vmempredec$) < 16 then VIRTSTRING$ = "**** Virtual memory (current): " + vmempredec$ + "." + vmemdec$ + " MB" else VIRTSTRING$ = "OK. Virtual memory (current): " + vmempredec$ + "." + vmemdec$ + " MB" end if wpermswapd$=GetIniKeyString(winsysini$,"386Enh","PermSwapDOSDrive") wtempswapd$=GetIniKeyString(winsysini$,"386Enh","PagingFile") wpermswap$=GetIniKeyString(winsysini$,"386Enh","PermSwapSizeK") wtempswap$=GetIniKeyString(winsysini$,"386Enh","MaxPagingFileSize") If len(wpermswap$) > 3 then wpermswapsz$ = mid$(wpermswap$,1,len(rtrim$(ltrim$(wpermswap$)))-1) wpermswapkb$ = mid$(wpermswapsz$,len(wpermswapsz$)-2,2) wpermswapmb$ = mid$(wpermswapsz$,1,len(wpermswapsz$)-2) if val(wpermswapmb$) < 16 then PERMSWAP$ = "**** Permanent Swap File (drive " + wpermswapd$ + "): " + wpermswapmb$ + "." + wpermswapkb$ + " MB" else PERMSWAP$ = "OK. Permanent Swap File (drive " + wpermswapd$ + "): " + wpermswapmb$ + "." + wpermswapkb$ + " MB" end if end if if wpermswapd$ = "" then NOPERMSWAP$ = "**** Permanent Swap File not found" end if If len(wtempswap$) > 3 then wtempswapsz$ = mid$(wtempswap$,1,len(rtrim$(ltrim$(wtempswap$)))-1) wtempswapkb$ = mid$(wtempswapsz$,len(wtempswapsz$)-2,2) wtempswapmb$ = mid$(wtempswapsz$,1,len(wtempswapsz$)-2) TEMPSWAP$ = "**** Temp Swap File (" + wtempswapd$ + "): " + wtempswapmb$ + "." + wtempswapkb$ + " MB" end if wbitcheck$=GetIniKeyString(winsysini$,"386Enh","32BitDiskAccess") If lcase$(ltrim$(rtrim$(wbitcheck$))) <> "on" then WBITRPT$ = "**** 32-bit Disk Access is OFF" else WBITRPT$ = "" end if dosver1% = GetDosMajorVersion() dosver2% = GetDosMinorVersion() dosresult1$ = ltrim$(rtrim$(str$(dosver1%))) dosresult2$ = ltrim$(rtrim$(str$(dosver2%))) dosresult$ = dosresult1$ + "." + dosresult2$ If val(dosresult1$) < 5 then DOSVERRPT$ = "*** DOS version: " + dosresult$ else DOSVERRPT$ = "" end if winver1% = GetWindowsMajorVersion() winver2% = GetWindowsMinorVersion() winresult1$ = ltrim$(rtrim$(str$(winver1%))) winresult2$ = ltrim$(rtrim$(str$(winver2%))) winresult$ = winresult1$ + "." + winresult2$ If val(winresult1$) < 3 and val(winresult2$) < 10 then WINVERRPT$ = "**** Windows version: " + winresult$ else WINVERRPT$ = "" end if mouse1% = HasMouseInstalled() If mouse1% <> 1 then MOUSERPT$ = "**** Mouse is NOT installed" else MOUSERPT$ = "" end if wmode% = GetWindowsMode() If wmode% = 2 then WMODERPT$ = "" elseif wmode% = 1 then WMODERPT$ = "**** Windows mode: standard" elseif wmode% = 0 then WMODERPT$ = "**** Windows mode: Real" end if wproctype% = GetProcessorType() If wproctype% = 4 then wproctyprpt$ = "OK. Processor type: 80486" elseif wproctype% = 3 then wproctyprpt$ = "**** Processor type: 80386" elseif wproctype% = 2 then wproctyprpt$ = "**** Processor type: 80286" elseif wproctype% = 1 then wproctyprpt$ = "**** Processor type: 80186" elseif wproctype% = 0 then wproctyprpt$ = "**** Processor type: 8086" else wproctyprpt$ = "**** Processor type: Undetermined" end if wttfkeycheck% = DoesIniSectionExist("win.ini","TrueType") If wttfkeycheck% = 0 then TRUTYPKEY$ = "**** TrueType enabling switch not present" else TRUTYPKEY$ = "" end if if wttfkeycheck% <> 0 then wttfcheck$=GetIniKeyString("win.ini","TrueType","TTEnable") If ltrim$(rtrim$(wttfcheck$)) <> "1" then TRUTYPRPT$ = "**** TrueType is not enabled" else TRUTYPRPT$ = "" end if end if If findarial$ = "" then ARIALRPT$ = "**** Arial TrueType font not found" else ARIALRPT$ = "" end if If findarial$ <> "" then arialkey1% = DoesIniKeyExist("win.ini","fonts","Arial (TrueType)") arialkey2% = DoesIniKeyExist("win.ini","fonts","Arial(TrueType)") arialkey3% = DoesIniKeyExist("win.ini","fonts","Arial") if arialkey1% = 0 and arialkey2% = 0 and arialkey3% = 0 then ARIALKEY$ = "**** Arial is not on your fonts list" else ARIALKEY$ = "" end if end if ''/////////////////////////////////////////// opening dialog (3 radio buttons) GETPURPOSE: SetSymbolValue "RadioDefault", OPTCUR$ OPTL1: if scrwid% = 640 then sz$ = UIStartDlg(CUIDLL$, PICKTASKX, "FRadioDlgProc", 0, "") else sz$ = UIStartDlg(CUIDLL$, PICKTASK, "FRadioDlgProc", 0, "") end if OPTCUR$ = GetSymbolValue("ButtonChecked") IF sz$ = "CONTINUE" THEN UIPop 1 ELSEIF sz$ = "REACTIVATE" THEN GOTO OPTL1 ELSE GOSUB ASKQUIT GOTO GETPURPOSE END IF If OPTCUR$ = "2" then PATHNOW$ = GetIniKeyString(MakePath(WINDIRECT$ , "audio.ini"),"SetupInfo","SetupPath") GOTO CURPATH end if If OPTCUR$ = "3" then PATHNOW$ = GetIniKeyString(MakePath(WINDIRECT$ , "audio.ini"),"SetupInfo","SetupPath") REMIMPRESSION = "yes" GOTO CURPATH end if ''///////////////////////////// show destination path dialog (if installing) IF OPTCUR$ = "1" then DEST$ = "C:\AUDIOSIM" end if GETPATH: UIPop 1 SetSymbolValue "EditTextIn", DEST$ SetSymbolValue "EditFocus", "END" GETPATHL1: If SCRWID% = 640 then sz$ = UIStartDlg(CUIDLL$, DESTPATHX, "FEditDlgProc", 0, "") else sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", 0, "") end if DEST$ = GetSymbolValue("EditTextOut") IF sz$ = "CONTINUE" THEN checkdltr$ = mid$(DEST$,1,1) If checkdltr$ <> "" then checkexist% = IsDriveValid(checkdltr$) If checkexist% = 0 then GOSUB BADPATH GOTO GETPATHL1 end if end if IF IsDirWritable(DEST$) = 0 THEN GOSUB BADPATH GOTO GETPATHL1 END IF checkdspc& = GetFreeSpaceForDrive(checkdltr$) if checkdspc& < 2500000 then spcneeded& = 2500000 - checkdspc& notenuff% = MessageBox(hwnd%,"Insufficient space on drive '" + checkdltr$ + "'. Shortfall: " + str$(spcneeded&) + " bytes.","Sound Impression Setup",MB_OK+MB_TASKMODAL+MB_ICONINFORMATION) If IDOK then GOTO GETPATHL1 end if end if UIPop 1 ELSEIF sz$ = "REACTIVATE" THEN GOTO GETPATHL1 ELSE GOSUB ASKQUIT GOTO GETPATH END IF ''///////////////////////////// show destination path dialog (if deinstalling or changing cards) If OPTCUR$ = "2" or OPTCUR$ = "3" then CURPATH: UIPop 1 SetSymbolValue "EditTextIn", PATHNOW$ SetSymbolValue "EditFocus", "END" CURPATHL1: If SCRWID% = 640 then sz$ = UIStartDlg(CUIDLL$, SIPATHX, "FEditDlgProc", 0, "") else sz$ = UIStartDlg(CUIDLL$, SIPATH, "FEditDlgProc", 0, "") end if PATHNOW$ = GetSymbolValue("EditTextOut") IF sz$ = "CONTINUE" THEN checkdltr2$ = mid$(PATHNOW$,1,1) if checkdltr2$ <> "" then checkexist2% = IsDriveValid(checkdltr2$) If checkexist2% = 0 then GOSUB BADPATH GOTO CURPATHL1 end if end if IF IsDirWritable(PATHNOW$) = 0 THEN GOSUB BADPATH GOTO CURPATHL1 END IF if OPTCUR$ = "2" then checkaudiox% = DoesFileExist(MakePath (PATHNOW$,"AUDIOSIM.EXE"),femExists) If checkaudiox% = 0 then axnotfound% = MessageBox(hwnd%, "Sound Impression program not found in this directory. Try again.", "Sound Impression Setup", MB_OK+MB_TASKMODAL+MB_ICONQUESTION) GOTO CURPATHL1 end if checkdspc2& = GetFreeSpaceForDrive(checkdltr2$) if checkdspc2& < 850000 then spcneeded2& = 850000 - checkdspc2& notenuff2% = MessageBox(hwnd%,"Insufficient space on drive " + checkdltr2$ + "for Setup temp files. Shortfall: " + str$(spcneeded2&) + " bytes.","Sound Impression Setup",MB_OK+MB_TASKMODAL+MB_ICONINFORMATION) If IDOK then GOTO CURPATHL1 end if end if end if If OPTCUR$ = "3" then If REMIMPRESSION = "yes" then lastchance% = MessageBox(hwnd%, "Are you SURE you want to remove Sound Impression from your hard disk?", "Sound Impression Deinstall", MB_YESNO+MB_TASKMODAL+MB_ICONQUESTION) if IDYES then GOTO DEINSTALL else GOTO CURPATHL1 end if END IF END IF UIPop 1 ELSEIF sz$ = "REACTIVATE" THEN GOTO CURPATHL1 ELSE GOSUB ASKQUIT GOTO CURPATH END IF end if ''//////////////////////////////////////// prep status report items, ''//////////////////////////////////////// get Help file ready to call if needed source$ = GetSymbolValue("STF_SRCDIR") helpsource$ = MakePath$(source$,"audiotec.hlp") If OPTCUR$ = "1" then helploc$ = MakePath(DEST$,"audiotec.hlp") CopyFile helpsource$,helploc$,cmoOverwrite,0 elseif OPTCUR$ = "2" then helploc$ = MakePath(PATHNOW$,"audiotec.hlp") CopyFile helpsource$,helploc$,cmoOverwrite,0 end if helptitle$ = "Sound Impression Help System" helpWnd% = FindWindow (NULL,helptitle$) STATUSITEMS$ = "ListItemsIn" STATUSITEMSPICK$ = "ListItemsOut" If CDD$ = "no" then AddListItem STATUSITEMS$,"**** CD-ROM driver not detected" end if If SEQ$ = "no" then AddListItem STATUSITEMS$,"**** MIDI driver not detected" end if If WAV$ = "no" then AddListItem STATUSITEMS$,"**** Wave audio driver not detected" end if If TIM$ = "no" then AddListItem STATUSITEMS$,"**** Multimedia Timer not detected" end if AddListItem STATUSITEMS$,WORKSTRING$ AddListItem STATUSITEMS$,VIRTSTRING$ If wtempswapd$ <> "" Then AddListItem STATUSITEMS$,TEMPSWAP$ end if If wpermswapd$ <> "" Then AddListItem STATUSITEMS$,PERMSWAP$ else AddListItem STATUSITEMS$,NOPERMSWAP$ end if AddListItem STATUSITEMS$,wproctyprpt$ If DOSVERRPT$ <> "" then AddListItem STATUSITEMS$,DOSVERRPT$ end if If WINVERRPT <> "" then AddListItem STATUSITEMS$,WINVERRPT$ end if If wmode% <> 2 then AddListItem STATUSITEMS$,WMODERPT$ end if IF MOUSERPT$ <> "" then AddListItem STATUSITEMS$,MOUSERPT$ end if IF ARIALRPT$ <> "" then AddListItem STATUSITEMS$,ARIALRPT$ end if IF ARIALKEY$ <> "" then AddListItem STATUSITEMS$,ARIALKEY$ end if If TRUTYPRPT$ <> "" then AddListItem STATUSITEMS$,TRUTYPRPT$ end if If TRUTYPKEY$ <> "" then AddListItem STATUSITEMS$,TRUTYPKEY$ end if If WBITRPT$ <> "" then AddListItem STATUSITEMS$,WBITRPT$ end if ''//////////////////////////////////////// show status report SHOWTOP: sslistlen% = GetListLength(STATUSITEMS$) totop$ = GetListItem(STATUSITEMS$,1) SetSymbolValue "ListItemsOut", totop$ SHOWSTATS: if SCRWID% = 640 then sz$ = UIStartDlg(CUIDLL$, STATUSREPORTX, "FListDlgProc", 0, "") else sz$ = UIStartDlg(CUIDLL$, STATUSREPORT, "FListDlgProc", 0, "") end if STATS$ = GetSymbolValue(STATUSITEMS$) STATPICK$ = GetSymbolValue(STATUSITEMSPICK$) IF sz$ = "CONTINUE" THEN If STATPICK$ = WORKSTRING$ then show10% = WinHelp (mainWnd%,helploc$,HELP_CONTEXT,10) GOTO SHOWSTATS END IF If STATPICK$ = VIRTSTRING$ then show20% = WinHelp (mainWnd%,helploc$,HELP_CONTEXT,20) GOTO SHOWSTATS END IF If STATPICK$ = NOPERMSWAP$ or STATPICK$ = PERMSWAP$ or STATPICK$ = TEMPSWAP$ then show30% = WinHelp (mainWnd%,helploc$,HELP_CONTEXT,30) GOTO SHOWSTATS END IF If STATPICK$ = wproctyprpt$ then show40% = WinHelp (mainWnd%,helploc$,HELP_CONTEXT,40) GOTO SHOWSTATS END IF If STATPICK$ = DOSVERRPT$ then show50% = WinHelp (mainWnd%,helploc$,HELP_CONTEXT,50) GOTO SHOWSTATS END IF If STATPICK$ = WINVERRPT$ or STATPICK$ = WMODERPT$ then show60% = WinHelp (mainWnd%,helploc$,HELP_CONTEXT,60) GOTO SHOWSTATS END IF If STATPICK$ = ARIALRPT$ or STATPICK$ = ARIALKEY$ then show70% = WinHelp (mainWnd%,helploc$,HELP_CONTEXT,70) GOTO SHOWSTATS END IF If STATPICK$ = TRUTYPKEY$ or STATPICK$ = TRUTYPRPT$ then show75% = WinHelp (mainWnd%,helploc$,HELP_CONTEXT,75) GOTO SHOWSTATS END IF If STATPICK$ = WBITRPT$ then show80% = WinHelp (mainWnd%,helploc$,HELP_CONTEXT,80) GOTO SHOWSTATS END IF If STATPICK$ = MOUSERPT$ then show90% = WinHelp (mainWnd%,helploc$,HELP_CONTEXT,90) GOTO SHOWSTATS END IF If STATPICK$ = "**** Wave audio driver not detected" then show100% = WinHelp (mainWnd%,helploc$,HELP_CONTEXT,100) GOTO SHOWSTATS END IF If STATPICK$ = "**** MIDI driver not detected" then show110% = WinHelp (mainWnd%,helploc$,HELP_CONTEXT,110) GOTO SHOWSTATS END IF If STATPICK$ = "**** CD-ROM driver not detected" then show120% = WinHelp (mainWnd%,helploc$,HELP_CONTEXT,120) GOTO SHOWSTATS END IF If STATPICK$ = "**** Multimedia Timer not detected" then show130% = WinHelp (mainWnd%,helploc$,HELP_CONTEXT,130) GOTO SHOWSTATS END IF ELSEIF sz$ = "EXIT" THEN ''note: this is actually the "continue" button UIPop 1 ELSEIF sz$ = "REACTIVATE" THEN GOTO SHOWSTATS ELSE GOSUB ASKQUIT GOTO SHOWTOP END IF SetSymbolValue "ListItemsIn","" SetSymbolValue "ListItemsOut","" ''//////////////////////////////////////// show card selection list CARD$ = "ListItemsIn" CARDPICK$ = "ListItemsOut" AddListItem CARD$,"Mozart Sound System" AddListItem CARD$,"Other" SINGLELIST: SetSymbolValue "ListItemsOut", "Mozart Sound System" LISTIT1: If SCRWID% = 640 then sz$ = UIStartDlg(CUIDLL$, CARDLISTX, "FListDlgProc", APPHELPX, HELPPROC$) else sz$ = UIStartDlg(CUIDLL$, CARDLIST, "FListDlgProc", APPHELP, HELPPROC$) end if CARDLOADLIST$ = GetSymbolValue(CARD$) SELECTED$ = GetSymbolValue(CARDPICK$) IF sz$ = "CONTINUE" THEN UIPop 1 ELSEIF sz$ = "REACTIVATE" THEN GOTO LISTIT1 ELSE GOSUB ASKQUIT GOTO SINGLELIST END IF ''//////////////////////////////////////// card selection is made; do install INSTALL ''//////////////////////////////////////// end checks & routines, cleanup QUIT: ON ERROR GOTO ERRQUIT IF ERR = 0 THEN SETUPOK = "success" helpx% = WinHelp (mainWnd%,helploc$,HELP_QUIT,NULL) if SCRWID% = 640 then dlg% = EXITSUCCESSX else dlg% = EXITSUCCESS end if ELSEIF ERR = STFQUIT THEN helpx% = WinHelp (mainWnd%,helploc$,HELP_QUIT,NULL) if SCRWID% = 640 then dlg% = EXITQUITX else dlg% = EXITQUIT end if REMOVESI ELSE helpx% = WinHelp (mainWnd%,helploc$,HELP_QUIT,NULL) if SCRWID% = 640 then dlg% = EXITFAILUREX else dlg% = EXITFAILURE end if REMOVESI END IF QUITL1: sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "") IF sz$ = "REACTIVATE" THEN GOTO QUITL1 END IF UIPop 1 END ERRQUIT: er% = ERR WHATERR$ = ERROR$(er%) iii% = DoMsgBox("Error "+ str$(er%) + ": "+ WHATERR$ + ". Call Technical Support.", "Sound Impression Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND) END BADPATH: if SCRWID% = 640 then sz$ = UIStartDlg(CUIDLL$, BADPATHX, "FInfo0DlgProc", 0, "") else sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "") end if IF sz$ = "REACTIVATE" THEN GOTO BADPATH END IF UIPop 1 RETURN ASKQUIT: if SCRWID% = 640 then sz$ = UIStartDlg(CUIDLL$, ASKQUITX, "FQuitDlgProc", 0, "") else sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "") end if DELETEFLAG$ = "NO" IF sz$ = "EXIT" THEN If OPTCUR$ = "1" then RemoveFile MakePath(DEST$ , "audiotec.hlp"),cmoForce elseif OPTCUR$ = "2" then RemoveFile MakePath(PATHNOW$ , "audiotec.hlp"),cmoForce end if UIPopAll ERROR STFQUIT ELSEIF sz$ = "REACTIVATE" THEN GOTO ASKQUIT ELSE UIPop 1 END IF RETURN ''//////////////////////////////////////// deinstallation sequence DEINSTALL: ON ERROR GOTO XDEINSTALL If REMIMPRESSION = "yes" then CloseLogFile logclosed% = 1 RemoveFile MakePath(PATHNOW$ , "audiocmp.dll"),cmoForce RemoveFile MakePath(PATHNOW$ , "audiocnv.dll"),cmoForce RemoveFile MakePath(PATHNOW$ , "audioctl.dll"),cmoForce RemoveFile MakePath(PATHNOW$ , "audiodlg.dll"),cmoForce RemoveFile MakePath(PATHNOW$ , "audiodrv.dll"),cmoForce RemoveFile MakePath(PATHNOW$ , "audiomix.dll"),cmoForce RemoveFile MakePath(PATHNOW$ , "audiogpl.dll"),cmoForce RemoveFile MakePath(PATHNOW$ , "audioman.dll"),cmoForce RemoveFile MakePath(PATHNOW$ , "audioole.dll"),cmoForce RemoveFile MakePath(PATHNOW$ , "audiorak.dll"),cmoForce RemoveFile MakePath(PATHNOW$ , "audiosys.dll"),cmoForce RemoveFile MakePath(PATHNOW$ , "audiowam.dll"),cmoForce RemoveFile MakePath(PATHNOW$ , "audiowav.dll"),cmoForce RemoveFile MakePath(PATHNOW$ , "audiored.exe"),cmoForce RemoveFile MakePath(PATHNOW$ , "audiorcm.exe"),cmoForce RemoveFile MakePath(PATHNOW$ , "audiormn.exe"),cmoForce RemoveFile MakePath(PATHNOW$ , "audiosim.exe"),cmoForce RemoveFile MakePath(PATHNOW$ , "audiohlp.hlp"),cmoForce RemoveFile MakePath(PATHNOW$ , "audiotec.hlp"),cmoForce RemoveFile MakePath(PATHNOW$ , "news01.txt"),cmoForce RemoveFile MakePath(PATHNOW$ , "logfile.out"),cmoForce RemoveFile MakePath(PATHNOW$ , "logfile.xx1"),cmoForce RemoveFile MakePath(PATHNOW$ , "logfile.xx2"),cmoForce islog1% = DoesFileExist(MakePath(PATHNOW$,"logfile.out"),femExists) islog1b% = DoesFileExist(MakePath(PATHNOW$,"logfile.xx1"),femExists) islog2b% = DoesFileExist(MakePath(PATHNOW$,"logfile.xx2"),femExists) if log1% = 1 then RemoveFile MakePath(PATHNOW$ , "logfile.out"),cmoForce end if if log1b% = 1 then RemoveFile MakePath(PATHNOW$ , "logfile.xx1"),cmoForce end if if log2b% = 1 then RemoveFile MakePath(PATHNOW$ , "logfile.xx2"),cmoForce end if mixfilex$ = MakePath(PATHNOW$ , "MMMIXER.DLL") mmmdatex$ = GetDateOfFile(mixfilex$) If mmmdatex$ = "1993-01-01-00-00-00" then RemoveFile MakePath(PATHNOW$ , "mmmixer.dll"),cmoForce end if RemoveFile MakePath(WINDIRECT$ , "audio.ini"),cmoForce RMDIR PATHNOW$ closeremoval% = MessageBox(hwnd%, "Sound Impression files have been removed.", "Sound Impression deinstallation", MB_OK+MB_TASKMODAL+MB_ICONINFORMATION) UIPopAll stop XDEINSTALL: if exists (MakePath(PATHNOW$ , "*.*")) then verifyfdel% = MessageBox(hwnd%, "One or more files (not identified as Sound Impression program files) remain in directory" + DEST$ + ".","Sound Impression Setup", MB_OK+MB_TASKMODAL+MB_ICONINFORMATION) else CHDIR "c:\" RMDIR PATHNOW$ end if stop end if ''/////////////////////////////////////// installation subroutine (start) SUB Install STATIC RemoveSymbol "ListItemsIn" RemoveSymbol "ListItemsOut" SrcDir$ = GetSymbolValue("STF_SRCDIR") If OPTCUR$ = "2" then DEST$ = PATHNOW$ end if CreateDir DEST$, cmoNone '' //////////// (installation): create log file (rename old) and write stats islog2% = DoesFileExist(MakePath(DEST$,"logfile.xx1"),femExists) if islog2% = 1 then RenameFile MakePath(DEST$ , "logfile.xx1"), "logfile.xx2" end if islog% = DoesFileExist(MakePath(DEST$,"logfile.out"),femExists) if islog% = 1 then RenameFile MakePath(DEST$ , "logfile.out"), "logfile.xx1" end if OpenLogFile MakePath(DEST$, "LOGFILE.OUT"), 0 WriteToLogFile "" WriteToLogFile "User chose as destination directory: '" + DEST$ + "'" WriteToLogFile "User chose option: '" + SELECTED$ + "'" WriteToLogFile "" WriteToLogFile "May have had to create the directory: " + DEST$ WriteToLogFile "" WriteToLogFile "SYSTEM CONFIGURATION AT TIME OF INSTALLATION:" WriteToLogFile DOSVERRPT$ WriteToLogFile WINVERRPT$ WriteToLogFile WPROCTYPRPT$ WriteToLogFile WORKSTRING$ WriteToLogFile VIRTSTRING$ WriteToLogFile PERMSWAP$ WriteToLogFile TEMPSWAP$ WriteToLogFile WBITRPT$ WriteToLogFile MOUSERPT$ WriteToLogFile WMODERPT$ WriteToLogFile TRUTYPRPT$ WriteToLogFile ARIALRPT$ WriteToLogFile "" '' //////////// (installation): establish copy file list, then copy files AddSectionFilesToCopyList "Files", SrcDir$, DEST$ COPYNOW: ''<<NEW block ends here CopyFilesInCopyList ''//////////// (installation): write initial audio.ini keys ini$ = MakePath(WINDIRECT$ , "AUDIO.INI") CreateIniKeyValue ini$, "SetupInfo", "SetupPath", DEST$ , cmoOverwrite CreateIniKeyValue ini$, "SetupInfo", "LastRunFrom", DEST$ + "\audiosim.exe", cmoOverwrite CreateIniKeyValue ini$, "SetupInfo", "RATProduct", "No" , cmoOverwrite CreateIniKeyValue ini$, "SetupInfo", "Running", "No" , cmoOverwrite CreateIniKeyValue ini$, "Audio", "PitchType", "Fixed", cmoOverwrite CreateIniKeyValue ini$, "AudioLevel", "InputImpedance", "Mic", cmoOverwrite CreateIniKeyValue ini$, "AudioLevel", "InputPatch", "On" , cmoOverwrite CreateIniKeyValue ini$, "AudioLevel", "OutputPatch", "On" , cmoOverwrite CreateIniKeyValue ini$, "AudioLevel", "Focus", "Mic" , cmoOverwrite CreateIniKeyValue ini$, "AudioLevel", "MicLevel", "32760,32760", cmoOverwrite if SELECTED$ = "Other" then CreateIniKeyValue ini$, "Audio", "MixerType", "Standard" , cmoOverwrite CreateIniKeyValue ini$, "Audio", "SamplerType", "Fixed" , cmoOverwrite CreateIniKeyValue ini$, "Audio", "SamplerMin", "11025" , cmoOverwrite CreateIniKeyValue ini$, "Audio", "SamplerMax", "44100" , cmoOverwrite end if if SELECTED$ = "Mozart Sound System" then CreateIniKeyValue ini$, "Audio", "MixerType", "OAKMozart" , cmoOverwrite CreateIniKeyValue ini$, "Audio", "SamplerType", "Variable" , cmoOverwrite CreateIniKeyValue ini$, "Audio", "SamplerMin", "11025" , cmoOverwrite CreateIniKeyValue ini$, "Audio", "SamplerMax", "44100" , cmoOverwrite end if ''///////////////// (installation): check if PM present; if so, create group & add items findpm$ = FindTargetOnEnvVar("progman.exe","path") if findpm$ <> "" then CreateProgmanGroup "Sound Impression", "", cmoNone ShowProgmanGroup "Sound Impression", 1, cmoNone CreateProgmanItem "Sound Impression", "Sound Impression", MakePath(DEST$ , "audiosim.exe"), "", cmoOverwrite CreateProgmanItem "Sound Impression", "Waveform Editor", MakePath(DEST$ , "audiored.exe"), "", cmoOverwrite ''<<NEW [removed] CreateProgmanItem "Sound Impression", "Wave Composer", MakePath(DEST$ , "audiorcm.exe"), "", cmoOverwrite ''<<NEW [removed] CreateProgmanItem "Sound Impression", "Session Manager", MakePath(DEST$ , "audiormn.exe"), "", cmoOverwrite CreateProgmanItem "Sound Impression", "Sound Impression Help", MakePath(DEST$ , "audiohlp.hlp"), "", cmoOverwrite else nopm% = MessageBox(hwnd%,"Program Manager not found on your path. Add Sound Impression paths and properties to your shell after installation.", "Sound Impression Setup)", MB_OK+MB_ICONINFORMATION) end if ''///////////////// (installation): if the logfile isn't already closed, close it and end setup if logclosed% = 0 then CloseLogFile end if END SUB ''/////////////////////////////////// end subroutine SUB FINIS STATIC If SETUPOK = "success" then endit: end if END SUB ''/////////////////////////////////// subroutine to remove SI files & destination directory ''/////////////////////////////////// if process cancelled by user SUB REMOVESI STATIC If DELETEFLAG = "" THEN verifydel1% = MessageBox(hwnd%, "Remove Sound Impression files from " + DEST$ + "?","Sound Impression Setup", MB_YESNO+MB_TASKMODAL+MB_ICONQUESTION) if verifydel1% = IDYES then CloseLogFile logclosed% = 1 RemoveFile MakePath(DEST$ , "audiocmp.dll"),cmoForce RemoveFile MakePath(DEST$ , "audiocnv.dll"),cmoForce RemoveFile MakePath(DEST$ , "audioctl.dll"),cmoForce RemoveFile MakePath(DEST$ , "audiodlg.dll"),cmoForce RemoveFile MakePath(DEST$ , "audiomix.dll"),cmoForce RemoveFile MakePath(DEST$ , "audiogpl.dll"),cmoForce RemoveFile MakePath(DEST$ , "audioman.dll"),cmoForce RemoveFile MakePath(DEST$ , "audioole.dll"),cmoForce RemoveFile MakePath(DEST$ , "audiorak.dll"),cmoForce RemoveFile MakePath(DEST$ , "audiosys.dll"),cmoForce RemoveFile MakePath(DEST$ , "audiowam.dll"),cmoForce RemoveFile MakePath(DEST$ , "audiowav.dll"),cmoForce RemoveFile MakePath(DEST$ , "audiored.exe"),cmoForce RemoveFile MakePath(DEST$ , "audiormn.exe"),cmoForce RemoveFile MakePath(DEST$ , "audiorcm.exe"),cmoForce RemoveFile MakePath(DEST$ , "audiosim.exe"),cmoForce RemoveFile MakePath(DEST$ , "audiohlp.hlp"),cmoForce RemoveFile MakePath(DEST$ , "audiotec.hlp"),cmoForce RemoveFile MakePath(DEST$ , "news01.txt"),cmoForce RemoveFile MakePath(DEST$ , "logfile.out"),cmoForce RemoveFile MakePath(DEST$ , "logfile.xx1"),cmoForce RemoveFile MakePath(DEST$ , "logfile.xx2"),cmoForce islog1% = DoesFileExist(MakePath(DEST$,"logfile.out"),femExists) islog1b% = DoesFileExist(MakePath(DEST$,"logfile.xx1"),femExists) islog2b% = DoesFileExist(MakePath(DEST$,"logfile.xx2"),femExists) if log1% = 1 then RemoveFile MakePath(DEST$ , "logfile.out"),cmoForce end if if log1b% = 1 then RemoveFile MakePath(DEST$ , "logfile.xx1"),cmoForce end if if log2b% = 1 then RemoveFile MakePath(DEST$ , "logfile.xx2"),cmoForce end if isit2% = DoesFileExist(MakePath(WINDIRECT$,"audio.ini"),femExists) if isit2% = 1 then verifydel2% = MessageBox(hwnd%, "Sound Impression initialization file (AUDIO.INI) was found in " + WINDIRECT$ + ". Remove it?","Sound Impression Setup", MB_YESNO+MB_TASKMODAL+MB_ICONQUESTION) if verifydel2% = IDYES then RemoveFile MakePath(WINDIRECT$ , "audio.ini"),cmoForce end if end if mixfiley$ = MakePath(DEST$ , "MMMIXER.DLL") mmmdatey$ = GetDateOfFile(mixfiley$) If mmmdatey$ = "1993-01-01-00-00-00" then RemoveFile MakePath(DEST$ , "mmmixer.dll"),cmoForce end if ''<<<NEW:'end if' that was here moved to end of this sub (it's the third one down there) if exists (MakePath(DEST$ , "*.*")) then verifydel3% = MessageBox(hwnd%, "One or more files (not identified as Sound Impression program files) remain in directory" + DEST$ + ".","Sound Impression Setup", MB_OK+MB_TASKMODAL+MB_ICONINFORMATION) else DESTDRV$ = MID$(DEST$,1,3) ''<<<NEW CHDIR DESTDRV$ ''<<<NEW RMDIR DEST$ end if end if end if END SUB ''/////////////////////////////////////// script functions 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