home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aztec Masterblend
/
aztecmasterblendazteknewmediaj
/
cakewalk
/
wincake.ms_
/
wincake.bin
Wrap
Text File
|
1992-05-22
|
14KB
|
446 lines
'**************************************************************************
'* $Header: G:/SRC/WCW/MSSETUP/VCS/WINCAKE.MSV 1.7 22 May 1992 11:11:14 pws $
'*
'* DESCRIPTION: MS-Setup script for Wincake and Wcwdemo.
'*
'* $Log: G:/SRC/WCW/MSSETUP/VCS/WINCAKE.MSV $
'*
'* Rev 1.7 22 May 1992 11:11:14 pws
'* Demo .INI file is named WINCAKE.INI, not WCWDEMO.INI.
'*
'* Rev 1.6 13 May 1992 22:22:10 pws
'* .INF filename is now always SETUP.INF.
'*
'* Rev 1.5 08 May 1992 18:28:28 gwh
'* Use EXITSUCCESS_DEMO if installing Demo.
'*
'* Rev 1.4 08 May 1992 18:00:20 pws
'* Support WCWDEMO.
'*
'* Rev 1.3 03 May 1992 18:51:18 pws
'* Associate filetypes in Registration Database, too.
'*
'* Rev 1.2 21 Apr 1992 00:37:36 pws
'* Added filetype associations for .WRK, .MID, & .MFF to WIN.INI,
'* obtaining user confirmation when desirable.
'* Reject installation if Windows Version < 3.1.
'* Sense and handle when insufficient disk space on any paths.
'*
'* Rev 1.1 17 Apr 1992 19:16:38 gwh
'* Revised some names, including ProgMan group now "Cakewalk Professional".
'*
'* Rev 1.0 17 Apr 1992 17:14:56 pws
'* Initial revision.
'*
'* Copyright (C) 1990- by Greg Hendershott. All rights reserved.
'**************************************************************************
'$INCLUDE 'setupapi.inc'
'$INCLUDE 'msdetect.inc'
'$INCLUDE 'msregdb.inc'
''These should have all been in SETUPAPI.INC.
''Note that duplicate definitions are errors and so are commented out!
'CONST MB_OK = &H0000
CONST MB_OKCANCEL = &H0001
CONST MB_ABORTRETRYIGNORE = &H0002
CONST MB_YESNOCANCEL = &H0003
CONST MB_YESNO = &H0004
CONST MB_RETRYCANCEL = &H0005
CONST MB_TYPEMASK = &H000F
'CONST MB_ICONHAND = &H0010
CONST MB_ICONQUESTION = &H0020
CONST MB_ICONEXCLAMATION = &H0030
CONST MB_ICONASTERISK = &H0040
CONST MB_ICONMASK = &H00F0
CONST MB_ICONINFORMATION = MB_ICONASTERISK
CONST MB_ICONSTOP = MB_ICONHAND
CONST MB_DEFBUTTON1 = &H0000
CONST MB_DEFBUTTON2 = &H0100
CONST MB_DEFBUTTON3 = &H0200
CONST MB_DEFMASK = &H0F00
CONST MB_APPLMODAL = &H0000
CONST MB_SYSTEMMODAL = &H1000
'CONST MB_TASKMODAL = &H2000
CONST MB_NOFOCUS = &H8000
CONST IDOK = 1
CONST IDCANCEL = 2
CONST IDABORT = 3
CONST IDRETRY = 4
CONST IDIGNORE = 5
CONST IDYES = 6
CONST IDNO = 7
''Dialog ID's
CONST WELCOME = 100
CONST ASKQUIT = 200
CONST DESTPATH = 300
CONST EXITFAILURE = 400
CONST EXITQUIT = 600
CONST EXITSUCCESS = 700
CONST APPHELP = 900
CONST INI_NOT_OVERWRITTEN = 1000
CONST PATCHES_NOT_OVERWRITTEN = 1100
CONST EXITSUCCESS_DEMO = 1200
CONST BADPATH = 6400
''Bitmap ID
CONST LOGO = 1
GLOBAL COMPANY$
GLOBAL PROGNAME$
GLOBAL PRODUCTNAME$
GLOBAL DEST$ ''Default destination directory.
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
DECLARE SUB MaybeAssociate (szExt$)
INIT:
CUIDLL$ = "mscuistf.dll" ''Custom user interface dll
HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
COMPANY$ = "Twelve Tone Systems"
PROGMANGROUPNAME$ = "Cakewalk Professional"
INIBASENAME$ = "WINCAKE"
INFBASENAME$ = "SETUP"
IF DoesFileExist(GetSymbolValue("STF_SRCDIR") + "WINCAKE.EX_", femExists) <> 0 THEN
PROGNAME$ = "WINCAKE"
ELSEIF DoesFileExist(GetSymbolValue("STF_SRCDIR") + "WCWDEMO.EX_", femExists) <> 0 THEN
PROGNAME$ = "WCWDEMO"
ELSE
GOTO ERRQUIT
END IF
IF PROGNAME$ = "WINCAKE" THEN
PRODUCTNAME$ = "Cakewalk Professional"
ELSEIF PROGNAME$ = "WCWDEMO" THEN
PRODUCTNAME$ = "Cakewalk Professional Demo"
END IF
DEST$ = "C:\WINCAKE"
winVerReqd$ = "3.1"
SetBitmap CUIDLL$, LOGO
SetTitle PRODUCTNAME$ + " Setup"
winVer$ = LTRIM$(STR$(GetWindowsMajorVersion())) + "." + LTRIM$(STR$(GetWindowsMinorVersion()))
IF winVer$ < winVerReqd$ THEN ''String sort works
i% = DoMsgBox("Sorry, but your Windows version is "+winVer$+" and "+PRODUCTNAME$+" requires at least Windows "+winVerReqd$+".", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
END
END IF
szInf$ = GetSymbolValue("STF_SRCINFPATH")
IF szInf$ = "" THEN
szInf$ = GetSymbolValue("STF_CWDDIR") + INFBASENAME$+".INF"
END IF
ReadInfFile szInf$
''Disk cost list symbols
FILECOSTS$ = "FileCosts"
EXTRACOSTS$ = "ExtraCosts"
STILLNEEDED$ = "StillNeeded"
FOR i% = 1 TO 26 STEP 1
AddListItem EXTRACOSTS$, "0"
NEXT i%
''Add extra cost to Windows drive for ini/progman, etc.
ixWinDrive% = ASC(UCASE$( MID$(GetWindowsDir(), 1, 1) )) - ASC("A") + 1
ReplaceListItem EXTRACOSTS$, ixWinDrive%, "10240"
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
GOSUB BADPATH
GOTO GETPATHL1
END IF
UIPop 1
ixAppDrive% = ASC(UCASE$( MID$(DEST$, 1, 1) )) - ASC("A") + 1
ELSEIF sz$ = "REACTIVATE" THEN
GOTO GETPATHL1
ELSEIF sz$ = "BACK" THEN
UIPop 1
GOTO WELCOME
ELSE
GOSUB ASKQUIT
GOTO GETPATH
END IF
GOSUB INSTALL
IF StillNeed& > 0 THEN
GOTO GETPATH
END IF
QUIT:
ON ERROR GOTO ERRQUIT
IF ERR = 0 THEN
IF PROGNAME$ = "WINCAKE" THEN
dlg% = EXITSUCCESS
ELSEIF PROGNAME$ = "WCWDEMO" THEN
dlg% = EXITSUCCESS_DEMO
END IF
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("Installation failure. Call " + COMPANY$ + " Technical Support", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
END
BADPATH:
sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" 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
'**
'** Purpose:
'** Builds the copy list and performs all installation operations.
'** Arguments:
'** none.
'** Returns:
'** none.
'*************************************************************************
INSTALL:
SrcDir$ = GetSymbolValue("STF_SRCDIR")
AddSectionFilesToCopyList "app", SrcDir$, DEST$
IF PROGNAME$ = "WINCAKE" THEN
AddSectionFilesToCopyList "pro", SrcDir$, DEST$
ELSEIF PROGNAME$ = "WCWDEMO" THEN
AddSectionFilesToCopyList "demo", SrcDir$, DEST$
END IF
AddSectionFilesToCopyList "system", SrcDir$, GetWindowsSysDir()
StillNeed& = GetCopyListCost(EXTRACOSTS$, FILECOSTS$, STILLNEEDED$)
IF StillNeed& > 0 THEN
ClearCopyList
FOR ix% = 1 TO 26 STEP 1 ''find first drive that needs space
need1& = VAL(GetListItem(STILLNEEDED$, ix%))
IF need1& > 0 THEN
GOTO FNDDRV
END IF
NEXT ix%
ix = ixAppDrive ''(shouldn't happen)