home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Corel Draw 3
/
CorelDRAW-v3.0.iso
/
draw.mst
< prev
next >
Wrap
Text File
|
1992-10-25
|
48KB
|
1,345 lines
'' $Keywords: draw.mst 2.41 11Nov92 11:18am$ $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 RegisterFont LIB "mscuistf.dll" (szFOTName$, szTTFName$)
DECLARE SUB InitPrintTestFile LIB "mscuistf.dll"
DECLARE SUB ShutDownPrintTestFile LIB "mscuistf.dll"
DECLARE SUB FileChangeString LIB "mscuistf.dll" (szFile1$, szFile2$, szString1$, szString2$)
DECLARE SUB ExecCommand LIB "mscuistf.dll" (szCommand$)
DECLARE SUB CommentIniSection LIB "mscuistf.dll" (szFileName$, szTempFile$, szSection$, szPath$ )
DECLARE FUNCTION ScanList LIB "mscuistf.dll" (szSymbol$, nIndex%) AS INTEGER
DECLARE FUNCTION PrintTestFile LIB "mscuistf.dll" (szFileName$, bLast% ) 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" (cDrive%) AS LONG
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 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 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 BADGROUP = 9933
CONST PRINTTEST = 9937
CONST SUCCESS = 9938
CONST WINREADONLY = 9943
CONST NETINSTWELCOME = 9944
CONST CHECKUPGRADE = 9945
CONST CHECKUPGRADEFAIL = 9946
CONST NETADDITEMFAILED = 9949
CONST NETADMINABOUT = 9950
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
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 AGRAPHIX = 7
CONST FONTSYM = 8
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.
'$DEFINE INSTALLCD ''When this is set, Draw will install off cd-rom
'$UNDEF UPGRADE ''When this is set, Draw will only install as an upgrade
'' used as values for afState(NUMCUST) array.
CONST ALL = 1
CONST SOME = 2
CONST NONE = 3
'' set 'customize' variables
''Customized installation settings
GLOBAL OPTS(TRACE) AS STRING
OPTS(DRAW) = "DrawOpt"
OPTS(CHART) = "ChartOpt"
OPTS(SHOW) = "ShowOpt"
OPTS(PHOTO) = "PhotoOpt"
OPTS(TRACE) = "TraceOpt"
''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 bTooBig%
bTooBig% = FALSE
GLOBAL CustomGroups% '' TRUE ==> user went through SELECTCUSTGROUPS
CustomGroups% = FALSE
GLOBAL bInstallWinDLL% '' Should the dlls be copied to the windows system dir?
'' Note: redists are always copied under win 3.0
bInstallWinDLL% = FALSE
GLOBAL bInstallNet% '' Are we installing a network version?
GLOBAL bAddedFilters% '' Did we install any filters?
''list of sections (1..NUMGROUPS)
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 bWindowsIsNetworked%
GLOBAL DEST$ ''destination directory.
GLOBAL szFontDir$ ''directory for .ttf fonts
GLOBAL szWWinDir$ ''Writable Windows 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$
GLOBAL bRecalcOpt%
''TRUE => must do a global recalculation after GetPath - starts TRUE
GLOBAL bRecalc%
''Globals for WaitOn and WaitOff
GLOBAL nWaiting%
GLOBAL CursorSave%
GLOBAL bPathAltered% '' If set then autoexec.bat has been changed
GLOBAL SrcDir$ '' Directory where files can be found
SrcDir$ = GetSymbolValue("STF_SRCDIR")
''local MSTest functions
DECLARE SUB WaitOnBig
DECLARE SUB WaitOn
DECLARE SUB WaitOff
DECLARE SUB SetDirectories
DECLARE SUB SetProgmanGroups
DECLARE SUB PrepInstall
DECLARE SUB FullInstall
DECLARE SUB MinInstall
DECLARE SUB AddOptFilesToCopyList( ftype% )
DECLARE SUB RecalcOptFiles( ftype% )
DECLARE SUB RecalcPath
DECLARE SUB SetDriveStatus
DECLARE SUB SetFontRedistDir
DECLARE SUB AddRedistSection( szSection$, bInstallRedist%, bRedistFiles% )
DECLARE SUB WrapFileChangeString( szFile1$, szFile2$, szString1$, szString2$ )
DECLARE SUB WrapExecCommand( szCommand$ )
DECLARE SUB WrapCommentIniSection( szFileName$, szTempFile$, szSection$, szPath$ )
DECLARE SUB CheckBackupFile( szFile1$, szFile2$ )
DECLARE FUNCTION CreateProgmanItem (szGroup$, szItem$, szCmd$, szOther$, cmo%) AS INTEGER
DECLARE FUNCTION WrapScanList( szSymbol$, nIndex% ) AS INTEGER
DECLARE FUNCTION MakePath( szDir$, szFile$ ) AS STRING
DECLARE FUNCTION MakeDir( szDir$ ) AS STRING
INIT:
'' set waiting cursor
nWaiting% = 0
WaitOn
'' Determine whether or not we are installing as a network administrator.
'' If we are, modify the copy of the .inf file to force files to be copied
'' as readonly.
IF GetSymbolValue("STF_MODE") = "ADMIN" THEN
bInstallNet% = TRUE
'' set the .inf readonly flag to true
szDir$ = GetSymbolValue("STF_CWDDIR")
WrapFileChangeString MakePath(szDir$,"draw.inf"), MakePath(szDir$,"___temp_"), """STF_READONLY"" = """"", """STF_READONLY"" = ""YES"""
szDir$ = ""
ELSE
bInstallNet% = FALSE
ENDIF
''Set default directory names
WINDIR$ = GetWindowsDir
WINSYSDIR$ = GetWindowsSysDir
WINDRIVE$ = MID$(WINDIR$, 1, 1)
bWindowsIsNetworked% = IsDriveNetwork( MID$(WINSYSDIR$,1,1) )
DEST$ = WINDRIVE$ + ":\"+TR_CORELDRW
SetDirectories
OpenLogfile MakePath(WINDIR$, TR_LOGFILE), 0
'$IFDEF INSTALLCD
WriteToLogFile TR_INSTALLCD
'$ELSE
WriteToLogFile TR_INSTALLFLOPPY
'$ENDIF
IF bInstallNet% THEN
WriteToLogFile TR_INSTALLNETADMIN
ENDIF
IF bWindowsIsNetworked% THEN
WriteToLogFile TR_NETWINDOWS
ENDIF
'' Quit if installing a network version and windows is readonly on net
IF bWindowsIsNetworked% AND bInstallNet% AND IsDirWritable(WINSYSDIR$) = 0 THEN
Dialog% = WINREADONLY
GOSUB INFO
ERR = STFERR
GOTO QUIT
ENDIF
''find and read .inf file
ReadInfFile GetSymbolValue("STF_CWDDIR") + "draw.INF"
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
TOOLGROUP$ = TR_TOOLGROUP
'' Put up the Welcome dialog
WELCOME:
WaitOff
IF bInstallNet% THEN
Dialog% = NETINSTWELCOME
ELSE
Dialog% = WELCOME
ENDIF
sz$ = UIStartDlg( "mscuistf.dll", Dialog%, "FInfoDlgProc", WELCOMEHELP, "FHelpDlgProc" )
SELECT CASE sz$
CASE "CONTINUE"
UIPop 1
CASE "ABOUT"
IF bInstallNet% THEN
Dialog% = NETADMINABOUT
ELSE
Dialog% = ABOUT
ENDIF
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
'' 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
WriteToLogfile TR_FULLINSTALL
GOSUB GETPATH
CASE "M"
UIPop(1)
''At least one recalculation must be made to determine that everything fits
bRecalc% = TRUE
MinInstall
SetProgmanGroups
WriteToLogfile TR_MININSTALL
GOSUB GETPATH
CASE "C"
UIPop(1)
''At least one recalculation must be made to determine that everything fits
bRecalc% = TRUE
FullInstall
WriteToLogfile TR_CUSTOMINSTALL
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(TRACE), etc. to
'' indicate which files should be installed.
INSTALL:
WaitOn
''Make sure there is enough space for CorelDRAW!
IF bRecalc% THEN
WaitOnBig
bRecalc% = FALSE
RecalcPath
SetDriveStatus
ENDIF
IF bTooBig% <> 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%
IF bInstallNet% THEN
CreateDir MakePath(DIR(MAIN),TR_SETUP), cmoNone
IF afState(FONTSYM) <> NONE THEN
CreateDir MakePath(DIR(FONTSYM),TR_TTF), cmoNone
ENDIF
ELSE
'' 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")
ENDIF
IF afState(DRAW) <> NONE THEN
IF afState(DRAW) = ALL OR GetListItem( OPTS(DRAW), 1 ) = "ON" THEN
IF bInstallNet% = FALSE THEN
CreateDir MakePath( DIR(MAIN), TR_AUTOBACK ), cmoNone
ENDIF
CreateDir MakePath( DIR(DRAW), TR_EHANDLER ), cmoNone
ENDIF
IF afState(DRAW) = ALL OR GetListItem( OPTS(DRAW), 3 ) = "ON" THEN
CreateDir MakePath( DIR(DRAW), TR_SAMPLES ), cmoNone
ENDIF
'$IFNDEF INSTALLCD
IF afState(DRAW) = ALL OR GetListItem( OPTS(DRAW), 6 ) = "ON" THEN
CreateDir MakePath( DIR(DRAW), TR_CLIPART ), cmoNone
CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_AIRCRAFT ), cmoNone
CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_BIRD ), cmoNone
CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_CELEBRAT ), cmoNone
CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_DENTAL ), cmoNone
CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_EMERGENC ), cmoNone
CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_EQUIPMEN ), cmoNone
CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_FLAG ), cmoNone
CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_FOOD ), cmoNone
CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_ICON ), cmoNone
CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_MAMMAL ), cmoNone
CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_MAN ), cmoNone
CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_MAP ), cmoNone
CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_MEDICAL ), cmoNone
CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_MISC ), cmoNone
CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_MONEY ), cmoNone
CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_POLITICA ), cmoNone
CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_SIGN ), cmoNone
CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_SPORTS ), cmoNone
CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_THEME_BO ), cmoNone
CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_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), TR_3DRISER ), cmoNone
CreateDir MakePath( DIR(CHART), TR_3DSCAT ), cmoNone
CreateDir MakePath( DIR(CHART), TR_AREA ), cmoNone
CreateDir MakePath( DIR(CHART), TR_BAR ), cmoNone
CreateDir MakePath( DIR(CHART), TR_BITMAPS ), cmoNone
CreateDir MakePath( DIR(CHART), TR_EFFECTS ), cmoNone
CreateDir MakePath( DIR(CHART), TR_HILO ), cmoNone
CreateDir MakePath( DIR(CHART), TR_HIST ), cmoNone
CreateDir MakePath( DIR(CHART), TR_LINE ), cmoNone
CreateDir MakePath( DIR(CHART), TR_PICTO ), cmoNone
CreateDir MakePath( DIR(CHART), TR_PIE ), cmoNone
CreateDir MakePath( DIR(CHART), TR_SCATTER ), cmoNone
CreateDir MakePath( DIR(CHART), TR_SPECTRAL ), cmoNone
IF bInstallNet% = FALSE THEN
CreateDir MakePath( DIR(CHART), TR_TEMP ), cmoNone
ENDIF
CreateDir MakePath( DIR(CHART), TR_TABLE ), cmoNone
CreateDir MakePath( DIR(CHART), TR_VECTORS ), cmoNone
ENDIF
IF afState(CHART) = ALL OR GetListItem( OPTS(CHART), 3 ) = "ON" THEN
CreateDir MakePath( DIR(CHART), TR_SAMPLES ), cmoNone
ENDIF
ENDIF
IF afState(SHOW) <> NONE THEN
IF afState(SHOW) = ALL OR GetListItem( OPTS(SHOW), 3 ) = "ON" THEN
CreateDir MakePath( DIR(SHOW), TR_SAMPLES ), cmoNone
CreateDir MakePath( DIR(SHOW), TR_FLICS ), cmoNone
CreateDir MakePath( DIR(SHOW), TR_BACKGRDS ), cmoNone
ENDIF
IF afState(SHOW) = ALL OR GetListItem( OPTS(SHOW), 4 ) = "ON" THEN
CreateDir MakePath( DIR(SHOW), TR_SHOWRUN ), cmoNone
ENDIF
ENDIF
IF afState(PHOTO) <> NONE THEN
IF afState(PHOTO) = ALL OR GetListItem( OPTS(PHOTO), 1 ) = "ON" THEN
CreateDir MakePath( DIR(PHOTO), TR_PALETTES ), cmoNone
CreateDir MakePath( DIR(PHOTO), TR_TILES ), cmoNone
ENDIF
IF afState(PHOTO) = ALL OR GetListItem( OPTS(PHOTO), 3 ) = "ON" THEN
CreateDir MakePath( DIR(PHOTO), TR_SAMPLES ), cmoNone
ENDIF
ENDIF
IF afState(AGRAPHIX) <> NONE THEN
CreateDir MakePath( DIR(AGRAPHIX), TR_PRINTERS ), cmoNone
CreateDir MakePath( DIR(AGRAPHIX), TR_TOAGX ), cmoNone
ENDIF
'' add the extra stuff for root files
IF bAddedFilters% THEN
CreateDir MakePath(DIR(MAIN),TR_FILTERS), cmoNone
ENDIF
'' If installing as a network administrator, copy redists to redist dir
IF bInstallNet% THEN
CreateDir MakePath(DIR(MAIN),TR_REDIST), cmoNone
ENDIF
AddSectionFilesToCopyList "Main", SrcDir$, DEST$
'' Add billboards
FOR i% = 1 TO 6 STEP 1
AddToBillBoardList "mscuistf.dll", BILLBOARD, "FModelessBitmapDlgProc", 10
NEXT i%
''Copy all the files over
WaitOff
CopyFilesInCopyList
WaitOn
'' By default we do not want to do the print test.
bDoPrintTest% = FALSE
'' if installing as a network administrator don't create .fot files
IF bInstallNet% = FALSE THEN
'' 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% = WrapScanList(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 )
szFOTName$ = MID$(szFileName2$,1,LEN(szFileName2$)-3) + "fot"
RegisterFont MakePath(szWWinDir$,szFOTName$), MakePath(szFontDir$,szFileName2$)
IF bInstallNet% = FALSE THEN
temp% = GetTypeFaceNameFromTTF( MakePath(szFontDir$,szFileName2$), szString$, STRINGLEN )
CreateIniKeyValue TR_WIN_INI, "fonts", szString$+" "+TR_TRUETYPE, UCASE$(szFOTName$), cmoOverWrite
ENDIF
nIndex% = nIndex% + nIndexInc%
nIndexInc% = WrapScanList(NeedsList$,nIndex%)
WEND
UIPop 1
ENDIF
ENDIF
ENDIF
'' szFileName$ = ""
'' szFileName2$ = ""
'' szFOTName$ = ""
'' When installing as a network administrator, register nothing
IF bInstallNet% = FALSE THEN
nAddItemFailed% = 0
IF afState(DRAW) <> NONE THEN
IF afState(DRAW) = ALL OR GetListItem(OPTS(DRAW), 1) = "ON" THEN
'' setup coreldrw.reg
WrapFileChangeString MakePath(DIR(DRAW),TR_CORELDRW_REG), MakePath(DIR(DRAW),"___temp_"), TR_CORELDRW_EXE, MakePath(DIR(DRAW),TR_CORELDRW_EXE)
WrapExecCommand TR_REGLOAD_S + " " + MakePath(DIR(DRAW),TR_CORELDRW_REG)
ini$ = MakePath(DIR(DRAW), TR_CORELDRW_INI)
CreateIniKeyValue TR_WIN_INI, "Extensions", "cdr", MakePath(DIR(DRAW),TR_CORELDRW_EXE+" ^.cdr"), cmoOverWrite
CreateIniKeyValue TR_WIN_INI, "CorelDraw3", "DrawDir", DIR(DRAW), cmoOverWrite
CreateIniKeyValue ini$, "CDrawConfig", "Applic", DIR(DRAW), cmoOverwrite
CreateIniKeyValue ini$, "CDrawConfig", "ConfigDir", DIR(DRAW), cmoOverwrite
CreateIniKeyValue ini$, "CDrawConfig", "FontsDir", DIR(FONTSYM), cmoOverwrite
CreateIniKeyValue ini$, "CDrawConfig", "CorelFiltersDir", MakePath(DIR(MAIN),TR_FILTERS), cmoOverwrite
CreateIniKeyValue ini$, "CDrawConfig", "AutoBackupDir", MakePath(DIR(MAIN),TR_AUTOBACK), cmoOverwrite
CreateIniKeyValue ini$, "Mosaic", "Applic", MakePath(DIR(MOSAIC),TR_CORELMOS_EXE), cmoOverwrite
WrapCommentIniSection ini$, MakePath(Dir(DRAW),"___temp_"), "CDrawImportFilters", MakePath(DIR(MAIN),TR_FILTERS+"\")
WrapCommentIniSection ini$, MakePath(Dir(DRAW),"___temp_"), "CDrawExportFilters", MakePath(DIR(MAIN),TR_FILTERS+"\")
WrapCommentIniSection ini$, MakePath(Dir(DRAW),"___temp_"), "CorelDrwFonts", MakePath(DIR(FONTSYM),"")
WrapCommentIniSection ini$, MakePath(Dir(DRAW),"___temp_"), "CorelDrwSymbols", MakePath(DIR(FONTSYM),"")
CreateProgmanGroup aszGroups(DRAW), "", cmoNone
ShowProgmanGroup aszGroups(DRAW), 1, cmoNone
nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( aszGroups(DRAW), TR_RELEASENOTES, TR_NOTEPAD_EXE + " " + MakePath(DIR(MAIN),TR_README_TXT), "", cmoOverwrite)
nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( aszGroups(DRAW), TR_CORELDRAW, MakePath(DIR(DRAW),TR_CORELDRW_EXE), "", cmoOverwrite)
ENDIF
IF afState(DRAW) = ALL OR GetListItem(OPTS(DRAW), 5) = "ON" THEN
CreateProgmanGroup aszGroups(DRAW), "", cmoNone
ShowProgmanGroup aszGroups(DRAW), 1, cmoNone
'' Make sure we use our winhelp if we installed one
IF WinMinor% = 0 THEN
nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( aszGroups(DRAW), TR_CORELDRAW+" "+TR_TUTORIAL, MakePath(WINSYSDIR$,TR_WINHELP)+" "+MakePath(DIR(DRAW),TR_TUTORIAL_HLP), "", cmoOverwrite)
ELSE
nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( aszGroups(DRAW), TR_CORELDRAW+" "+TR_TUTORIAL, TR_WINHELP+" "+MakePath(DIR(DRAW),TR_TUTORIAL_HLP), "", cmoOverwrite)
ENDIF
ENDIF
ENDIF
'' DIR(FONTSYM) = ""
IF afState(CHART) <> NONE THEN
IF afState(CHART) = ALL OR GetListItem(OPTS(CHART), 1) = "ON" THEN
'' setup corelcht.reg
WrapFileChangeString MakePath(DIR(CHART),TR_CORELCHT_REG), MakePath(DIR(CHART),"___temp_"), TR_CORELCHT_EXE, MakePath(DIR(CHART),TR_CORELCHT_EXE)
WrapExecCommand TR_REGLOAD_S + " " + MakePath(DIR(CHART),TR_CORELCHT_REG)
CreateIniKeyValue TR_WIN_INI, "Extensions", "cch", MakePath(DIR(CHART),TR_CORELCHT_EXE+" ^.cch"), cmoOverWrite
CreateIniKeyValue TR_WIN_INI, "CorelDraw3", "ChartDir", DIR(CHART), cmoOverWrite
ini$ = MakePath(WINDIR$, "CORELCHT.INI")
CreateIniKeyValue ini$, "CorelChart", "GATO_PATH", 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(DIR(CHART),TR_EFFECTS), cmoOverwrite
CreateIniKeyValue ini$, "CorelChart", "F3FX_FILTERS", MakePath(DIR(MAIN),TR_FILTERS), cmoOverwrite
CreateIniKeyValue ini$, "CorelChart", "F3FX_TEMPDIR", MakePath(DIR(CHART),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
CreateProgmanGroup aszGroups(CHART), "", cmoNone
ShowProgmanGroup aszGroups(CHART), 1, cmoNone
nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( aszGroups(CHART), TR_CORELCHART, MakePath(DIR(CHART),TR_CORELCHT_EXE), "", cmoOverwrite)
ENDIF
ENDIF
IF afState(SHOW) <> NONE THEN
IF afState(SHOW) = ALL OR GetListItem(OPTS(SHOW), 1) = "ON" THEN
'' setup corelshw.reg
WrapFileChangeString MakePath(DIR(SHOW),TR_CORELSHW_REG), MakePath(DIR(SHOW),"___temp_"),TR_CORELSHW_EXE, MakePath(DIR(SHOW),TR_CORELSHW_EXE)
WrapExecCommand TR_REGLOAD_S + " " + MakePath(DIR(SHOW),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", DIR(SHOW), 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(DIR(SHOW), TR_CORELSHW_INI)
CreateIniKeyValue ini$, "CShowConfig", "ConfigDir", DIR(SHOW), cmoOverWrite
CreateIniKeyValue ini$, "MasterBackGround", "defaultfile", MakePath(DIR(SHOW),TR_BACKGRDS+"\"+TR_SAMPLE_SHB), cmoOverwrite
CreateProgmanGroup aszGroups(SHOW), "", cmoNone
ShowProgmanGroup aszGroups(SHOW), 1, cmoNone
nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( aszGroups(SHOW), TR_CORELSHOW, MakePath(DIR(SHOW),TR_CORELSHW_EXE), "", cmoOverwrite)
ENDIF
IF afState(SHOW) = ALL OR GetListItem(OPTS(SHOW), 4) = "ON" THEN
CreateProgmanGroup aszGroups(SHOW), "", cmoNone
ShowProgmanGroup aszGroups(SHOW), 1, cmoNone
nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( aszGroups(SHOW), TR_CORELSHOW_RUNTIME_PLAYER, MakePath(DIR(SHOW),TR_SHOWRUN+"\"+TR_SHOWRUN_EXE), "", cmoOverwrite)
ENDIF
ENDIF
IF afState(PHOTO) <> NONE THEN
IF afState(PHOTO) = ALL OR GetListItem(OPTS(PHOTO), 1) = "ON" THEN
'' Register photo with OLE
WrapFileChangeString MakePath(DIR(PHOTO),TR_CORELPNT_REG), MakePath(DIR(PHOTO),"___temp_"),TR_CORELPNT_EXE, MakePath(DIR(PHOTO),TR_CORELPNT_EXE)
WrapFileChangeString MakePath(DIR(PHOTO),TR_CORELPNT_REG), MakePath(DIR(PHOTO),"___temp_"),TR_PNTHNDLR_DLL, MakePath(DIR(PHOTO),TR_PNTHNDLR_DLL)
WrapExecCommand TR_REGLOAD_S + " " + MakePath(DIR(PHOTO),TR_CORELPNT_REG)
CreateIniKeyValue TR_WIN_INI, "Extensions", "pcx", MakePath(DIR(PHOTO),TR_CORELPNT_EXE+" ^.pcx"), cmoOverWrite
CreateIniKeyValue TR_WIN_INI, "CorelDraw3", "PhotoPaintDir", DIR(PHOTO), cmoOverWrite
ini$ = MakePath(DIR(PHOTO),TR_CORELPNT_INI)
CreateIniKeyValue ini$, "CorelPaintDll", "PCX 16 Color/Gray", MakePath(DIR(PHOTO),"pcx16.dll,*.pcx"), cmoOverWrite
CreateProgmanGroup aszGroups(PHOTO), "", cmoNone
ShowProgmanGroup aszGroups(PHOTO), 1, cmoNone
nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( aszGroups(PHOTO), TR_CORELPHOTO, MakePath(DIR(PHOTO),TR_CORELPNT_EXE), "", cmoOverwrite)
nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( aszGroups(PHOTO), TR_CCAPTURE, MakePath(DIR(PHOTO),TR_CCAPTURE_EXE), "", cmoOverwrite)
ENDIF
ENDIF
IF afState(TRACE) <> NONE THEN
IF afState(TRACE) = ALL OR GetListItem(OPTS(TRACE), 1) = "ON" THEN
CreateIniKeyValue TR_WIN_INI, "CorelDraw3", "TraceDir", DIR(TRACE), cmoOverWrite
ini$ = MakePath(DIR(TRACE),TR_CORELTRC_INI)
CreateIniKeyValue ini$, "CorelTrace", "OutPath", MakePath(WINDIR$,""), cmoOverWrite
CreateIniKeyValue ini$, "CorelTrace", "InPath", MakePath(WINDIR$,""), cmoOverWrite
CreateIniKeyValue ini$, "CorelTrace", "ApplPath", DIR(TRACE), cmoOverWrite
CreateIniKeyValue ini$, "CorelTrace", "TraceFiltersDir", MakePath(DIR(MAIN),TR_FILTERS+"\"), cmoOverWrite
CreateProgmanGroup aszGroups(TRACE), "", cmoNone
ShowProgmanGroup aszGroups(TRACE), 1, cmoNone
nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( aszGroups(TRACE), TR_CORELTRACE, MakePath(DIR(TRACE),TR_CORELTRC_EXE), "", cmoOverwrite)
ENDIF
ENDIF
IF afState(MOSAIC) <> NONE THEN
CreateIniKeyValue TR_WIN_INI, "CorelDraw3", "MosaicDir", DIR(MOSAIC), cmoOverwrite
CreateProgmanGroup aszGroups(MOSAIC), "", cmoNone
ShowProgmanGroup aszGroups(MOSAIC), 1, cmoNone
nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( aszGroups(MOSAIC), TR_CORELMOSAIC, MakePath(DIR(MOSAIC),TR_CORELMOS_EXE), "", cmoOverwrite)
ENDIF
IF nAddItemFailed% > 0 THEN
Dialog% = NETADDITEMFAILED
GOSUB INFO
ENDIF
'' Update CorelDraw's ini file to correspond to new components if it was
'' previously installed
IF afState(DRAW) <> ALL AND DoesIniKeyExist(TR_WIN_INI,"CorelDraw3","DrawDir") = 1 THEN
IF afState(DRAW) <> SOME OR GetListItem(OPTS(DRAW), 1) = "OFF" THEN
ini$ = MakePath(GetIniKeyString(TR_WIN_INI,"CorelDraw3","DrawDir"), TR_CORELDRW_INI)
IF bAddedFilters% THEN
WrapCommentIniSection ini$, MakePath(Dir(DRAW),"___temp_"), "CDrawImportFilters", MakePath(DIR(MAIN),TR_FILTERS+"\")
WrapCommentIniSection ini$, MakePath(Dir(DRAW),"___temp_"), "CDrawExportFilters", MakePath(DIR(MAIN),TR_FILTERS+"\")
ENDIF
IF afState(MOSAIC) = ALL THEN
CreateIniKeyValue ini$, "Mosaic", "Applic", MakePath(DIR(MOSAIC),TR_CORELMOS_EXE), cmoOverwrite
ENDIF
IF afState(FONTSYM) <> NONE THEN
WrapCommentIniSection ini$, MakePath(Dir(DRAW),"___temp_"), "CorelDrwFonts", MakePath(DIR(FONTSYM),"")
WrapCommentIniSection ini$, MakePath(Dir(DRAW),"___temp_"), "CorelDrwSymbols", MakePath(DIR(FONTSYM),"")
ENDIF
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:\"+TR_AUTOEXEC_BAT,femWrite) = 1 AND DoesFileExist("C:\"+TR_AUTOEXEC_BAK,femRead) = 0 THEN
szPath$ = GetEnvVariableValue( "path" )
IF LEN( szPath$ ) + LEN( DIR(CHART) ) < 127 THEN
RenameFile "C:\"+TR_AUTOEXEC_BAT, TR_AUTOEXEC_BAK
PrependToPath "C:\"+TR_AUTOEXEC_BAK, "C:\"+TR_AUTOEXEC_BAT, DIR(CHART), cmoNone
bPathAltered% = TRUE
ENDIF
ENDIF
ENDIF
'' Display the info dialog telling the user what we did
IF bPathAltered% THEN
Dialog% = UPDATEDAUTOEXEC
GOSUB INFO
ELSE
Dialog% = UPDATEAUTOEXEC
GOSUB INFO
ENDIF
ENDIF
'' Is the system set up to allow us to print the samples?
IF afState(DRAW) = ALL THEN
bDoPrintTest% = TRUE
ELSEIF afState(DRAW) = SOME AND GetListItem(OPTS(DRAW),1) = "ON" AND GetListItem(OPTS(DRAW),3) = "ON" THEN
bDoPrintTest% = TRUE
ENDIF
ELSE '' if a network administrator
ini$ = MakePath( DIR(MAIN), TR_SETUP+"\"+TR_SETUP_INI )
CreateIniKeyValue ini$, "Directories", TR_FIXEDDRIVE, "FALSE", cmoOverwrite
CreateIniKeyValue ini$, "Directories", TR_DRAW, DIR(DRAW), cmoOverwrite
CreateIniKeyValue ini$, "Directories", TR_CHART, DIR(CHART), cmoOverwrite
CreateIniKeyValue ini$, "Directories", TR_SHOW, DIR(SHOW), cmoOverwrite
CreateIniKeyValue ini$, "Directories", TR_PHOTOPNT, DIR(PHOTO), cmoOverwrite
CreateIniKeyValue ini$, "Directories", TR_TRACE, DIR(TRACE), cmoOverwrite
CreateIniKeyValue ini$, "Directories", TR_MOSAIC, DIR(MOSAIC), cmoOverwrite
CreateIniKeyValue ini$, "Directories", TR_FONTS, DIR(FONTSYM), cmoOverwrite
CreateIniKeyValue ini$, "Directories", TR_TTF, MakePath(DIR(FONTSYM),TR_TTF), cmoOverwrite
CreateIniKeyValue ini$, "Directories", TR_MAIN, DIR(MAIN), cmoOverwrite
ENDIF '' end 'network administrator?'
'' Do print test?
IF bDoPrintTest% THEN
GOSUB PRINTTEST
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
sz$ = UIStartDlg("mscuistf.dll", SUCCESS, "FSuccessBitmapDlgProc", 0, "")
dlg% = EXITSUCCESS
szDlgProc$ = "FInfo075DlgProc"
WriteToLogfile TR_SETUPSUCCEEDED
ELSEIF ERR = STFQUIT THEN
dlg% = EXITQUIT
szDlgProc$ = "FInfo0DlgProc"
WriteToLogfile TR_SETUPQUIT
ELSE
dlg% = EXITFAILURE
szDlgProc$ = "FInfo0DlgProc"
WriteToLogfile TR_SETUPFAILED
ENDIF
WriteToLogfile ""
'' 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)
WriteToLogfile TR_SETUPCORRUPTED
WriteToLogFile ""
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% 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
GOSUB SetDirFromSymbol '' set afState and DIR array from symbols
SetDriveStatus '' Test for not enough space
IF bTooBig% <> FALSE THEN
Dialog% = TOOBIG
GOSUB INFO
GOTO CUSTINSTL1
ENDIF
WriteToLogFile TR_DIRECTORIES
WriteToLogFile TR_CORELDRAW + " - " + DIR(DRAW)
WriteToLogFile TR_CORELCHART + " - " + DIR(CHART)
WriteToLogFile TR_CORELSHOW + " - " + DIR(SHOW)
WriteToLogFile TR_CORELPHOTO + " - " + DIR(PHOTO)
WriteToLogFile TR_CORELTRACE + " - " + DIR(TRACE)
WriteToLogFile TR_CORELMOSAIC + " - " + DIR(MOSAIC)
WriteToLogFile TR_FONTSYM + " - " + DIR(FONTSYM)
WriteToLogFile TR_MAIN + " - " + DIR(MAIN)
WriteToLogFile TR_CUSTOMSELECT
WriteToLogFile TR_CUSTOMMESSAGE
WriteToLogFile TR_CORELDRAW + " - " + STR$(afState(DRAW)) + " - " + GetSymbolValue(OPTS(DRAW))
WriteToLogFile TR_CORELCHART + " - " + STR$(afState(CHART)) + " - " + GetSymbolValue(OPTS(CHART))
WriteToLogFile TR_CORELSHOW + " - " + STR$(afState(SHOW)) + " - " + GetSymbolValue(OPTS(SHOW))
WriteToLogFile TR_CORELPHOTO + " - " + STR$(afState(PHOTO)) + " - " + GetSymbolValue(OPTS(PHOTO))
WriteToLogFile TR_CORELTRACE + " - " + STR$(afState(TRACE)) + " - " + GetSymbolValue(OPTS(TRACE))
WriteToLogFile TR_CORELMOSAIC + " - " + STR$(afState(MOSAIC))
WriteToLogFile TR_AUTOGRAPHIX_SLIDE_SERVICE + " - " + STR$(afState(AGRAPHIX))
WriteToLogFile TR_FONTSYM + " - " + STR$(afState(FONTSYM))
''Maybe should add filters/fonts/symbols here
WriteToLogFile TR_ASTERIXES
CASE "CUST1"
WaitOn
szOptions$ = OPTS(DRAW)
Dialog% = CUSTDRAW
SelectType% = DRAW
GOSUB SetDirFromSymbol '' set afState and DIR array from symbols
GOSUB CUSTINST2
GOTO CUSTINSTL1
CASE "CUST2"
WaitOn
szOptions$ = OPTS(CHART)
Dialog% = CUSTCHART
SelectType% = CHART
GOSUB SetDirFromSymbol '' set afState and DIR array from symbols
GOSUB CUSTINST2
GOTO CUSTINSTL1
CASE "CUST3"
WaitOn
szOptions$ = OPTS(SHOW)
Dialog% = CUSTSHOW
SelectType% = SHOW
GOSUB SetDirFromSymbol '' set afState and DIR array from symbols
GOSUB CUSTINST2
GOTO CUSTINSTL1
CASE "CUST4"
WaitOn
szOptions$ = OPTS(PHOTO)
Dialog% = CUSTPHOTO
SelectType% = PHOTO
GOSUB SetDirFromSymbol '' set afState and DIR array from symbols
GOSUB CUSTINST2
GOTO CUSTINSTL1
CASE "CUST5"
WaitOn
szOptions = OPTS(TRACE)
Dialog% = CUSTTRACE
SelectType% = TRACE
GOSUB SetDirFromSymbol '' set afState and DIR array from symbols
GOSUB CUSTINST2
GOTO CUSTINSTL1
CASE "CUST8"
WaitOn
szFList1a$ = FONTLIST1$
szFList1b$ = FONTLIST2$
szFList2a$ = SYMBOLLIST1$
szFList2b$ = SYMBOLLIST2$
Dialog% = SELECTFONTSYM
SelectType% = FONTSYM
IF afState(FONTSYM) <> SOME THEN
afState(FONTSYM) = SOME
bRecalcOpt% = TRUE
ELSE
bRecalcOpt% = FALSE
ENDIF
GOSUB SetDirFromSymbol '' set afState and DIR array from symbols
GOSUB SELECTFILES
GOTO CUSTINSTL1
''reset afState, the drive status and status text
CASE "RESET"
WaitOn
GOSUB SetDirFromSymbol '' set afState and DIR array from symbols
GOTO CUSTINSTL1
CASE "REACTIVATE"
bRecalc% = TRUE
GOSUB SetDirFromSymbol '' set afState and DIR array from symbols
GOTO CUSTINSTL1
CASE "CANCEL", "BACK"
WaitOn
UIPop 1
GOTO OPTIONS
CASE ELSE
GOSUB ASKQUIT
GOSUB SetDirFromSymbol '' set afState and DIR array from symbols
GOTO CUSTINSTL1
END SELECT
UIPop 1
'' Don't ask what progman group to use if installing as an administrator
IF bInstallNet% THEN
GOTO ASKINSTALL
ENDIF
'' Fall through from CUSTINST
''set the default progman group to put everything in
TOOLGROUP$ = TR_TOOLGROUP
'' 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"
group$ = GetListitem("EditText",1)
IF LEN(group$) > 30 THEN
Dialog% = BADGROUP
GOSUB INFO
GOTO SELECTGROUPSL1
ENDIF
TOOLGROUP$ = group$
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
WriteToLogFile TR_PROGMANGROUP + TOOLGROUP$
WriteToLogFile ""
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 bInstallNet% THEN
GOTO CUSTINST
ELSEIF CustomGroups% 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
group$ = GetListItem( "EditText", i% )
IF LEN(group$) > 30 THEN
Dialog% = BADGROUP
GOSUB INFO
GOTO SELECTCUSTGROUPSL1
ENDIF
aszGroups( i% ) = group$
NEXT i%
CASE "CANCEL", "BACK"
UIPop 1
GOTO SELECTGROUPS
CASE "REACTIVATE"
bRecalc% = TRUE
GOTO SELECTCUSTGROUPSL1
CASE ELSE
GOSUB ASKQUIT
GOTO SELECTCUSTGROUPSL1
END SELECT
WriteToLogFile TR_PROGMANGROUP
WriteToLogFile TR_CORELDRAW + " - " + aszGroups(DRAW)
WriteToLogFile TR_CORELCHART + " - " + aszGroups(CHART)
WriteToLogFile TR_CORELSHOW + " - " + aszGroups(SHOW)
WriteToLogFile TR_CORELPHOTO + " - " + aszGroups(PHOTO)
WriteToLogFile TR_CORELTRACE + " - " + aszGroups(TRACE)
WriteToLogFile TR_CORELMOSAIC + " - " + aszGroups(MOSAIC)
WriteToLogFile TR_ASTERIXES
WriteToLogFile ""
UIPop 1
CustomGroups% = TRUE
GOTO ASKINSTALL
'' Input the custom installation choices for DRAW .. TRACE
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:
WriteToLogFile ""
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
WriteToLogFile TR_BASEDIR + DEST$
WriteToLogFile ""
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$ )
SELECTL1:
WaitOff
sz$ = UIStartDlg("mscuistf.dll", Dialog%, "FList4DlgProc", SELECTHELP, "FHelpDlgProc")
SELECT CASE sz$
CASE "CONTINUE"
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
UIPop 1
IF SelectType% = FONTSYM AND bRecalcOpt% THEN
WaitOnBig
RecalcOptFiles SelectType%
ENDIF
'' newlist$ = ""
CASE "REACTIVATE"
bRecalc% = TRUE
GOTO SELECTL1
CASE "CANCEL", "BACK"
UIPop 1
IF SelectType% = FONTSYM THEN
WaitOnBig
RecalcOptFiles SelectType%
ENDIF
CASE ELSE
GOSUB ASKQUIT
GOTO SELECTL1
END SELECT
RemoveSymbol "ListItems1a"
RemoveSymbol "ListItems1b"
RemoveSymbol "ListItems2a"
RemoveSymbol "ListItems2b"
RETURN
'' 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(DIR(DRAW), TR_CORELDRW_INI)
CreateIniKeyValue ini$, "CDrawConfig", "MaximizeCDraw", "1", cmoOverwrite
InitPrintTestFile
IF PrintTestFile( MakePath( DIR(DRAW), TR_SAMPLES+"\"+TR_SCREENS_CDR ), FALSE ) 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
RETURN
'$INCLUDE 'draw2.mst'