home *** CD-ROM | disk | FTP | other *** search
- '$INCLUDE 'setupapi.inc'
- '$INCLUDE 'msdetect.inc'
-
- CONST WELCOME = 100
- CONST ASKQUIT = 200
- CONST DESTPATH = 300
- CONST EXITFAILURE = 400
- CONST EXITQUIT = 600
- CONST EXITSUCCESS = 700
- CONST APPHELP = 900
- CONST BADPATH = 6400
- CONST LOGO = 1
-
- GLOBAL DEST$
- GLOBAL OPTCUR$
-
- DECLARE SUB Install
- DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
- DECLARE FUNCTION JoinDispatch LIB "mscuistf.dll" (path$,l3%) AS INTEGER
- DECLARE FUNCTION MessageMax LIB "mscuistf.dll" (i3%) AS INTEGER
-
- INIT:
- CUIDLL$ = "mscuistf.dll"
- HELPPROC$ = "FHelpDlgProc"
-
- SetBitmap CUIDLL$, LOGO
- SetTitle "All-Music Guide Setup"
-
- i1% = GetWindowsMajorVersion()
- i2% = GetWindowsMinorVersion()
- i1% = i1%*100 + i2%
- IF i1%<310 THEN
- i1% = DoMsgBox("This program requires Windows 3.1 or later version.","All-Music Guide Setup",MB_OK)
- END
- END IF
-
- szInf$ = GetSymbolValue("STF_SRCINFPATH")
- IF szInf$ = "" THEN
- szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
- END IF
- ReadInfFile szInf$
-
- OPTCUR$ = "1"
- DEST$ = "C:\MUSIC"
-
- '$IFDEF DEBUG
- i% = SetSizeCheckMode(scmOnIgnore)
- WinDrive$ = MID$(GetWindowsDir, 1, 1)
- 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
- '$ENDIF
-
- i3%=HwndFrame()
- IF MessageMax(i3%) = 0 THEN
- '$ifdef DEBUG
- StfApiErr saeFail, "MessageMax",i3%
- '$endif
- ERROR STFERR
- END IF
-
- WELCOME:
- sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
- IF sz$ = "CONTINUE" THEN
- UIPop 1
- ELSE
- GOSUB ASKQUIT
- GOTO WELCOME
- 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 IsDirWritable(DEST$) = 0 THEN
- i% = DoMsgBox(" Disk write error ! ","All-Music Guide Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
- '' GOSUB BADPATH
- GOTO GETPATHL1
- ELSE
- L&=12500000
- Drive$ = MID$(DEST$,1,1)
- IF GetFreeSpaceForDrive(Drive$)<L& THEN
- i% = DoMsgBox("There is not enough free space on drive "+Drive$+": . You need 12.5 MB FREE.", "All-Music Guide Setup", MB_TASKMODAL+MB_ICONHAND+MB_OK)
- GOTO GETPATHL1
- END IF
- UIPop 1
- END IF
- UIPop 1
- ELSEIF sz$ = "REACTIVATE" THEN
- GOTO GETPATHL1
- ELSEIF sz$ = "BACK" THEN
- UIPop 1
- GOTO GETPATH
- ELSE
- GOSUB ASKQUIT
- GOTO GETPATH
- END IF
-
- Install
-
- QUIT:
- ON ERROR GOTO ERRQUIT
-
- IF ERR = 0 THEN
- dlg% = EXITSUCCESS
- 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("Setup sources were corrupted, call your dealer!", "All-Music Guide Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
- END
-
- BADPATH:
- '' i% = DoMsgBox("Disk write error!","All-Music Guide Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
- sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
- IF sz$ = "REACTIVATE" THEN
- '' IF i% = 1 THEN
- GOTO BADPATH
- 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
-
- SUB Install STATIC
-
- SrcDir$ = GetSymbolValue("STF_SRCDIR")
- CreateDir DEST$, cmoNone
-
- ProSetPos 170,175
-
- AddSectionFilesToCopyList "AppFiles", SrcDir$, DEST$
-
- lTicks& = 1
- AddToBillboardList "mscuistf.dll",5000,"FModelessDlgProc",lTicks&
- lTicks& = 1
- AddToBillboardList "mscuistf.dll",5001,"FModelessDlgProc",lTicks&
- lTicks& = 1
- AddToBillboardList "mscuistf.dll",5002,"FModelessDlgProc",lTicks&
- lTicks& = 1
- AddToBillboardList "mscuistf.dll",5003,"FModelessDlgProc",lTicks&
- lTicks& = 1
- AddToBillboardList "mscuistf.dll",5004,"FModelessDlgProc",lTicks&
- lTicks& = 1
- AddToBillboardList "mscuistf.dll",5005,"FModelessDlgProc",lTicks&
- lTicks& = 2
- AddToBillboardList "mscuistf.dll",5006,"FModelessDlgProc",lTicks&
-
- CopyFilesInCopyList
-
- IF JoinDispatch(DEST$,i3%) = 0 THEN
- '$ifdef DEBUG
- StfApiErr saeFail, "JoinDispatch", "",i3%
- '$endif
- ERROR STFERR
- END IF
-
- CreateProgmanGroup "All-Music Guide", "", cmoNone
- ShowProgmanGroup "All-Music Guide", 1, cmoNone
- CreateProgmanItem "All-Music Guide", "All-Music Guide", MakePath(DEST$,"music.exe"), "", cmoOverwrite
- CreateProgmanItem "All-Music Guide", "All-Music Guide Help", MakePath(GetWindowsDir,"winhelp.exe ") + MakePath(DEST$,"music.hlp"), "", cmoOverwrite
-
-
- END SUB
-
- 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
-