home *** CD-ROM | disk | FTP | other *** search
- '**************************************************************************
- '* Mentor with Recording Session Setup
- '* Define MENTORCD
- '*
- '*
- '* Changes:
- '* 1\10\93
- '* Bitmap fills screen for 800x600 and greater, title bar and border is on background bitmap,
- '* checks if directory is already present, checks for enough hard driver space.
- '* 3/10/94 Special CD-Rom version. Only Mentor is installed.
- '**************************************************************************
-
-
-
- '$INCLUDE 'setupapi.inc'
- '$INCLUDE 'msdetect.inc'
-
- DECLARE FUNCTION ShowWindow LIB "user.exe" (hWnd%,iShow%) AS INTEGER
- DECLARE FUNCTION SetWindowLong LIB "user.exe" (hWnd%, offset%, style&) AS LONG
- DECLARE FUNCTION GetWindowLong LIB "user.exe" (hWnd%, offset%) AS LONG
-
-
- ''Dialog ID's
-
- CONST WELCOME = 100
- CONST WELCOMEX = 150
- CONST ASKQUIT = 200
- CONST ASKQUITX = 250
- CONST DESTPATH1 = 300
- CONST DESTPATH1X = 350
- CONST DESTPATH2 = 6401
- CONST DESTPATH2X = 6451
- CONST EXITFAILURE = 400
- CONST EXITFAILUREX = 450
- CONST EXITQUIT = 600
- CONST EXITQUITX = 650
- CONST EXITSUCCESS = 700
- CONST EXITSUCCESSX = 750
- CONST APPHELP = 900
- CONST APPHELPX = 950
- CONST ALREADYEXISTS = 1000
- CONST ALREADYEXISTSX = 1050
- CONST TOOBIG = 6300
- CONST TOOBIGX = 6350
- CONST BADPATH = 6400
- CONST BADPATHX = 6450
-
- CONST HDSPACE = 4700000
-
- CONST WS_VISIBLE = &H10000000
- CONST WS_CLIPCHILDREN = &H2000000
- CONST WS_BORDER = &H800000
- CONST SW_SHOWMAXIMIZED = 3
- CONST GWL_STYLE =-16
-
- '$IFDEF MENTORCD
- CONST TITLE = "Midisoft Music Mentor Setup"
- '$ENDIF MENTORCD
-
- '$IFNDEF MENTORCD
- CONST TITLE = "Midisoft Music Mentor with Recording Session"
- '$ENDIF MENTORCD
- ''Bitmap ID
-
- CONST LOGO1 = 1
- CONST LOGO2 = 1
-
- GLOBAL DEST$ ''Default destination directory.
- GLOBAL SESDEST$ ''Default Session directory.
- GLOBAL RUNDEST$ ''Default Runtime subdirectory.
- GLOBAL OPTCUR$ ''Option selection from option dialog.
- GLOBAL SCRWID%
-
- DECLARE SUB Install
- DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
-
-
- INIT:
- CUIDLL$ = "mscuistf.dll" ''Custom user interface dll
- HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
-
- mainWnd%=HwndFrame()
- curLong& = GetWindowLong (mainWnd%, GWL_STYLE) 'Creates window with
- curLong& = curLong& OR (WS_BORDER OR WS_CLIPCHILDREN OR WS_CAPTION) 'title bar (Note: using
- w&=SetWindowLong (mainWnd%, GWL_STYLE, curLong&) 'HT video drivers icon
- 'on one screen is corrupt)
-
- '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
-
- SetTitle TITLE
-
- szInf$ = GetSymbolValue("STF_SRCINFPATH")
- IF szInf$ = "" THEN
- szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
- END IF
- ReadInfFile szInf$
-
- OPTCUR$ = "1"
- DEST$ = "C:\MENTOR"
- SESDEST$ = "C:\SESSION"
-
- WELCOME:
-
- IF scrwid% = 640 THEN
- sz$ = UIStartDlg(CUIDLL$, WELCOMEX, "FInfoDlgProc", APPHELP, HELPPROC$)
- ELSE
- sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
- END IF
-
-
- IF sz$ = "CONTINUE" THEN
- UIPop 1
- ELSE
- GOSUB ASKQUIT
- GOTO WELCOME
- END IF
-
-
- GETPATH:
- SetSymbolValue "EditTextIn", DEST$
- SetSymbolValue "EditFocus", "END"
- GETPATHL1:
-
- IF scrwid% = 640 THEN
- sz$ = UIStartDlg(CUIDLL$, DESTPATH1X, "FEditDlgProc", APPHELP, HELPPROC$)
- ELSE
- sz$ = UIStartDlg(CUIDLL$, DESTPATH1, "FEditDlgProc", APPHELP, HELPPROC$)
- END IF
-
-
- 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 WELCOME
- ELSE
- GOSUB ASKQUIT
- GOTO GETPATH
- END IF
-
- 'Check if directory exists
- IF DoesDirExist(DEST$) THEN
- UIPop 1
-
- IF SCRWID% = 640 THEN
- sz$ = UIStartDlg(CUIDLL$, ALREADYEXISTSX, "FInfoDlgProc", 0, "")
- ELSE
- sz$ = UIStartDlg(CUIDLL$, ALREADYEXISTS, "FInfoDlgProc", 0, "")
- END IF 'Screen resolution
-
- IF sz$ = "CONTINUE" THEN
- UIPop 1
-
- ELSEIF sz$ = "REACTIVATE" THEN
- UIPop 1
- GOTO GETPATHL1
-
- ELSEIF sz$ = "BACK" THEN
- UIPop 1
- GOTO GETPATHL1
-
- ELSE
- UIPop 1
- GOSUB ASKQUIT
- GOTO GETPATH
- END IF 'User responses for already exists dialog
-
- END IF 'If directory already exists
-
- checkdltr$ = mid$(DEST$, 1, 1)
- checkdspc& = GetFreeSpaceForDrive(checkdltr$)
- IF checkdspc& < HDSPACE THEN
- IF scrwid% = 640 THEN
- sz$ = UIStartDlg(CUIDLL$, TOOBIGX, "FInfoDlgProc", APPHELP, HELPPROC$)
- ELSE
- sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfoDlgProc", APPHELP, HELPPROC$)
- END IF
-
-
- ERROR STFQUIT
- GOTO QUIT
- END IF
-
- '$IFNDEF MENTORCD
- GETPATH2:
- SetSymbolValue "EditTextIn", SESDEST$
- SetSymbolValue "EditFocus", "END"
- GETPATHL2:
-
- IF scrwid% = 640 THEN
- sz$ = UIStartDlg(CUIDLL$, DESTPATH2X, "FEditDlgProc", APPHELP, HELPPROC$)
- ELSE
- sz$ = UIStartDlg(CUIDLL$, DESTPATH2, "FEditDlgProc", APPHELP, HELPPROC$)
- END IF
-
-
- SESDEST$ = GetSymbolValue("EditTextOut")
-
- IF sz$ = "CONTINUE" THEN
- IF IsDirWritable(SESDEST$) = 0 THEN
- GOSUB BADPATH
- GOTO GETPATHL2
- END IF
- UIPop 1
- ELSEIF sz$ = "REACTIVATE" THEN
- GOTO GETPATHL2
- ELSEIF sz$ = "BACK" THEN
- UIPop 1
-
- GOTO GETPATH
- ELSE
- GOSUB ASKQUIT
- GOTO GETPATH2
- END IF
-
- 'Check if directory exists
- IF DoesDirExist(SESDEST$) THEN
- UIPop 1
-
- IF SCRWID% = 640 THEN
- sz$ = UIStartDlg(CUIDLL$, ALREADYEXISTSX, "FInfoDlgProc", 0, "")
- ELSE
- sz$ = UIStartDlg(CUIDLL$, ALREADYEXISTS, "FInfoDlgProc", 0, "")
- END IF 'Screen resolution
-
- IF sz$ = "CONTINUE" THEN
- UIPop 1
-
- ELSEIF sz$ = "REACTIVATE" THEN
- UIPop 1
- GOTO GETPATHL2
-
- ELSEIF sz$ = "BACK" THEN
- UIPop 1
- GOTO GETPATHL2
-
- ELSE
- UIPop 1
- GOSUB ASKQUIT
- GOTO GETPATH2
- END IF 'User responses for already exists dialog
-
- END IF 'If directory already exists
- '$ENDIF MENTORCD
-
- Install
-
-
- QUIT:
- ON ERROR GOTO ERRQUIT
-
- IF ERR = 0 THEN
- IF SCRWID% = 640 THEN
- dlg% = EXITSUCCESSX
- ELSE
- dlg% = EXITSUCCESS
- END IF
-
-
- ELSEIF ERR = STFQUIT THEN
- IF SCRWID% = 640 THEN
- dlg% = EXITQUITX
- ELSE
- dlg% = EXITQUIT
- END IF
- ELSE
- IF SCRWID% = 640 THEN
- dlg% = EXITFAILUREX
- ELSE
- dlg% = EXITFAILURE
- END IF
- END IF
- QUITL1:
- sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfoDlgProc", 0, "")
- IF sz$ = "REACTIVATE" THEN
- GOTO QUITL1
- END IF
- UIPop 1
-
- END
-
- ERRQUIT:
- i% = DoMsgBox("Setup sources were corrupted, please call Midisoft Technical Support", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
- END
-
-
-
- BADPATH:
- IF scrwid% = 640 THEN
- sz$ = UIStartDlg(CUIDLL$, BADPATHX, "FInfoDlgProc", APPHELP, HELPPROC$)
- ELSE
- sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfoDlgProc", APPHELP, HELPPROC$)
- END IF
-
-
- IF sz$ = "REACTIVATE" THEN
- GOTO BADPATH
- END IF
- UIPop 1
- RETURN
-
-
-
- ASKQUIT:
- IF scrwid% = 640 THEN
- sz$ = UIStartDlg(CUIDLL$, ASKQUITX, "FQuitDlgProc", APPHELP, HELPPROC$)
- ELSE
- sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", APPHELP, HELPPROC$)
- END IF
-
-
-
- IF sz$ = "EXIT" THEN
- UIPop 5
- 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
-
- SrcDir$ = GetSymbolValue("STF_SRCDIR")
- MENTSRCDIR$ = SrcDir$
- RUNSRCDIR$ = MakePath (MENTSRCDIR$, "RUNTIME")
- MIDISRCDIR$ = MakePath (MENTSRCDIR$, "MIDFILES")
- RUNDEST$ = MakePath(DEST$, "RUNTIME")
- SESSIONSRCDIR$ = MakePath(SrcDir$, "SESSION")
-
- CreateDir DEST$, cmoNone
- CreateDir MakePath(DEST$, "RUNTIME"), cmoNone
- CreateDir MakePath(DEST$, "MIDFILES"), cmoNone
-
- '$IFNDEF MENTORCD
- CreateDir SESDEST$, cmoNone
-
- AddSectionFilesToCopyList "Midisoft", SESSIONSRCDIR$, SESDEST$
- AddSectionFilesToCopyList "Midifiles", MIDISRCDIR$, MakePath(DEST$, "MIDFILES")
- AddSectionFilesToCopyList "Runtime", RUNSRCDIR$, MakePath(DEST$, "RUNTIME")
- AddSectionFilesToCopyList "Mentor", MENTSRCDIR$, DEST$
- AddSectionFilesToCopyList "System", MakePath(SrcDir$, "SYSTEM"), MakePath(GetWindowsDir(), "SYSTEM")
- '$ENDIF MENTORCD
-
- '$IFDEF MENTORCD
- AddSectionFilesToCopyList "Midifiles", MIDISRCDIR$, MakePath(DEST$, "MIDFILES")
- AddSectionFilesToCopyList "Runtime", RUNSRCDIR$, MakePath(DEST$, "RUNTIME")
- AddSectionFilesToCopyList "Mentor", MENTSRCDIR$, DEST$
- '$ENDIF MENTORCD
- CopyFilesInCopyList
-
- CreateIniKeyValue "Win.ini", "Extensions", "mtr", MakePath(DEST$,"TBOOK.EXE"), cmoOverwrite
-
- ICONPATH$ = MakePath(RUNDEST$,"MENTOR.ICO")
-
-
-
- CreateProgmanGroup "Midisoft« Music Mentor", "", cmoNone
- ShowProgmanGroup "Midisoft« Music Mentor", 1, cmoNone
- CreateProgmanItem "Midisoft« Music Mentor", "Music Mentor", MakePath(RUNDEST$,"tbook.exe")+" "+MakePath(DEST$, "Mentor.mtr"), ICONPATH$, cmoOverwrite
- '$IFNDEF MENTORCD
- CreateProgmanItem "Midisoft« Music Mentor", "Recording Session", MakePath(SESDEST$,"SESSION.EXE"), "", cmoOverwrite
- CreateProgmanItem "Midisoft« Music Mentor", "Recording Session Help", MakePath(SESDEST$, "session.hlp"),"", cmoOverwrite
- CreateProgmanItem "Midisoft« Music Mentor", "Introduction to Notation", "WINHELP -i INTRO_NOTATION " + SESDEST$ + "\INTRO.HLP","", cmoOverwrite
- CreateProgmanItem "Midisoft« Music Mentor", "Introduction to MIDI", "WINHELP -i INTRO_MIDI " + SESDEST$ + "\INTRO.HLP","", cmoOverwrite
- CreateProgmanItem "Midisoft« Music Mentor", "General MIDI", "WINHELP -i INTRO_GENERAL_MIDI " + SESDEST$ + "\INTRO.HLP","", cmoOverwrite
-
- '$ENDIF MENTORCD
-
-
- 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
-
-