home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
OTHERUTI
/
DASHBRD.ZIP
/
DBDASH.MS_
/
DBDASH.MS
Wrap
Text File
|
1993-06-14
|
8KB
|
314 lines
'**************************************************************************
'* Dashboard for Windows Setup Script
'**************************************************************************
'$INCLUDE 'setupapi.inc'
'$INCLUDE 'msdetect.inc'
''Dialog ID's
CONST WELCOME = 100
CONST ASKQUIT = 200
CONST NOWIN30 = 300
CONST EXITFAILURE = 400
CONST EXITQUIT = 600
CONST EXITSUCCESS = 700
CONST EXITCREATE = 800
CONST NODASHSPACE = 2000
CONST DASHISSHELL = 3100
CONST DASHISRUNNING = 3200
CONST UPDATEDASH = 3400
CONST UPDATENEWDASH = 3500
CONST BADPATH = 6400
''Bitmap ID
CONST LOGO = 1
''SPACE REQUIREMENT
CONST DASHSPACES& = 1600000
GLOBAL DEST$ ''Default destination directory.
GLOBAL WINSYSDIR$ ''Windows System Directory
GLOBAL WINDIR$ ''Windows Directory
GLOBAL DASHDRIVE$ ''Dashboard drive.
GLOBAL CUIDLL$ ''DialogBox Dll File
GLOBAL WINMAJOR% ''Windows Major Version Number
GLOBAL WINMINOR% ''Windows Minor Version Number
GLOBAL SETASSHELL% ''Set the DASH as the shell.
GLOBAL MERGEOLDINI% ''Merge old and new DASH.INI's
GLOBAL COPYNEWINI% ''Copy new DASH.INI file
GLOBAL DELETEDATA% ''Delete existing data files
GLOBAL DELETEITEMS% ''Delete existing program items
GLOBAL DBWASSHELL% ''Set the DASH as the shell.
DECLARE FUNCTION CheckOldShell LIB "DASHINST.DLL" AS INTEGER
DECLARE FUNCTION DeleteGroupItem LIB "DASHINST.DLL" (szItem$) AS INTEGER
DECLARE FUNCTION IsDashShell LIB "DASHINST.DLL" AS INTEGER
DECLARE FUNCTION IsDashRunning LIB "DASHINST.DLL" AS INTEGER
DECLARE FUNCTION MergeIni LIB "DASHINST.DLL" (szIni$, szOldIni$) AS INTEGER
DECLARE FUNCTION RestartWindows LIB "DASHINST.DLL" (szPath$) AS INTEGER
DECLARE FUNCTION SetDashAsShell LIB "DASHINST.DLL" (szSrc$, szPath$) AS INTEGER
DECLARE SUB Install
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
CUIDLL$ = "mscuistf.dll" ''Custom user interface dll
SetBitmap CUIDLL$, LOGO
SetCopyGaugePosition 80, 80
szInf$ = GetSymbolValue("STF_SRCINFPATH")
IF szInf$ = "" THEN
szInf$ = GetSymbolValue("STF_CWDDIR") + "DBDASH.INF"
END IF
ReadInfFile szInf$
WINSYSDIR$ = Mid$(GetWindowsSysDir(),1,Len(GetWindowsSysDir())-1)
WINDIR$ = GetWindowsDir()
DEST$ = Mid$(WINDIR$,1,2) + "\DASH"
WINMAJOR% = GetWindowsMajorVersion()
WINMINOR% = GetWindowsMinorVersion()
MERGEOLDINI% = 0
COPYNEWINI% = 1
DELETEDATA% = 0
DELETEITEMS = 0
SETASSHELL% = 0
IF ((WINMAJOR% < 3) OR ((WINMAJOR% = 3) AND (WINMINOR% < 10))) THEN
sz$ = UIStartDlg(CUIDLL$, NOWIN30, "FInfoDlgProc", 0, "")
UIPop 1
ERROR STFQUIT
GOTO QUIT
END IF
IF (IsDashShell() = 1) THEN
sz$ = UIStartDlg(CUIDLL$, DASHISSHELL, "FInfoDlgProc", 0, "")
UIPop 1
IF (sz$ = "CONTINUE") THEN
szSetup$ = MakePath(GetSymbolValue("STF_SRCDIR"), "SETUP.EXE")
x% = RestartWindows(szSetup)
'if we get here, the restart failed...
END IF
ERROR STFQUIT
GOTO QUIT
END IF
DBWASSHELL% = CheckOldShell()
DASHRUNNING:
IF (IsDashRunning() = 1) THEN
sz$ = UIStartDlg(CUIDLL$, DASHISRUNNING, "FInfoDlgProc", 0, "")
UIPop 1
IF (sz$ = "CONTINUE") THEN
GOTO DASHRUNNING
END IF
ERROR STFQUIT
GOTO QUIT
END IF
SetSymbolValue "EditTextIn", DEST$
SetSymbolValue "EditFocus", "END"
GETPATH:
sz$ = UIStartDlg(CUIDLL$, WELCOME, "FEditDlgProc", 0, "")
DEST$ = GetSymbolValue("EditTextOut")
IF (sz$ = "CONTINUE") THEN
IF (IsDirWritable(DEST$) = 0) THEN
sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfoDlgProc", 0, "")
UIPop 1
GOTO GETPATH
END IF
szDash$ = MakePath(DEST$, "DASH.EXE")
x% = DoesFileExist(szDash$, femExists)
IF (x% = 1) THEN
szVer$ = GetVersionOfFile(szDash$)
szIni$ = MakePath(DEST$, "DASH.INI")
bIni% = DoesFileExist(szIni$, femExists)
IF (szVer$ = "") THEN
sz$ = UIStartDlg(CUIDLL$, UPDATEDASH, "FInfoDlgProc", 0, "")
UIPop 1
IF (sz$ <> "CONTINUE") THEN
GOTO GETPATH
ELSE
IF (bIni% = 1) THEN
szTempIni$ = MakePath(DEST$, "~DASHOLD.INI")
CopyFile szIni$, szTempIni$, cmoOverwrite, 0
MERGEOLDINI% = 1
DELETEITEMS% = 1
END IF
END IF
ELSEIF (szVer$ = "2.0.0.0") THEN
IF (bIni% = 1) THEN
COPYNEWINI% = 0
END IF
ELSE
sz$ = UIStartDlg(CUIDLL$, UPDATENEWDASH, "FInfoDlgProc", 0, "")
UIPop 1
IF (sz$ <> "CONTINUE") THEN
GOTO GETPATH
ELSE
DELETEDATA% = 1
END IF
END IF
END IF
UIPop 1
ELSE
sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FInfoDlgProc", 0, "")
IF sz$ = "CONTINUE" THEN
UIPopAll
GOTO QUITL2
ELSE
UIPop 1
END IF
GOTO GETPATH
END IF
DASHDRIVE$ = Mid$(DEST$,1,1)
IF (GetFreeSpaceForDrive(DASHDRIVE$) < DASHSPACES&) THEN
sz$ = UIStartDlg(CUIDLL$, NODASHSPACE, "FInfoDlgProc", 0, "")
UIPop 1
ERROR STFQUIT
GOTO QUIT
END IF
Install
ON ERROR GOTO GROUPFAIL
CreateProgmanGroup "Dashboard for Windows", "", cmoNone
ShowProgmanGroup "Dashboard for Windows", 1, cmoNone
ON ERROR GOTO QUIT
IF (DELETEITEMS% = 1) THEN
x% = DeleteGroupItem("Dashboard for Windows")
x% = DeleteGroupItem("Remove Dashboard")
x% = DeleteGroupItem("Read Me")
x% = DeleteGroupItem("Read Me Advanced")
ENDIF
path$ = MakePath(DEST$, "DASH.EXE")
CreateProgmanItem "Dashboard for Windows", "Dashboard 2.0 for Windows", path$, "", cmoOverwrite
path$ = MakePath("", "DASHZAP.EXE " + DEST$)
CreateProgmanItem "Dashboard for Windows", "Remove Dashboard 2.0", path$, "", cmoOverwrite
readme$ = MakePath(DEST$, "README.WRI")
CreateProgmanItem "Dashboard for Windows", "Read Me 2.0", readme$, "", cmoOverwrite
readme$ = MakePath(DEST$, "READADV.WRI")
CreateProgmanItem "Dashboard for Windows", "Read Me Advanced 2.0", readme$, "", cmoOverwrite
QUIT:
IF (ERR = 0) THEN
sz$ = UIStartDlg(CUIDLL$, EXITSUCCESS, "FInfoDlgProc", 0, "")
UIPop 1
IF (MERGEOLDINI% = 1) THEN
szIni$ = MakePath(DEST$, "DASH.INI")
szTempIni$ = MakePath(DEST$, "~DASHOLD.INI")
x% = MergeIni(szIni$, szTempIni$)
END IF
IF (DBWASSHELL% = 1) THEN
SETASSHELL = 1
END IF
ELSEIF (ERR = STFQUIT) THEN
sz$ = UIStartDlg(CUIDLL$, EXITQUIT, "FInfoDlgProc", 0, "")
UIPop 1
ELSE
sz$ = UIStartDlg(CUIDLL$, EXITFAILURE, "FInfoDlgProc", 0, "")
UIPop 1
END IF
QUITL2:
IF (MERGEOLDINI% = 1) THEN
szTempIni$ = MakePath(DEST$, "~DASHOLD.INI")
x% = DoesFileExist(szTempIni$, femExists)
IF (x% = 1) THEN
RemoveFile szTempIni$, cmoNone
END IF
END IF
IF (SETASSHELL% = 1) THEN
szSrc$ = GetSymbolValue("STF_SRCDIR")
szShell$ = MakePath(DEST$, "DASH.EXE")
x% = SetDashAsShell(szSrc$, szShell$)
END IF
END
GROUPFAIL:
sz$ = UIStartDlg(CUIDLL$, EXITCREATE, "FInfoDlgProc", 0, "")
UIPop 1
GOTO QUITL2
'**
'** Purpose:
'** Builds the copy list and performs the copy.
'** Arguments:
'** none.
'** Returns:
'** none.
'*************************************************************************
SUB Install STATIC
SrcDir$ = GetSymbolValue("STF_SRCDIR")
CreateDir DEST$, cmoNone
AddSectionFilesToCopyList "Files", SrcDir$, DEST$
IF (COPYNEWINI% = 1) THEN
AddSectionFilesToCopyList "INIFILES", SrcDir$, DEST$
END IF
IF (DELETEDATA% = 1) THEN
AddSectionFilesToCopyList "DELDATA", SrcDir$, DEST$
END IF
AddSectionFilesToCopyList "DEINSTALL", SrcDir$, WINDIR$
CopyFilesInCopyList
ClearCopyList
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