home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-05-15 | 63.7 KB | 1,856 lines |
- '' $Keywords: draw.mst 1.65 14May92 07:58am$ $nokeywords$
- '**************************************************************************
- '* CorelTools setup script
- '**************************************************************************
- '' Date Name Reason
- ''-------------------------------------------------------------------------
- '' Feb 25 1992 Randall Mack Modified from sample2.mst provided with
- '' Windows SDK 3.1 Beta.
-
- '$INCLUDE 'setupapi.inc'
-
- ''C functions
- DECLARE SUB InitializeInstall LIB "mscuistf.dll" (hInstance%, hMainWind% )
- DECLARE SUB ShutDownInstall LIB "mscuistf.dll"
- DECLARE SUB RegisterDraw LIB "mscuistf.dll" (szDrawExePath$)
- DECLARE SUB LoadStringResource LIB "mscuistf.dll" (nID%, szStr$, nStrLen%)
- DECLARE SUB RegisterFont LIB "mscuistf.dll" (szFOTName$, szTTFName$)
- DECLARE SUB FileChangeString LIB "mscuistf.dll" (szFile1$, szFile2$, szString1$, szString2$)
- DECLARE SUB ExecCommand LIB "mscuistf.dll" (szCommand$)
- DECLARE FUNCTION ScanList LIB "mscuistf.dll" (szSymbol$, nIndex%) AS INTEGER
- DECLARE FUNCTION GetFilenameFromPath LIB "mscuistf.dll" (szPath$) AS INTEGER
- DECLARE FUNCTION IsTTFEnabled LIB "mscuistf.dll" AS INTEGER
-
- ''Strings for loading string resources
- GLOBAL szString$
- GLOBAL szString2$
- CONST STRINGLEN = 66
- szString$ = string$( STRINGLEN+1, 32 )
- szString2$ = string$( STRINGLEN+1, 32 )
-
- ''setup main window
- CONST IMSG_TITLE = 9302 ''must match the constant in dialogs.h
- CONST LOGO = 9100 ''must match the constant in dialogs.h
- LoadStringResource IMSG_TITLE, szString$, STRINGLEN
- SetTitle szString$
- InitializeInstall hinstFrame(), HwndFrame() ''corel style buttons; max window
- SetBitmap "mscuistf.dll", LOGO
-
- '$INCLUDE 'msdetect.inc'
-
- '' '$DEFINE DEBUG ''Define for script development/debugging
-
- ''Dialog ID's
- ''Note: These constants MUST match the constants in dialogs.h
- CONST WELCOME = 9900
- CONST ASKQUIT = 9901
- CONST DESTPATH = 9902
- CONST EXITFAILURE = 9903
- CONST EXITQUIT = 9904
- CONST EXITSUCCESS = 9905
- CONST OPTIONS = 9906
- CONST CUSTINST = 9907
- CONST TOOBIG = 9908
- CONST BADPATH = 9909
- CONST CUSTDRAW = 9910
- CONST CUSTCHART = 9911
- CONST CUSTSHOW = 9912
- CONST CUSTPHOTO = 9913
- CONST CUSTTRACE = 9914
- CONST CUSTMOSAIC = 9915
- CONST SELECTFILTERS = 9916
- CONST SELECTFONTSYM = 9917
- CONST WAIT = 9919
- CONST ABOUT = 9920
- CONST SELECTGROUPS = 9921
- CONST ASKINSTALL = 9922
- CONST CUSTGROUPS = 9925
- CONST BILLBOARD = 9926
- CONST UPDATEDAUTOEXEC = 9930
- CONST UPDATEAUTOEXEC = 9931
- CONST WAITREGISTER = 9932
- CONST WELCOMEHELP = 9800
- CONST OPTIONSHELP = 9801
- CONST GETPATHHELP = 9802
- CONST CUSTINSTHELP = 9803
- CONST CUSTINST2HELP = 9804
- CONST SELECTHELP = 9806
- CONST SELECTGROUPSHELP = 9807
- CONST ASKINSTALLHELP = 9808
- CONST CUSTGROUPSHELP = 9809
- ''String Resource IDs
- CONST IMSG_ERRQUIT = 9300
- CONST IMSG_SETUPMESSAGE = 9301
- CONST IMSG_TOOLGROUP = 9303
- CONST IMSG_RELEASENOTES = 9304
- CONST IMSG_CORELDRAW = 9306
- CONST IMSG_CORELCHART = 9307
- CONST IMSG_CORELSHOW = 9308
- CONST IMSG_CORELPHOTO = 9309
- CONST IMSG_CORELTRACE = 9310
- CONST IMSG_MOSAIC = 9311
- CONST IMSG_FONTSYM = 9312
- CONST IMSG_MAIN = 9313
- CONST IMSG_T1FONTS = 9314
- CONST IMSG_TTF = 9315
- ''Logfile string constants
- CONST ILOG_FULLINSTALL = 9350
- CONST ILOG_MININSTALL = 9351
- CONST ILOG_CUSTOMINSTALL = 9352
- CONST ILOG_SETUPSUCCEEDED = 9353
- CONST ILOG_SETUPFAILED = 9354
- CONST ILOG_SETUPQUIT = 9355
- CONST ILOG_SETUPCORRUPTED = 9356
- CONST ILOG_PROGMANGROUP = 9357
- CONST ILOG_BASEDIR = 9358
- CONST ILOG_DIRECTORIES = 9359
- CONST ILOG_ASTERIXES = 9360
- CONST ILOG_CUSTOMSELECT = 9361
- CONST ILOG_CUSTOMMESSAGE = 9362
-
- ''Constants representing each line in the custinst dialog
- CONST DRAW = 1
- CONST CHART = 2
- CONST SHOW = 3
- CONST PHOTO = 4
- CONST TRACE = 5
- CONST MOSAIC = 6
- CONST FONTSYM = 7
- CONST NUMCUST = FONTSYM
- CONST MAIN = NUMCUST + 1
- CONST NUMGROUPS = MAIN
-
- CONST FALSE = 0
- CONST TRUE = 1
-
- '' Set this constant to the type of install interested in.
- CONST INSTALLCD = FALSE
-
- '' used as values for afState(NUMCUST) array.
- CONST ALL = 1
- CONST SOME = 2
- CONST NONE = 3
-
- '' set 'customize' variables
-
- ''Customized installation settings
- GLOBAL OPTS(MOSAIC) AS STRING
- OPTS(DRAW) = "DrawOpt"
- OPTS(CHART) = "ChartOpt"
- OPTS(SHOW) = "ShowOpt"
- OPTS(PHOTO) = "PhotoOpt"
- OPTS(TRACE) = "TraceOpt"
- OPTS(MOSAIC) = "MosaicOpt"
- ''lists of reference keys for filters, fonts and symbols. 1 = install, 2 = don't
- GLOBAL IMPFILTERLIST1$
- IMPFILTERLIST1$ = "ImportFilterList1"
- GLOBAL IMPFILTERLIST2$
- IMPFILTERLIST2$ = "ImportFilterList2"
- GLOBAL EXPFILTERLIST1$
- EXPFILTERLIST1$ = "ExportFilterList1"
- GLOBAL EXPFILTERLIST2$
- EXPFILTERLIST2$ = "ExportFilterList2"
- GLOBAL FONTLIST1$
- FONTLIST1$ = "FontList1"
- GLOBAL FONTLIST2$
- FONTLIST2$ = "FontList2"
- GLOBAL SYMBOLLIST1$
- SYMBOLLIST1$ = "SymbolList1"
- GLOBAL SYMBOLLIST2$
- SYMBOLLIST2$ = "SymbolList2"
- ''information text for custom installation window
- GLOBAL STATUSTEXT$
- STATUSTEXT$ = "StatusItemsText"
- GLOBAL DRIVETEXT$
- DRIVETEXT$ = "DriveStatusText"
- ''used as a parm to GetCopyListCost only
- GLOBAL EXTRACOSTS$
- EXTRACOSTS$ = "ExtraCosts"
- GLOBAL afTooBig%
- afTooBig% = FALSE
- GLOBAL CustomGroups% '' TRUE ==> user went through SELECTCUSTGROUPS
- CustomGroups% = FALSE
- GLOBAL fInstallATM$ '' Should the type 1 fonts be installed?
- GLOBAL bInstallWinDLL% '' Should the dlls be copied to the windows system dir?
- '' Note: redists are always copied under win 3.0
- bInstallWinDLL% = FALSE
- GLOBAL bInstallDLL% '' Should the dlls be copied to the executable dirs?
- bInstallDLL% = TRUE
-
- ''list of sections (1..NUMGROUPS) :- TRUE => not enough space.
- GLOBAL afState(NUMCUST) AS INTEGER ''list of selections for main options
- GLOBAL DIR(NUMGROUPS) AS STRING ''list of directories for main options
- GLOBAL NUM(3) AS STRING ''string representations of 1 .. 3
- ''CustInst list of symbol names - each is a list of 26 numbers corresponding
- '' to the space required on that numbered drive for the files in the
- '' corresponding group
- GLOBAL aszNEEDS(NUMGROUPS) AS STRING
-
- GLOBAL WINDIR$ ''Windows directory.
- GLOBAL WINSYSDIR$ ''Windows directory.
- GLOBAL WINDRIVE$ ''Windows drive letter.
- GLOBAL DEST$ ''destination directory.
-
- GLOBAL TOOLGROUP$ '' Group in which tools are to be installed
- GLOBAL aszGroups(MOSAIC) AS STRING '' Custom progman groups
-
- ''Windows version numbers
- GLOBAL WinMinor%
-
- ''Variables to fake subroutines with parameters
- GLOBAL szFlist1a$
- GLOBAL szFlist1b$
- GLOBAL szFlist2a$
- GLOBAL szFlist2b$
- GLOBAL Dialog%
- GLOBAL SelectType%
- GLOBAL szOptions$
-
- ''TRUE => must do a global recalculation after GetPath - starts TRUE
- GLOBAL bRecalc%
-
- ''Globals for WaitOn and WaitOff
- GLOBAL nWaiting%
- GLOBAL CursorSave%
-
- GLOBAL bLogging% ''If set then the logfile has been opened
-
- Global bPathAltered% '' If set then autoexec.bat has been changed
-
- ''local MSTest functions
- DECLARE SUB SetStateFromSymbol
- DECLARE SUB WaitOnBig
- DECLARE SUB WaitOn
- DECLARE SUB WaitOff
- DECLARE SUB SetDirectories
- DECLARE SUB SetProgmanGroups
- DECLARE SUB FullInstall
- DECLARE SUB MinInstall
- DECLARE SUB AddOptFilesToCopyList (ftype%)
- DECLARE SUB RecalcOptFiles (ftype%)
- DECLARE SUB RecalcPath
- DECLARE SUB SetDriveStatus
- DECLARE SUB TestWriteToLogFile (szMsg$)
- DECLARE SUB WriteStringToLogFile (nResourceConst%)
- DECLARE SUB TestWriteStringToLogFile (nResourceConst%)
- DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
- DECLARE FUNCTION MakeDir (szDir$) AS STRING
-
- INIT:
- '' set waiting cursor
- nWaiting% = 0
- WaitOn
-
- ''Set default directory names
- WINDIR$ = GetWindowsDir
- WINSYSDIR$ = GetWindowsSysDir
- WINDRIVE$ = MID$(WINDIR$, 1, 1)
- DEST$ = WINDRIVE$ + ":\CORELDRW"
- SetDirectories
-
- ''Open the logfile at the root of their windrive$
- ''GetLocalHardDrivesList "LocalHardDrives"
- ''szDrive$ = GetListItem( "LocalHardDrives", 1 )
- ''IF szDrive$ <> "" THEN
- ''OpenLogfile szDrive$ + ":\logfile.txt", 0
- ''bLogging% = TRUE
- ''ENDIF
- ''RemoveSymbol "LocalHardDrives"
- OpenLogfile WINDRIVE$ + ":\logfile.txt", 0
- bLogging% = TRUE
-
- ''find and read .inf file
- szInf$ = GetSymbolValue("STF_SRCINFPATH")
- IF szInf$ = "" THEN
- szInf$ = GetSymbolValue("STF_CWDDIR") + "draw.INF"
- ENDIF
- ReadInfFile szInf$
- szInf$ = ""
-
- SetSymbolValue STATUSTEXT$, "{"""","""","""","""","""","""","""",""""}"
- SetSymbolValue DRIVETEXT$, "{"""","""","""","""","""","""","""","""","""","""","""","""","""","""",""""}"
-
- ''Disk cost list symbols
- FOR i% = 1 TO NUMGROUPS STEP 1
- aszNEEDS(i%) = "DrawNeeds" + STR$(i%)
- NEXT i%
-
- ''basic initialization
- NUM(1) = "1"
- NUM(2) = "2"
- NUM(3) = "3"
- SetSymbolValue EXTRACOSTS$, "{""0"",""0"",""0"",""0"",""0"",""0"",""0"",""0"",""0"",""0"",""0"",""0"",""0"",""0"",""0"",""0"",""0"",""0"",""0"",""0"",""0"",""0"",""0"",""0"",""0"",""0""}"
-
- ''Set windows version - for use with installing windows 3.1 DLL's
- WinMinor% = GetWindowsMinorVersion
- IF WinMinor% = 0 THEN
- bInstallWinDLL% = TRUE
- ENDIF
-
- ''set the default progman group to put everything in
- LoadStringResource IMSG_TOOLGROUP, szString$, STRINGLEN
- TOOLGROUP$ = szString$
-
-
- '' Put up the Welcome dialog
- WELCOME:
- WaitOff
- sz$ = UIStartDlg( "mscuistf.dll", WELCOME, "FInfoDlgProc", WELCOMEHELP, "FHelpDlgProc" )
- SELECT CASE sz$
- CASE "CONTINUE"
- UIPop 1
- CASE "ABOUT"
- Dialog% = ABOUT
- GOSUB INFO
- GOTO WELCOME
- CASE "REACTIVATE"
- GOTO WELCOME
- CASE ELSE
- GOSUB ASKQUIT
- GOTO WELCOME
- END SELECT
-
-
- '' fall through from WELCOME
- '' Allow the user to select between full, minimal and custom installation
- OPTIONS:
- WaitOff
- sz$ = UIStartDlg( "mscuistf.dll", OPTIONS, "FButtonsDlgProc", OPTIONSHELP, "FHelpDlgProc" )
- SELECT CASE sz$
- CASE "F"
- UIPop(1)
- ''At least one recalculation must be made to determine that everything fits
- bRecalc% = TRUE
- FullInstall
- SetProgmanGroups
- TestWriteStringToLogfile ILOG_FULLINSTALL
- TestWriteToLogfile ""
- GOSUB GETPATH
- CASE "M"
- UIPop(1)
- ''At least one recalculation must be made to determine that everything fits
- bRecalc% = TRUE
- MinInstall
- SetProgmanGroups
- TestWriteStringToLogfile ILOG_MININSTALL
- TestWriteToLogfile ""
- GOSUB GETPATH
- CASE "C"
- UIPop(1)
- ''At least one recalculation must be made to determine that everything fits
- bRecalc% = TRUE
- FullInstall
- TestWriteStringToLogfile ILOG_CUSTOMINSTALL
- TestWriteToLogfile ""
- GOSUB GETPATH
- GOSUB CUSTINST
- CASE "REACTIVATE"
- GOTO OPTIONS
- CASE ELSE
- GOSUB ASKQUIT
- GOTO OPTIONS
- END SELECT
-
- '' fall through from OPTIONS
- '' Do the installation using afState, OPTS(DRAW) .. OPT(MOSAIC), etc. to
- '' indicate which files should be installed.
- INSTALL:
- WaitOn
- ''Make sure there is enough space for CorelDRAW!
- IF bRecalc% = TRUE THEN
- WaitOnBig
- bRecalc% = FALSE
- RecalcPath
- SetDriveStatus
- ENDIF
- IF afTooBig% <> FALSE THEN
- Dialog% = TOOBIG
- GOSUB INFO
- GOTO OPTIONS
- ENDIF
-
- ClearCopyList
- ''Create all directories needed and assign all the files to copy
- FOR i% = 1 TO NUMGROUPS STEP 1
- IF afState(i%) <> NONE THEN
- CreateDir DIR(i%), cmoNone
- AddOptFilesToCopyList i%
- ENDIF
- NEXT i%
- CreateDir DIR(MAIN), cmoNone
-
- IF afState(DRAW) <> NONE THEN
- IF afState(DRAW) = ALL OR GetListItem( OPTS(DRAW), 1 ) = "ON" THEN
- CreateDir MakePath( DIR(MAIN), "autoback" ), cmoNone
- ENDIF
- IF afState(DRAW) = ALL OR GetListItem( OPTS(DRAW), 4 ) = "ON" THEN
- CreateDir MakePath( DIR(DRAW), "samples" ), cmoNone
- ENDIF
- IF INSTALLCD = FALSE THEN
- IF afState(DRAW) = ALL OR GetListItem( OPTS(DRAW), 5 ) = "ON" THEN
- CreateDir MakePath( DIR(DRAW), "clipart" ), cmoNone
- CreateDir MakePath( DIR(DRAW), "clipart\aircraft" ), cmoNone
- CreateDir MakePath( DIR(DRAW), "clipart\bird" ), cmoNone
- CreateDir MakePath( DIR(DRAW), "clipart\celebrat" ), cmoNone
- CreateDir MakePath( DIR(DRAW), "clipart\dental" ), cmoNone
- CreateDir MakePath( DIR(DRAW), "clipart\emergenc" ), cmoNone
- CreateDir MakePath( DIR(DRAW), "clipart\equipmen" ), cmoNone
- CreateDir MakePath( DIR(DRAW), "clipart\flag" ), cmoNone
- CreateDir MakePath( DIR(DRAW), "clipart\food" ), cmoNone
- CreateDir MakePath( DIR(DRAW), "clipart\icon" ), cmoNone
- CreateDir MakePath( DIR(DRAW), "clipart\mammal" ), cmoNone
- CreateDir MakePath( DIR(DRAW), "clipart\man" ), cmoNone
- CreateDir MakePath( DIR(DRAW), "clipart\map" ), cmoNone
- CreateDir MakePath( DIR(DRAW), "clipart\medical" ), cmoNone
- CreateDir MakePath( DIR(DRAW), "clipart\misc" ), cmoNone
- CreateDir MakePath( DIR(DRAW), "clipart\money" ), cmoNone
- CreateDir MakePath( DIR(DRAW), "clipart\politica" ), cmoNone
- CreateDir MakePath( DIR(DRAW), "clipart\sign" ), cmoNone
- CreateDir MakePath( DIR(DRAW), "clipart\sports" ), cmoNone
- CreateDir MakePath( DIR(DRAW), "clipart\theme_bo" ), cmoNone
- CreateDir MakePath( DIR(DRAW), "clipart\woman" ), cmoNone
- ENDIF
- ENDIF
- ENDIF
-
- IF afState(CHART) <> NONE THEN
- IF afState(CHART) = ALL OR GetListItem( OPTS(CHART), 1 ) = "ON" THEN
- CreateDir MakePath( DIR(CHART), "3driser" ), cmoNone
- CreateDir MakePath( DIR(CHART), "3dscat" ), cmoNone
- CreateDir MakePath( DIR(CHART), "area" ), cmoNone
- CreateDir MakePath( DIR(CHART), "bar" ), cmoNone
- CreateDir MakePath( DIR(CHART), "bitmaps" ), cmoNone
- CreateDir MakePath( DIR(CHART), "effects" ), cmoNone
- CreateDir MakePath( DIR(CHART), "hilo" ), cmoNone
- CreateDir MakePath( DIR(CHART), "hist" ), cmoNone
- CreateDir MakePath( DIR(CHART), "line" ), cmoNone
- CreateDir MakePath( DIR(CHART), "picto" ), cmoNone
- CreateDir MakePath( DIR(CHART), "pie" ), cmoNone
- CreateDir MakePath( DIR(CHART), "scatter" ), cmoNone
- CreateDir MakePath( DIR(CHART), "spectral" ), cmoNone
- CreateDir MakePath( DIR(CHART), "temp" ), cmoNone
- CreateDir MakePath( DIR(CHART), "table" ), cmoNone
- CreateDir MakePath( DIR(CHART), "vectors" ), cmoNone
- ENDIF
- IF afState(CHART) = ALL OR GetListItem( OPTS(CHART), 3 ) = "ON" THEN
- CreateDir MakePath( DIR(CHART), "samples" ), cmoNone
- ENDIF
- ENDIF
-
- IF afState(SHOW) <> NONE THEN
- IF afState(SHOW) = ALL OR GetListItem( OPTS(SHOW), 3 ) = "ON" THEN
- CreateDir MakePath( DIR(SHOW), "samples" ), cmoNone
- CreateDir MakePath( DIR(SHOW), "flics" ), cmoNone
- CreateDir MakePath( DIR(SHOW), "backgrds" ), cmoNone
- ENDIF
- ENDIF
-
- IF afState(PHOTO) <> NONE THEN
- IF afState(PHOTO) = ALL OR GetListItem( OPTS(PHOTO), 1 ) = "ON" THEN
- CreateDir MakePath( DIR(PHOTO), "palettes" ), cmoNone
- CreateDir MakePath( DIR(PHOTO), "tiles" ), cmoNone
- ENDIF
- IF afState(PHOTO) = ALL OR GetListItem( OPTS(PHOTO), 3 ) = "ON" THEN
- CreateDir MakePath( DIR(PHOTO), "samples" ), cmoNone
- ENDIF
- ENDIF
-
- '' add the extra stuff for root files
- CreateDir DEST$, cmoNone
- bCreateDir% = FALSE
- IF afState(DRAW) = ALL THEN
- bCreateDir% = TRUE
- ELSEIF afState(DRAW) = SOME AND GetListItem( OPTS(DRAW), 4 ) = "ON" THEN
- bCreateDir% = TRUE
- ENDIF
- IF afState(CHART) = ALL THEN
- bCreateDir% = TRUE
- ELSEIF afState(CHART) = SOME AND GetListItem( OPTS(CHART), 4 ) = "ON" THEN
- bCreateDir% = TRUE
- ENDIF
- IF afState(TRACE) = ALL THEN
- bCreateDir% = TRUE
- ELSEIF afState(TRACE) = SOME AND GetListItem( OPTS(TRACE), 3 ) = "ON" THEN
- bCreateDir% = TRUE
- ENDIF
- IF bCreateDir% = TRUE THEN
- CreateDir MakePath(DEST$,"FILTERS"), cmoNone
- ENDIF
- AddSectionFilesToCopyList "Main", GetSymbolValue("STF_SRCDIR"), DEST$
-
- '' Add billboards
- AddToBillBoardList "mscuistf.dll", BILLBOARD, "FModelessBitmapDlgProc", 10
- AddToBillBoardList "mscuistf.dll", BILLBOARD, "FModelessBitmapDlgProc", 10
- AddToBillBoardList "mscuistf.dll", BILLBOARD, "FModelessBitmapDlgProc", 10
- AddToBillBoardList "mscuistf.dll", BILLBOARD, "FModelessBitmapDlgProc", 10
- AddToBillBoardList "mscuistf.dll", BILLBOARD, "FModelessBitmapDlgProc", 10
-
- '' Get rid of the WAIT dialog
- WaitOff
- WaitOn
-
- ''Copy all the files over
- CopyFilesInCopyList
-
-
- '' Register all the ttf fonts with Windows
- IF WinMinor% > 0 AND afState(FONTSYM) <> NONE THEN
- IF IsTTFEnabled = 1 THEN
- sz$ = UIStartDlg("mscuistf.dll", WAITREGISTER, "FModelessDlgProc", 0, "")
- IF afState(FONTSYM) = ALL THEN
- MakeListFromSectionKeys FONTLIST2$, "Fonts"
- ENDIF
- NeedsList$ = GetSymbolValue( FONTLIST2$ )
- nIndex% = 0
- nIndexInc% = ScanList(NeedsList$,nIndex%)
- WHILE nIndexInc% > 0
- szFilename$ = GetSectionKeyFilename( "Fonts", MID$(NeedsList$, nIndex%+3, nIndexInc%-3) )
- IF MID$( szFilename$, LEN(szFilename$)-2, 3 ) = "ttf" THEN
- index% = GetFilenameFromPath( szFilename$ )
- szFilename2$ = MID$( szFilename$, index%, LEN(szFilename$) - index% + 1 )
- szFOTName$ = MID$(szFilename2$,1,LEN(szFilename2$)-3) + "fot"
- RegisterFont MakePath(WINSYSDIR$,szFOTName$), MakePath(WINSYSDIR$,szFilename2$)
- temp% = GetTypeFaceNameFromTTF( MakePath(WINSYSDIR$,szFilename2$), szString$, STRINGLEN )
- LoadStringResource IMSG_TTF, szString2$, STRINGLEN
- CreateIniKeyValue "WIN.INI", "fonts", szString$+" "+szString2$, MakePath(WINSYSDIR$,szFOTName$), cmoOverWrite
- ENDIF
- nIndex% = nIndex% + nIndexInc%
- nIndexInc% = ScanList(NeedsList$,nIndex%)
- WEND
- UIPop 1
- ENDIF
- ENDIF
- szFilename$ = ""
- szFilename2$ = ""
- szFOTName$ = ""
-
- IF afState(DRAW) <> NONE THEN
- IF afState(DRAW) = ALL OR GetListItem(OPTS(DRAW), 1) = "ON" THEN
-
- '' setup coreldrw.reg
- FileChangeString MakePath(DIR(DRAW),"coreldrw.reg"), MakePath(DIR(DRAW),"___temp_"), "coreldrw.exe", MakePath(DIR(DRAW),"CORELDRW.EXE")
- ExecCommand "regload /s " + MakePath(DIR(DRAW),"coreldrw.reg")
-
- ini$ = MakePath(DIR(DRAW), "CORELDRW.INI")
- CreateIniKeyValue "WIN.INI", "Extensions", "cdr", MakePath(DIR(DRAW),"coreldrw.exe ^.cdr"), cmoOverWrite
- CreateIniKeyValue "WIN.INI", "CorelDraw3", "DrawDir", MakeDir(DIR(DRAW)), cmoOverWrite
- CreateIniKeyValue ini$, "CDrawConfig", "Applic", MakeDir(DIR(DRAW)), cmoOverwrite
- CreateIniKeyValue ini$, "CDrawConfig", "ConfigDir", MakeDir(DIR(DRAW)), cmoOverwrite
- CreateIniKeyValue ini$, "CDrawConfig", "FontsDir", MakeDir(DIR(FONTSYM)), cmoOverwrite
- CreateIniKeyValue ini$, "CDrawConfig", "CorelFiltersDir", MakePath(DIR(MAIN),"FILTERS"), cmoOverwrite
- CreateIniKeyValue ini$, "CDrawConfig", "AutoBackupDir", MakePath(DIR(MAIN),"AUTOBACK"), cmoOverwrite
- CreateIniKeyValue ini$, "Mosaic", "Applic", MakePath(DIR(MOSAIC),"MOSAIC.EXE"), cmoOverwrite
-
- ''Register CorelDRAW! as OLE
- RegisterDraw MakePath(DIR(DRAW),"CORELDRW.EXE")
-
- CreateProgmanGroup aszGroups(DRAW), "", cmoNone
- ShowProgmanGroup aszGroups(DRAW), 1, cmoNone
- LoadStringResource IMSG_RELEASENOTES, szString$, STRINGLEN
- CreateProgmanItem aszGroups(DRAW), szString$, "notepad.exe " + MakePath(DEST$,"readme.txt"), "", cmoOverwrite
- LoadStringResource IMSG_CORELDRAW, szString$, STRINGLEN
- CreateProgmanItem aszGroups(DRAW), szString$, MakePath(DIR(DRAW),"coreldrw.exe"), "", cmoOverwrite
- ENDIF
- ENDIF
- DIR(FONTSYM) = ""
-
- IF afState(CHART) <> NONE THEN
- IF afState(CHART) = ALL OR GetListItem(OPTS(CHART), 1) = "ON" THEN
-
- '' setup corelcht.reg
- FileChangeString MakePath(DIR(CHART),"corelcht.reg"), MakePath(DIR(CHART),"___temp_"), "corelcht.exe", MakePath(DIR(CHART),"CORELCHT.EXE")
- ExecCommand "regload /s " + MakePath(DIR(CHART),"corelcht.reg")
-
- CreateIniKeyValue "WIN.INI", "Extensions", "cch", MakePath(DIR(CHART),"corelcht.exe ^.cch"), cmoOverWrite
- CreateIniKeyValue "WIN.INI", "CorelDraw3", "ChartDir", MakeDir(DIR(CHART)), cmoOverWrite
- ini$ = MakePath(WINDIR$, "CORELCHT.INI")
- CreateIniKeyValue ini$, "CorelChart", "GATO_PATH", MakeDir(DIR(CHART)), cmoOverwrite
- CreateIniKeyValue ini$, "CorelChart", "F3DF_3DRISER", MakePath(DIR(CHART),"3DRISER"), cmoOverwrite
- CreateIniKeyValue ini$, "CorelChart", "F3DF_3DSCAT", MakePath(DIR(CHART),"3DSCAT"), cmoOverwrite
- CreateIniKeyValue ini$, "CorelChart", "F3DF_AREA", MakePath(DIR(CHART),"AREA"), cmoOverwrite
- CreateIniKeyValue ini$, "CorelChart", "F3DF_BAR", MakePath(DIR(CHART),"BAR"), cmoOverwrite
- CreateIniKeyValue ini$, "CorelChart", "F3DF_HILO", MakePath(DIR(CHART),"HILO"), cmoOverwrite
- CreateIniKeyValue ini$, "CorelChart", "F3DF_HIST", MakePath(DIR(CHART),"HIST"), cmoOverwrite
- CreateIniKeyValue ini$, "CorelChart", "F3DF_LINE", MakePath(DIR(CHART),"LINE"), cmoOverwrite
- CreateIniKeyValue ini$, "CorelChart", "F3DF_PICTO", MakePath(DIR(CHART),"PICTO"), cmoOverwrite
- CreateIniKeyValue ini$, "CorelChart", "F3DF_PIE", MakePath(DIR(CHART),"PIE"), cmoOverwrite
- CreateIniKeyValue ini$, "CorelChart", "F3DF_SCATTER", MakePath(DIR(CHART),"SCATTER"), cmoOverwrite
- CreateIniKeyValue ini$, "CorelChart", "F3DF_SPECTRAL", MakePath(DIR(CHART),"SPECTRAL"), cmoOverwrite
- CreateIniKeyValue ini$, "CorelChart", "F3DF_TABLE", MakePath(DIR(CHART),"TABLE"), cmoOverwrite
- CreateIniKeyValue ini$, "CorelChart", "F3DF_TEXT", MakePath(DIR(CHART),"TEXT"), cmoOverwrite
- CreateIniKeyValue ini$, "CorelChart", "F3FX_EFFECTS", MakePath(DIR(CHART),"EFFECTS"), cmoOverwrite
- CreateIniKeyValue ini$, "CorelChart", "F3FX_FILTERS", MakePath(DIR(MAIN),"FILTERS"), cmoOverwrite
- CreateIniKeyValue ini$, "CorelChart", "F3FX_TEMPDIR", MakePath(DIR(CHART),"TEMP"), cmoOverwrite
- CreateIniKeyValue ini$, "CorelChart", "F3FX_PICTIONARY", MakePath(DIR(CHART),"BITMAPS"), cmoOverwrite
- CreateIniKeyValue ini$, "CorelChart", "Vector_path", MakePath(DIR(CHART),"VECTORS"), cmoOverwrite
- CreateProgmanGroup aszGroups(CHART), "", cmoNone
- ShowProgmanGroup aszGroups(CHART), 1, cmoNone
- LoadStringResource IMSG_CORELCHART, szString$, STRINGLEN
- CreateProgmanItem aszGroups(CHART), szString$, MakePath(DIR(CHART),"corelcht.exe"), "", cmoOverwrite
- ENDIF
- ENDIF
- IF afState(SHOW) <> NONE THEN
- IF afState(SHOW) = ALL OR GetListItem(OPTS(SHOW), 1) = "ON" THEN
-
- '' setup corelshw.reg
- FileChangeString MakePath(DIR(SHOW),"corelshw.reg"), MakePath(DIR(SHOW),"___temp_"), "corelshw.exe", MakePath(DIR(SHOW),"CORELSHW.EXE")
- ExecCommand "regload /s " + MakePath(DIR(SHOW),"corelshw.reg")
-
- CreateIniKeyValue "WIN.INI", "Extensions", "shw", MakePath(DIR(SHOW),"corelshw.exe ^.shw"), cmoOverWrite
- CreateIniKeyValue "WIN.INI", "Extensions", "shb", MakePath(DIR(SHOW),"corelshw.exe ^.shb"), cmoOverWrite
- CreateIniKeyValue "WIN.INI", "CorelDraw3", "ShowDir", MakeDir(DIR(SHOW)), cmoOverWrite
- CreateIniKeyValue "WIN.INI", "CorelShow", "Dir", MakeDir(DIR(SHOW)), cmoOverWrite
- CreateIniKeyValue "WIN.INI", "AAPLAY Animation", "WaveAudio", "c,522", cmoOverWrite
- CreateIniKeyValue "WIN.INI", "AAPLAY Animation", "Sequencer", "x,523", cmoOverWrite
- CreateIniKeyValue "WIN.INI", "AAPLAY Animation", "FullScreen", "AAVGA.DLL", cmoOverWrite
- CreateIniKeyValue "WIN.INI", "AAPLAY Animation", "DualScreen", "no", cmoOverWrite
- ini$ = MakePath(DIR(SHOW), "CORELSHW.INI")
- CreateIniKeyValue ini$, "CShowConfig", "ConfigDir", MakeDir(DIR(SHOW)), cmoOverwrite
- CreateIniKeyValue ini$, "MasterBackGround", "defaultfile", MakePath(DIR(SHOW),"backgrds\sample.shb"), cmoOverwrite
- CreateProgmanGroup aszGroups(SHOW), "", cmoNone
- ShowProgmanGroup aszGroups(SHOW), 1, cmoNone
- LoadStringResource IMSG_CORELSHOW, szString$, STRINGLEN
- CreateProgmanItem aszGroups(SHOW), szString$, MakePath(DIR(SHOW),"corelshw.exe"), "", cmoOverwrite
- ENDIF
- ENDIF
- IF afState(PHOTO) <> NONE THEN
- IF afState(PHOTO) = ALL OR GetListItem(OPTS(PHOTO), 1) = "ON" THEN
-
- '' Register photo with OLE
- FileChangeString MakePath(DIR(PHOTO),"corelpnt.reg"), MakePath(DIR(PHOTO),"___temp_"), "corelpnt.exe", MakePath(DIR(PHOTO),"CORELPNT.EXE")
- ExecCommand "regload /s " + MakePath(DIR(PHOTO),"corelpnt.reg")
-
- CreateIniKeyValue "WIN.INI", "Extensions", "pcx", MakePath(DIR(PHOTO),"corelpnt.exe ^.pcx"), cmoOverWrite
- CreateIniKeyValue "WIN.INI", "CorelDraw3", "PhotoPaintDir", MakeDir(DIR(PHOTO)), cmoOverWrite
- CreateIniKeyValue "WIN.INI", "PhotoPaint", "Path", MakeDir(DIR(PHOTO)), cmoOverWrite
- CreateIniKeyValue "WIN.INI", "CorelPaintDll", "PCX 16 Color/Gray", MakePath(DIR(PHOTO),"pcx16.dll,*.pcx"), cmoOverWrite
- CreateProgmanGroup aszGroups(PHOTO), "", cmoNone
- ShowProgmanGroup aszGroups(PHOTO), 1, cmoNone
- LoadStringResource IMSG_CORELPHOTO, szString$, STRINGLEN
- CreateProgmanItem aszGroups(PHOTO), szString$, MakePath(DIR(PHOTO),"corelpnt.exe"), "", cmoOverwrite
- ENDIF
- ENDIF
- IF afState(TRACE) <> NONE THEN
- IF afState(TRACE) = ALL OR GetListItem(OPTS(TRACE), 1) = "ON" THEN
- CreateIniKeyValue "WIN.INI", "CorelDraw3", "TraceDir", MakeDir(DIR(TRACE)), cmoOverWrite
- ini$ = MakePath(DIR(TRACE), "CORELTRC.INI")
- CreateIniKeyValue ini$, "CorelTrace", "OutPath", MakePath(WINDIR$,""), cmoOverWrite
- CreateIniKeyValue ini$, "CorelTrace", "InPath", MakePath(WINDIR$,""), cmoOverWrite
- CreateIniKeyValue ini$, "CorelTrace", "ApplPath", MakeDir(DIR(TRACE)), cmoOverWrite
- CreateIniKeyValue ini$, "CorelTrace", "TraceFiltersDir", MakePath(DIR(MAIN),"FILTERS\"), cmoOverWrite
- CreateProgmanGroup aszGroups(TRACE), "", cmoNone
- ShowProgmanGroup aszGroups(TRACE), 1, cmoNone
- LoadStringResource IMSG_CORELTRACE, szString$, STRINGLEN
- CreateProgmanItem aszGroups(TRACE), szString$, MakePath(DIR(TRACE),"coreltrc.exe"), "", cmoOverwrite
- ENDIF
- ENDIF
- IF afState(MOSAIC) <> NONE THEN
- IF afState(MOSAIC) = ALL OR GetListItem(OPTS(MOSAIC), 1) = "ON" THEN
- CreateIniKeyValue "WIN.INI", "CorelDraw3", "MosaicDir", MakeDir(DIR(MOSAIC)), cmoOverwrite
- ini$ = MakePath(DIR(DRAW), "CORELDRW.INI")
- CreateIniKeyValue ini$, "Mosaic", "Applic", MakePath(DIR(MOSAIC),"mosaic3.exe"), cmoOverwrite
- CreateProgmanGroup aszGroups(MOSAIC), "", cmoNone
- ShowProgmanGroup aszGroups(MOSAIC), 1, cmoNone
- LoadStringResource IMSG_MOSAIC, szString$, STRINGLEN
- CreateProgmanItem aszGroups(MOSAIC), szString$, MakePath(DIR(MOSAIC),"mosaic3.exe"), "", cmoOverwrite
- ENDIF
- ENDIF
- ini$ = ""
-
- '' Prepend the chart directory to the users path if possible
- IF WinMinor% = 0 AND afState(CHART) <> NONE THEN
- bPathAltered% = FALSE
- IF afState(CHART) = ALL OR GetListItem(OPTS(CHART),1) = "ON" THEN
- IF DoesFileExist("c:\autoexec.bat",femWrite) = 1 AND DoesFileExist("c:\autoexec.bak",femRead) = 0 THEN
- szPath$ = GetEnvVariableValue( "path" )
- IF LEN( szPath$ ) + LEN( MakeDir(DIR(CHART)) ) < 128 THEN
- RenameFile "c:\autoexec.bat", "autoexec.bak"
- PrependToPath "c:\autoexec.bak", "c:\autoexec.bat", MakeDir(DIR(CHART)), cmoNone
- bPathAltered% = TRUE
- ENDIF
- ENDIF
- ENDIF
- '' Display the info dialog telling the user what we did
- IF bPathAltered% = TRUE THEN
- Dialog% = UPDATEDAUTOEXEC
- GOSUB INFO
- ELSE
- Dialog% = UPDATEAUTOEXEC
- GOSUB INFO
- ENDIF
- ENDIF
-
- '' User has completed run of setup or has unconditionally decided to quit
- QUIT:
- WaitOff
- '' On MSTest errors report "setup file corrupted" and abort
- ON ERROR GOTO ERRQUIT
-
- IF ERR = 0 THEN
- dlg% = EXITSUCCESS
- TestWriteStringToLogfile ILOG_SETUPSUCCEEDED
- TestWriteToLogfile ""
- ELSEIF ERR = STFQUIT THEN
- dlg% = EXITQUIT
- TestWriteStringToLogfile ILOG_SETUPQUIT
- TestWriteToLogfile ""
- ELSE
- dlg% = EXITFAILURE
- TestWriteStringToLogfile ILOG_SETUPFAILED
- TestWriteToLogfile ""
- ENDIF
-
-
- '' Put up one of the exit message dialog boxes
- QUITL1:
- sz$ = UIStartDlg("mscuistf.dll", dlg%, "FInfo0DlgProc", 0, "")
- IF sz$ = "REACTIVATE" THEN
- GOTO QUITL1
- ENDIF
- UIPop 1
- ShutDownInstall
- CloseLogFile
- END
-
-
- '' An error has occurred in MSTest. Tell the user and abort.
- ERRQUIT:
- LoadStringResource IMSG_ERRQUIT, szString$, STRINGLEN
- LoadStringResource IMSG_SETUPMESSAGE, szString2$, STRINGLEN
- i% = DoMsgBox( szString$, szString2$, MB_OK+MB_TASKMODAL+MB_ICONHAND)
- TestWriteStringToLogfile ILOG_SETUPCORRUPTED
- TestWriteToLogfile ""
- ShutDownInstall
- CloseLogFile
- END
-
-
- '' allow the user to select all the customize options
- CUSTINST:
- RemoveSymbol "InstallDirs"
- RemoveSymbol "InstallState"
- '' pass current directories and custom install state to dlgproc
- FOR i% = 1 to NUMCUST STEP 1
- AddListItem "InstallDirs", DIR(i%)
- AddListItem "InstallState", NUM(afState(i%))
- NEXT i%
- AddListItem "InstallDirs", DIR(MAIN)
-
- CUSTINSTL1:
- WaitOn
- ''Do a full recalculation if necessary
- IF bRecalc% = TRUE THEN
- WaitOnBig
- bRecalc% = FALSE
- RecalcPath
- ENDIF
- SetDriveStatus '' set DriveText$ and StatusText$
- WaitOff
-
- sz$ = UIStartDlg("mscuistf.dll", CUSTINST, "FCustInstDlgProc", CUSTINSTHELP, "FHelpDlgProc")
-
- SELECT CASE sz$
- CASE "CONTINUE"
- WaitOn
- SetStateFromSymbol '' set afState array from "InstallState"
- GOSUB SetDirFromSymbol '' set DIR array from "InstallDirs"
- IF afTooBig% <> FALSE THEN
- Dialog% = TOOBIG
- GOSUB INFO
- GOTO CUSTINSTL1
- ENDIF
-
- IF bLogging% THEN
- WriteStringToLogfile ILOG_DIRECTORIES
- FOR i% = DRAW TO MAIN
- LoadStringResource IMSG_CORELDRAW + i% - 1, szString$, STRINGLEN
- WriteToLogfile szString$ + " - " + DIR(i%)
- NEXT i%
- WriteStringToLogfile ILOG_CUSTOMSELECT
- WriteStringToLogfile ILOG_CUSTOMMESSAGE
- FOR i% = DRAW TO MOSAIC STEP 1
- LoadStringResource IMSG_CORELDRAW + i% - 1, szString$, STRINGLEN
- WriteToLogfile szString$ + " - " + STR$(afState(i%)) + " - " + GetSymbolValue( OPTS(i%) )
- NEXT i%
- LoadStringResource IMSG_FONTSYM, szString$, STRINGLEN
- WriteToLogfile szString$ + " - " + STR$(afState(FONTSYM))
- LoadStringResource IMSG_T1FONTS, szString$, STRINGLEN
- WriteToLogFile szString$ + " - " + FInstallATM$
- ''Maybe should add filters/fonts/symbols here
- WriteStringToLogfile ILOG_ASTERIXES
- ENDIF
-
- CASE "CUST1"
- WaitOn
- szOptions$ = OPTS(DRAW)
- Dialog% = CUSTDRAW
- SelectType% = DRAW
- SetStateFromSymbol '' set afState array from "InstallState"
- GOSUB SetDirFromSymbol '' set DIR array from "InstallDirs"
- GOSUB CUSTINST2
- GOTO CUSTINSTL1
- CASE "CUST2"
- WaitOn
- szOptions$ = OPTS(CHART)
- Dialog% = CUSTCHART
- SelectType% = CHART
- SetStateFromSymbol '' set afState array from "InstallState"
- GOSUB SetDirFromSymbol '' set DIR array from "InstallDirs"
- GOSUB CUSTINST2
- GOTO CUSTINSTL1
- CASE "CUST3"
- WaitOn
- szOptions$ = OPTS(SHOW)
- Dialog% = CUSTSHOW
- SelectType% = SHOW
- SetStateFromSymbol '' set afState array from "InstallState"
- GOSUB SetDirFromSymbol '' set DIR array from "InstallDirs"
- GOSUB CUSTINST2
- GOTO CUSTINSTL1
- CASE "CUST4"
- WaitOn
- szOptions$ = OPTS(PHOTO)
- Dialog% = CUSTPHOTO
- SelectType% = PHOTO
- SetStateFromSymbol '' set afState array from "InstallState"
- GOSUB SetDirFromSymbol '' set DIR array from "InstallDirs"
- GOSUB CUSTINST2
- GOTO CUSTINSTL1
- CASE "CUST5"
- WaitOn
- szOptions$ = OPTS(TRACE)
- Dialog% = CUSTTRACE
- SelectType% = TRACE
- SetStateFromSymbol '' set afState array from "InstallState"
- GOSUB SetDirFromSymbol '' set DIR array from "InstallDirs"
- GOSUB CUSTINST2
- GOTO CUSTINSTL1
- CASE "CUST6"
- WaitOn
- szOptions$ = OPTS(MOSAIC)
- Dialog% = CUSTMOSAIC
- SelectType% = MOSAIC
- SetStateFromSymbol '' set afState array from "InstallState"
- GOSUB SetDirFromSymbol '' set DIR array from "InstallDirs"
- GOSUB CUSTINST2
- GOTO CUSTINSTL1
- CASE "CUST7"
- WaitOn
- szFList1a$ = FONTLIST1$
- szFList1b$ = FONTLIST2$
- szFList2a$ = SYMBOLLIST1$
- szFList2b$ = SYMBOLLIST2$
- Dialog% = SELECTFONTSYM
- SelectType% = FONTSYM
- SetStateFromSymbol '' set afState array from "InstallState"
- GOSUB SetDirFromSymbol '' set DIR array from "InstallDirs"
- GOSUB SELECTFILES
- GOTO CUSTINSTL1
-
- ''reset afState, the drive status and status text
- CASE "RESET"
- WaitOn
- SetStateFromSymbol '' set afState array from "InstallState"
- GOSUB SetDirFromSymbol '' set DIR array from "InstallDirs"
- GOTO CUSTINSTL1
-
- CASE "REACTIVATE"
- bRecalc% = TRUE
- GOTO CUSTINSTL1
-
- CASE "CANCEL", "BACK"
- WaitOn
- UIPop 1
- GOTO OPTIONS
-
- CASE ELSE
- GOSUB ASKQUIT
- SetStateFromSymbol '' set afState array from "InstallState"
- GOSUB SetDirFromSymbol '' set DIR array from "InstallDirs"
- GOTO CUSTINSTL1
- END SELECT
- UIPop 1
-
-
- '' Fall through from CUSTINST
- ''set the default progman group to put everything in
- LoadStringResource IMSG_TOOLGROUP, szString$, STRINGLEN
- TOOLGROUP$ = szString$
-
- '' Let the user select the progman group where all executables will be stored
- SELECTGROUPS:
- RemoveSymbol "EditText"
- AddListItem "EditText", TOOLGROUP$
- SELECTGROUPSL1:
- WaitOff
- sz$ = UIStartDlg( "mscuistf.dll", SELECTGROUPS, "FMultiEditDlgProc", SELECTGROUPSHELP, "FHelpDlgProc" )
- SELECT CASE sz$
- CASE "CONTINUE"
- TOOLGROUP$ = GetListItem("EditText",1)
- SetProgmanGroups
- CASE "CANCEL", "BACK"
- UIPop 1
- GOTO CUSTINST
- CASE "REACTIVATE"
- bRecalc% = TRUE
- GOTO SELECTGROUPSL1
- CASE "BTN1"
- TOOLGROUP$ = GetListItem("EditText",1)
- SetProgmanGroups
- UIPop 1
- GOTO SELECTCUSTGROUPS
- CASE ELSE
- GOSUB ASKQUIT
- GOTO SELECTGROUPSL1
- END SELECT
- LoadStringResource ILOG_PROGMANGROUP, szString$, STRINGLEN
- TestWriteToLogFile szString$ + TOOLGROUP$
- TestWriteToLogfile ""
- UIPop 1
- CustomGroups% = FALSE
-
- ''Fall through from SelectGroups - or from SelectCustGroups
- '' Ask the user if he wants to change any of his selections. If so, let him
- '' work his way back by hitting the "back" button
- ASKINSTALL:
- WaitOff
- sz$ = UIStartDlg( "mscuistf.dll", ASKINSTALL, "FInfoDlgProc", ASKINSTALLHELP, "FHelpDlgProc" )
- SELECT CASE sz$
- CASE "CONTINUE"
- ''Do nothing
- CASE "CANCEL", "BACK"
- UIPop 1
- IF CustomGroups% = TRUE THEN
- GOTO SELECTCUSTGROUPS
- ELSE
- GOTO SELECTGROUPS
- ENDIF
- CASE "REACTIVATE"
- bRecalc% = TRUE
- GOTO ASKINSTALL
- CASE ELSE
- GOSUB ASKQUIT
- GOTO ASKINSTALL
- END SELECT
- UIPop 1
- RETURN ''return to OPTIONS - going to INSTALL
-
-
- '' Let the user customize the progman groups where each executable will be
- '' stored
- SELECTCUSTGROUPS:
- RemoveSymbol "EditText"
- FOR i% = DRAW TO MOSAIC STEP 1
- AddListItem "EditText", aszGroups( i% )
- NEXT i%
- SELECTCUSTGROUPSL1:
- WaitOff
- sz$ = UIStartDlg( "mscuistf.dll", CUSTGROUPS, "FMultiEditDlgProc", CUSTGROUPSHELP, "FHelpDlgProc" )
- SELECT CASE sz$
- CASE "CONTINUE"
- FOR i% = DRAW TO MOSAIC STEP 1
- aszGroups( i% ) = GetListItem( "EditText", i% )
- NEXT i%
- CASE "CANCEL", "BACK"
- UIPop 1
- GOTO SELECTGROUPS
- CASE "REACTIVATE"
- bRecalc% = TRUE
- GOTO SELECTCUSTGROUPSL1
- CASE ELSE
- GOSUB ASKQUIT
- GOTO SELECTCUSTGROUPSL1
- END SELECT
- IF bLogging% THEN
- WriteStringToLogfile ILOG_PROGMANGROUP
- FOR i% = DRAW TO MOSAIC STEP 1
- LoadStringResource IMSG_CORELDRAW + i% - 1, szString$, STRINGLEN
- WriteToLogfile szString$ + " - " + aszGroups(i%)
- NEXT i%
- WriteStringToLogfile ILOG_ASTERIXES
- WriteToLogfile ""
- ENDIF
- UIPop 1
- CustomGroups% = TRUE
- GOTO ASKINSTALL
-
-
- '' Input the custom installation choices for DRAW .. MOSAIC
- CUSTINST2:
- SetSymbolValue "CheckItemsIn", GetSymbolValue( szOptions$ )
- szOldExpFilterList1$ = GetSymbolValue( EXPFILTERLIST1$ )
- szOldExpFilterList2$ = GetSymbolValue( EXPFILTERLIST2$ )
- szOldImpFilterList1$ = GetSymbolValue( IMPFILTERLIST1$ )
- szOldImpFilterList2$ = GetSymbolValue( IMPFILTERLIST2$ )
- CUSTINST2L1:
- WaitOff
- sz$ = UIStartDlg("mscuistf.dll", Dialog%, "FCheckDlgProc", CUSTINST2HELP, "FHelpDlgProc")
-
- SELECT CASE sz$
- CASE "CONTINUE"
- WaitOn
- newopt$ = GetSymbolValue("CheckItemsOut")
- IF SelectType% = DRAW OR SelectType% = CHART OR SelectType% = TRACE THEN
- '' if we might have customized the filters, always recalc MAIN
- IF newopt$ <> GetSymbolValue(szOptions$) THEN
- SetSymbolValue szOptions$, newopt$
- RecalcOptFiles SelectType%
- ENDIF
- RecalcOptFiles MAIN
- ELSEIF newopt$ <> GetSymbolValue(szOptions$) THEN
- '' otherwise, only recalc if we changed things and win 3.0
- SetSymbolValue szOptions$, newopt$
- RecalcOptFiles SelectType%
- IF WinMinor% = 0 THEN
- RecalcOptFiles MAIN
- ENDIF
- ENDIF
- newopt$ = ""
-
- CASE "BTN1"
- ''This will only happen if customizing filter selection
- szFList1a$ = EXPFILTERLIST1$
- szFList1b$ = EXPFILTERLIST2$
- szFList2a$ = IMPFILTERLIST1$
- szFList2b$ = IMPFILTERLIST2$
- oldDialog% = Dialog%
- Dialog% = SELECTFILTERS
- GOSUB SELECTFILES
- Dialog% = oldDialog%
- GOTO CUSTINST2L1
-
- CASE "REACTIVATE"
- bRecalc% = TRUE
- GOTO CUSTINST2L1
-
- CASE "CANCEL", "BACK"
- '' reset filters
- SetSymbolValue EXPFILTERLIST1$, szOldExpFilterList1$
- SetSymbolValue EXPFILTERLIST2$, szOldExpFilterList2$
- SetSymbolValue IMPFILTERLIST1$, szOldImpFilterList1$
- SetSymbolValue IMPFILTERLIST2$, szOldImpFilterList2$
-
- CASE ELSE
- GOSUB ASKQUIT
- GOTO CUSTINST2L1
-
- END SELECT
- szOldExpFilterList1$ = ""
- szOldExpFilterList2$ = ""
- szOldImpFilterList1$ = ""
- szOldImpFilterList2$ = ""
- UIPop 1
- RETURN
-
-
- '' Display an information dialog
- '' Uses the global Dialog% to identify which dialog to display
- INFO:
- WaitOff
- sz$ = UIStartDlg( "mscuistf.dll", Dialog%, "FInfo0DlgProc", 0, "" )
- SELECT CASE sz$
- CASE "CONTINUE"
- ''Do nothing
- CASE "REACTIVATE"
- bRecalc% = TRUE
- GOTO INFO
- CASE "EXIT"
- GOSUB ASKQUIT
- GOTO INFO
- END SELECT
- UIPop 1
- RETURN
-
-
- '' Get the base directory under which CorelDRAW! will be installed
- GETPATH:
- SetSymbolValue "EditTextIn", DEST$
- SetSymbolValue "EditFocus", "END"
- GETPATHL1:
- WaitOff
- sz$ = UIStartDlg("mscuistf.dll", DESTPATH, "FEditDlgProc", GETPATHHELP, "FHelpDlgProc")
- SELECT CASE sz$
- CASE "CONTINUE"
- WaitOn
- olddest$ = DEST$
- DEST$ = GetSymbolValue("EditTextOut")
-
- ''Validate new path.
- IF IsDirWritable(DEST$) = 0 THEN
- Dialog% = BADPATH
- GOSUB INFO
- GOTO GETPATHL1
- ENDIF
-
- ''Set Recalc and change subdirectories if DEST$ changed
- IF (olddest$ <> DEST$) AND (olddest$ <> DEST$+"\") AND (olddest$+"\" <> DEST$) THEN
- bRecalc% = TRUE
- SetDirectories
- ENDIF
- olddest$ = ""
-
- CASE "REACTIVATE"
- bRecalc% = TRUE
- GOTO GETPATHL1
- CASE "CANCEL", "BACK"
- UIPop 1
- GOTO OPTIONS
- CASE ELSE
- GOSUB ASKQUIT
- GOTO GETPATHL1
- END SELECT
- LoadStringResource ILOG_BASEDIR, szString$, STRINGLEN
- TestWriteToLogfile szString$ + DEST$
- TestWriteToLogfile ""
- UIPop 1
- RETURN
-
-
- '' The user has asked to quit - confirm his decision
- ASKQUIT:
- WaitOff
- sz$ = UIStartDlg("mscuistf.dll", ASKQUIT, "FQuitDlgProc", 0, "")
- SELECT CASE sz$
- CASE "EXIT"
- UIPopAll
- ERROR STFQUIT
- CASE "REACTIVATE"
- bRecalc% = TRUE
- GOTO ASKQUIT
- CASE ELSE
- ''Do nothing
- END SELECT
- UIPop 1
- RETURN
-
-
- '' Permit the user to select which filters or fonts/symbols he wants to install
- SELECTFILES:
- SetSymbolValue "ListItems1a", GetSymbolValue( szFList1a$ )
- SetSymbolValue "ListItems1b", GetSymbolValue( szFList1b$ )
- SetSymbolValue "ListItems2a", GetSymbolValue( szFList2a$ )
- SetSymbolValue "ListItems2b", GetSymbolValue( szFList2b$ )
- SetSymbolValue "Button1", fInstallATM$
-
- SELECTL1:
- WaitOff
- sz$ = UIStartDlg("mscuistf.dll", Dialog%, "FList4DlgProc", SELECTHELP, "FHelpDlgProc")
-
- SELECT CASE sz$
- CASE "CONTINUE"
- bRecalcOpt% = FALSE
- WaitOn
- ''If lists have been modified, reset them and recalculate
- newlist$ = GetSymbolValue( "ListItems1a" )
- IF newlist$ <> GetSymbolValue( szFList1a$ ) THEN
- IF newlist$ = "" THEN
- SetSymbolValue szFList1a$, "{}"
- ELSE
- SetSymbolValue szFList1a$, newlist$
- ENDIF
- newlist$ = GetSymbolValue( "ListItems1b" )
- IF newlist$ = "" THEN
- SetSymbolValue szFList1b$, "{}"
- ELSE
- SetSymbolValue szFList1b$, newlist$
- ENDIF
- bRecalcOpt = TRUE
- ENDIF
- newlist$ = GetSymbolValue( "ListItems2a" )
- IF newlist$ <> GetSymbolValue( szFList2a$ ) THEN
- IF newlist$ = "" THEN
- SetSymbolValue szFList2a$, "{}"
- ELSE
- SetSymbolValue szFList2a$, newlist$
- ENDIF
- newlist$ = GetSymbolValue( "ListItems2b" )
- IF newlist$ = "" THEN
- SetSymbolValue szFList2b$, "{}"
- ELSE
- SetSymbolValue szFList2b$, newlist$
- ENDIF
- bRecalcOpt% = TRUE
- ENDIF
- newlist$ = GetSymbolValue( "Button1" )
- IF( newlist$ <> fInstallATM$ ) THEN
- fInstallATM$ = newlist$
- bRecalcOpt% = TRUE
- ENDIF
- UIPop 1
- IF bRecalcOpt% = TRUE THEN
- WaitOnBig
- RecalcOptFiles SelectType%
- ENDIF
- newlist$ = ""
- CASE "REACTIVATE"
- bRecalc% = TRUE
- GOTO SELECTL1
- CASE "CANCEL", "BACK"
- UIPop 1
- CASE ELSE
- GOSUB ASKQUIT
- GOTO SELECTL1
- END SELECT
- RemoveSymbol "ListItems1a"
- RemoveSymbol "ListItems1b"
- RemoveSymbol "ListItems2a"
- RemoveSymbol "ListItems2b"
- RETURN
-
- '**
- '** Purpose:
- '** Adds the specified option files to the copy list.
- '** Arguments:
- '** ftype% - type of files to add, one of the following:
- '** DRAW, CHART, SHOW, PHOTO, TRACE, MOSAIC or FONTSYM
- '** Returns:
- '** none.
- '*************************************************************************
- SUB AddOptFilesToCopyList (ftype%) STATIC
-
- fState% = afState(ftype%)
- IF fState% <> NONE THEN
- SrcDir$ = GetSymbolValue("STF_SRCDIR")
-
- SELECT CASE ftype%
- CASE DRAW
- IF fState% = ALL OR GetListItem( OPTS(DRAW), 1 ) = "ON" THEN
- IF bInstallWinDLL% = TRUE THEN
- AddSectionFilesToCopyList "DrawDLL", SrcDir$, WINSYSDIR$
- ENDIF
- IF bInstallDLL% = TRUE THEN
- AddSectionFilesToCopyList "DrawDLL", SrcDir$, DIR(DRAW)
- ENDIF
- AddSectionFilesToCopyList "DrawDraw", SrcDir$, DIR(DRAW)
- ENDIF
- IF fState% = ALL OR GetListItem( OPTS(DRAW), 2 ) = "ON" THEN
- AddSectionFilesToCopyList "DrawHelp", SrcDir$, DIR(DRAW)
- ENDIF
- IF fState% = ALL OR GetListItem( OPTS(DRAW), 3 ) = "ON" THEN
- AddSectionFilesToCopyList "DrawSamples", SrcDir$, MakePath(DIR(DRAW),"SAMPLES")
- ENDIF
- IF fState% = ALL OR GetListItem( OPTS(DRAW), 5 ) = "ON" THEN
- IF INSTALLCD = FALSE THEN
- AddSectionFilesToCopyList "ArtAircraft", SrcDir$, MakePath(DIR(DRAW),"CLIPART\AIRCRAFT")
- AddSectionFilesToCopyList "ArtBird", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Bird")
- AddSectionFilesToCopyList "ArtCelebrat", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Celebrat")
- AddSectionFilesToCopyList "ArtDental", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Dental")
- AddSectionFilesToCopyList "ArtEmergenc", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Emergenc")
- AddSectionFilesToCopyList "ArtEquipmen", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Equipmen")
- AddSectionFilesToCopyList "ArtFlag", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Flag")
- AddSectionFilesToCopyList "ArtFood", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Food")
- AddSectionFilesToCopyList "ArtIcon", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Icon")
- AddSectionFilesToCopyList "ArtMammal", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Mammal")
- AddSectionFilesToCopyList "ArtMan", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Man")
- AddSectionFilesToCopyList "ArtMap", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Map")
- AddSectionFilesToCopyList "ArtMedical", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Medical")
- AddSectionFilesToCopyList "ArtMisc", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Misc")
- AddSectionFilesToCopyList "ArtMoney", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Money")
- AddSectionFilesToCopyList "ArtPolitica", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Politica")
- AddSectionFilesToCopyList "ArtSign", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Sign")
- AddSectionFilesToCopyList "ArtSports", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Sports")
- AddSectionFilesToCopyList "ArtTheme_bo", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Theme_bo")
- AddSectionFilesToCopyList "ArtWoman", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Woman")
- ELSE
- AddSectionFilesToCopyList "DrawTutorial", SrcDir$, DIR(DRAW)
- ENDIF
- ENDIF
-
- CASE CHART
- IF fState% = ALL OR GetListItem( OPTS(CHART), 1 ) = "ON" THEN
- AddSectionFilesToCopyList "ChartIni", SrcDir$, WINDIR$
- AddSectionFilesToCopyList "ChartDLL", SrcDir$, DIR(CHART)
- AddSectionFilesToCopyList "ChartChart", SrcDir$, DIR(CHART)
- AddSectionFilesToCopyList "Chart3driser", SrcDir$, MakePath(DIR(CHART),"3DRISER")
- AddSectionFilesToCopyList "Chart3dscat", SrcDir$, MakePath(DIR(CHART),"3DSCAT")
- AddSectionFilesToCopyList "ChartArea", SrcDir$, MakePath(DIR(CHART),"AREA")
- AddSectionFilesToCopyList "ChartBar", SrcDir$, MakePath(DIR(CHART),"BAR")
- AddSectionFilesToCopyList "ChartBitmaps", SrcDir$, MakePath(DIR(CHART),"BITMAPS")
- AddSectionFilesToCopyList "ChartEffects", SrcDir$, MakePath(DIR(CHART),"EFFECTS")
- AddSectionFilesToCopyList "ChartHilo", SrcDir$, MakePath(DIR(CHART),"HILO")
- AddSectionFilesToCopyList "ChartHist", SrcDir$, MakePath(DIR(CHART),"HIST")
- AddSectionFilesToCopyList "ChartLine", SrcDir$, MakePath(DIR(CHART),"LINE")
- AddSectionFilesToCopyList "ChartPie", SrcDir$, MakePath(DIR(CHART),"PIE")
- AddSectionFilesToCopyList "ChartPicto", SrcDir$, MakePath(DIR(CHART),"PICTO")
- AddSectionFilesToCopyList "ChartScatter", SrcDir$, MakePath(DIR(CHART),"SCATTER")
- AddSectionFilesToCopyList "ChartSpectral", SrcDir$, MakePath(DIR(CHART),"SPECTRAL")
- AddSectionFilesToCopyList "ChartTable", SrcDir$, MakePath(DIR(CHART),"TABLE")
- AddSectionFilesToCopyList "ChartVectors", SrcDir$, MakePath(DIR(CHART),"VECTORS")
- ENDIF
- IF fState% = ALL OR GetListItem( OPTS(CHART), 2 ) = "ON" THEN
- AddSectionFilesToCopyList "ChartHelp", SrcDir$, DIR(CHART)
- ENDIF
- IF fState% = ALL OR GetListItem( OPTS(CHART), 3 ) = "ON" THEN
- AddSectionFilesToCopyList "ChartSamples", SrcDir$, MakePath(DIR(CHART),"SAMPLES")
- ENDIF
-
- CASE SHOW
- IF fState% = ALL OR GetListItem( OPTS(SHOW), 1 ) = "ON" THEN
- IF bInstallWinDLL% = TRUE THEN
- AddSectionFilesToCopyList "ShowDLL", SrcDir$, WINSYSDIR$
- ENDIF
- IF bInstallDLL% = TRUE THEN
- AddSectionFilesToCopyList "ShowDLL", SrcDir$, DIR(SHOW)
- ENDIF
- AddSectionFilesToCopyList "ShowShow", SrcDir$, DIR(SHOW)
- ENDIF
- IF fState% = ALL OR GetListItem( OPTS(SHOW), 2 ) = "ON" THEN
- AddSectionFilesToCopyList "ShowHelp", SrcDir$, DIR(SHOW)
- ENDIF
- IF fState% = ALL OR GetListItem( OPTS(SHOW), 3 ) = "ON" THEN
- AddSectionFilesToCopyList "ShowSamples", SrcDir$, MakePath(DIR(SHOW),"SAMPLES")
- AddSectionFilesToCopyList "ShowFlics", SrcDir$, MakePath(DIR(SHOW),"FLICS")
- AddSectionFilesToCopyList "ShowBackgrds", SrcDir$, MakePath(DIR(SHOW),"BACKGRDS")
- ENDIF
-
- CASE PHOTO
- IF fState% = ALL OR GetListItem( OPTS(PHOTO), 1 ) = "ON" THEN
- IF bInstallWinDLL% = TRUE THEN
- AddSectionFilesToCopyList "PhotoDLL", SrcDir$, WINSYSDIR$
- ENDIF
- IF bInstallDLL% = TRUE THEN
- AddSectionFilesToCopyList "PhotoDLL", SrcDir$, DIR(PHOTO)
- ENDIF
- AddSectionFilesToCopyList "PhotoPhoto", SrcDir$, DIR(PHOTO)
- AddSectionFilesToCopyList "PhotoTiles", SrcDir$, MakePath(DIR(PHOTO),"tiles")
- AddSectionFilesToCopyList "PhotoPalettes", SrcDir$, MakePath(DIR(PHOTO),"palettes")
- ENDIF
- IF fState% = ALL OR GetListItem( OPTS(PHOTO), 2 ) = "ON" THEN
- AddSectionFilesToCopyList "PhotoHelp", SrcDir$, DIR(PHOTO)
- ENDIF
- IF fState% = ALL OR GetListItem( OPTS(PHOTO), 3 ) = "ON" THEN
- AddSectionFilesToCopyList "PhotoSamples", SrcDir$, MakePath(DIR(PHOTO),"SAMPLES")
- ENDIF
-
- CASE TRACE
- IF fState% = ALL OR GetListItem( OPTS(TRACE), 1 ) = "ON" THEN
- IF bInstallWinDLL% = TRUE THEN
- AddSectionFilesToCopyList "TraceDLL", SrcDir$, WINSYSDIR$
- ENDIF
- IF bInstallDLL% = TRUE THEN
- AddSectionFilesToCopyList "TraceDLL", SrcDir$, DIR(TRACE)
- ENDIF
- AddSectionFilesToCopyList "TraceTrace", SrcDir$, DIR(TRACE)
- ENDIF
- IF fState% = ALL OR GetListItem( OPTS(TRACE), 2 ) = "ON" THEN
- AddSectionFilesToCopyList "TraceHelp", SrcDir$, DIR(TRACE)
- ENDIF
-
- CASE MOSAIC
- IF fState% = ALL OR GetListItem( OPTS(MOSAIC), 1 ) = "ON" THEN
- IF bInstallWinDLL% = TRUE THEN
- AddSectionFilesToCopyList "MosaicDLL", SrcDir$, WINSYSDIR$
- ENDIF
- IF bInstallDLL% = TRUE THEN
- AddSectionFilesToCopyList "MosaicDLL", SrcDir$, DIR(MOSAIC)
- ENDIF
- AddSectionFilesToCopyList "MosaicMosaic", SrcDir$, DIR(MOSAIC)
- ENDIF
- IF fState% = ALL OR GetListItem( OPTS(MOSAIC), 2 ) = "ON" THEN
- AddSectionFilesToCopyList "MosaicHelp", SrcDir$, DIR(MOSAIC)
- ENDIF
-
- CASE FONTSYM
- '' Add the type one fonts to the windows system directory
- IF INSTALLCD = TRUE THEN
- IF fState% = ALL OR fInstallATM$ = "TRUE" THEN
- AddSectionFilesToCopyList "T1", SrcDir$, WINSYSDIR$
- ENDIF
- ENDIF
- IF fstate% = ALL THEN
- AddSectionFilesToCopyList "Fonts", SrcDir$, WINSYSDIR$
- AddSectionFilesToCopyList "Symbols", SrcDir$, DIR(FONTSYM)
- ELSE
- ''Add all the fonts specified using SelectFonts
- NeedsList$ = GetSymbolValue( FONTLIST2$ )
- nIndex% = 0
- nIndexInc% = ScanList(NeedsList$,nIndex%)
- WHILE nIndexInc% > 0
- AddSectionKeyFileToCopyList "Fonts", MID$(NeedsList$, nIndex%+3, nIndexInc%-3), SrcDir$, WINSYSDIR$
- nIndex% = nIndex% + nIndexInc%
- nIndexInc% = ScanList(NeedsList$,nIndex%)
- WEND
- ''Add all the symbols specified using SelectSymbols or default
- NeedsList$ = GetSymbolValue( SYMBOLLIST2$ )
- nIndex% = 0
- nIndexInc% = ScanList(NeedsList$,nIndex%)
- WHILE nIndexInc% > 0
- AddSectionKeyFileToCopyList "Symbols", MID$(NeedsList$, nIndex%+3, nIndexInc%-3), SrcDir$, DIR(FONTSYM)
- nIndex% = nIndex% + nIndexInc%
- nIndexInc% = ScanList(NeedsList$,nIndex%)
- WEND
- ENDIF
-
- CASE MAIN
-
- bAddOptFiles% = FALSE
- FOR i% = DRAW TO PHOTO STEP 1
- IF afState(i%) = ALL THEN
- bAddOptFiles% = TRUE
- ELSEIF afState(i%) = SOME AND GetListItem( OPTS(i%), 1 ) = "ON" THEN
- bAddOptFiles% = TRUE
- ENDIF
- NEXT i%
- IF bAddOptFiles% = TRUE THEN
- AddSectionFilesToCopyList "Win31Exe", SrcDir$, WINSYSDIR$
- ENDIF
- IF WinMinor% = 0 THEN
- '' Add winhelp.exe and redistributable dlls if necessary
- bAddOptFiles% = FALSE
- bAddOptFiles2% = FALSE
- FOR i% = DRAW TO MOSAIC STEP 1
- IF afState(i%) = ALL THEN
- bAddOptFiles% = TRUE
- bAddOptFiles2% = TRUE
- ELSEIF afState(i%) = SOME THEN
- IF GetListItem( OPTS(i%), 1 ) = "ON" THEN
- bAddOptFiles% = TRUE
- ENDIF
- IF GetListItem( OPTS(i%), 2 ) = "ON" THEN
- bAddOptFiles2% = TRUE
- ENDIF
- ENDIF
- NEXT i%
- IF bAddOptFiles% = TRUE THEN
- AddSectionFilesToCopyList "Win30DLL", SrcDir$, WINSYSDIR$
- ENDIF
- IF bAddOptFiles2% = TRUE THEN
- AddSectionFilesToCopyList "WinHelp", SrcDir$, WINSYSDIR$
- ENDIF
- ENDIF
-
- ''Add all necessary import filters
- bAddOptFiles% = FALSE
- IF afState(DRAW) = ALL OR afState(CHART) = ALL OR afState(TRACE) = ALL THEN
- AddSectionFilesToCopyList "ImpFilters", SrcDir$, MakePath(DIR(MAIN),"FILTERS")
- AddSectionFilesToCopyList "Filters", SrcDir$, MakePath(DIR(MAIN),"FILTERS")
- ELSEIF afState(DRAW) = SOME AND GetListItem( OPTS(DRAW), 4 ) = "ON" THEN
- bAddOptFiles% = TRUE
- ELSEIF afState(CHART) = SOME AND GetListItem( OPTS(CHART), 4 ) = "ON" THEN
- bAddOptFiles% = TRUE
- ELSEIF afState(TRACE) = SOME AND GetListItem( OPTS(TRACE), 3 ) = "ON" THEN
- bAddOptFiles% = TRUE
- ELSEIF afState(DRAW) = SOME AND GetListItem( OPTS(DRAW), 1 ) = "ON" THEN
- AddSectionFilesToCopyList "Filters", SrcDir$, MakePath(DIR(MAIN),"FILTERS")
- ENDIF
- IF bAddOptFiles% = TRUE THEN
- AddSectionFilesToCopyList "Filters", SrcDir$, MakePath(DIR(MAIN),"FILTERS")
- ''Add all the import filters specified using SelectFilters or default
- NeedsList$ = GetSymbolValue( IMPFILTERLIST2$ )
- nIndex% = 0
- nIndexInc% = ScanList(NeedsList$,nIndex%)
- WHILE nIndexInc% > 0
- AddSectionKeyFileToCopyList "ImpFilters", MID$(NeedsList$, nIndex%+3, nIndexInc%-3), SrcDir$, MakePath(DIR(MAIN),"FILTERS")
- nIndex% = nIndex% + nIndexInc%
- nIndexInc% = ScanList(NeedsList$,nIndex%)
- WEND
- ENDIF
-
- ''Add all necessary export filters
- bAddOptFiles% = FALSE
- IF afState(DRAW) = ALL OR afState(CHART) = ALL THEN
- AddSectionFilesToCopyList "ExpFilters", SrcDir$, MakePath(DIR(MAIN),"FILTERS")
- ELSEIF afState(DRAW) = SOME AND GetListItem( OPTS(DRAW), 4 ) = "ON" THEN
- bAddOptFiles% = TRUE
- ELSEIF afState(CHART) = SOME AND GetListItem( OPTS(CHART), 4 ) = "ON" THEN
- bAddOptFiles% = TRUE
- ENDIF
- IF bAddOptFiles% = TRUE THEN
- ''Add all the export filters specified using SelectFilters or default
- NeedsList$ = GetSymbolValue( EXPFILTERLIST2$ )
- nIndex% = 0
- nIndexInc% = ScanList(NeedsList$,nIndex%)
- WHILE nIndexInc% > 0
- AddSectionKeyFileToCopyList "ExpFilters", MID$(NeedsList$, nIndex%+3, nIndexInc%-3), SrcDir$, MakePath(DIR(MAIN),"FILTERS")
- nIndex% = nIndex% + nIndexInc%
- nIndexInc% = ScanList(NeedsList$,nIndex%)
- WEND
- ENDIF
-
- END SELECT
-
- SrcDir$ = ""
- NeedsList$ = ""
- ENDIF
-
- END SUB
-
-
- '**
- '** Purpose:
- '** Recalculates disk space for the given option files and sets
- '** the status info symbol "StatusItemsText".
- '** Arguments:
- '** ftype% - type of files to add, one of the following:
- '** DRAW, CHART, SHOW, PHOTO, TRACE, MOSAIC, FONTSYM, MAIN
- '** Returns:
- '** none.
- '*************************************************************************
- SUB RecalcOptFiles (ftype%) STATIC
- ClearCopyList
- AddOptFilesToCopyList ftype%
- bExtra% = FALSE
- ''TBD: must do more sophisticated testing here, set memory correctly
- IF ftype% = MAIN THEN
- ''Add extra cost to Windows drive for logfile.txt + ini/progman, etc.
- ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
- ReplaceListItem EXTRACOSTS$, ndrive%, "250000"
- bExtra% = TRUE
- ELSEIF ftype% = FONTSYM AND afState(FONTSYM) <> NONE THEN
- ''Add extra cost to Windows drive for .fot files
- ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
- IF afState(FONTSYM) = ALL THEN
- lSpace& = 1450 * 256
- ELSE
- lSpace& = 1450 * GetListLength(FONTLIST2$)
- ENDIF
- ReplaceListItem EXTRACOSTS$, ndrive%, STR$(lSpace&)
- bExtra% = TRUE
- ENDIF
-
- ''Get symbol to store space requirements for drives 'A' - 'Z'
- ListSym$ = aszNEEDS(ftype%)
-
- StillNeed& = GetCopyListCost(EXTRACOSTS$, ListSym$, "")
-
- '' Sum the costs for drives 'A' - 'Z' and store in STATUSTEXT$
- '' - This might be faster if we only add the cost of the given drive and
- '' windows drive together.
- cost& = 0
- NeedsList$ = GetSymbolValue( ListSym$ )
- nIndex% = 0
- nIndexInc% = ScanList(NeedsList$,nIndex%)
- WHILE nIndexInc% > 0
- cost& = cost& + VAL( MID$(NeedsList$, nIndex%+3, nIndexInc%-3) )
- nIndex% = nIndex% + nIndexInc%
- nIndexInc% = ScanList(NeedsList$,nIndex%)
- WEND
- ReplaceListItem STATUSTEXT$, ftype%, STR$(cost& / 1024) + " K"
-
- IF bExtra% = TRUE THEN
- ReplaceListItem EXTRACOSTS$, ndrive%, "0"
- ENDIF
- ListSym$ = ""
- NeedsList$ = ""
- END SUB
-
-
- '**
- '** Purpose:
- '** Recalculates disk space and sets option status info according
- '** to the current destination path.
- '** Arguments:
- '** none.
- '** Returns:
- '** none.
- '*************************************************************************
- SUB RecalcPath STATIC
- FOR i% = 1 TO NUMGROUPS STEP 1
- RecalcOptFiles i%
- NEXT i%
- END SUB
-
-
- '**
- '** Purpose:
- '** Sets drive status info according to latest disk space calcs.
- '** Checks that enough space is available on all drives.
- '** Arguments:
- '** none.
- '** Returns:
- '** none.
- '*************************************************************************
- SUB SetDriveStatus STATIC
-
- DIM alCosts(26) AS LONG
-
- ''Calculate total costs for each drive
-
- FOR i% = 1 TO 26 STEP 1
- alCosts(i%) = 0
- NEXT i%
-
- FOR i% = 1 to NUMGROUPS STEP 1
- drive$ = MID$(DIR(i%), 1, 1)
- ndrive% = ASC(ucase$(drive$)) - ASC("A") + 1
- alCosts(ndrive%) = alCosts(ndrive%) + VAL(GetListItem(aszNEEDS(i%), ndrive%))
- IF drive$ <> WINDRIVE$ THEN
- ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
- alCosts(ndrive%) = VAL(GetListItem(aszNEEDS(i%), ndrive%)) + alCosts(ndrive%)
- ENDIF
- NEXT i%
-
- ''Store the costs and free space for the first five drives used
- afTooBig% = FALSE
- j% = 0
- FOR i% = 1 TO 26 STEP 1
- if alCosts(i%) > 0 THEN
- j% = j% + 1
- drive$ = CHR$( i% - 1 + ASC("A") )
- free& = GetFreeSpaceForDrive(drive$)
- IF free& < alCosts(i%) THEN
- afTooBig% = TRUE
- ENDIF
- IF j% < 6 THEN
- ReplaceListItem DRIVETEXT$, j%*3-2, drive$ + ":"
- ReplaceListItem DRIVETEXT$, j%*3-1, STR$(alCosts(i%) / 1024) + " K"
- ReplaceListItem DRIVETEXT$, j%*3, STR$(free& / 1024) + " K"
- ENDIF
- ENDIF
- NEXT i%
- ''wipe clean all remaining directory information
- FOR i% = j%*3+1 TO 15 STEP 1
- ReplaceListItem DRIVETEXT$, i%, ""
- NEXT i%
- drive$ = ""
- drive2$ = ""
-
- END SUB
-
-
- '**
- '** Purpose:
- '** Removes the optional trailing "\"
- '** Arguments:
- '** szDir$ - full directory path (with optional ending "\")
- '** Returns:
- '** szDir$ without a trailing "\"
- '*************************************************************************
- FUNCTION MakeDir (szDir$) STATIC AS STRING
- IF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
- MakeDir = MID$( szDir$, 1, LEN(szDir$) - 1 )
- ELSE
- MakeDir = szDir$
- ENDIF
- END FUNCTION
-
-
- '**
- '** 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$
- ENDIF
- END FUNCTION
-
-
- ''** If the logfile is open, write szMsg$ to it.
- '*************************************************************************
- SUB TestWriteToLogfile (szMsg$) STATIC
- IF bLogging% THEN
- WriteToLogfile szMsg$
- ENDIF
- END SUB
-
-
- ''** Load the string resource associated with nResourceConst% and write it.
- '*************************************************************************
- SUB WriteStringToLogfile (nResourceConst%) STATIC
- LoadStringResource nResourceConst%, szString$, STRINGLEN
- WriteToLogfile szString$
- END SUB
-
-
- ''** If the logfile is open, load the string resource associated with
- ''** nResourceCount% and write it.
- '*************************************************************************
- SUB TestWriteStringToLogfile (nResourceConst%) STATIC
- IF bLogging% THEN
- LoadStringResource nResourceConst%, szString$, STRINGLEN
- WriteToLogfile szString$
- ENDIF
- END SUB
-
-
- '** This sub converts the symbol "InstallState" into the afState array,
- '** recalculating disk usage if anything has changed.
- '*************************************************************************
- SUB SetStateFromSymbol STATIC
- bRecalcMain% = FALSE
- FOR i% = 1 TO NUMCUST STEP 1
- fNewState% = ASC( GetListItem("InstallState",i%) ) - ASC("1") + 1
- IF fNewState% <> afState(i%) THEN
- afState(i%) = fNewState%
- RecalcOptFiles i%
- IF fNewState% <> 2 THEN
- bRecalcMain% = TRUE
- ENDIF
- ENDIF
- NEXT i%
- IF bRecalcMain% = TRUE THEN
- RecalcOptFiles MAIN
- ENDIF
- END SUB
-
-
- '** This sub converts the symbol "InstallDirs" into the DIR array,
- '** recalculating disk usage if anything has changed.
- '** NOTE: this a only a simulated subroutine because we want to be
- '** able to GOSUB BADPATH from inside it.
- '*************************************************************************
- SetDirFromSymbol:
- szList$ = GetSymbolValue("InstallDirs")
- nIndex% = 0
- nIndexInc% = ScanList(szList$,nIndex%)
- i% = 1
- WHILE nIndexInc% > 0
- szDir$ = MID$(szList$, nIndex%+3, nIndexInc%-3)
- '' If the directory is not writable, tell the user and don't update it.
- IF IsDirWritable( szDir$ ) = 0 THEN
- Dialog% = BADPATH
- GOSUB INFO
- GOTO CUSTINSTL1
- ENDIF
- '' If the directory has changed - recalculate disk usage
- IF DIR(i%) <> szDir$ THEN
- DIR(i%) = szDir$
- RecalcOptFiles i%
- ENDIF
- i% = i% + 1
- nIndex% = nIndex% + nIndexInc%
- nIndexInc% = ScanList(szList$, nIndex%)
- WEND
- szDir$ = ""
- szList$ = ""
- RETURN
-
-
- '** This sub sets all files to load - sets directory structure to default
- '*************************************************************************
- SUB FullInstall STATIC
- ''Set directories to default
- SetDirectories
- ''Set all sections to install
- FOR i% = 1 TO NUMGROUPS STEP 1
- afState(i%) = ALL
- NEXT i%
- '' Temporarily set FONTSYM to SOME to handle ATMs
- IF INSTALLCD = TRUE THEN
- afState(FONTSYM) = SOME
- ENDIF
-
- SetSymbolValue OPTS(DRAW), "{""ON"",""ON"",""ON"",""ON"",""ON""}"
- SetSymbolValue OPTS(CHART), "{""ON"",""ON"",""ON"",""ON""}"
- SetSymbolValue OPTS(SHOW), "{""ON"",""ON"",""ON""}"
- SetSymbolValue OPTS(PHOTO), "{""ON"",""ON"",""ON""}"
- SetSymbolValue OPTS(TRACE), "{""ON"",""ON"",""ON""}"
- SetSymbolValue OPTS(MOSAIC), "{""ON"",""ON""}"
- ''Prepare lists for customized selection of filters, fonts and symbols
- SetSymbolValue IMPFILTERLIST1$, "{}"
- SetSymbolValue EXPFILTERLIST1$, "{}"
- SetSymbolValue FONTLIST1$, "{}"
- SetSymbolValue SYMBOLLIST1$, "{}"
- MakeListFromSectionKeys EXPFILTERLIST2$, "ExpFilters"
- MakeListFromSectionKeys IMPFILTERLIST2$, "ImpFilters"
- MakeListFromSectionKeys FONTLIST2$, "Fonts"
- MakeListFromSectionKeys SYMBOLLIST2$, "Symbols"
- '' Set no ATMs to install
- fInstallATM$ = "FALSE"
- END SUB
-
-
- '** This sub sets only a minimal set of files to load
- '** - sets directory structure to default
- '*************************************************************************
- SUB MinInstall STATIC
- ''Set directories to default
- SetDirectories
- ''Set draw, fonts and symbols only to install
- FOR i% = 1 TO NUMGROUPS STEP 1
- afState(i%) = NONE
- NEXT i%
- SetSymbolValue OPTS(DRAW), "{""ON"",""OFF"",""OFF"",""OFF"",""OFF""}"
- SetSymbolValue OPTS(CHART), "{""ON"",""ON"",""ON"",""ON""}"
- SetSymbolValue OPTS(SHOW), "{""ON"",""ON"",""ON""}"
- SetSymbolValue OPTS(PHOTO), "{""ON"",""ON"",""ON""}"
- SetSymbolValue OPTS(TRACE), "{""ON"",""ON"",""ON""}"
- SetSymbolValue OPTS(MOSAIC), "{""ON"",""ON""}"
- afState(DRAW) = SOME
- afState(FONTSYM) = SOME
- afState(MAIN) = ALL
- '' Set no ATMs to install
- fInstallATM$ = "FALSE"
- ''Should change to minimal font and symbol selection here(?)
- SetSymbolValue FONTLIST1$, "{}"
- SetSymbolValue SYMBOLLIST1$, "{}"
- MakeListFromSectionKeys FONTLIST2$, "MinFonts"
- MakeListFromSectionKeys SYMBOLLIST2$, "Symbols"
- END SUB
-
-
- '** Set the subdirectories to their default values.
- '*************************************************************************
- SUB SetDirectories STATIC
- DIR(DRAW) = MakePath( DEST$, "DRAW\" )
- DIR(CHART) = MakePath( DEST$, "CHART\" )
- DIR(SHOW) = MakePath( DEST$, "SHOW\" )
- DIR(PHOTO) = MakePath( DEST$, "PHOTOPNT\" )
- DIR(TRACE) = MakePath( DEST$, "DRAW\" )
- DIR(MOSAIC) = MakePath( DEST$, "DRAW\" )
- DIR(FONTSYM) = MakePath( DEST$, "FONTS\" )
- DIR(MAIN) = DEST$
- END SUB
-
-
- '** Set the custom progman groups (aszGroups()) to all be TOOLGROUP$
- '****************************************************************************
- SUB SetProgmanGroups STATIC
- FOR i% = DRAW to MOSAIC STEP 1
- aszGroups(i%) = TOOLGROUP$
- NEXT i%
- END SUB
-
-
- '** Make sure that the long wait dialog is displayed and the hourglass cursor
- '** are being used
- '*************************************************************************
- SUB WaitOnBig STATIC
- IF nWaiting% = 0 THEN
- CursorSave% = ShowWaitCursor()
- sz$ = UIStartDlg("mscuistf.dll", WAIT, "FModelessDlgProc", 0, "")
- nWaiting% = 2
- ELSEIF nWaiting% = 1 THEN
- sz$ = UIStartDlg("mscuistf.dll", WAIT, "FModelessDlgProc", 0, "")
- nWaiting% = 2
- ENDIF
- END SUB
-
-
- '** Make sure that the hourglass cursor is being used
- '*************************************************************************
- SUB WaitOn STATIC
- IF nWaiting% = 0 THEN
- CursorSave% = ShowWaitCursor()
- nWaiting% = 1
- ENDIF
- END SUB
-
-
- '** Remove the long wait dialog if it is being displayed and reset the cursor
- '** back to normal if it was set to the hourglass icon
- '*************************************************************************
- SUB WaitOff STATIC
- IF nWaiting% = 2 THEN
- UIPop 1
- RestoreCursor CursorSave%
- nWaiting% = 0
- ELSEIF nWaiting% = 1 THEN
- RestoreCursor CursorSave%
- nWaiting% = 0
- ENDIF
- END SUB
-