home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Corel Draw 3
/
CorelDRAW-v3.0.iso
/
cdbased
/
cdrom.mst
< prev
next >
Wrap
Text File
|
1992-10-25
|
27KB
|
740 lines
'' $Keywords: cdrom.mst 2.15 14Nov92 02:01pm$ $nokeywords$
'**************************************************************************
'* CorelTools setup script
'**************************************************************************
'' Date Name Reason
''-------------------------------------------------------------------------
'' Feb 25 1992 Randall Mack Modified from sample2.mst provided with
'' Windows SDK 3.1 Beta.
'' Jun 1 1992 Randall Mack Modified from draw.mst and draw2.mst to
'' serve as a net install
'$INCLUDE 'setupapi.inc'
''C functions
DECLARE SUB InitializeInstall LIB "mscuistf.dll" (hInstance%, hMainWind% )
DECLARE SUB ShutDownInstall LIB "mscuistf.dll"
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 SUB InitPrintTestFile LIB "mscuistf.dll"
DECLARE SUB ShutDownPrintTestFile LIB "mscuistf.dll"
DECLARE FUNCTION PrintTestFile LIB "mscuistf.dll" (szFilename$, bLast% ) AS INTEGER
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
DECLARE FUNCTION GetMinFileSize LIB "mscuistf.dll" (szDrive%) AS INTEGER
DECLARE FUNCTION TestDoUpgrade LIB "mscuistf.dll" (szDir$) AS INTEGER
'$INCLUDE 'translat.inc'
''Strings for loading string resources
GLOBAL szString$
CONST STRINGLEN = 66
szString$ = string$( STRINGLEN+1, 32 )
''setup main window
CONST LOGO = 9100 ''must match the constant in dialogs.h
SetTitle TR_TITLE
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 TOOBIG = 9908
CONST BADPATH = 9909
CONST WAIT = 9919
CONST ASKINSTALL = 9922
CONST BILLBOARD = 9926
CONST UPDATEDAUTOEXEC = 9930
CONST UPDATEAUTOEXEC = 9931
CONST WAITREGISTER = 9932
CONST BADGROUP = 9933
CONST LOCPATH = 9934
CONST WRONGDIR = 9935
CONST CDGETPATH = 9936
CONST PRINTTEST = 9937
CONST SUCCESS = 9938
CONST CDTOOBIG = 9940
CONST CDWELCOME = 9941
CONST CHECKUPGRADE = 9945
CONST CHECKUPGRADEFAIL = 9946
CONST NETADDITEMFAILED = 9949
CONST CDBASEDABOUT = 9952
CONST WELCOMEHELP = 9800
CONST GETPATHHELP = 9802
CONST ASKINSTALLHELP = 9808
CONST CDGETPATHHELP = 9810
CONST PRINTTESTHELP = 9811
CONST CHECKUPGRADEHELP = 9812
''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
GLOBAL FONTLIST2$
FONTLIST2$ = "FontList2"
''used as a parm to GetCopyListCost only
GLOBAL EXTRACOSTS$
EXTRACOSTS$ = "ExtraCosts"
GLOBAL bTooBig%
bTooBig% = 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
'$UNDEF UPGRADE ''When this is set, Draw will only install as an upgrade
''list of sections (1..NUMGROUPS)
GLOBAL DIR(NUMGROUPS) AS STRING ''list of directories for main options
GLOBAL WINDIR$ ''Windows directory.
GLOBAL WINSYSDIR$ ''Windows directory.
GLOBAL WINDRIVE$ ''Windows drive letter.
GLOBAL DEST$ ''destination directory.
GLOBAL LOCATION$ ''location of network files to install
GLOBAL TOOLGROUP$ '' Group in which tools are to be installed
''Windows version number
GLOBAL WinMinor%
''Variables to fake subroutines with parameters
GLOBAL Dialog%
''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 WaitOnBig
DECLARE SUB WaitOn
DECLARE SUB WaitOff
DECLARE SUB SetDirectories
DECLARE SUB RecalcAll
DECLARE SUB TestWriteToLogFile (szMsg$)
DECLARE SUB CheckBackupFile( szFile1$, szFile2$ )
DECLARE FUNCTION CreateProgmanItem (szGroup$, szItem$, szCmd$, szOther$, cmo%) AS INTEGER
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
'' If net windows then all the files we would put in system go in root
IF IsDriveNetwork( MID$(WINSYSDIR$,1,1) ) THEN
WINSYSDIR$ = WINDIR$
ENDIF
WINDRIVE$ = MID$(WINDIR$, 1, 1)
DEST$ = WINDRIVE$ + ":\"+TR_CORELDRW
LOCATION$ = GetSymbolValue("STF_SRCDIR")
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""}"
OpenLogfile MakePath(WINDIR$, TR_LOGFILE), 0
bLogging% = TRUE
''find and read .inf file
szInf$ = GetSymbolValue("STF_SRCINFPATH")
IF szInf$ = "" THEN
szInf$ = GetSymbolValue("STF_CWDDIR")
ENDIF
szInf$ = MakePath( szInf$, "cdrom.inf" )
ReadInfFile szInf$
szInf$ = ""
''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
TOOLGROUP$ = TR_TOOLGROUP
'' Put up the Welcome dialog
WELCOME:
WaitOff
sz$ = UIStartDlg( "mscuistf.dll", CDWELCOME, "FInfoDlgProc", WELCOMEHELP, "FHelpDlgProc" )
SELECT CASE sz$
CASE "CONTINUE"
UIPop 1
CASE "ABOUT"
Dialog% = CDBASEDABOUT
GOSUB INFO
GOTO WELCOME
CASE "REACTIVATE"
GOTO WELCOME
CASE ELSE
GOSUB ASKQUIT
GOTO WELCOME
END SELECT
'$ifdef UPGRADE
WriteToLogFile TR_UPGRADING
WriteToLogFile ""
SetSymbolValue "EditTextIn", DEST$
SetSymbolValue "EditFocus", "END"
CHECKUPGRADE:
WaitOff
sz$ = UIStartDlg("mscuistf.dll", CHECKUPGRADE, "FEditDlgProc", CHECKUPGRADEHELP, "FHelpDlgProc")
SELECT CASE sz$
CASE "CONTINUE"
WaitOn
IF TestDoUpgrade( MakeDir(GetSymbolValue("EditTextOut")) ) = 0 THEN
Dialog% = CHECKUPGRADEFAIL
GOSUB INFO
GOTO CHECKUPGRADE
ENDIF
CASE "REACTIVATE"
bRecalc% = TRUE
GOTO CHECKUPGRADE
CASE ELSE
GOSUB ASKQUIT
GOTO CHECKUPGRADE
END SELECT
UIPop 1
'$endif ''UPGRADE
'' fall through from WELCOME
SetDirectories '' Set DIR(..) to the location of the files on the network
'' select destination directory for files
GETDEST:
EditDir$ = DEST$
Dialog% = CDGETPATH
GOSUB GETPATH
DEST$ = EditDir$
TestWriteToLogFile TR_BASEDIR + DEST$
TestWriteToLogFile ""
'' fall through from selecting destination directory
INSTALL:
WaitOn
''Make sure there is enough space for CorelDRAW!
RecalcAll
IF bTooBig% = TRUE THEN
Dialog% = CDTOOBIG
GOSUB INFO
GOTO GETDEST
ENDIF
''Create all directories needed
CreateDir MakeDir(DEST$), cmoNone
CreateDir MakePath(DEST$,TR_EFFECTS), cmoNone
CreateDir MakePath(DEST$,TR_AUTOBACK), cmoNone
CreateDir MakePath(DEST$,TR_TEMP), cmoNone
'' Backup files to *.cor - do not overwrite
CheckBackupFile MakePath(WINDIR$,"win.ini"), MakePath(WINDIR$,"win.cor")
CheckBackupFile MakePath(WINDIR$,"reg.dat"), MakePath(WINDIR$,"reg.cor")
CheckBackupFile MakePath(WINDIR$,"progman.ini"), MakePath(WINDIR$,"progman.cor")
'' 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
AddToBillBoardList "mscuistf.dll", BILLBOARD, "FModelessBitmapDlgProc", 10
'' Disable size checking so I don't have to update the inf file
temp% = SetSizeCheckMode( scmOff )
''Copy all the files over
WaitOff
CopyFilesInCopyList
WaitOn
'' Register all the ttf fonts with Windows
IF WinMinor% > 0 THEN
IF IsTTFEnabled = 1 THEN
sz$ = UIStartDlg("mscuistf.dll", WAITREGISTER, "FModelessDlgProc", 0, "")
MakeListFromSectionKeys FONTLIST2$, "Fonts"
NeedsList$ = GetSymbolValue( FONTLIST2$ )
nIndex% = 0
nIndexInc% = ScanList(NeedsList$,nIndex%)
WHILE nIndexInc% > 0
szFilename$ = GetSectionKeyFilename( "Fonts", MID$(NeedsList$, nIndex%+3, nIndexInc%-3) )
index% = GetFilenameFromPath( szFilename$ )
szFilename2$ = MID$( szFilename$, index%, LEN(szFilename$) - index% + 1 )
szFilename$ = MID$(LOCATION$,1,2)+"\"+TR_FONTS+"\"+TR_TTF+"\"+szFilename2$
szFOTName$ = MID$(szFilename2$,1,LEN(szFilename2$)-3) + "fot"
RegisterFont MakePath(WINSYSDIR$,szFOTName$), szFilename$
temp% = GetTypeFaceNameFromTTF( szFilename$, szString$, STRINGLEN )
CreateIniKeyValue TR_WIN_INI, "fonts", szString$+" "+TR_TRUETYPE, UCASE$(szFOTName$), cmoOverWrite
nIndex% = nIndex% + nIndexInc%
nIndexInc% = ScanList(NeedsList$,nIndex%)
WEND
UIPop 1
ENDIF
ENDIF
szFilename$ = ""
szFilename2$ = ""
szFOTName$ = ""
nAddItemFailed% = 0
'' setup coreldrw.reg
FileChangeString MakePath(DEST$,TR_CORELDRW_REG), MakePath(DEST$,"___temp_"), TR_CORELDRW_EXE, MakePath(DIR(DRAW),TR_CORELDRW_EXE)
ExecCommand TR_REGLOAD_S + " " + MakePath(DEST$,TR_CORELDRW_REG)
ini$ = MakePath(DEST$, TR_CORELDRW_INI)
CreateIniKeyValue TR_WIN_INI, "Extensions", "cdr", MakePath(DIR(DRAW),TR_CORELDRW_EXE+" ^.cdr"), cmoOverWrite
CreateIniKeyValue TR_WIN_INI, "CorelDraw3", "DrawDir", MakeDir(DEST$), cmoOverWrite
CreateIniKeyValue ini$, "CDrawConfig", "Applic", MakeDir(DIR(DRAW)), cmoOverwrite
CreateIniKeyValue ini$, "CDrawConfig", "ConfigDir", MakeDir(DEST$), cmoOverwrite
CreateIniKeyValue ini$, "CDrawConfig", "FontsDir", MakeDir(DIR(FONTSYM)), cmoOverwrite
CreateIniKeyValue ini$, "CDrawConfig", "CorelFiltersDir", MakePath(DIR(MAIN),TR_FILTERS), cmoOverwrite
CreateIniKeyValue ini$, "CDrawConfig", "AutoBackupDir", MakePath(DEST$,TR_AUTOBACK), cmoOverwrite
CreateIniKeyValue ini$, "Mosaic", "Applic", MakePath(DIR(MOSAIC),TR_CORELMOS_EXE), cmoOverwrite
CreateProgmanGroup TOOLGROUP$, "", cmoNone
ShowProgmanGroup TOOLGROUP$, 1, cmoNone
nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( TOOLGROUP$, TR_RELEASENOTES, TR_NOTEPAD_EXE + " " + MakePath(DIR(MAIN),TR_README_TXT), "", cmoOverwrite)
nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( TOOLGROUP$, TR_CORELDRAW, MakePath(DIR(DRAW),TR_CORELDRW_EXE),"", cmoOverwrite)
IF WinMinor% = 0 THEN
nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( TOOLGROUP$, TR_CORELDRAW+" "+TR_TUTORIAL, MakePath(WINSYSDIR$,TR_WINHELP)+" "+MakePath(DIR(DRAW),TR_TUTORIAL_HLP), "", cmoOverwrite)
ELSE
nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( TOOLGROUP$, TR_CORELDRAW+" "+TR_TUTORIAL, TR_WINHELP+" "+MakePath(DIR(DRAW),TR_TUTORIAL_HLP), "", cmoOverwrite)
ENDIF
'' setup corelcht.reg
FileChangeString MakePath(DEST$,TR_CORELCHT_REG), MakePath(DEST$,"___temp_"), TR_CORELCHT_EXE, MakePath(DIR(CHART),TR_CORELCHT_EXE)
ExecCommand TR_REGLOAD_S + " " + MakePath(DEST$,TR_CORELCHT_REG)
CreateIniKeyValue TR_WIN_INI, "Extensions", "cch", MakePath(DIR(CHART),TR_CORELCHT_EXE+" ^.cch"), cmoOverWrite
CreateIniKeyValue TR_WIN_INI, "CorelDraw3", "ChartDir", MakeDir(DEST$), cmoOverWrite
ini$ = MakePath(WINDIR$, "CORELCHT.INI")
CreateIniKeyValue ini$, "CorelChart", "GATO_PATH", MakeDir(DIR(CHART)), cmoOverwrite
CreateIniKeyValue ini$, "CorelChart", "F3DF_3DRISER", MakePath(DIR(CHART),TR_3DRISER), cmoOverwrite
CreateIniKeyValue ini$, "CorelChart", "F3DF_3DSCAT", MakePath(DIR(CHART),TR_3DSCAT), cmoOverwrite
CreateIniKeyValue ini$, "CorelChart", "F3DF_AREA", MakePath(DIR(CHART),TR_AREA), cmoOverwrite
CreateIniKeyValue ini$, "CorelChart", "F3DF_BAR", MakePath(DIR(CHART),TR_BAR), cmoOverwrite
CreateIniKeyValue ini$, "CorelChart", "F3DF_HILO", MakePath(DIR(CHART),TR_HILO), cmoOverwrite
CreateIniKeyValue ini$, "CorelChart", "F3DF_HIST", MakePath(DIR(CHART),TR_HIST), cmoOverwrite
CreateIniKeyValue ini$, "CorelChart", "F3DF_LINE", MakePath(DIR(CHART),TR_LINE), cmoOverwrite
CreateIniKeyValue ini$, "CorelChart", "F3DF_PICTO", MakePath(DIR(CHART),TR_PICTO), cmoOverwrite
CreateIniKeyValue ini$, "CorelChart", "F3DF_PIE", MakePath(DIR(CHART),TR_PIE), cmoOverwrite
CreateIniKeyValue ini$, "CorelChart", "F3DF_SCATTER", MakePath(DIR(CHART),TR_SCATTER), cmoOverwrite
CreateIniKeyValue ini$, "CorelChart", "F3DF_SPECTRAL", MakePath(DIR(CHART),TR_SPECTRAL), cmoOverwrite
CreateIniKeyValue ini$, "CorelChart", "F3DF_TABLE", MakePath(DIR(CHART),TR_TABLE), cmoOverwrite
CreateIniKeyValue ini$, "CorelChart", "F3FX_EFFECTS", MakePath(DEST$,TR_EFFECTS), cmoOverwrite
CreateIniKeyValue ini$, "CorelChart", "F3FX_FILTERS", MakePath(DIR(MAIN),TR_FILTERS), cmoOverwrite
CreateIniKeyValue ini$, "CorelChart", "F3FX_TEMPDIR", MakePath(DEST$,TR_TEMP), cmoOverwrite
CreateIniKeyValue ini$, "CorelChart", "F3FX_PICTIONARY", MakePath(DIR(CHART),TR_BITMAPS), cmoOverwrite
CreateIniKeyValue ini$, "CorelChart", "Vector_path", MakePath(DIR(CHART),TR_VECTORS), cmoOverwrite
nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( TOOLGROUP$, TR_CORELCHART, MakePath(DIR(CHART),TR_CORELCHT_EXE), "", cmoOverwrite)
'' setup corelshw.reg
FileChangeString MakePath(DEST$,TR_CORELSHW_REG), MakePath(DEST$,"___temp_"),TR_CORELSHW_EXE, MakePath(DIR(SHOW),TR_CORELSHW_EXE)
ExecCommand TR_REGLOAD_S + " " + MakePath(DEST$,TR_CORELSHW_REG)
CreateIniKeyValue TR_WIN_INI, "Extensions", "shw", MakePath(DIR(SHOW),TR_CORELSHW_EXE+" ^.shw"), cmoOverWrite
CreateIniKeyValue TR_WIN_INI, "Extensions", "shb", MakePath(DIR(SHOW),TR_CORELSHW_EXE+" ^.shb"), cmoOverWrite
CreateIniKeyValue TR_WIN_INI, "CorelDraw3", "ShowDir", MakeDir(DEST$), cmoOverWrite
CreateIniKeyValue TR_WIN_INI, "AAPLAY Animation", "WaveAudio", "c,522", cmoOverWrite
CreateIniKeyValue TR_WIN_INI, "AAPLAY Animation", "Sequencer", "x,523", cmoOverWrite
CreateIniKeyValue TR_WIN_INI, "AAPLAY Animation", "FullScreen", "AAVGA.DLL", cmoOverWrite
CreateIniKeyValue TR_WIN_INI, "AAPLAY Animation", "DualScreen", "no", cmoOverWrite
ini$ = MakePath(DEST$, TR_CORELSHW_INI)
CreateIniKeyValue ini$, "CShowConfig", "ConfigDir", MakeDir(DIR(SHOW)), cmoOverWrite
CreateIniKeyValue ini$, "MasterBackGround", "defaultfile", MakePath(DIR(SHOW),TR_BACKGRDS+"\"+TR_SAMPLE_SHB), cmoOverwrite
nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( TOOLGROUP$, TR_CORELSHOW, MakePath(DIR(SHOW),TR_CORELSHW_EXE), "", cmoOverwrite)
nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( TOOLGROUP$, TR_CORELSHOW_RUNTIME_PLAYER, MakePath(DIR(SHOW),TR_SHOWRUN+"\"+TR_SHOWRUN_EXE), "", cmoOverwrite)
'' Register photo with OLE
FileChangeString MakePath(DEST$,TR_CORELPNT_REG), MakePath(DEST$,"___temp_"),TR_CORELPNT_EXE, MakePath(DIR(PHOTO),TR_CORELPNT_EXE)
ExecCommand TR_REGLOAD_S + " " + MakePath(DEST$,TR_CORELPNT_REG)
CreateIniKeyValue TR_WIN_INI, "Extensions", "pcx", MakePath(DIR(PHOTO),TR_CORELPNT_EXE+" ^.pcx"), cmoOverWrite
CreateIniKeyValue TR_WIN_INI, "CorelDraw3", "PhotoPaintDir", MakeDir(DEST$), cmoOverWrite
ini$ = MakePath(DEST$,TR_CORELPNT_INI)
CreateIniKeyValue ini$, "CorelPaintDll", "PCX 16 Color/Gray", MakePath(DIR(PHOTO),"pcx16.dll,*.pcx"), cmoOverWrite
nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( TOOLGROUP$, TR_CORELPHOTO, MakePath(DIR(PHOTO),TR_CORELPNT_EXE), "", cmoOverwrite)
nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( TOOLGROUP$, TR_CCAPTURE, MakePath(DIR(PHOTO),TR_CCAPTURE_EXE), "", cmoOverwrite)
CreateIniKeyValue TR_WIN_INI, "CorelDraw3", "TraceDir", MakeDir(DEST$), cmoOverWrite
ini$ = MakePath(DEST$,TR_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),TR_FILTERS+"\"), cmoOverWrite
nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( TOOLGROUP$, TR_CORELTRACE, MakePath(DIR(TRACE),TR_CORELTRC_EXE), "", cmoOverwrite)
CreateIniKeyValue TR_WIN_INI, "CorelDraw3", "MosaicDir", MakeDir(DEST$), cmoOverwrite
nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( TOOLGROUP$, TR_CORELMOSAIC, MakePath(DIR(MOSAIC),TR_CORELMOS_EXE), "", cmoOverwrite)
ini$ = ""
IF nAddItemFailed% > 0 THEN
Dialog% = NETADDITEMFAILED
GOSUB INFO
ENDIF
'' Prepend the chart directory to the users path if possible
IF WinMinor% = 0 THEN
bPathAltered% = FALSE
IF DoesFileExist("C:\"+TR_AUTOEXEC_BAT,femWrite) = 1 AND DoesFileExist("C:\"+TR_AUTOEXEC_BAK,femRead) = 0 THEN
szPath$ = GetEnvVariableValue( "path" )
IF LEN( szPath$ ) + LEN( MakeDir(DIR(CHART)) ) < 128 THEN
RenameFile "C:\"+TR_AUTOEXEC_BAT, TR_AUTOEXEC_BAK
PrependToPath "C:\"+TR_AUTOEXEC_BAK, "C:\"+TR_AUTOEXEC_BAT, MakeDir(DIR(CHART)), cmoNone
bPathAltered% = TRUE
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
'' ask the user whether or not to print the test samples
PRINTTEST:
WaitOff
sz$ = UIStartDlg( "mscuistf.dll", PRINTTEST, "FButtonsDlgProc", PRINTTESTHELP, "FHelpDlgProc" )
SELECT CASE sz$
CASE "P"
UIPop(1)
ini$ = MakePath(DEST$, TR_CORELDRW_INI)
CreateIniKeyValue ini$, "CDrawConfig", "MaximizeCDraw", "1", cmoOverwrite
InitPrintTestFile
IF PrintTestFile( MakePath( DIR(DRAW), TR_SAMPLES+"\"+TR_SCREENS_CDR ), FALSE ) = TRUE THEN
bTemp% = PrintTestFile( MakePath( DIR(DRAW), TR_SAMPLES+"\"+TR_COLORBAR_CDR ), TRUE )
ENDIF
CreateIniKeyValue ini$, "CDrawConfig", "MaximizeCDraw", "0", cmoOverwrite
ShutDownPrintTestFile
CASE "D"
UIPop(1)
CASE ELSE
GOTO PRINTTEST
END SELECT
'' 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
sz$ = UIStartDlg("mscuistf.dll", SUCCESS, "FSuccessBitmapDlgProc", 0, "")
dlg% = EXITSUCCESS
szDlgProc$ = "FInfo075DlgProc"
TestWriteToLogfile TR_SETUPSUCCEEDED
TestWriteToLogfile ""
ELSEIF ERR = STFQUIT THEN
dlg% = EXITQUIT
szDlgProc$ = "FInfo0DlgProc"
TestWriteToLogfile TR_SETUPQUIT
TestWriteToLogfile ""
ELSE
dlg% = EXITFAILURE
szDlgProc$ = "FInfo0DlgProc"
TestWriteToLogfile TR_SETUPFAILED
TestWriteToLogfile ""
ENDIF
'' Put up one of the exit message dialog boxes
QUITL1:
sz$ = UIStartDlg("mscuistf.dll", dlg%, szDlgProc, 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO QUITL1
ENDIF
UIPopAll
ShutDownInstall
CloseLogFile
END
'' An error has occurred in MSTest. Tell the user and abort.
ERRQUIT:
i% = DoMsgBox( TR_ERRQUIT, TR_SETUPMESSAGE, MB_OK+MB_TASKMODAL+MB_ICONHAND)
TestWriteToLogfile TR_SETUPCORRUPTED
TestWriteToLogfile ""
ShutDownInstall
CloseLogFile
END
'' 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", EditDir$
SetSymbolValue "EditFocus", "END"
GETPATHL1:
WaitOff
sz$ = UIStartDlg("mscuistf.dll", Dialog%, "FEditDlgProc", CDGETPATHHELP, "FHelpDlgProc")
SELECT CASE sz$
CASE "CONTINUE"
WaitOn
olddir$ = EditDir$
EditDir$ = GetSymbolValue("EditTextOut")
''Validate new path.
IF IsDirWritable(EditDir$) = 0 THEN
oldDialog% = Dialog%
Dialog% = BADPATH
GOSUB INFO
Dialog% = oldDialog%
GOTO GETPATHL1
ENDIF
''Set Recalc and change subdirectories if EditDir$ changed
IF (olddir$ <> EditDir$) AND (olddir$ <> EditDir$+"\") AND (olddir$+"\" <> EditDir$) THEN
bRecalc% = TRUE
ENDIF
olddir$ = ""
CASE "REACTIVATE"
GOTO GETPATHL1
CASE "CANCEL", "BACK"
UIPop 1
GOTO WELCOME
CASE ELSE
GOSUB ASKQUIT
GOTO GETPATHL1
END SELECT
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"
GOTO ASKQUIT
CASE ELSE
''Do nothing
END SELECT
UIPop 1
RETURN
'**
'** Purpose:
'** Recalculates disk space required to install all net files. Also
'** sets the copy list to contain all files.
'** Arguments:
'** none
'** Returns:
'** none
'*************************************************************************
SUB RecalcAll STATIC
ClearCopyList
AddSectionFilesToCopyList "Main", LOCATION$, MakeDir(DEST$)
AddSectionFilesToCopyList "Effects", LOCATION$, MakePath(DEST$,TR_EFFECTS)
AddSectionFilesToCopyList "WinDir", LOCATION$, WINDIR$
AddSectionFilesToCopyList "WinSysDir", LOCATION$, WINSYSDIR$
IF WinMinor% = 0 THEN
AddSectionFilesToCopyList "Win30SysDir", LOCATION$, WINSYSDIR$
ENDIF
ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
IF WinMinor% > 0 THEN
'' Add extra cost to Windows drive for .fot files + logfile.txt, etc.
ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
'' calculate how much space is needed for each .fot file
minfilesize% = GetMinFileSize( ndrive% )
filesize% = minfilesize%
WHILE filesize% < 1350
filesize% = filesize% + minfilesize%
WEND
filesize% = filesize% + 100
lSpace& = filesize% * 256 + 250000
ReplaceListItem EXTRACOSTS$, ndrive%, STR$(lSpace&)
ELSE
''Add extra cost to Windows drive for logfile.txt + ini/progman, etc.
ReplaceListItem EXTRACOSTS$, ndrive%, "250000"
ENDIF
StillNeed& = GetCopyListCost(EXTRACOSTS$, "temp", "")
ReplaceListItem EXTRACOSTS$, ndrive%, "0"
RemoveSymbol( "temp" )
IF StillNeed& > 0 THEN
bTooBig% = TRUE
ELSE
bTooBig% = FALSE
ENDIF
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
'** Set the subdirectories to their default values.
'*************************************************************************
SUB SetDirectories STATIC
DIR(DRAW) = MakePath( MID$(LOCATION$,1,2), TR_DRAW+"\" )
DIR(CHART) = MakePath( MID$(LOCATION$,1,2), TR_CHART+"\" )
DIR(SHOW) = MakePath( MID$(LOCATION$,1,2), TR_SHOW+"\" )
DIR(PHOTO) = MakePath( MID$(LOCATION$,1,2), TR_PHOTOPNT+"\" )
DIR(TRACE) = MakePath( MID$(LOCATION$,1,2), TR_TRACE+"\" )
DIR(MOSAIC) = MakePath( MID$(LOCATION$,1,2), TR_MOSAIC+"\" )
DIR(FONTSYM) = MakePath( MID$(LOCATION$,1,2), TR_FONTS+"\"+"wfn"+"\" )
DIR(MAIN) = MakeDir( MID$(LOCATION$,1,2) )
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
'** If the second file does not exist, backup szFile1$ as szFile2$
'*************************************************************************
SUB CheckBackupFile( szFile1$, szFile2$ ) STATIC
IF DoesFileExist(szFile2$,femExists) = 0 AND DoesFileExist(szFile1$,femExists) THEN
CopyFile szFile1$, szFile2$, cmoNone, 0
ENDIF
END SUB
'*************************************************************************
FUNCTION CreateProgmanItem (szGroup$, szItem$, szCmd$, szOther$, cmo%) STATIC AS INTEGER
szItemNew$ = szItem$
IF szOther$ <> "" THEN
szItemNew$ = szItem$ + "," + szOther$
END IF
IF FCreateProgManItem(szGroup$, szItemNew$, szCmd$, cmo%) = 0 THEN
CreateProgmanItem = 1
ELSE
CreateProgmanItem = 0
END IF
szItemNew$ = ""
END FUNCTION