home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Education
/
collectionofeducationcarat1997.iso
/
COMPUSCI
/
GRAPHICN.ZIP
/
GRAPHICN.MS_
/
GRAPHICN.MS
Wrap
Text File
|
1993-08-15
|
5KB
|
198 lines
'**************************************************************************
'* Graphicon Setup Script
'**************************************************************************
'$INCLUDE 'setupapi.inc'
'$INCLUDE 'msdetect.inc'
''Dialog ID's
CONST WELCOME = 100
CONST DESTPATH = 300
CONST EXITFAILURE = 400
CONST EXITSUCCESS = 700
CONST TOOBIG = 6300
CONST BADPATH = 6400
''Bitmap ID
CONST LOGO = 1
GLOBAL DEST$ ''Default destination directory.
GLOBAL WINDRIVE$ ''Windows drive letter.
GLOBAL WINDIR$ ''Windows directory
GLOBAL WINSYSDIR$ ''Windows system directory
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
INIT:
CUIDLL$ = "mscuistf.dll" ''custom user interface dll
SetBitmap CUIDLL$, LOGO
SetTitle "Graphicon Setup"
maj = GetWindowsMajorVersion()
min = GetWindowsMinorVersion()
IF (maj < 3) OR ( (maj = 3) AND (min < 1) ) THEN
i% = DoMsgBox("Graphicon can be installed under Microsoft Windows 3.1 or later.","Graphicon Setup",MB_OK+MB_ICONHAND+MB_TASKMODAL)
GOTO ENDOFPRG
END IF
szInf$ = GetSymbolValue("STF_SRCINFPATH")
IF szInf$ = "" THEN
szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
END IF
ReadInfFile szInf$
'' Display the Welcome dialog box
WELCOME:
sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", 0, "")
IF sz$ = "CONTINUE" THEN
UIPop 1
ELSEIF sz$ = "REACTIVATE" THEN
GOTO WELCOME
ELSE
UIPop 1
ERR = 1
GOTO QUIT
END IF
WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
WINDIR$ = GetWindowsDir()
WINSYSDIR$ = GetWindowsSysDir()
DEST$ = WINDRIVE$ + ":\GRAPHICN"
SrcDir$ = GetSymbolValue("STF_SRCDIR")
INSTALL:
GOTO GETPATH
CUSTINST:
IF IsDirWritable(WINSYSDIR$)=0 OR IsDirWritable(WINDIR$)=0 THEN
i% = DoMsgBox("The Windows or the Windows System directory is read only.","Graphicon Setup",MB_OK+MB_ICONHAND)
ERR=1
GOTO QUIT
END IF
ClearCopyList
AddSectionFilesToCopyList "AppFiles", SrcDir$, DEST$
AddSectionFilesToCopyList "Examples", SrcDir$, DEST$+"\EXAMPLES"
AddSectionFilesToCopyList "IniFiles", SrcDir$, WINDIR$
AddSectionFilesToCopyList "RedistFiles", SrcDir$, WINSYSDIR$
IF IsWindowsShared()=TRUE AND GetSymbolValue("STF_MODE") = "ADMIN" THEN
AddSectionFilesToCopyList "SharedFiles", SrcDir$, WINSYSDIR$
else
AddSectionFilesToCopyList "SharedFiles", SrcDir$, WINDIR$
end if
IF GetCopyListCost("","","") <> 0 THEN
GOSUB TOOBIG
GOTO INSTALL
END IF
CreateDir DEST$, cmoVital
CreateDir DEST$+"\EXAMPLES", cmoVital
CopyFilesInCopyList
CreateProgmanGroup "Graphicon", "", cmoNone
ShowProgmanGroup "Graphicon", 1, cmoNone
CreateProgmanItem "Graphicon", "Graphicon", MakePath(DEST$,"GRAPHICN.EXE"), "" , cmoOverwrite
QUIT:
ON ERROR GOTO FAIL
IF ERR = 0 THEN
dlg% = EXITSUCCESS
ELSE
dlg% = EXITFAILURE
END IF
QUITL1:
sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO QUITL1
END IF
UIPop 1
ENDOFPRG:
END
FAIL:
i% = DoMsgBox("The setup disk is corrupted!","Graphicon Setup",MB_OK+MB_ICONHAND)
dlg% = EXITFAILURE
GOTO QUITL1
GETPATH:
SetSymbolValue "EditTextIn", DEST$
SetSymbolValue "EditFocus", "END"
GETPATHL1:
sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", 0 , "")
IF sz$ = "CONTINUE" THEN
olddest$ = DEST$
DEST$ = GetSymbolValue("EditTextOut")
''Validate new path.
IF IsDirWritable(DEST$) = 0 THEN
GOSUB BADPATH
GOTO GETPATHL1
END IF
UIPop 1
GOTO CUSTINST
ELSEIF sz$ = "REACTIVATE" THEN
GOTO GETPATHL1
ELSEIF sz$ = "EXIT" THEN
ERR = 1
GOTO QUIT
ELSE
UIPop 1
GOTO CUSTINST
END IF
BADPATH:
sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO BADPATH
END IF
UIPop 1
RETURN
TOOBIG:
sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO TOOBIG
END IF
UIPop 1
RETURN
'**
'** 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