home *** CD-ROM | disk | FTP | other *** search
Wrap
'******************************************************************* '* '* DESCRIPTION: Compton's STARGATE Installation Script '* '* AUTHOR: Hal Grogan et al '* '* HISTORY: Last Edit 09/06/94 '* '******************************************************************* '************************************************************************** '* STARGATE & Quicktime for Windows '************************************************************************** '$DEFINE DEBUG ''Define for script development/debugging '$INCLUDE 'setupapi.inc' '$INCLUDE 'msdetect.inc' ''Dialog ID's CONST WELCOME = 100 CONST ASKQUITSETUP = 200 CONST ASKQUITNOTHING = 201 CONST ASKQUITQTW = 202 CONST ASKEXISTSQTWDIR = 300 CONST ASKEXISTSQTWPROD = 301 CONST ASKEXISTSOLDQTWPROD = 302 CONST DESTPATHQTW = 400 CONST EXITFAILURE = 500 CONST EXITQUIT = 600 CONST EXITSUCCESSFFS = 700 CONST EXITSUCCESSQTW = 701 CONST EXITSUCCESSQTWREBOOT = 702 CONST PRODHELP = 900 CONST MODELESS = 5000 CONST CUSTINST = 6200 CONST TOOBIG = 6300 CONST BADPATH = 6400 CONST MINREQUIRED = 6500 ''Bitmap IDs CONST IDC_BM0 = 600 CONST PRODUCT = 1 CONST FILEVER = 0 ''File Types CONST GROUP = 1 CONST QTW = 2 '' actual amount plus 10% CONST GROUPCOST = 10240 CONST QTWCOST = 2329118 GLOBAL CUIDLL$ GLOBAL WinDir$ GLOBAL WinSysDir$ GLOBAL DEST$ '' Default destination directory. GLOBAL WINDRIVE$ '' Windows drive letter. GLOBAL cost& GLOBAL cost1& GLOBAL free& GLOBAL free1& GLOBAL CursorSave% ''Dialog list symbol names GLOBAL CHECKSTATES$ GLOBAL STATUSTEXT$ GLOBAL DRIVETEXT$ GLOBAL REQUIREDTEXT$ GLOBAL HDLIST$ '' defined functions DECLARE SUB AddOptFilesToCopyList DECLARE SUB RecalcOptFiles (ftype%) DECLARE SUB RecalcPath DECLARE SUB SetDriveStatus DECLARE FUNCTION MakePath(szDir$, szFile$) AS STRING Declare FUNCTION MakeDirPath (szDir$) AS STRING DECLARE FUNCTION RemoveSlash(szDir$) AS STRING Declare Function CheckFileForDateAndVersion(szFile$, szDate$, szVersion$) As String Declare Sub AskExit(nDialog%) Declare Sub AskQuit(nDialog%) Declare Sub GetPath Declare Sub InstallQTWFiles Declare Sub ModifyIniForQTW Declare Sub InstallGroup Declare Sub BadDirPath Declare Sub NotEnoughRoom Declare Sub WelcomeToSetup Declare Sub MinimumRequired Declare Sub ModifyAutoexec Declare Sub CustomInstall Declare Function GetProcessor() As Integer Declare Function MeetsMinRequired() As Integer '' external procedures Declare Function MaximizeWindow LIB "mscuistf.dll" (hwnd%) As Integer Declare Function DoMemManInfo LIB "mscuistf.dll" (item%) As Integer Declare Function SetTo256Min LIB "mscuistf.dll" () As Integer Declare Function GetVerInfo LIB "mscuistf.dll" (szPath$, szVer$, Product%) As Integer DECLARE FUNCTION GetModuleHandle LIB "kernel" (szModName$) AS INTEGER DECLARE FUNCTION VflatdPresent LIB "iniupd.DLL" AS INTEGER DECLARE FUNCTION ExitWindowsExec LIB "User" (Exec$, Param$) AS INTEGER Declare Function sndPlaySound Lib "MMSystem" (lpsound As Any, flag As Integer) As Integer Declare Function waveOutGetNumDevs Lib "MMSystem" () As Integer Declare Function GetDC Lib "User" (hWnd%) As Integer Declare Function GetDeskTopWindow Lib "User" () As Integer Declare Function GetDeviceCaps Lib "GDI" (hDC%, nIndex%) As Integer DECLARE FUNCTION GetPrivateProfileString LIB "Kernel" (lpApplicationName As String, lpKeyName As String, lpDefault As String, lpReturnedString As String, nSize As Integer, lpFileName As String) As Integer Declare Function GlobalCompact Lib "kernel" (flag&) As Long Declare Function GetFreeSpace Lib "kernel" (flag%) As Long Declare Function GetFreeSystemResources Lib "User" (fuSysResource As Integer) As Integer Declare Function ReleaseDC Lib "User" (hWnd As Integer, hDC As Integer) As Integer Const SM_MOUSEPRESENT = 19 INIT: CUIDLL$ = "mscuistf.dll" '' custom user interface dll HELPPROC$ = "FHelpDlgProc" '' Help dialog procedure hwnd% = HwndFrame() i% = MaximizeWindow(hwnd%) '' maximize the main window SetBitmap CUIDLL$, IDC_BM0 '' comptons logo SetTitle "STARGATE" szTmp$ = GetSymbolValue("STF_SRCINFPATH") szInf$ = GetSymbolValue("STF_SRCINFPATH") IF szInf$ = "" THEN szInf$ = GetSymbolValue("STF_CWDDIR") + "STARGATE" + ".INF" END IF ReadInfFile szInf$ WinDir$ = GetWindowsDir() WinSysDir$ = GetWindowsSysDir() WINDRIVE$ = MID$(WinDir$, 1, 1) '' see if the product is running IF GetModuleHandle("STARGATE") > 0 THEN i% = DoMsgBox("Product is currently running."+chr$(13)+"Please exit the program and rerun Setup.","Setup", MB_OK+MB_TASKMODAL+MB_ICONHAND) END END IF ''CustInst list symbols CHECKSTATES$ = "CheckItemsState" STATUSTEXT$ = "StatusItemsText" DRIVETEXT$ = "DriveStatusText" REQUIREDTEXT$ = "MinRequiredText" HDLIST$ = "HdList" FOR i% = 1 TO 2 STEP 1 AddListItem CHECKSTATES$, "ON" NEXT i% '' for each inf section the required K FOR i% = 1 TO 2 STEP 1 AddListItem STATUSTEXT$, "" NEXT i% '' for the display in custinst FOR i% = 1 TO 7 STEP 1 AddListItem DRIVETEXT$, "" NEXT i% '' for the display of minimum requirements FOR i% = 1 TO 7 STEP 1 AddListItem REQUIREDTEXT$, "" NEXT i% '' means the message box will allow error to be ignored if file size does not match with inf file i% = SetSizeCheckMode(scmOnIgnore) '' could use scmOff; def = scmOnFatal WelcomeToSetup '' If MeetsMinRequired() = 0 Then '' MinimumRequired '' End If CursorSave% = ShowWaitCursor() DEST$ = CheckFileForDateAndVersion("PLAYER.EXE", "1994-01-11", "1.1.1.0") If DEST$ = "" Then '' set windows drive and windows directory as default for QTW DEST$ = RemoveSlash(WinDir$) End If '' CustomInstall InstallQTWFiles ModifyIniForQTW InstallGroup '' IF GetListItem(CHECKSTATES$, GROUP) = "ON" THEN '' sz$ = UIStartDlg(CUIDLL$, EXITSUCCESSFFS, "FQuitDlgProc", 0, "") '' ElseIf GetListItem(CHECKSTATES$, QTW) = "ON" THEN '' sz$ = UIStartDlg(CUIDLL$, EXITSUCCESSQTW, "FQuitDlgProc", 0, "") '' End If '' IF GetListItem(CHECKSTATES$, QTW) = "ON" THEN '' UIPop 1 '' ELSE '' if VFW not installed then no need to see about restarting '' UIPopAll '' END '' END IF QUIT: ON ERROR GOTO ERRQUIT IF ERR = 0 THEN dlg% = EXITSUCCESSFFS 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 END ERRQUIT: i% = DoMsgBox("Call Compton's NewMedia Technical Support!", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND) END '** '** Purpose: '** Adds the specified option files (sections of inf file) to the copy list. '** Arguments: '** ftype% - constant representing section such as GROUP, QTW '** Caveats: '** This SUB has been hand tweaked to get the job done and is not generic '** for that reason. '** Returns: '** none. '************************************************************************* SUB AddOptFilesToCopyList STATIC SrcDir$ = GetSymbolValue("STF_SRCDIR") AddSectionFilesToCopyList "QTW Files", MakePath(SrcDir$,"install\"), DEST$ AddSectionFilesToCopyList "QTW Ini", MakePath(SrcDir$,"install\"), WinDir$ AddSectionFilesToCopyList "QTW Driver", MakePath(SrcDir$,"install\"), WinSysDir$ AddSectionFilesToCopyList "QTW Exe", MakePath(SrcDir$,"install\"), DEST$ 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 '** '** Purpose: '** Removes a file name at the end of a directory path, '** Arguments: '** szDir$ - full directory path including filespec '** Returns: '** Resulting directory path name '************************************************************************* FUNCTION MakeDirPath (szDir$) STATIC AS STRING szTmp$ = RemoveSlash(szDir$) For j% = Len(szTmp$) to 1 Step -1 If MID$(szTmp$, j%, 1) = "\" Then szTmp$ = Mid$(szTmp$, 1, j% - 1) Exit For End If Next J% MakeDirPath = szTmp$ END FUNCTION FUNCTION RemoveSlash (szDir$) STATIC AS STRING IF MID$(szDir$, LEN(szDir$), 1) = "\" THEN szTmp$ = MID$(szDir$, 1, LEN(szDir$) - 1) RemoveSlash = szTmp$ Else RemoveSlash = szDir$ END IF END FUNCTION '** '** Purpose: '** Recalculates disk space for the given option files and sets '** the status info symbol "StatusItemsText". '** Arguments: '** ftype% - type of files to add, one of the following: '** GROUP, QTW '** Returns: '** none. '************************************************************************* SUB RecalcOptFiles (ftype%) STATIC CursorSave% = ShowWaitCursor() nowcost& = 0 IF ftype% = GROUP THEN IF GetListItem(CHECKSTATES$, GROUP) = "ON" THEN nowcost& = GROUPCOST END IF ELSEIF ftype% = QTW THEN IF GetListItem(CHECKSTATES$, QTW) = "ON" THEN nowcost& = QTWCOST END IF END IF ReplaceListItem STATUSTEXT$, ftype%, STR$(nowcost& / 1024) + " K" RestoreCursor CursorSave% END SUB '** '** Purpose: '** Recalculates disk space and sets option status info according '** to the current destination path. '** Arguments: '** none. '** Returns: '** none. '************************************************************************* SUB RecalcPath STATIC CursorSave% = ShowWaitCursor() RecalcOptFiles GROUP RecalcOptFiles QTW RestoreCursor CursorSave% END SUB '** '** Purpose: '** Sets drive status info according to latest disk space calcs. '** Arguments: '** none. '** Returns: '** none. '************************************************************************* SUB SetDriveStatus STATIC drive$ = MID$(DEST$, 1, 1) ndrive% = ASC(ucase$(drive$)) - ASC("A") + 1 cost& = 0 IF GetListItem(CHECKSTATES$, GROUP) = "ON" THEN cost& = GROUPCOST END IF IF drive$ = WINDRIVE$ THEN IF GetListItem(CHECKSTATES$, QTW) = "ON" THEN cost& = cost& + QTWCOST END IF END IF '' do install to drive which may or may not be windows drive free& = GetFreeSpaceForDrive(drive$) ReplaceListItem DRIVETEXT$, 1, drive$ + ":" ReplaceListItem DRIVETEXT$, 2, STR$(cost& / 1024) + " K" ReplaceListItem DRIVETEXT$, 3, STR$(free& / 1024) + " K" cost1& = 0 ReplaceListItem DRIVETEXT$, 4, "" ReplaceListItem DRIVETEXT$, 5, "" ReplaceListItem DRIVETEXT$, 6, "" IF drive$ <> WINDRIVE$ THEN IF GetListItem(CHECKSTATES$, QTW) = "ON" THEN cost1& = QTWCOST free1& = GetFreeSpaceForDrive(WINDRIVE$) ReplaceListItem DRIVETEXT$, 4, WINDRIVE$ + ":" ReplaceListItem DRIVETEXT$, 5, STR$(cost1& / 1024) + " K" ReplaceListItem DRIVETEXT$, 6, STR$(free1& / 1024) + " K" END IF END IF END SUB '** '** Purpose: '** offers dialogs to continue or quit '** Returns: '** nothing '************************************************************************* Sub AskExit(nDialog%) STATIC sz$ = UIStartDlg(CUIDLL$, nDialog%, "FQuitDlgProc", 0, "") IF sz$ = "EXIT" THEN UIPopAll ERROR STFQUIT ELSEIF sz$ = "REACTIVATE" THEN AskExit(nDialog%) ELSE UIPop 1 END IF End Sub '** '** Purpose: '** offers dialogs to continue or quit '** Returns: '** nothing '************************************************************************* Sub AskQuit(nDialog%) STATIC sz$ = UIStartDlg(CUIDLL$, nDialog%, "FQuitDlgProc", 0, "") IF sz$ = "EXIT" THEN UIPopAll ERROR STFQUIT ELSEIF sz$ = "REACTIVATE" THEN AskQuit(nDialog%) ELSE UIPop 1 END IF End Sub '** '** Purpose: '** Sees if File exists on users system with specified date '** offers dialogs to continue or quit '** Returns: '** Directory path without filename '************************************************************************* Function CheckFileForDateAndVersion(szFile$, szDate$, szVersion$) STATIC As String GetLocalHardDrivesList HDLIST$ i% = GetListLength(HDLIST$) For j% = 1 To i% Step 1 szDrive$ = GetListItem(HDLIST$, j%) szDrive$ = szDrive$ + ":\" szFound$ = FindFileInTree(szFile$, szDrive$) If szFound$ <> "" Then Exit For End If Next J% RestoreCursor CursorSave% If szFound$ <> "" Then szFileDate$ = GetDateOfFile(szFound$) j% = GetVerInfo(szFound$, szVersion$, PRODUCT) CurrentPath$ = GetEnvVariableValue("PATH") i% = InStr(1, CurrentPath$, MakeDirPath(szFound$)) If (Mid$(szFileDate$, 1, Len(szDate$)) = szDate$) And (j% = 1) And (i% <> 0) Then ReplaceListItem CHECKSTATES$, 2, "" CheckFileForDateAndVersion = MakeDirPath(szFound$) Else CheckFileForDateAndVersion = "" End If Else CheckFileForDateAndVersion = "" End If END Function '' CheckForfile Function GetProcessor() Static As Integer Dim WinFlags As Long '' Operating System Info. WinFlags = GetWinFlags() '' CPU Info. If WinFlags And WF_CPU486 Then GetProcessor = 2 ElseIf WinFlags And WF_CPU386 Then GetProcessor = 1 ElseIf WinFlags And WF_CPU286 Then GetProcessor = 0 End If End Function Function MeetsMinRequired() Static As Integer Min% = 1 f% = GetDosMajorVersion() g% = GetDosMinorVersion() ReplaceListItem REQUIREDTEXT$, 2, STR$(f%) + "." + STR$(g%) h% = GetWindowsMajorVersion() i% = GetWindowsMinorVersion() ReplaceListItem REQUIREDTEXT$, 1, STR$(h%) + "." + STR$(i%) If (f% < 3) Then Min% = 0 ElseIf (f% = 3) AND (g% < 1) Then Min% = 0 END IF IF (h% < 3) Then Min% = 0 ElseIf (h% = 3) AND (i% < 1) Then Min% = 0 END IF d% = GetSystemMetrics(SM_MOUSEPRESENT) ReplaceListItem REQUIREDTEXT$, 3, "Mouse Present" If d% = 0 Then ReplaceListItem REQUIREDTEXT$, 3, "*No Mouse" Min% = 0 End If g% = GetProcessor() If g% = 0 Then ReplaceListItem REQUIREDTEXT$, 4, "*286" ElseIf g% = 1 Then ReplaceListItem REQUIREDTEXT$, 4, "386" ElseIf g% = 2 Then ReplaceListItem REQUIREDTEXT$, 4, "486 or 586" End If If g% = 0 Then Min% = 0 End If totalpages& = DoMemManInfo(7) pagesize& = DoMemManInfo(10) ReplaceListItem REQUIREDTEXT$, 5, Str$((totalpages& * pagesize&) / 1024) +" Kb" IF (totalpages& * pagesize&) < 2500000 THEN ReplaceListItem REQUIREDTEXT$, 5, "*" + Str$((totalpages& * pagesize&) / 1024) +" Kb" Min% = 0 END IF '' Video j% = SetTo256Min() If j% < 0 Then ReplaceListItem REQUIREDTEXT$, 6, "*Less than 256" Min% = 0 Else ReplaceListItem REQUIREDTEXT$, 6, "256 or more" End If e% = waveOutGetNumDevs() ReplaceListItem REQUIREDTEXT$, 7, "WAVE Okay" If e% = 0 Then ReplaceListItem REQUIREDTEXT$, 7, "*No WAVE driver" Min% = 0 End If MeetsMinRequired = Min% End Function Sub InstallGroup STATIC IF GetListItem(CHECKSTATES$, GROUP) = "ON" THEN SrcDir$ = GetSymbolValue("STF_SRCDIR") CreateProgmanGroup "STARGATE", "", cmoNone ShowProgmanGroup "STARGATE", 2, cmoNone CreateProgmanItem "STARGATE", "STARGATE",MakePath(SrcDir$,"STARGATE.exe"),MakePath(SrcDir$,"STARGATE.ico")+",IDC_ICON7,0,0,"+SrcDir$, cmoOverwrite '' CreateProgmanItem "STARGATE", "STARGATE",MakePath(SrcDir$,"STARGATE.exe"),",,,,"+SrcDir$, cmoOverwrite ShowProgmanGroup "STARGATE", 1, cmoNone End If End Sub Sub InstallQTWFiles STATIC If (GetListItem(CHECKSTATES$, QTW) = "ON") Then ClearCopyList AddOptFilesToCopyList ClearBillboardList SetCopyGaugePosition -1, 40 SetRestartDir(WinDir$) CopyFilesInCopyList ClearBillboardList End If End Sub Sub ModifyIniForQTW STATIC IF (GetListItem(CHECKSTATES$, QTW) = "ON") THEN SrcPath$ = MakePath(WinDir$,"WIN.INI") DstPath$ = MakePath(WinDir$,"WIN.CNM") CopyFile SrcPath$, DstPath$, cmoOverwrite, 0 SrcPath$ = MakePath(WinDir$,"SYSTEM.INI") DstPath$ = MakePath(WinDir$,"SYSTEM.CNM") CopyFile SrcPath$, DstPath$, cmoOverwrite, 0 SrcPath$ = MakePath(WinDir$,"CONTROL.INI") DstPath$ = MakePath(WinDir$,"CONTROL.CNM") CopyFile SrcPath$, DstPath$, cmoOverwrite, 0 I% = DoesIniKeyExist (WinDir$ + "system.ini", "mci", "QTWVideo") IF I% = 0 THEN CreateIniKeyValue WinDir$ + "system.ini", "mci", "QTWVideo", "mciqtw.drv", cmoOverwrite CreateIniKeyValue WinDir$ + "system.ini", "mci", ";Added QTWVideo", "mciqtw.drv by Compton's Setup", cmoOverwrite END IF I% = DoesIniKeyExist (WinDir$ + "control.ini", "drivers.desc", "mciqtw.drv") IF I% = 0 THEN CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "mciqtw.drv", "[MCI] Quicktime for Windows", cmoOverwrite CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", ";Added mciqtw.drv", "[MCI] Quicktime for Windows by Compton's Setup", cmoOverwrite END IF I% = DoesIniKeyExist ("WIN.INI", "Extensions", "mov") IF I% = 0 THEN CreateIniKeyValue "WIN.INI", "Extensions", "mov", "player.exe ^.mov", cmoOverwrite CreateIniKeyValue "WIN.INI", "Extensions", ";Added mov", "player.exe ^.mov by Compton's Setup", cmoOverwrite END IF I% = DoesIniKeyExist ("WIN.INI", "Extensions", "pic") IF I% = 0 THEN CreateIniKeyValue "WIN.INI", "Extensions", "pic", "viewer.exe ^.pic", cmoOverwrite CreateIniKeyValue "WIN.INI", "Extensions", ";Added pic", "viewer.exe ^.pic by Compton's Setup", cmoOverwrite END IF I% = DoesIniKeyExist ("WIN.INI", "mci extensions", "mov") IF I% = 0 THEN CreateIniKeyValue "WIN.INI", "mci extensions", "mov", "QTWVideo", cmoOverwrite CreateIniKeyValue "WIN.INI", "mci extensions", ";Added mov", "QTWVideo by Compton's Setup", cmoOverwrite END IF I% = DoesIniKeyExist ("WIN.INI", "mci extensions", "pic") IF I% = 0 THEN CreateIniKeyValue "WIN.INI", "mci extensions", "pic", "QTWVideo", cmoOverwrite CreateIniKeyValue "WIN.INI", "mci extensions", ";Added pic", "QTWVideo by Compton's Setup", cmoOverwrite END IF I% = DoesIniKeyExist ("WIN.INI", "mci extensions", "jpg") IF I% = 0 THEN CreateIniKeyValue "WIN.INI", "mci extensions", "jpg", "QTWVideo", cmoOverwrite CreateIniKeyValue "WIN.INI", "mci extensions", ";Added jpg", "QTWVideo by Compton's Setup", cmoOverwrite END IF I% = DoesIniKeyExist ("WIN.INI", "embedding", "PlayerFrameClass") '' IF I% = 0 THEN CreateIniKeyValue "WIN.INI", "embedding", "PlayerFrameClass", "QuickTime Movie,QuickTime Movie,"+MakePath(DEST$,"player.exe")+",picture", cmoOverwrite CreateIniKeyValue "WIN.INI", "embedding", ";Added PlayerFrameClass", "QuickTime Movie,QuickTime Movie,"+MakePath(DEST$,"player.exe")+",picture by Compton's Setup", cmoOverwrite '' END IF I% = DoesIniKeyExist ("WIN.INI", "embedding", "ViewerFrameClass") '' IF I% = 0 THEN CreateIniKeyValue "WIN.INI", "embedding", "ViewerFrameClass", "QuickTime Movie,QuickTime Movie,"+MakePath(DEST$,"viewer.exe")+",picture", cmoOverwrite CreateIniKeyValue "WIN.INI", "embedding", ";Added ViewerFrameClass", "QuickTime Movie,QuickTime Movie,"+MakePath(DEST$,"viewer.exe")+",picture by Compton's Setup", cmoOverwrite '' END IF End If End Sub Sub GetPath STATIC SetSymbolValue "EditTextIn", DEST$ SetSymbolValue "EditFocus", "END" GETPATHL1: sz$ = UIStartDlg(CUIDLL$, DESTPATHQTW, "FEditDlgProc", PRODHELP, HELPPROC$) IF sz$ = "CONTINUE" THEN olddest$ = DEST$ DEST$ = GetSymbolValue("EditTextOut") drive$ = MID$(DEST$, 1, 1) '' make sure they entered a valid path - it does not have to already exist. j% = IsDirWritable(DEST$) IF (j% = 0) THEN BadDirPath GOTO GETPATHL1 END IF '' dest$ may or may not have a \ at this point UIPop 1 ''Truncate display if too long. IF LEN(DEST$) > 23 THEN ReplaceListItem DRIVETEXT$, 7, MID$(DEST$, 1, 23)+"..." ELSE ReplaceListItem DRIVETEXT$, 7, DEST$ END IF ''Recalc if path changed. IF (olddest$ <> DEST$) AND (olddest$ <> DEST$+"\") AND (olddest$+"\" <> DEST$) THEN RecalcPath SetDriveStatus END IF olddest$ = "" '' GOTO CUSTINST ELSEIF sz$ = "REACTIVATE" THEN RecalcPath SetDriveStatus GOTO GETPATHL1 ELSEIF sz$ = "EXIT" THEN AskQuit(ASKQUITQTW) GOTO GETPATHL1 ELSE UIPop 1 '' GOTO CUSTINST END IF End Sub Sub BadDirPath STATIC sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "") If sz$ = "REACTIVATE" Then RecalcPath SetDriveStatus BadDirPath End If UIPop 1 End Sub Sub NotEnoughRoom STATIC sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfoDlgProc", 0, "") IF sz$ = "CONTINUE" THEN UIPop 1 ELSEIF sz$ = "EXIT" THEN UIPop 1 AskExit(ASKQUITSETUP) ELSEIF sz$ = "REACTIVATE" THEN RecalcPath SetDriveStatus NotEnoughRoom END IF UIPop 1 End Sub Sub WelcomeToSetup STATIC sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", PRODHELP, HELPPROC$) IF sz$ = "CONTINUE" THEN UIPop 1 ELSE AskQuit(ASKQUITSETUP) WelcomeToSetup END IF End Sub Sub MinimumRequired STATIC sz$ = UIStartDlg(CUIDLL$, MINREQUIRED, "FMinReqDlgProc", PRODHELP, HELPPROC$) IF sz$ = "CONTINUE" THEN UIPop 1 ELSE AskQuit(ASKQUITSETUP) MinimumRequired END IF End Sub Sub CustomInstall STATIC '' destination path ReplaceListItem DRIVETEXT$, 7, DEST$ RecalcPath SetDriveStatus sz$ = UIStartDlg(CUIDLL$, CUSTINST, "FCustInstDlgProc", PRODHELP, HELPPROC$) IF sz$ = "CONTINUE" THEN ''Check diskspace IF ((cost& > free&) OR (cost1& > free1&)) THEN NotEnoughRoom END IF IF GetListItem(CHECKSTATES$, GROUP) <> "ON" THEN IF GetListItem(CHECKSTATES$, QTW) <> "ON" THEN AskQuit(ASKQUITNOTHING) CustomInstall End If End If UIPop 1 '' GOTO INSTALL ELSEIF sz$ = "PATH" THEN GetPath CustomInstall ELSEIF sz$ = "CHK1" THEN RecalcOptFiles GROUP SetDriveStatus CustomInstall ELSEIF sz$ = "CHK2" THEN RecalcOptFiles QTW SetDriveStatus CustomInstall ELSEIF sz$ = "REACTIVATE" THEN RecalcPath SetDriveStatus CustomInstall ELSE If (GetListItem(CHECKSTATES$, GROUP) <> "ON") And (GetListItem(CHECKSTATES$, QTW) <> "ON") Then AskQuit(ASKQUITNOTHING) CustomInstall ElseIf GetListItem(CHECKSTATES$, GROUP) <> "ON" Then AskQuit(ASKQUITQTW) CustomInstall Else AskQuit(ASKQUITSETUP) CustomInstall End If END IF End Sub Sub ModifyAutoexec STATIC CurrentPath$ = GetEnvVariableValue("PATH") j% = InStr(1, CurrentPath$, RemoveSlash(DEST$)) If j% <> 0 Then i% = DoMsgBox(CurrentPath$,"Debug",MB_OK+MB_TASKMODAL+MB_ICONHAND) Else i% = DoMsgBox(CurrentPath$, "Debug",MB_OK+MB_TASKMODAL+MB_ICONHAND) End If End Sub '' end of FOCUS.MST