home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 11 / 11.iso / m / m420 / 12.ddi / SETUP2.MS_ / SETUP2.bin
Encoding:
Text File  |  1993-05-15  |  60.4 KB  |  1,682 lines

  1. '' $Keywords: setup2.mst 1.9 07May93 03:48am$ $nokeywords$
  2. '**************************************************************************
  3. '*                       CorelTools setup script
  4. '**************************************************************************
  5. ''    Date         Name                Reason
  6. ''-------------------------------------------------------------------------
  7. '' Feb 25 1992  Randall Mack    Modified from sample2.mst provided with
  8. ''                              Windows SDK 3.1 Beta.
  9. '' Feb 5    1993    Ibrahim Sallam    Modified for Draw 4.0
  10. '' Apr 24 1993    Ibrahim Sallam    Modified from Draw.mst Draw2.mst of Draw4
  11. '' May 1  1993    Ibrahim Sallam    Merging Net.mst with cdrom.mst in one file setup2.mst
  12.  
  13.  
  14. '$INCLUDE 'setupapi.inc'
  15.  
  16. ''C functions
  17. DECLARE SUB                InitializeInstall LIB "mscuistf.dll" (hInstance%, hMainWind% )
  18. DECLARE SUB                ShutDownInstall LIB "mscuistf.dll"
  19. DECLARE SUB                RegisterFont LIB "mscuistf.dll" (szFOTName$, szTTFName$) 
  20. DECLARE SUB                FileChangeString LIB "mscuistf.dll" (szFile1$, szFile2$, szString1$, szString2$)
  21. DECLARE SUB                FRecalcOptFiles LIB "mscuistf.dll" (iType%, szNeeds$)
  22. DECLARE FUNCTION    FIsDrawExist LIB "mscuistf.dll" (szFileName$, szDest$) AS INTEGER
  23. DECLARE FUNCTION    IsSectionKeyExist LIB "mscuistf.dll" (szSectionName$, szKeyName$) AS INTEGER
  24. DECLARE SUB             FAddFilesToList LIB "mscuistf.dll" (SectionName$, FiltersList$)
  25. DECLARE SUB             FAddFileToCopyList LIB "mscuistf.dll" (AppendSect$, Section$, FilterName$, SourceDir$, FiltersDir$) 
  26. DECLARE SUB                CommentIniSection LIB "mscuistf.dll" (szFileName$, szTempFile$, szSection$, szPath$ )
  27. DECLARE FUNCTION    GetFilenameFromPath LIB "mscuistf.dll" (szPath$) AS INTEGER
  28. DECLARE FUNCTION    IsTTFEnabled LIB "mscuistf.dll" AS INTEGER
  29. DECLARE SUB                InitScannerSelection LIB "mscuistf.dll" 
  30. DECLARE FUNCTION    FGetScannerLine LIB "mscuistf.dll" (szScannerDir$) AS INTEGER
  31. DECLARE SUB                CloseScannerSelection LIB "mscuistf.dll" 
  32. DECLARE SUB                FModifyFile LIB "mscuistf.dll" (szFileName$, szList$, szWhere$) 
  33. DECLARE FUNCTION    IsWinForWorkgroups LIB "mscuistf.dll" AS INTEGER
  34. DECLARE SUB       MakeFontSectList LIB "mscuistf.dll"
  35. DECLARE FUNCTION    VerifyNumber LIB "mscuistf.dll" (szSerialNumber$) AS INTEGER
  36.  
  37. '$INCLUDE 'setupvar.inc'
  38.  
  39. ''Strings for loading string resources
  40. GLOBAL szString$
  41. CONST     STRINGLEN =    128
  42. szString$ = string$( STRINGLEN+1, 32 )
  43.  
  44. ''setup main window
  45. CONST LOGO                            = 9100            ''must match the constant in dialogs.h
  46. SetTitle TR_TITLE
  47. SetBitmap "mscuistf.dll", LOGO
  48. InitializeInstall hinstFrame(), HwndFrame()        ''corel style buttons; max window
  49.  
  50. '$INCLUDE 'msdetect.inc'
  51.  
  52. '$DEFINE DEBUG  ''Define for script development/debugging
  53.  
  54. ''Dialog ID's
  55. ''Note: These constants MUST match the constants in dialogs.h
  56. CONST CDBASEDWELCOME    = 9941
  57. CONST NETWELCOME        = 9942
  58. CONST ASKQUIT                    = 9901
  59. CONST DESTPATH                   = 9902
  60. CONST ERROREXITFAILURE    = 9903
  61. CONST EXITQUIT                   = 9904
  62. CONST EXITSUCCESS                = 9905
  63. CONST TOOBIG                     = 9908
  64. CONST ERRORBADPATH           = 9909
  65. CONST SELECTFONTSYM            = 9917
  66. CONST SELECTFONTTT            = 9918
  67. CONST SELECTFONTTTCD        = 9821
  68. CONST WAIT                            = 9919
  69. CONST CDBASEDABOUT            = 9952
  70. CONST NETUSERABOUT            = 9951
  71. CONST ASKINSTALL                = 9922
  72. CONST WARNINGDESTPATH        = 9923
  73. ''CONST CUSTTTFONT                = 9924
  74. CONST BILLBOARD                    = 9926
  75. CONST UPDATEHELP             = 9929
  76. CONST UPDATEAUTOEXEC        = 9930
  77. CONST UPDATEAUTOEXECFORSHARE        = 9931
  78. CONST UPDATECONFIG            = 9934
  79. CONST WAITREGISTER            = 9932
  80. CONST SUCCESS                        = 9938
  81. CONST WAITCONFIGER            = 9939
  82. CONST WINREADONLY                = 9943
  83. CONST NETINSTWELCOME        = 9944
  84. CONST NETADDITEMFAILED    = 9949
  85. CONST NETADMINABOUT            = 9950
  86. CONST NETEXITSUCCESS      = 9948
  87. CONST WELCOMEHELP                = 9800
  88. CONST OPTIONSHELP                = 9801
  89. CONST DESTPATHHELP           = 9802
  90. CONST SELECTHELP            = 9806
  91. CONST ASKINSTALLHELP        = 9808
  92. CONST CUSTINSTHELP          = 9803
  93. CONST CUSTINSTCDBASED        = 9823
  94. CONST CUSTSCAN          = 9815
  95. CONST CUSTSCANHELP      = 9816
  96. CONST REGISTRATION      = 9817
  97. CONST REGISTRATIONBADNAME = 9818
  98. CONST REGISTRATIONBADSN = 9819
  99. CONST BILLBOARD1                = 9990
  100. CONST MOREFONTS         = 9824
  101.  
  102. ''Constants representing each line in the custinst dialog
  103. CONST DRAW          = 1
  104. CONST CHART         = 2
  105. CONST SHOW            = 3
  106. CONST PHOTO            = 4
  107. CONST MOVE            = 5
  108. CONST TRACE            = 6
  109. CONST MOSAIC        = 7
  110. CONST SCANNERS  = 8
  111. CONST FILTERS        = 9            ''Does not have custom dialog
  112. CONST FONTTT        = 10
  113. CONST NUMCUST      = FONTTT
  114. CONST MAIN            = NUMCUST + 1
  115. CONST NUMGROUPS    = MAIN
  116.  
  117. CONST FALSE    = 0
  118. CONST TRUE    = 1
  119.  
  120. '' used as values for afState(NUMCUST) array.
  121. CONST ALL        = 1
  122. CONST    SOME    = 2
  123. CONST    NONE    = 3
  124.  
  125. ''lists of reference keys for filters, fonts and symbols. 1 = install, 2 = don't
  126. GLOBAL FONTLIST1$
  127. FONTLIST1$        = "FontList1"
  128. GLOBAL FONTLIST2$
  129. FONTLIST2$        = "FontList2"
  130.  
  131. '' Scanners STUFF
  132. GLOBAL SCANNERLINE$
  133. SCANNERLINE$ = "ScannerLine"
  134. GLOBAL CONFIGLINE$
  135. CONFIGLINE$ = "ConfigLine"
  136. GLOBAL AUTOEXECLINE$
  137. AUTOEXECLINE$ = "AutoexecLine"
  138. GLOBAL SCANNERSECTION$
  139. SCANNERSECTION$ = "ScannerSection"
  140.  
  141.  
  142. ''information text for custom installation window
  143. GLOBAL STATUSTEXT$
  144. STATUSTEXT$  = "StatusItemsText"
  145. GLOBAL DRIVETEXT$
  146. DRIVETEXT$   = "DriveStatusText"
  147. GLOBAL DrivesList$            ''experemental variable for the drives list
  148. DrivesList$ = "DrivesList"
  149. GLOBAL TempList$                '' Used for Temp lists
  150. TempList$ = "TempList"
  151.  
  152. ''used as a parm to GetCopyListCost only
  153. GLOBAL EXTRACOSTS$
  154. EXTRACOSTS$ = "ExtraCosts"
  155. GLOBAL bTooBig%
  156. bTooBig% = FALSE
  157. GLOBAL bBadPath%
  158. bBadPath% = FALSE
  159. GLOBAL bBack%
  160. bBadPath% = FALSE
  161. GLOBAL bFullInstall%        '' TRUE ==> user went through Full Install Option
  162.  
  163. GLOBAL bAutoexecModified% '' TRUE ==> Config.sys has beed modified.
  164. bAutoexecModified% = FALSE
  165.  
  166. GLOBAL bDosScanner%    '' Did we install any Scanners? 
  167. bDosScanner% = FALSE
  168. GLOBAL bTwainScanner%    '' Did we install any Scanners? 
  169. bTwainScanner% = FALSE
  170.  
  171. GLOBAL bInstallWorkstation%            '' Are we installing a network Workstation?
  172.  
  173. ''list of sections (1..NUMGROUPS)
  174. GLOBAL afState(NUMCUST) AS INTEGER        ''list of selections for main options
  175. GLOBAL DIR(NUMGROUPS) AS STRING        ''list of directories for main options
  176. GLOBAL NUM(3) AS STRING                                ''string representations of 1 .. 3
  177. ''CustInst list of symbol names - each is a list of 26 numbers corresponding
  178. ''  to the space required on that numbered drive for the files in the
  179. ''  corresponding group
  180. GLOBAL aszNEEDS(NUMGROUPS) AS STRING
  181.  
  182. GLOBAL WINDIR$            ''Windows directory.
  183. GLOBAL WINSYSDIR$        ''Windows directory.
  184. GLOBAL WINDRIVE$        ''Windows drive letter.
  185. GLOBAL bWindowsIsNetworked%
  186. GLOBAL bWindowsForWorkgroups%
  187. GLOBAL DEST$            ''destination directory.
  188. GLOBAL SrcDir$      ''SrcDir of the CDROM or the Network files directory.
  189. GLOBAL szSymbolDir$        ''directory for Symbols 
  190. GLOBAL szDestScannersDir$''directory for scanner files
  191. GLOBAL szWWinDir$        ''Writable Windows directory
  192.  
  193. GLOBAL szFontSectDisk$
  194. szFontSectDisk$ = "FontSectDisk"
  195.  
  196. GLOBAL szUserName$            ''UserName for registration
  197. GLOBAL szSerialNumber$    ''SerialNumber for registration
  198.  
  199. GLOBAL TOOLGROUP$                    '' Group in which tools are to be installed
  200.  
  201. ''Windows version numbers
  202. GLOBAL WinMinor%
  203.  
  204. ''Variables to fake subroutines with parameters
  205. GLOBAL szFlist1a$
  206. GLOBAL szFlist1b$
  207. GLOBAL szFlist2a$
  208. GLOBAL szFlist2b$
  209. GLOBAL Dialog%
  210. GLOBAL SelectType%
  211. GLOBAL szOptions$
  212. GLOBAL bRecalcOpt%
  213.  
  214. ''TRUE => must do a global recalculation after GetPath - starts TRUE
  215. GLOBAL bRecalc%
  216.  
  217. ''Globals for WaitOn and WaitOff
  218. GLOBAL nWaiting%
  219. GLOBAL CursorSave%
  220.  
  221. ''local MSTest functions
  222. DECLARE SUB WaitOnBig
  223. DECLARE SUB WaitOn
  224. DECLARE SUB WaitOff
  225. DECLARE SUB SetDirectories
  226. DECLARE SUB PrepInstall
  227. DECLARE SUB AddOptFilesToCopyList( ftype% )
  228. DECLARE SUB RecalcOptFiles( fType% )
  229. DECLARE SUB RecalcPath
  230. DECLARE SUB SetDriveStatus
  231. ''''DECLARE SUB SetFontAndScannerDir
  232. DECLARE SUB    WrapFileChangeString( szFile1$, szFile2$, szString1$, szString2$ )
  233. DECLARE SUB    WrapCommentIniSection( szFileName$, szTempFile$, szSection$, szPath$ )
  234. DECLARE    SUB    CheckBackupFile( szFile1$, szFile2$ )
  235. DECLARE FUNCTION CreateProgmanItem (szGroup$, szItem$, szCmd$, szOther$, cmo%) AS INTEGER
  236. DECLARE FUNCTION MakePath( szDir$, szFile$ ) AS STRING
  237. DECLARE FUNCTION MakeDir( szDir$ ) AS STRING
  238. DECLARE SUB MakeFontList
  239. DECLARE SUB AddFilesToList (SectionName$, FiltersList$)
  240. DECLARE SUB AddFileToCopyList(AppendSect$, Section$, FilterName$) 
  241. DECLARE SUB TestAddSectionFilesToCopyList (szSection$,szFrom$,szTo$)
  242.  
  243.  
  244. INIT:
  245.     '' set waiting cursor
  246.     nWaiting% = 0
  247.     WaitOn
  248.     
  249.     ''Set default directory names
  250.     WINDIR$ = GetWindowsDir
  251.     WINSYSDIR$ = GetWindowsSysDir
  252.     WINDRIVE$ = MID$(WINDIR$, 1, 1)
  253.     bWindowsIsNetworked% = IsDriveNetwork( MID$(WINSYSDIR$,1,1) )
  254.     OpenLogfile MakePath(WINDIR$, TR_LOGFILE), 0
  255.     IF bWindowsIsNetworked% THEN
  256.         szWWinDir$ = WINDIR$            '' copy files to users personal directory
  257.         WriteToLogFile TR_NETWINDOWS
  258.     ELSE
  259.         szWWinDir$ = WINSYSDIR$        '' copy files to users Windows system directory
  260.     ENDIF
  261.     bWindowsForWorkgroups% = IsWinForWorkgroups
  262.     DEST$ = WINDRIVE$ + ":\"+TR_CORELDRW
  263.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  264. ''    DIR(MAIN) = MID$(SrcDir$,1,2)
  265.     SetDirectories
  266.     
  267.      IF bInstallWorkstation% THEN
  268.         WriteToLogFile TR_INSTALLNETUSER
  269.     ELSE
  270.         WriteToLogFile TR_INSTALLCDBASED
  271.     ENDIF
  272.         
  273.     ''find and read .inf file
  274.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  275.     IF szInf$ = "" THEN
  276.         szInf$ = MakePath( GetSymbolValue("STF_CWDDIR"), "setup2.inf" )
  277.     ENDIF
  278.     ReadInfFile szInf$
  279.     szInf$ = ""
  280.  
  281.     FOR i% = 1 TO MAIN
  282.          AddListItem STATUSTEXT$, ""
  283.     NEXT i%
  284.     ''We have 15 DRIVETEXT variables defined for 5 drives only
  285.     FOR i% = 1 TO 15
  286.         AddListItem DRIVETEXT$, ""
  287.     NEXT i%
  288.     
  289.     ''Disk cost list symbols
  290.     FOR i% = 1 TO NUMGROUPS STEP 1
  291.         aszNEEDS(i%)        = "DrawNeeds" + STR$(i%)
  292.     NEXT i%
  293.     
  294.     ''basic initialization
  295.     NUM(1) = "1"
  296.     NUM(2) = "2"
  297.     NUM(3) = "3"
  298.     ''Get Drives List
  299.     GetValidDrivesList(DrivesList$)
  300. '''' The Drives List will define the length of the EXTRACOSTS$
  301.     FOR i%=1 TO GetListLength(DrivesList$)
  302.         ''Disk cost list symbols
  303.         FOR j% = DRAW TO NUMGROUPS 
  304.             AddListItem aszNEEDS(j%), "0"
  305.         NEXT j%
  306.     NEXT i%
  307.     
  308.      WriteToLogFile "Before the Font Lists"
  309.       MakeFontSectList
  310.     WriteToLogFile "After the Font Lists"
  311.         
  312.     ''Set windows version - for use with installing windows 3.1 DLL's
  313.     '' 25Feb93: We wont install Draw4 on Win3.0.
  314.     '' 16Mar93: The following Check is not working YET.
  315. ''    WinMajor% = GetWindowsMajorVersion
  316. ''    WriteToLogFile "Windows Major Version is: " + STR$(WinMajor%)
  317.     WinMinor% = GetWindowsMinorVersion
  318. ''    WriteToLogFile "Windows Minor Version is: " + STR$(WinMinor%)
  319. ''    WriteToLogFile "Windows For Workgroups Installed Checking Return value: "+STR$(bWindowsForWorkgroups%)
  320.     
  321.     ''set the default progman group to put everything in
  322.     TOOLGROUP$    = TR_TOOLGROUP
  323.     
  324. '' Put up the Welcome dialog
  325. WELCOME:
  326.     '$IFDEF DEBUG
  327.         WriteToLogFile "WELCOME:"
  328.     '$ENDIF
  329.     WaitOff
  330.     IF bInstallWorkstation% THEN
  331.         Dialog% = NETWELCOME
  332.     ELSE
  333.         Dialog% = CDBASEDWELCOME
  334.     ENDIF
  335.     sz$ = UIStartDlg( "mscuistf.dll", Dialog%, "FInfoDlgProc", WELCOMEHELP, "FHelpDlgProc" )
  336.     SELECT CASE sz$
  337.     CASE "CONTINUE"
  338.         UIPop 1
  339.     CASE "ABOUT"
  340.         IF bInstallWorkstation% THEN
  341.             Dialog% = NETUSERABOUT
  342.         ELSE
  343.             Dialog% = CDBASEDABOUT
  344.         ENDIF
  345.         GOSUB INFO
  346.         GOTO WELCOME
  347.     CASE "REACTIVATE"
  348.         GOTO WELCOME
  349.     CASE ELSE
  350.         GOSUB ASKQUIT
  351.         GOTO WELCOME
  352.     END SELECT
  353.  
  354. IF bInstallWorkstation% = FALSE THEN
  355. ''Before we give him OPTIONs let's get the user name and his serial number.
  356. REGISTER:
  357.         '$IFDEF DEBUG
  358.             WriteToLogFile "REGISTER:"
  359.         '$ENDIF
  360.     AddListItem "EditText", ""
  361.     AddListItem "EditText", ""
  362. REGISTER1:
  363.     sz$ = UIStartDlg("mscuistf.dll", REGISTRATION, "FMultiEditDlgProc", 0, "")
  364.     SELECT CASE sz$
  365.     CASE "CONTINUE"
  366.         WaitOn
  367.         szUserName$ = RTRIM$(LTRIM$(GetListItem("EditText", 1)))
  368.         szSerialNumber$ = RTRIM$(LTRIM$(GetListItem("EditText", 2)))
  369.         IF szUserName$ = "" THEN
  370.             Dialog% = REGISTRATIONBADNAME
  371.             GOSUB INFO
  372.             GOTO REGISTER1
  373.         ENDIF
  374.         IF VerifyNumber(szSerialNumber$) = FALSE THEN
  375.             Dialog% = REGISTRATIONBADSN
  376.             GOSUB INFO
  377.             GOTO REGISTER1
  378.         ENDIF
  379.             
  380.     CASE "REACTIVATE"
  381.         GOTO REGISTER1
  382.     CASE ELSE
  383.         GOSUB ASKQUIT
  384.         GOTO REGISTER1
  385.     END SELECT
  386.     UIPop 1
  387. RemoveSymbol "EditText"
  388.  
  389. ENDIF ''bInstallWorkstation%
  390.  
  391. '' fall through from WELCOME
  392. '' Allow the user to select between full, minimal and custom installation
  393. '' OOPS, we removed minimum, so it's only FULL or CUSTOM.
  394. BEFOREINSTALL:
  395.     PrepInstall
  396.     GOSUB GETPATH
  397.     IF bBack% THEN
  398.         GOTO WELCOME
  399.     ENDIF
  400.     IF DoesDirExist(DIR(FONTTT)) OR DoesDirExist(DIR(SCANNERS)) THEN
  401.         GOSUB CUSTINST
  402.         IF bBack% THEN
  403.             GOTO BEFOREINSTALL
  404.         ENDIF
  405.     ENDIF
  406.  
  407. '' Install the neccessaty files, and the selected fonts and scanners.
  408. INSTALL:
  409.     '$IFDEF DEBUG
  410.         WriteToLogFile "INSTALL:"
  411.     '$ENDIF
  412.     WaitOn
  413.     ''Make sure there is enough space for CorelDRAW!
  414.         WaitOnBig
  415.         bRecalc% = FALSE
  416.         RecalcPath 
  417.         SetDriveStatus
  418.     IF bTooBig% THEN
  419.         Dialog% = TOOBIG
  420.         GOSUB INFO
  421.         ERROR STFQUIT
  422.     ENDIF
  423.     
  424.     ClearCopyList
  425.     ''Create all directories needed and assign all the files to copy
  426.     FOR i% = 1 TO NUMGROUPS STEP 1
  427.             AddOptFilesToCopyList i%
  428.     NEXT i%
  429.     
  430.         '' backup files to *.cor - do not overwrite
  431.         CheckBackupFile MakePath(WINDIR$,"win.ini"), MakePath(WINDIR$,"win.cor")
  432.         CheckBackupFile MakePath(WINDIR$,"reg.dat"), MakePath(WINDIR$,"reg.cor")
  433.         CheckBackupFile MakePath(WINDIR$,"progman.ini"), MakePath(WINDIR$,"progman.cor")
  434.     
  435.         IF DoesFileExist( MakePath(DIR(MAIN),TR_PROGRAMS+"\"+ TR_CORELDRW_EXE), femExists ) THEN 
  436.             CreateDir MakePath(DEST$,TR_DRAW), cmoNone
  437.             CreateDir MakePath( DEST$, TR_DRAW+"\"+TR_AUTOBACK ), cmoNone
  438.             CreateDir MakePath( DEST$, TR_DRAW+"\"+TR_TEMPLATE ), cmoNone
  439.         ENDIF
  440.         IF DoesFileExist( MakePath(DIR(MAIN),TR_PROGRAMS+"\"+ TR_CORELCHT_EXE), femExists ) THEN 
  441.             CreateDir MakePath(DEST$,TR_CHART), cmoNone
  442.         ENDIF
  443.         IF DoesFileExist( MakePath(DIR(MAIN),TR_PROGRAMS+"\"+ TR_CORELSHW_EXE), femExists ) THEN 
  444.             CreateDir MakePath(DEST$,TR_SHOW), cmoNone
  445.         ENDIF
  446.         IF DoesFileExist( MakePath(DIR(MAIN),TR_PROGRAMS+"\"+ TR_CORELPNT_EXE), femExists ) THEN 
  447.             CreateDir MakePath(DEST$,TR_PHOTOPNT), cmoNone
  448.         ENDIF
  449.         IF DoesFileExist( MakePath(DIR(MAIN),TR_PROGRAMS+"\"+ TR_CORELMOV_EXE), femExists ) THEN 
  450.             CreateDir MakePath(DEST$,TR_MOVE), cmoNone
  451.         ENDIF
  452.     
  453.      '' If installing as a network administrator, copy redists to redist dir
  454.     
  455.      '' Add billboards
  456.     BilBrd% = BILLBOARD1 
  457.     FOR i% = 0 TO 5 STEP 1
  458.         AddToBillBoardList "mscuistf.dll", BilBrd+i%, "FModelessBillBoardDlgProc", 20
  459.     NEXT i%
  460.     
  461.     ''Copy all the files over
  462.     WaitOff
  463.         CopyFilesInCopyList
  464.     WaitOn
  465.         
  466.     '' if installing as a network administrator don't create .fot files
  467.         '' Register all the ttf fonts with Windows
  468.         IF IsTTFEnabled = 1 AND DoesDirExist(DIR(FONTTT)) THEN
  469.             WriteToLogFile "**** TTFEnabled ****"
  470.                 sz$ = UIStartDlg("mscuistf.dll", WAITREGISTER, "FModelessDlgProc", 0, "")
  471.             '' Let's register the Symbols TTF,... FONTLIST1$ is an empty Symbole varaible
  472.                 IF szSymbolDir <> "" THEN
  473.                     MakeListFromSectionKeys TempList$, "WFN"
  474.                     FOR i% = 1 TO GetListLength(TempList$)
  475.                         szFileName$ = GetSectionKeyFilename( "WFN", GetListItem(TempList$, i%))
  476.                         IF DoesFileExist( MakePath(szSymbolDir$, szFileName$),  femExists) THEN
  477. ''                        WriteToLogFile "In Symbols: FileName: " + szFileName2$
  478. ''                        WriteToLogFile "This is the Extension:"+ MID$(szFileName$, LEN(szFileName$)-3) 
  479.                             IF MID$(szFileName$, LEN(szFileName$)-2) = "ttf" THEN
  480.                                 index% = GetFilenameFromPath( szFileName$ )
  481.                                 szFileName2$ = MID$( szFileName$, index%, LEN(szFileName$) - index% + 1 )
  482. ''                            WriteToLogFile "This is a TTF file let's register " 
  483.                                 szFOTName$ = MID$(szFileName2$,1,LEN(szFileName2$)-3) + "fot"
  484. ''                            WriteToLogFile "This is the filename:"+ MID$(szFileName$, 1, LEN(szFileName$)-3) 
  485.                                 RegisterFont MakePath(szWWinDir$,szFOTName$), MakePath(szSymbolDir$, szFileName$)
  486.                                 temp% = GetTypeFaceNameFromTTF( MakePath(szSymbolDir$, szFileName$), szString$, STRINGLEN )
  487.                                 IF temp% > 0 AND temp% < STRINGLEN THEN
  488.                                     CreateIniKeyValue TR_WIN_INI, "fonts", szString$+" "+TR_TRUETYPE, UCASE$(szFOTName$), cmoOverWrite
  489.                                 ENDIF
  490.                             ENDIF
  491.                         ENDIF
  492.                     NEXT i%
  493.                 ENDIF
  494.                     
  495.             ''Lets register Avante Garde Book first, it's always been installed.
  496.             MakeListFromSectionKeys TempList$, "DrawFonts"
  497.             FOR i% = 1 TO GetListLength(TempList$)
  498.                 szFileName$ = GetSectionKeyFileName("DrawFonts", GetListItem(TempList$, i%))
  499.                 index% = GetFilenameFromPath( szFileName$ )
  500.                 szFileName2$ = MID$( szFileName$, index%, LEN(szFileName$) - index% + 1 )
  501.                 IF bInstallWorkstation% THEN
  502.                     szFontFile$ = szFileName2$
  503.                 ELSE
  504.                     szFontFile$ = szFileName$
  505.                 ENDIF
  506.                 IF DoesFileExist( MakePath(DIR(FONTTT), szFontFile$),  femExists) THEN
  507.                     szFOTName$ = MID$(szFileName2$,1,LEN(szFileName2$)-3) + "fot"
  508.                     RegisterFont MakePath(szWWinDir$,szFOTName$), MakePath(DIR(FONTTT),szFontFile$)
  509.                         temp% = GetTypeFaceNameFromTTF( MakePath(DIR(FONTTT),szFontFile$), szString$, STRINGLEN )
  510.                         IF temp% > 0 AND temp% < STRINGLEN THEN
  511.                             CreateIniKeyValue TR_WIN_INI, "fonts", szString$+" "+TR_TRUETYPE, UCASE$(szFOTName$), cmoOverWrite
  512.                         ENDIF
  513.                 ENDIF
  514.             NEXT i%
  515.             
  516.             IF afState(FONTTT) <> NONE THEN
  517.                 WriteToLogFile "afState(FONTTT) <> NONE"
  518.                 IF afState(FONTTT) = ALL THEN
  519.                     MakeFontList                    
  520.                 ENDIF
  521.                 FOR nIndex% = 1 TO GetListLength(FONTLIST2$)
  522.                     FOR i% = 1 TO GetListLength(szFontSectDisk$)
  523.                         IF IsSectionKeyExist( GetListItem(szFontSectDisk$, i%), GetListItem(FONTLIST2$, nIndex%)) THEN
  524.                             szFileName$ = GetSectionKeyFilename( GetListItem(szFontSectDisk$, i%), GetListItem(FONTLIST2$, nIndex%))
  525.                             EXIT FOR
  526.                         ENDIF
  527.                     NEXT i%                            
  528.                     index% = GetFilenameFromPath( szFileName$ )
  529.                     szFileName2$ = MID$( szFileName$, index%, LEN(szFileName$) - index% + 1 )
  530.                     IF bInstallWorkstation% THEN
  531.                         szFontFile$ = szFileName2$
  532.                     ELSE
  533.                         szFontFile$ = szFileName$
  534.                     ENDIF
  535.                     IF DoesFileExist( MakePath(DIR(FONTTT), szFontFile$),  femExists) THEN
  536.                         szFOTName$ = MID$(szFileName2$,1,LEN(szFileName2$)-3) + "fot"
  537.                         RegisterFont MakePath(szWWinDir$,szFOTName$), MakePath(DIR(FONTTT),szFontFile$)
  538.                         temp% = GetTypeFaceNameFromTTF( MakePath(DIR(FONTTT),szFontFile$), szString$, STRINGLEN )
  539.                         IF temp% > 0 AND temp% < STRINGLEN THEN
  540.                             CreateIniKeyValue TR_WIN_INI, "fonts", szString$+" "+TR_TRUETYPE, UCASE$(szFOTName$), cmoOverWrite
  541.                         ENDIF
  542.                     ENDIF
  543.                     szString$ = string$( STRINGLEN+1, 32 )
  544.                     szFileName$ = ""
  545.                     szFileName2$ = ""
  546.                     szFOTName$ = ""
  547.                 NEXT nIndex%
  548.                 UIPop 1
  549.             ENDIF
  550.         ENDIF
  551.     
  552.     '' When installing as a network administrator, register nothing
  553.     
  554.         sz$ = UIStartDlg("mscuistf.dll", WAITCONFIGER, "FModelessDlgProc", 0, "")
  555.         
  556.          nAddItemFailed% = 0
  557.         
  558.         '' Updating the INI files in the Config directory    only if an APP installed.
  559.         IF DoesDirExist( MakePath(DEST$, TR_CONFIG) ) THEN
  560.             CreateIniKeyValue TR_WIN_INI, "CorelGraphics4", "Dir", MakePath(DEST$,TR_CONFIG), cmoOverWrite
  561.         ENDIF
  562.         IF bWindowsIsNetworked% = TRUE AND DoesFileExist( MakePath(WINSYSDIR$,"ole2.dll"), femExists ) = 1 THEN 
  563.             RUN( TR_REGLOAD_S + " " + MakePath(WINSYSDIR$, "OLE2.REG") )
  564.         ELSE
  565.             RUN( TR_REGLOAD_S + " " + MakePath(szWWinDir$, "OLE2.REG") )
  566.         ENDIF
  567.         IF DoesFileExist( MakePath(DEST$, TR_CONFIG+"\"+TR_CORELAPP_INI), femExists) THEN
  568.             ini$ = MakePath( DEST$, TR_CONFIG+"\"+TR_CORELAPP_INI)
  569.                 CreateIniKeyValue ini$, "Config", "ProgramsDir", MakePath(DIR(MAIN),TR_PROGRAMS), cmoOverWrite
  570.                 CreateIniKeyValue ini$, "Config", "DataDir", MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_DATA), cmoOverWrite
  571.                 CreateIniKeyValue ini$, "Config", "CustomDir", MakePath(DEST$,TR_CUSTOM), cmoOverWrite
  572.                 CreateIniKeyValue ini$, "Config", "DrawDir", MakePath(DEST$,TR_DRAW), cmoOverWrite
  573.                 CreateIniKeyValue ini$, "Config", "ChartDir", MakePath(DEST$, TR_CHART), cmoOverWrite
  574.                 CreateIniKeyValue ini$, "Config", "ShowDir", MakePath(DEST$, TR_SHOW), cmoOverWrite
  575.                 CreateIniKeyValue ini$, "Config", "PhotoPaintDir", MakePath(DEST$, TR_PHOTOPNT), cmoOverWrite
  576.                 CreateIniKeyValue ini$, "Config", "MoveDir", MakePath(DEST$, TR_MOVE), cmoOverWrite
  577.                 CreateIniKeyValue ini$, "Config", "TraceDir", MakePath(DEST$, TR_TRACE), cmoOverWrite
  578.                 CreateIniKeyValue ini$, "Config", "MosaicDir", MakePath(DIR(MAIN),TR_PROGRAMS), cmoOverWrite
  579.                 CreateIniKeyValue ini$, "Config", "FontsDir", MakePath(DIR(MAIN),TR_FONTS+"\"+TR_WFN), cmoOverWrite
  580.                 CreateIniKeyValue ini$, "Config", "FiltersDir", MakePath(DIR(MAIN),TR_PROGRAMS), cmoOverWrite
  581.                 CreateIniKeyValue ini$, "Registration", "UserName", szUserName$, cmoOverWrite
  582.                 CreateIniKeyValue ini$, "Registration", "SerialNumber", szSerialNumber$, cmoOverWrite
  583.             ini$ = MakePath( DEST$, TR_CONFIG+"\"+TR_CORELPRN_INI)
  584.                 CreateIniKeyValue ini$, "ColorPath", "CircuitPath", MakePath(DEST$,TR_CUSTOM), cmoOverwrite
  585.             ini$ = MakePath( DEST$, TR_CONFIG+"\"+TR_CORELFLT_INI)
  586.                 CreateIniKeyValue ini$, "ColorPath", "CircuitPath", MakePath(DEST$,TR_CUSTOM), cmoOverWrite
  587.                 CreateIniKeyValue ini$, "ColorPath", "CurvePath", MakePath(DEST$,TR_CUSTOM), cmoOverWrite
  588.                 WrapCommentIniSection ini$, MakePath(DEST$,"___temp_"), "ImportFilters", MakePath(DIR(MAIN),TR_PROGRAMS+"\")
  589.                 WrapCommentIniSection ini$, MakePath(DEST$,"___temp_"), "ExportFilters", MakePath(DIR(MAIN),TR_PROGRAMS+"\")
  590.                 WrapCommentIniSection ini$, MakePath(DEST$,"___temp_"), "CorelAIExport", MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_DATA+"\")
  591.                 WrapCommentIniSection ini$, MakePath(DEST$,"___temp_"), "CorelDXFExport", MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_DATA+"\")
  592.             ini$ = MakePath( DEST$, TR_CONFIG+"\"+TR_CORELFNT_INI)
  593.                 WrapCommentIniSection ini$, MakePath(DEST$,"___temp_"), "Fonts", MakePath(DIR(MAIN),TR_FONTS+"\"+TR_WFN+"\")
  594.                 WrapCommentIniSection ini$, MakePath(DEST$,"___temp_"), "Symbols", MakePath(DIR(MAIN),TR_FONTS+"\"+TR_WFN+"\")
  595.                 CreateProgmanGroup TOOLGROUP$, "", cmoNone
  596.                 ShowProgmanGroup  TOOLGROUP$, 1, cmoNone
  597.                 nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( TOOLGROUP$, TR_RELEASENOTES, TR_WRITE_EXE + " " + MakePath(DIR(MAIN),TR_README_WRI), "", cmoOverwrite)
  598.         ENDIF ''DoesFileExist    CORELAPP_INI
  599.         
  600.                 '' setup coreldrw.reg
  601.         IF DoesFileExist( MakePath(DEST$, TR_CONFIG+"\"+TR_CORELDRW_REG), femExists) THEN
  602.                 WrapFileChangeString MakePath(DEST$,TR_CONFIG+"\"+TR_CORELDRW_REG), MakePath(DEST$,"___temp_"), TR_CORELDRW_EXE, MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_CORELDRW_EXE)
  603.                 WrapFileChangeString MakePath(DEST$,TR_CONFIG+"\"+TR_CORELDRW_REG), MakePath(DEST$,"___temp_"), TR_CDROL140_DLL, MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_CDROL140_DLL)
  604.                 RUN( TR_REGLOAD_S + " " + MakePath(DEST$,TR_CONFIG+"\"+TR_CORELDRW_REG) )
  605.         ENDIF
  606.         IF DoesFileExist( MakePath(DEST$, TR_CONFIG+"\"+TR_CORELDRW_INI), femExists)  THEN
  607.                 ini$ = MakePath(DEST$, TR_CONFIG+"\"+TR_CORELDRW_INI)
  608.                     CreateIniKeyValue ini$, "Config", "AutoBackupDir", MakePath(DEST$,TR_DRAW+"\"+TR_AUTOBACK), cmoOverwrite
  609.                     CreateIniKeyValue ini$, "Config", "TemplateDir", MakePath(DEST$,TR_DRAW+"\"+TR_TEMPLATE), cmoOverwrite
  610.                 nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( TOOLGROUP$, TR_CORELDRAW, MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_CORELDRW_EXE),"", cmoOverwrite)
  611.         ENDIF
  612.  
  613.                 '' setup corelcht.reg
  614.         IF DoesFileExist( MakePath(DEST$, TR_CONFIG+"\"+TR_CORELCHT_REG), femExists) THEN
  615.                 WrapFileChangeString MakePath(DEST$,TR_CONFIG+"\"+TR_CORELCHT_REG), MakePath(DEST$,"___temp_"), TR_CORELCHT_EXE, MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_CORELCHT_EXE)
  616.                 WrapFileChangeString MakePath(DEST$,TR_CONFIG+"\"+TR_CORELCHT_REG), MakePath(DEST$,"___temp_"), TR_CDROL140_DLL, MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_CDROL140_DLL)
  617.                 RUN( TR_REGLOAD_S + " " + MakePath(DEST$,TR_CONFIG+"\"+TR_CORELCHT_REG) )
  618.         ENDIF
  619.         IF DoesFileExist( MakePath(DEST$, TR_CONFIG+"\"+TR_CORELCHT_INI), femExists) THEN
  620.                 ini$ = MakePath(DEST$, TR_CONFIG+"\"+"CORELCHT.INI")
  621.                     CreateIniKeyValue ini$, "Config", "Vector_path", MakePath(DIR(MAIN),TR_CLIPART+"\"+TR_VECTORS), cmoOverwrite
  622.                     CreateIniKeyValue ini$, "Templates", "1", CHR$(34)+"Bar"+CHR$(34)+","+MakePath(DIR(CHART),TR_BAR), cmoOverwrite
  623.                     CreateIniKeyValue ini$, "Templates", "2", CHR$(34)+"Line"+CHR$(34)+","+MakePath(DIR(CHART),TR_LINE), cmoOverwrite
  624.                     CreateIniKeyValue ini$, "Templates", "3", CHR$(34)+"Area"+CHR$(34)+","+MakePath(DIR(CHART),TR_AREA), cmoOverwrite
  625.                     CreateIniKeyValue ini$, "Templates", "4", CHR$(34)+"Pie"+CHR$(34)+","+MakePath(DIR(CHART),TR_PIE), cmoOverwrite
  626.                     CreateIniKeyValue ini$, "Templates", "5", CHR$(34)+"Scatter"+CHR$(34)+","+MakePath(DIR(CHART),TR_SCATTER), cmoOverwrite
  627.                     CreateIniKeyValue ini$, "Templates", "6", CHR$(34)+"High/Low/Open/Close"+CHR$(34)+","+MakePath(DIR(CHART),TR_HILO), cmoOverwrite
  628.                     CreateIniKeyValue ini$, "Templates", "7", CHR$(34)+"Spectral_Maps"+CHR$(34)+","+MakePath(DIR(CHART),TR_SPECTRAL), cmoOverwrite
  629.                     CreateIniKeyValue ini$, "Templates", "8", CHR$(34)+"Histograms"+CHR$(34)+","+MakePath(DIR(CHART),TR_HIST), cmoOverwrite
  630.                     CreateIniKeyValue ini$, "Templates", "9", CHR$(34)+"Table_Charts"+CHR$(34)+","+MakePath(DIR(CHART),TR_TABLE), cmoOverwrite
  631.                     CreateIniKeyValue ini$, "Templates", "10", CHR$(34)+"3D-Riser"+CHR$(34)+","+MakePath(DIR(CHART),TR_3DRISER), cmoOverwrite
  632.                     CreateIniKeyValue ini$, "Templates", "11", CHR$(34)+"3D-Scatter"+CHR$(34)+","+MakePath(DIR(CHART),TR_3DSCAT), cmoOverwrite
  633.                     CreateIniKeyValue ini$, "Templates", "12", CHR$(34)+"Pictographs"+CHR$(34)+","+MakePath(DIR(CHART),TR_PICTO), cmoOverwrite
  634.                 nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( TOOLGROUP$, TR_CORELCHART, MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_CORELCHT_EXE), "", cmoOverwrite)
  635.         ENDIF '' DoesFileExist CORELCHT_INI
  636.  
  637.                 '' setup corelshw.reg
  638.         IF DoesFileExist( MakePath(DEST$, TR_CONFIG+"\"+TR_CORELSHW_REG), femExists) THEN
  639.                 WrapFileChangeString MakePath(DEST$,TR_CONFIG+"\"+TR_CORELSHW_REG), MakePath(DEST$,"___temp_"),TR_CORELSHW_EXE, MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_CORELSHW_EXE)
  640.                 RUN( TR_REGLOAD_S + " " + MakePath(DEST$,TR_CONFIG+"\"+TR_CORELSHW_REG) )
  641.         ENDIF
  642.         IF DoesFileExist( MakePath(DEST$, TR_CONFIG+"\"+TR_CORELSHW_INI), femExists) THEN
  643.                 ini$ = MakePath(DEST$, TR_CONFIG+"\"+TR_CORELSHW_INI)
  644.                     CreateIniKeyValue ini$, "HomeDirectories", "Presentations", MakePath(DIR(SHOW), TR_SAMPLES), cmoOverwrite
  645.                     CreateIniKeyValue ini$, "HomeDirectories", "Animations", MakePath(DIR(SHOW),TR_SAMPLES), cmoOverwrite
  646.                 nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( TOOLGROUP$, TR_CORELSHOW, MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_CORELSHW_EXE), "", cmoOverwrite)
  647.                 CreateIniKeyValue TR_WIN_INI, "AAPLAY Animation", "WaveAudio", "c,522", cmoOverWrite
  648.                 CreateIniKeyValue TR_WIN_INI, "AAPLAY Animation", "Sequencer", "x,523", cmoOverWrite
  649.                 CreateIniKeyValue TR_WIN_INI, "AAPLAY Animation", "FullScreen", "AAVGA.DLL", cmoOverWrite
  650.                 CreateIniKeyValue TR_WIN_INI, "AAPLAY Animation", "DualScreen", "no", cmoOverWrite
  651.         ENDIF ''DoesFileExist CORELSHW_INI
  652.  
  653.                 '' Register photo with OLE
  654.         IF DoesFileExist( MakePath(DEST$, TR_CONFIG+"\"+TR_CORELPNT_REG), femExists) THEN
  655.                 WrapFileChangeString MakePath(DEST$,TR_CONFIG+"\"+TR_CORELPNT_REG), MakePath(DEST$,"___temp_"),TR_CORELPNT_EXE, MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_CORELPNT_EXE)
  656.                 WrapFileChangeString MakePath(DEST$,TR_CONFIG+"\"+TR_CORELPNT_REG), MakePath(DEST$,"___temp_"),TR_PNTHNDLR_DLL, MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_PNTHNDLR_DLL)
  657.                 RUN( TR_REGLOAD_S + " " + MakePath(DEST$,TR_CONFIG+"\"+TR_CORELPNT_REG) )
  658.         ENDIF
  659.         IF DoesFileExist( MakePath(DEST$, TR_CONFIG+"\"+TR_CORELPNT_INI), femExists) THEN
  660.                 ini$ = MakePath(DEST$,TR_CONFIG+"\"+TR_CORELPNT_INI)
  661.                     CreateIniKeyValue ini$, "CorelPaintDll", "PCX 16 Color/Gray", MakePath(DIR(MAIN),TR_PROGRAMS+"\"+"pcx16.dll,*.pcx"), cmoOverWrite
  662.                     CreateIniKeyValue ini$, "ARTIST", "Path", MakePath(DIR(PHOTO),TR_BRUSHES+"\"), cmoOverWrite
  663.                     CreateIniKeyValue ini$, "COLORSELECT", "Brush", MakePath(DIR(PHOTO),TR_BRUSHES+"\"+TR_PNTBRUSH_BMP), cmoOverWrite
  664.                     CreateIniKeyValue ini$, "COLORSELECT", "Area", MakePath(DEST$,TR_PHOTOPNT+"\"+TR_COLORS+"\"+TR_DEFAULT_CLR), cmoOverWrite
  665.                     CreateIniKeyValue ini$, "CANVAS", "Canvas", MakePath(DIR(PHOTO),TR_CANVAS+"\"+TR_CANVAS_PCX), cmoOverWrite
  666.                     CreateIniKeyValue ini$, "ColorPath", "CircuitPath", MakePath(DEST$,TR_CUSTOM), cmoOverWrite
  667.                     CreateIniKeyValue ini$, "ColorPath", "CurvePath", MakePath(DEST$,TR_CUSTOM), cmoOverWrite
  668.                     CreateIniKeyValue ini$, "ColorPath", "TargetPath", MakePath(DEST$,TR_CUSTOM), cmoOverWrite
  669.                     CreateIniKeyValue ini$, "FILL", "Fill", MakePath(DIR(PHOTO),TR_TILES+"\"+"SAND.PCX"), cmoOverWrite
  670.                 nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( TOOLGROUP$, TR_CORELPHOTO, MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_CORELPNT_EXE), "", cmoOverwrite)
  671.                 nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( TOOLGROUP$, TR_CCAPTURE, MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_CCAPTURE_EXE), "", cmoOverwrite)
  672.         ENDIF  '' DoesFileExist CORELPNT_INI
  673.         
  674.                 '' Register move with OLE
  675.         IF DoesFileExist( MakePath(DEST$, TR_CONFIG+"\"+TR_CORELMOV_INI), femExists) THEN
  676.                 ini$ = MakePath(DEST$,TR_CONFIG+"\"+TR_CORELMOV_INI)
  677.                     CreateIniKeyValue ini$, "Config", "FilterDir", MakePath(DIR(MAIN),TR_PROGRAMS), cmoOverWrite
  678.                 '' Make the changes for media player installation    
  679.                 ini$ = MakePath(WINDIR$, "system.ini")
  680.                     CopyFile MakePath(WINDIR$, "system.ini"), MakePath(WINDIR$, "system.cor"), cmoOverwrite, 0
  681.                     CreateIniKeyValue ini$, "mci", "CorelMOVE", MakePath(DIR(MAIN),TR_PROGRAMS+"\"+"mcicmv40.drv"), cmoOverWrite
  682.                     CreateIniKeyValue TR_WIN_INI, "mci extensions", "cmv", "CorelMOVE", cmoOverWrite
  683.                     CreateIniKeyValue TR_WIN_INI, "mci extensions", "mwf", "CorelMOVE", cmoOverWrite
  684.                 ini$ = MakePath(WINDIR$, "MPLAYER.INI")
  685.                     CopyFile MakePath(WINDIR$, "mplayer.ini"), MakePath(WINDIR$, "mplayer.cor"), cmoOverwrite, 0
  686.                     CreateIniKeyValue ini$, "Devices", "CorelMOVE", "350, CorelMove Player", cmoOverWrite
  687.                 nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( TOOLGROUP$, TR_CORELMOVE, MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_CORELMOV_EXE), "", cmoOverwrite)
  688.         ENDIF ''DoesFileExist CORELMOV_INI
  689.  
  690.         IF DoesFileExist( MakePath(DIR(MAIN), TR_PROGRAMS+"\"+TR_CORELTRC_EXE), femExists) THEN
  691.             nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( TOOLGROUP$, TR_CORELTRACE, MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_CORELTRC_EXE), "", cmoOverwrite)
  692.         ENDIF
  693.         
  694.         IF DoesFileExist( MakePath(DIR(MAIN), TR_PROGRAMS+"\"+TR_CORELMOS_EXE), femExists) THEN
  695.             nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( TOOLGROUP$, TR_CORELMOSAIC, MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_CORELMOS_EXE), "", cmoOverwrite)
  696.         ENDIF
  697.         
  698.         UIPop 1 ''WAITCONFIGER Dialog
  699.         
  700.         IF nAddItemFailed% > 0 THEN
  701.             Dialog% = NETADDITEMFAILED
  702.             GOSUB INFO
  703.         ENDIF
  704.         
  705.         ''Let's get the bootable drive, by looking at COMSPEC enviro variable
  706.         TempStr$ = GetEnvVariableValue("COMSPEC")
  707.         ''Assume that config.sys & autoexec.bat are in the same drive as command.com
  708.         Drive$ = MID$ (TempStr$, 1, 1)
  709.         '' If Scanners installed we need to add the lines to config.sys & autoexec.bat
  710.         IF afState(SCANNERS) = SOME THEN
  711.             '$IFDEF DEBUG
  712.                 WriteToLogFile "Drive of Command.com is: " + Drive$
  713.             '$ENDIF
  714.             IF DoesFileExist( MakePath(WINDIR$, TR_TWAIN+"\"+TR_COREL+"\"+"CORTWAIN.INI"), femExists) THEN
  715.                 ini$ = MakePath(WINDIR$,TR_TWAIN+"\"+TR_COREL+"\"+"CORTWAIN.INI")
  716.                 IF bDosScanner% AND GetListLength(AUTOEXECLINE$) THEN
  717.                     CopyFile Drive$+":\"+TR_AUTOEXEC_BAT, Drive$+":\"+TR_AUTOEXEC_COR, cmoOverwrite, 0
  718.                     bAutoexecModified% = TRUE
  719. UPDATEAUTO:
  720.                 WaitOff
  721.                  sz$ = UIStartDlg( "mscuistf.dll", UPDATEAUTOEXEC, "FButtonsDlgProc", UPDATEHELP, "FHelpDlgProc" )
  722.             SELECT CASE sz$
  723.                 CASE "U"
  724.                         UIPop(1)
  725.                         FModifyFile Drive$+":\"+TR_AUTOEXEC_BAT, AUTOEXECLINE$, "E"
  726.                         '$IFDEF DEBUG
  727.                             FOR i% =1 TO GetListLength(AUTOEXECLINE$)
  728.                                 WriteToLogFile "the Autoexec is: "+GetListItem(AUTOEXECLINE$, i%)
  729.                             NEXT i%
  730.                         '$ENDIF
  731.                     CASE "D"
  732.                         UIPop(1)
  733.                         FModifyFile Drive$+":\"+TR_AUTOEXEC_COR, AUTOEXECLINE$, "E"
  734.                     CASE ELSE
  735.                         GOTO UPDATEAUTO
  736.                 END SELECT
  737.                 ENDIF
  738.         
  739.                 IF bDosScanner% AND GetListLength(CONFIGLINE$) THEN
  740.                     CopyFile Drive$+":\"+TR_CONFIG_SYS, Drive$+":\"+TR_CONFIG_COR, cmoOverwrite, 0
  741. UPDATECONFIG:
  742.                     WaitOff
  743.                      sz$ = UIStartDlg( "mscuistf.dll", UPDATECONFIG, "FButtonsDlgProc", UPDATEHELP, "FHelpDlgProc" )
  744.                 SELECT CASE sz$
  745.                     CASE "U"
  746.                             UIPop(1)
  747.                             FModifyFile Drive$+":\"+TR_CONFIG_SYS, CONFIGLINE$, "B"
  748.                             '$IFDEF DEBUG
  749.                                 FOR i% =1 TO GetListLength(CONFIGLINE$)
  750.                                     WriteToLogFile "the Config is: "+GetListItem(CONFIGLINE$, i%)
  751.                                 NEXT i%
  752.                             '$ENDIF
  753. ''                            bConfigUpdated% = TRUE
  754.                         CASE "D"
  755.                             FModifyFile Drive$+":\"+TR_CONFIG_COR, CONFIGLINE$, "B"
  756.                             UIPop(1)
  757.                         CASE ELSE
  758.                             GOTO UPDATECONFIG
  759.                     END SELECT
  760.                 ENDIF
  761.                 IF bDosScanner% THEN
  762.                     CreateIniKeyValue ini$, "ZSTWAIN.DLL", "path", MakePath(szDestScannersDir$, "zstwain.dll"), cmoOverWrite
  763.                 ELSEIF bTwainScanner% THEN
  764.                     CreateIniKeyValue ini$, "CANON", "IPUBJS-SCANNER", MakePath(szDestScannersDir$,"canoncj1.dll"), cmoOverWrite
  765.                 ENDIF
  766.             ENDIF
  767.         ENDIF
  768.         
  769. '' Installing SHARE
  770.         '' We don't want to install SHARE for Windows for Workgroups
  771.         IF bWindowsForWorkgroups% = FALSE THEN
  772.             ShareFile$ = FindFileInTree("SHARE.EXE", Drive$+":\")
  773.                 WriteToLogFile "Found Share in: "+ShareFile$
  774.             IF ShareFile <> "" THEN
  775.                 SetSymbolValue "ShareLine", "{}"
  776.                 AddListItem "ShareLine", ShareFile$+" /L:500 /F:5100"
  777.                 IF bAutoexecModified% = FALSE THEN
  778.                     CopyFile Drive$+":\"+TR_AUTOEXEC_BAT, Drive$+":\"+TR_AUTOEXEC_COR, cmoOverwrite, 0
  779.                 ENDIF
  780. UPDATEAUTOEXECFORSHARE:                
  781.                 WaitOff
  782.                  sz$ = UIStartDlg( "mscuistf.dll", UPDATEAUTOEXECFORSHARE, "FButtonsDlgProc", UPDATEHELP, "FHelpDlgProc" )
  783.             SELECT CASE sz$
  784.                 CASE "U"
  785.                         UIPop(1)
  786.                             FModifyFile Drive$+":\"+TR_AUTOEXEC_BAT, "ShareLine", "E"
  787.                         '$IFDEF DEBUG
  788.                             FOR i% =1 TO GetListLength("ShareLine")
  789.                                 WriteToLogFile "the Config is: "+GetListItem("ShareLine", i%)
  790.                             NEXT i%
  791.                         '$ENDIF
  792.                     CASE "D"
  793.                         FModifyFile Drive$+":\"+TR_AUTOEXEC_COR, "ShareLine", "E"
  794.                         UIPop(1)
  795.                     CASE ELSE
  796.                         GOTO UPDATEAUTOEXECFORSHARE
  797.                 END SELECT
  798.             ENDIF
  799.         ENDIF
  800.         
  801. '' User has completed run of setup or has unconditionally decided to quit
  802. QUIT:
  803.     WaitOff
  804.     '' On MSTest errors report "setup file corrupted" and abort
  805.     ON ERROR GOTO ERRQUIT
  806.  
  807.     IF ERR = 0 THEN
  808.         sz$ = UIStartDlg("mscuistf.dll", SUCCESS, "FSuccessBitmapDlgProc", 0, "")
  809.         IF bInstallWorkstation% THEN
  810.             dlg% = NETEXITSUCCESS
  811.         ELSE
  812.             dlg% = EXITSUCCESS
  813.         ENDIF
  814.         szDlgProc$ = "FInfo075DlgProc"
  815.         WriteToLogfile TR_SETUPSUCCEEDED
  816.     ELSEIF ERR = STFQUIT THEN
  817.         dlg% = EXITQUIT
  818.         szDlgProc$ = "FInfo0DlgProc"
  819.         WriteToLogfile TR_SETUPQUIT
  820.     ELSE
  821.         dlg% = ERROREXITFAILURE
  822.         szDlgProc$ = "FInfo0DlgProc"
  823.         WriteToLogfile TR_SETUPFAILED
  824.     ENDIF
  825.     WriteToLogfile ""
  826.     
  827.  
  828. '' Put up one of the exit message dialog boxes
  829. QUITL1:
  830.     sz$ = UIStartDlg("mscuistf.dll", dlg%, szDlgProc, 0, "")
  831.     IF sz$ = "REACTIVATE" THEN
  832.         GOTO QUITL1
  833.     ENDIF
  834.  GOTO FINISH
  835.  
  836.  
  837. '' An error has occurred in MSTest. Tell the user and abort.
  838. ERRQUIT:
  839.     i% = DoMsgBox( TR_ERRQUIT, TR_SETUPMESSAGE, MB_OK+MB_TASKMODAL+MB_ICONHAND)
  840.     WriteToLogfile TR_SETUPCORRUPTED
  841.     WriteToLogFile ""
  842. FINISH:
  843.     UIPopAll
  844.     ShutDownInstall
  845.     CloseLogFile
  846.     END
  847.  
  848.  
  849. '' allow the user to select all the customize options
  850. CUSTINST:
  851.         '$IFDEF DEBUG
  852.             WriteToLogFile "CUSTINST:"
  853.         '$ENDIF
  854.     bBack% = FALSE
  855.     RemoveSymbol "InstallDirs"
  856.     RemoveSymbol "InstallState"
  857.     '' pass current directories and custom install state to dlgproc
  858.     FOR i%= 1 to NUMCUST
  859.         AddListItem "InstallDirs", " "
  860.         AddListItem "InstallState", NUM(afState(i%))
  861.     NEXT i%
  862.         ReplaceListItem "InstallDirs", SCANNERS, szDestScannersDir$
  863.  
  864.     ''Do a full recalculation if necessary
  865. ''    IF bRecalc% THEN
  866.         WaitOnBig
  867.         bRecalc% = FALSE
  868.         RecalcPath
  869. ''    ENDIF
  870.     
  871. CUSTINSTL2:    
  872.     WaitOn
  873.         '$IFDEF DEBUG
  874.             WriteToLogFile "CUSTINSTL2:"
  875.         '$ENDIF
  876. ''    SetDriveStatus
  877.     
  878. CUSTINSTL22:
  879.         
  880.     SetDriveStatus                '' set DriveText$ and StatusText$
  881.     WaitOff
  882.     
  883.     sz$ = UIStartDlg("mscuistf.dll", CUSTINSTCDBASED, "FCustInstDlgProc", CUSTINSTHELP, "FHelpDlgProc")
  884.     
  885.     
  886.     SELECT CASE sz$
  887.     CASE "CONTINUE"
  888.         WaitOn
  889.         GOSUB SetDirFromSymbol    '' set afState and DIR array from symbols
  890.         IF bBadPath% THEN
  891.             GOTO CUSTINSTL22
  892.         ENDIF
  893.         SetDriveStatus                    '' Test for not enough space
  894.         IF bTooBig% THEN
  895.             Dialog% = TOOBIG
  896.             GOSUB INFO
  897.             GOTO CUSTINSTL22
  898.         ENDIF
  899.         IF afState(FONTTT) = ALL AND bInstallWorkstation% = FALSE THEN
  900.             Dialog% = MOREFONTS
  901.             GOSUB INFO
  902.         ENDIF
  903.         
  904.         WriteToLogFile TR_DIRECTORIES
  905.         WriteToLogFile TR_CUSTOMSELECT
  906.         WriteToLogFile TR_CUSTOMMESSAGE
  907.         WriteToLogFile TR_FILTERS + " - " + STR$(afState(FILTERS)) + " - " + DIR(FILETRS)
  908.         WriteToLogFile TR_TTF + " - " + STR$(afState(FONTTT)) + " - " + DIR(FONTTT)
  909.         WriteToLogFile TR_SCANNERS + " - " + STR$(afState(SCANNERS)) + " - " + DIR(SCANNERS)
  910.         WriteToLogFile TR_ASTERIXES
  911.         
  912.     CASE "CUST8"
  913.         WaitOn
  914.         IF DoesDirExist(DIR(SCANNERS)) THEN
  915.     ''        szOptions$ = OPTS(SCANNERS)
  916.             SelectType% = SCANNERS
  917.             GOSUB SetDirFromSymbol    '' set afState and DIR array from symbols
  918.             IF bBadPath% THEN
  919.                 GOTO CUSTINSTL22
  920.             ENDIF
  921.             FOR i%=1 TO 3
  922.                 AddListItem "StatusText", ""
  923.             NEXT i%
  924.             InitScannerSelection
  925.             bDosScanner% = FALSE
  926.             bTwainScanner% = FALSE
  927.             GOSUB CUSTSCANNERS
  928.             CloseScannerSelection
  929.             RecalcOptFiles SelectType%
  930.         ENDIF
  931.         GOTO CUSTINSTL22
  932.         
  933.     CASE "CUST10"
  934.         WaitOn
  935.         IF DoesDirExist(DIR(FONTTT)) THEN
  936.             SelectType% = FONTTT
  937.             IF bInstallWorkstation% THEN
  938.                 Dialog% = SELECTFONTTT
  939.             ELSE
  940.                 Dialog% = SELECTFONTTTCD
  941.             ENDIF
  942.                 szFList1a$ = FONTLIST1$
  943.                 szFList1b$ = FONTLIST2$
  944. ''                RecalcOptFiles SelectType%
  945.                 GOSUB SELECTFILES
  946.                 szFList1a$ = ""
  947.                 szFList1b$ = ""
  948.         ENDIF
  949.         GOTO CUSTINSTL22
  950.         
  951.     ''reset afState, the drive status and status text
  952.     CASE "RESET"
  953.         WaitOn
  954.         GOSUB SetDirFromSymbol    '' set afState and DIR array from symbols
  955.         bRecalc% = TRUE
  956.         GOTO CUSTINSTL22
  957.         
  958.     CASE "REACTIVATE"
  959.         GOSUB SetDirFromSymbol    '' set afState and DIR array from symbols
  960.         bRecalc% = TRUE
  961.         GOTO CUSTINSTL22
  962.         
  963.     CASE "CANCEL", "BACK"
  964.         WaitOn
  965.         bBack% = TRUE
  966.         
  967.     CASE ELSE
  968.         GOSUB ASKQUIT
  969.         GOSUB SetDirFromSymbol    '' set afState and DIR array from symbols
  970.         GOTO CUSTINSTL22
  971.     END SELECT
  972.     UIPop 1
  973.     RETURN    '' The work needed is done, let's install the files.
  974.     
  975. '' Don't ask what progman group to use if installing as an administrator
  976. '' Since the group selection is deleted, we don't need to jump anything: 16Apr93
  977.  
  978. CUSTSCANNERS:
  979.          AddListItem "CombosStatus", GetListItem("ScanList", 1)
  980.         IF GetListLength("OptionList") THEN
  981.              AddListItem "CombosStatus", GetListItem("OptionList", 1)
  982.         ELSE
  983.              AddListItem "CombosStatus", ""
  984.         ENDIF
  985.         IF GetListLength("SubOptionList") THEN
  986.              AddListItem "CombosStatus", GetListItem("SubOptionList", 1)
  987.         ELSE
  988.              AddListItem "CombosStatus", ""
  989.         ENDIF
  990.         bDosScanner% = 0
  991.         bTwainScanner% = 0
  992.             
  993. CUSTSCANNERS2:
  994.     WaitOff
  995.     
  996.  
  997.     sz$ = UIStartDlg("mscuistf.dll", CUSTSCAN, "FScannerDlgProc", CUSTSCANHELP, "FHelpDlgProc")
  998.  
  999.  
  1000.     SELECT CASE sz$
  1001.     CASE "CONTINUE"
  1002.         SetSymbolValue SCANNERSECTION, "{}"
  1003.         SetSymbolValue CONFIGLINE, "{}"
  1004.         SetSymbolValue AUTOEXECLINE, "{}"
  1005.         bDosScanner% = FGetScannerLine(szDestScannersDir$+"\")
  1006.         bTwainScanner% = NOT bDosScanner%
  1007.         IF afState(SCANNERS) <> SOME THEN
  1008.             afState(SCANNERS) = SOME  
  1009.         ENDIF
  1010.         WaitOn
  1011.         GOSUB SetDirFromSymbol    
  1012.         RecalcOptFiles SCANNERS
  1013.     
  1014.     CASE "COMBO1"
  1015.         GOTO CUSTSCANNERS2
  1016.     CASE "COMBO2"
  1017.         GOTO CUSTSCANNERS2
  1018.     CASE "COMBO3"
  1019.         GOTO CUSTSCANNERS2
  1020.         
  1021.     CASE "REACTIVATE"
  1022.         GOTO CUSTSCANNERS2
  1023.         
  1024.     CASE "CANCEL"
  1025.         UIPop 1
  1026.         RETURN
  1027.             
  1028.     CASE ELSE
  1029.         GOSUB ASKQUIT
  1030.         GOTO CUSTSCANNERS2
  1031.         
  1032.     END SELECT
  1033.     UIPop 1
  1034. RETURN
  1035.  
  1036. '' Display an information dialog
  1037. '' Uses the global Dialog% to identify which dialog to display
  1038. INFO:
  1039.     WaitOff
  1040.     sz$ = UIStartDlg( "mscuistf.dll", Dialog%, "FInfo0DlgProc", 0, "" )
  1041.     SELECT CASE sz$
  1042.     CASE "CONTINUE"
  1043.         ''Do nothing
  1044.     CASE "REACTIVATE"
  1045.         bRecalc% = TRUE
  1046.         GOTO INFO
  1047.     CASE "EXIT"
  1048.         GOSUB ASKQUIT
  1049.         GOTO INFO
  1050.     END SELECT
  1051.     UIPop 1
  1052. RETURN
  1053.  
  1054. '' Get the base directory under which CorelDRAW! will be installed
  1055. GETPATH:
  1056.     bBack% = FALSE
  1057.         '$IFDEF DEBUG
  1058.             WriteToLogFile "GETPATH:"
  1059.         '$ENDIF
  1060.     bRet% = FIsDrawExist(TR_WIN_INI, szString$)
  1061.     WriteToLogFile "FIsDrawExist returns: "+STR$(bRet%)
  1062.     IF bRet% THEN  '' We have DRAW installed before (could be DRAW3 or DRAW4)
  1063.         DEST$ = szString$
  1064.     ENDIF
  1065.     Dialog% = DESTPATH
  1066.     SetSymbolValue "EditTextIn", DEST$
  1067.     SetSymbolValue "EditFocus", "END"
  1068. GETPATHL1:
  1069.     WaitOff
  1070.         '$IFDEF DEBUG
  1071.             WriteToLogFile "GETPATHL1:"
  1072.         '$ENDIF
  1073.     sz$ = UIStartDlg("mscuistf.dll", Dialog%, "FEditDlgProc", DESTPATHHELP, "FHelpDlgProc")
  1074.     SELECT CASE sz$
  1075.     CASE "CONTINUE"
  1076.         WaitOn
  1077.         olddest$ = DEST$
  1078.         DEST$ = RTRIM$(LTRIM$(GetSymbolValue("EditTextOut")))
  1079.         ''Validate new path.
  1080.         IF DEST$ = "" OR IsDirWritable(DEST$) = 0 THEN
  1081.             OldDialog% = Dialog%
  1082.             Dialog% = ERRORBADPATH
  1083.             GOSUB INFO
  1084.             Dialog% = OldDialog%
  1085.             GOTO GETPATHL1
  1086.         ENDIF
  1087.  
  1088.         ''Set Recalc and change subdirectories if DEST$ changed
  1089.         IF (olddest$ <> DEST$) AND (olddest$ <> DEST$+"\") AND (olddest$+"\" <> DEST$) THEN
  1090.             bRecalc% = TRUE
  1091.         ENDIF
  1092.         
  1093.     CASE "REACTIVATE"
  1094.         bRecalc% = TRUE
  1095.         GOTO GETPATHL1
  1096.     CASE "CANCEL", "BACK"
  1097.         UIPop 1
  1098.         bBack% = TRUE
  1099.         RETURN
  1100.     CASE ELSE
  1101.         GOSUB ASKQUIT
  1102.         GOTO GETPATHL1
  1103.     END SELECT
  1104.     WriteToLogFile TR_BASEDIR + DEST$
  1105.     WriteToLogFile ""
  1106.     UIPop 1
  1107. RETURN
  1108.  
  1109.  
  1110. '' The user has asked to quit - confirm his decision
  1111. ASKQUIT:
  1112.     WaitOff
  1113.     sz$ = UIStartDlg("mscuistf.dll", ASKQUIT, "FQuitDlgProc", 0, "")
  1114.     SELECT CASE sz$
  1115.     CASE "EXIT"
  1116. ''        GOTO FINISH
  1117. ''        UIPopAll
  1118.         ERROR STFQUIT
  1119.     CASE "REACTIVATE"
  1120.         bRecalc% = TRUE
  1121.         GOTO ASKQUIT
  1122.     CASE ELSE
  1123.         ''Do nothing
  1124.     END SELECT
  1125.     UIPop 1
  1126. RETURN
  1127.  
  1128.  
  1129. '' Permit the user to select which filters or fonts/symbols he wants to install
  1130. SELECTFILES:
  1131.     '$IFDEF DEBUG
  1132.         WriteToLogFile "SELECTFILES:"
  1133.     '$ENDIF
  1134.     SetSymbolValue "ListItems1a", GetSymbolValue( szFList1a$ )
  1135.     SetSymbolValue "ListItems1b", GetSymbolValue( szFList1b$ )
  1136.  
  1137. SELECTL1:
  1138.     '$IFDEF DEBUG
  1139.         WriteToLogFile "SELECTL1:"
  1140.     '$ENDIF
  1141.     WaitOff
  1142.     sz$ = UIStartDlg("mscuistf.dll", Dialog%, "FList4DlgProc", SELECTHELP, "FHelpDlgProc")
  1143.     
  1144.     SELECT CASE sz$
  1145.     CASE "CONTINUE"
  1146.         WaitOn
  1147.         ''If lists have been modified, reset them and recalculate
  1148.         newlist$ = GetSymbolValue( "ListItems1a" )
  1149.         IF newlist$ <> GetSymbolValue( szFList1a$ ) THEN
  1150.             IF newlist$ = "" THEN
  1151.                 SetSymbolValue szFList1a$, "{}"
  1152.             ELSE
  1153.                 SetSymbolValue szFList1a$, newlist$
  1154.             ENDIF
  1155.             newlist$ = GetSymbolValue( "ListItems1b" )
  1156.             IF newlist$ = "" THEN
  1157.                 SetSymbolValue szFList1b$, "{}"
  1158.             ELSE
  1159.                 SetSymbolValue szFList1b$, newlist$
  1160.             ENDIF
  1161.             bRecalcOpt = TRUE
  1162.         ENDIF
  1163.         UIPop 1
  1164. ''        IF SelectType% = FONTSYM OR SelectType% = FONTTT AND bRecalcOpt% THEN
  1165.             WaitOnBig
  1166.             RecalcOptFiles SelectType%
  1167. ''        ENDIF
  1168. ''        newlist$ = ""
  1169.     CASE "REACTIVATE"
  1170.         bRecalc% = TRUE
  1171.         GOTO SELECTL1
  1172.     CASE "CANCEL", "BACK"
  1173.         UIPop 1
  1174.         IF SelectType% = FONTSYM OR SelectType% = FONTTT THEN
  1175.             WaitOnBig
  1176.             RecalcOptFiles SelectType%
  1177.         ENDIF
  1178.     CASE ELSE
  1179.         GOSUB ASKQUIT
  1180.         GOTO SELECTL1
  1181.     END SELECT
  1182.     RemoveSymbol "ListItems1a"
  1183.     RemoveSymbol "ListItems1b"
  1184.     RemoveSymbol "ListItems2a"
  1185.     RemoveSymbol "ListItems2b"
  1186. RETURN
  1187.  
  1188. '' $Keywords: draw2.mst 2.22 15Oct92 11:43am$ $nokeywords$
  1189. '**
  1190. '** Purpose:
  1191. '**     Adds the specified option files to the copy list.
  1192. '** Arguments:
  1193. '**     ftype%  - type of files to add, one of the following:
  1194. '**             DRAW, CHART, SHOW, PHOTO, MOVE, TRACE, MOSAIC, FILTERS or FONTTT
  1195. '** Returns:
  1196. '**     none.
  1197. '*************************************************************************
  1198. SUB AddOptFilesToCopyList (ftype%) STATIC
  1199.  
  1200.     '$IFDEF DEBUG
  1201.         WriteToLogFile "SUB AddOptFilesToCopyList " + STR$(ftype%)
  1202.     '$ENDIF
  1203.     fState% = afState(ftype%)
  1204.         
  1205.     SELECT CASE ftype%
  1206.     CASE DRAW
  1207.             TestAddSectionFilesToCopyList "DrawDraw", DIR(DRAW), MakePath(DEST$, TR_DRAW)
  1208.             TestAddSectionFilesToCopyList "DrawConfig", MakePath(DIR(MAIN), TR_CONFIG), MakePath(DEST$,TR_CONFIG)
  1209.             
  1210.     CASE CHART
  1211.             TestAddSectionFilesToCopyList "ChartConfig", MakePath(DIR(MAIN), TR_CONFIG), MakePath(DEST$,TR_CONFIG)
  1212.             
  1213.     CASE SHOW
  1214.             TestAddSectionFilesToCopyList "ShowConfig", MakePath(DIR(MAIN), TR_CONFIG), MakePath(DEST$,TR_CONFIG)
  1215.             IF bWindowsIsNetworked% = FALSE OR DoesFileExist( MakePath(WINSYSDIR$,"qtnotify.exe"), femExists ) = 0 THEN 
  1216.                 TestAddSectionFilesToCopyList "ShowRedist", MakePath(DIR(MAIN), TR_REDIST), szWWinDir$
  1217.             ENDIF
  1218.             TestAddSectionFilesToCopyList "ShowRedistWin", MakePath(DIR(MAIN), TR_REDIST), WINDIR$
  1219.             
  1220.     CASE PHOTO
  1221.             TestAddSectionFilesToCopyList "PhotoConfig", MakePath(DIR(MAIN), TR_CONFIG), MakePath(DEST$,TR_CONFIG)
  1222.             TestAddSectionFilesToCopyList "PhotoColors", MakePath(DIR(PHOTO), TR_COLORS), MakePath(DEST$, TR_PHOTOPNT+"\"+TR_COLORS)
  1223.             
  1224.     CASE MOVE
  1225.             TestAddSectionFilesToCopyList "MoveConfig", MakePath(DIR(MAIN), TR_CONFIG), MakePath(DEST$,TR_CONFIG)
  1226.             IF bWindowsIsNetworked% = FALSE OR DoesFileExist( MakePath(WINSYSDIR$,"dib.drv"), femExists ) = 0 THEN 
  1227.                 TestAddSectionFilesToCopyList "MoveRedist", MakePath(DIR(MAIN), TR_REDIST), szWWinDir$
  1228.             ENDIF
  1229.             TestAddSectionFilesToCopyList "MoveRedistWin", MakePath(DIR(MAIN), TR_REDIST), WINDIR$
  1230.  
  1231.     CASE TRACE
  1232.             TestAddSectionFilesToCopyList "TraceTrace", DIR(TRACE), MakePath(DEST$, TR_TRACE)
  1233.             
  1234.     CASE MOSAIC
  1235.             IF bWindowsIsNetworked% = FALSE OR DoesFileExist( MakePath(WINSYSDIR$,"pcdxbmp.dll"), femExists ) = 0 THEN 
  1236.                 TestAddSectionFilesToCopyList "MosaicRedist", MakePath(DIR(MAIN), TR_REDIST), szWWinDir$
  1237.             ENDIF
  1238.             
  1239.     CASE FILTERS
  1240.             IF bWindowsIsNetworked% = FALSE OR DoesFileExist( MakePath(WINSYSDIR$,"pcdlib.dll"), femExists ) = 0 THEN 
  1241.                 TestAddSectionFilesToCopyList "ImpKodak Photo-CD", MakePath(DIR(MAIN), TR_REDIST), szWWinDir$ 
  1242.             ENDIF
  1243.             
  1244.     CASE FONTTT
  1245.             
  1246.     CASE SCANNERS
  1247.         IF fState% <> NONE THEN
  1248.             IF fstate% = SOME THEN
  1249.                 TestAddSectionFilesToCopyList "Twain", MakePath(DIR(MAIN), TR_REDIST), WINDIR$
  1250.                 TestAddSectionFilesToCopyList "TwainScan", DIR(SCANNERS), MakePath(WINDIR$, TR_TWAIN+"\"+TR_COREL)
  1251.                 WriteToLogFile "Added TwainScan: szDestScannersDir = " + szDestScannersDir$
  1252.                 IF bDosScanner% THEN
  1253.                     TestAddSectionFilesToCopyList "ZSTwainScan", DIR(SCANNERS), szDestScannersDir$ 
  1254.                     Section$ = GetListItem(SCANNERSECTION$, 1)
  1255.                     TestAddSectionFilesToCopyList Section$, DIR(SCANNERS), szDestScannersDir$ 
  1256.                 ENDIF
  1257.                 IF bTwainScanner% THEN
  1258.                     Section$ = GetListItem(SCANNERSECTION$, 1)
  1259.                     TestAddSectionFilesToCopyList Section$, DIR(SCANNERS), szDestScannersDir$ 
  1260.                 ENDIF
  1261.             ENDIF
  1262.         ENDIF
  1263.             
  1264.          
  1265.     CASE MAIN
  1266.         
  1267.             '' So we have an App to install, so we can create the main directory
  1268.                 
  1269.         IF bInstallWorkstation% THEN
  1270.             TestAddSectionFilesToCopyList "Main", DIR(MAIN), DEST$
  1271.         ENDIF
  1272.         TestAddSectionFilesToCopyList "CommonConfig", MakePath(DIR(MAIN), TR_CONFIG), MakePath(DEST$,TR_CONFIG)
  1273.         TestAddSectionFilesToCopyList "Custom", MakePath(DIR(MAIN), TR_CUSTOM), MakePath(DEST$,TR_CUSTOM)
  1274.         TestAddSectionFilesToCopyList "AgraphixAgraphix", MakePath(DIR(MAIN),TR_AGRAPHIX), MakePath(DEST$,TR_AGRAPHIX)
  1275.         TestAddSectionFilesToCopyList "AgraphixPrinters", MakePath(DIR(MAIN),TR_AGRAPHIX+"\"+TR_PRINTERS), MakePath(DEST$,TR_AGRAPHIX+"\"+TR_PRINTERS)
  1276.         TestAddSectionFilesToCopyList "AgraphixToagx", MakePath(DIR(MAIN),TR_AGRAPHIX+"\"+TR_TOAGX), MakePath(DEST$,TR_AGRAPHIX+"\"+TR_TOAGX)
  1277.             
  1278.         IF bInstallWorkstation% THEN
  1279.             IF bWindowsIsNetworked% = FALSE OR DoesFileExist( MakePath(WINSYSDIR$,"ole2.dll"), femExists ) = 0 THEN 
  1280.                 TestAddSectionFilesToCopyList "CommonRedist", MakePath(DIR(MAIN), TR_REDIST), szWWinDir$
  1281.             ENDIF
  1282.         ELSE
  1283.             TestAddSectionFilesToCopyList "CommonRedist", MakePath(DIR(MAIN), TR_REDIST), szWWinDir$
  1284.         ENDIF
  1285.         
  1286.     END SELECT
  1287.     
  1288. END SUB
  1289.  
  1290. '**
  1291. '** Purpose:
  1292. '**     Recalculates disk space for the given option files and sets
  1293. '**     the status info symbol "StatusItemsText".
  1294. '** Arguments:
  1295. '**     ftype% - type of files to add, one of the following:
  1296. '**       DRAW, CHART, SHOW, PHOTO, MOVE, TRACE, MOSAIC, FILTERS, FONTTT, MAIN
  1297. '** Returns:
  1298. '**     none.
  1299. '*************************************************************************
  1300. SUB RecalcOptFiles (ftype%) STATIC
  1301.         '$IFDEF DEBUG
  1302.             WriteToLogFile "SUB RecalcOptFiles"
  1303.         '$ENDIF
  1304.     ClearCopyList
  1305.     AddOptFilesToCopyList ftype%
  1306.     
  1307.     FRecalcOptFiles ftype%, aszNEEDS(ftype%)
  1308.         
  1309. END SUB
  1310.  
  1311.  
  1312. '**
  1313. '** Purpose:
  1314. '**     Recalculates disk space and sets option status info according
  1315. '**     to the current destination path.
  1316. '** Arguments: Type%: Passed to RecalcGroup
  1317. '**     none.
  1318. '** Returns:
  1319. '**     none.
  1320. '*************************************************************************
  1321. SUB RecalcPath STATIC
  1322.  
  1323.         '$IFDEF DEBUG
  1324.             WriteToLogFile "SUB RecalcPath"
  1325.         '$ENDIF
  1326.     
  1327.     FOR i% = 1 TO NUMGROUPS STEP 1
  1328.         RecalcOptFiles i%
  1329.     NEXT i%
  1330. END SUB
  1331.  
  1332.  
  1333. '**
  1334. '** Purpose:
  1335. '**     Sets drive status info according to latest disk space calcs.
  1336. '**     Checks that enough space is available on all drives.
  1337. '** Arguments:
  1338. '**     none.
  1339. '** Returns:
  1340. '**     none.
  1341. '*************************************************************************
  1342. SUB SetDriveStatus STATIC
  1343.     
  1344.     '$IFDEF DEBUG
  1345.         WriteToLogFile "SUB SetDriveStatus"
  1346.     '$ENDIF
  1347.     DIM alCosts AS POINTER TO LONG
  1348.     NoOfDrives% = GetListLength(DrivesList$)    
  1349.     ALLOCATE alCosts, NoOfDrives%
  1350.     
  1351.     ''Calculate total costs for each drive
  1352.     FOR i% = 0 TO NoOfDrives%-1 STEP 1
  1353.         alCosts[i%] = 0
  1354.     NEXT i%
  1355.     
  1356.     FOR i% = 0 TO NoOfDrives%-1
  1357.         ndrive% = ASC(GetListItem(DrivesList$, i%+1)) - ASC("A") 
  1358.         FOR j%= 1 TO NUMGROUPS
  1359.             alCosts[i%] = alCosts[i%] + VAL(GetListItem(aszNEEDS(j%), ndrive%+1))
  1360.         NEXT j%
  1361.     NEXT i%
  1362.     
  1363.     ''Store the costs and free space for the first five drives used
  1364.     j% = 0
  1365.     bTooBig% = FALSE
  1366.     FOR i% = 0 TO NoOfDrives%-1 STEP 1
  1367.         if alCosts[i%] > 0 THEN
  1368.             j% = j% + 1
  1369.             drive$ = GetListItem(DrivesList$, i%+1) 
  1370.             free& = GetFreeSpaceForDrive(drive$)
  1371.             IF free& < alCosts[i%] THEN
  1372.                 bTooBig% = TRUE
  1373.             ENDIF
  1374.             IF j% < 6 THEN
  1375.                 ReplaceListItem DRIVETEXT$, j%*3-2, drive$ + ":"
  1376.                 ReplaceListItem DRIVETEXT$, j%*3-1, STR$(alCosts[i%] / 1024) + " K"
  1377.                 ReplaceListItem DRIVETEXT$, j%*3, STR$(free& / 1024) + " K"
  1378.             ENDIF
  1379.             drive=""
  1380.         ENDIF
  1381.     NEXT i%
  1382.     ''wipe clean all remaining directory information
  1383.     FOR i% = j%*3+1 TO 15 STEP 1
  1384.         ReplaceListItem DRIVETEXT$, i%, ""
  1385.     NEXT i%
  1386.     DEALLOCATE alCosts
  1387.  
  1388. END SUB
  1389.  
  1390.  
  1391. '**
  1392. '** Purpose:
  1393. '**     Removes the optional trailing "\"
  1394. '** Arguments:
  1395. '**     szDir$  - full directory path (with optional ending "\")
  1396. '** Returns:
  1397. '**     szDir$ without a trailing "\"
  1398. '*************************************************************************
  1399. FUNCTION MakeDir (szDir$) STATIC AS STRING
  1400.     IF szDir$ <> "" THEN
  1401.         IF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  1402.             MakeDir = MID$( szDir$, 1, LEN(szDir$) - 1 )
  1403.         ELSE
  1404.             MakeDir = szDir$
  1405.         ENDIF
  1406.     ELSE
  1407.         MakeDir = szDir$
  1408.     ENDIF
  1409. END FUNCTION
  1410.  
  1411.  
  1412. '**
  1413. '** Purpose:
  1414. '**     Appends a file name to the end of a directory path,
  1415. '**     inserting a backslash character as needed.
  1416. '** Arguments:
  1417. '**     szDir$  - full directory path (with optional ending "\")
  1418. '**     szFile$ - filename to append to directory
  1419. '** Returns:
  1420. '**     Resulting fully qualified path name.
  1421. '*************************************************************************
  1422. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  1423.     MakePath = MakeDir(szDir$) + "\" + szFile$
  1424. END FUNCTION
  1425.  
  1426.  
  1427. '** This sub converts the symbol "InstallDirs" into the DIR array
  1428. '** and the symbol "InstallState" into the afState array, 
  1429. '** recalculating disk usage if anything has changed.
  1430. '** NOTE: this a only a simulated subroutine because we want to be
  1431. '**       able to GOSUB BADPATH from inside it.
  1432. '*************************************************************************
  1433. SetDirFromSymbol:
  1434.         '$IFDEF DEBUG
  1435.             WriteToLogFile "SetDirFromSymbol:"    
  1436.         '$ENDIF
  1437.     '' Convert "InstallState" into the afState array
  1438.     bRecalcMain% = FALSE
  1439.     FOR i% = SCANNERS TO FONTTT
  1440.         WriteToLogFile "SetDirFromSymbol: Status of "+STR$(i%)
  1441.         WriteToLogFile "with InstallState of: "+GetListItem("InstallState", i%)
  1442.         fNewState% = ASC( GetListItem("InstallState", i%) ) - ASC("1") + 1
  1443.         WriteToLogFile "fNewState% is: "+ STR$(fNewState)
  1444.         IF fNewState% <> afState(i%) THEN
  1445.             afState(i%) = fNewState%
  1446.             WriteToLogFile "State is: "+STR$(afState(i%))
  1447.             RecalcOptFiles i%
  1448.         ENDIF
  1449.     NEXT i%
  1450.     
  1451.     '' Convert "InstallDir" into the DIR array
  1452.         WriteToLogFile "Testing Directory changes"
  1453.         szList$ = "InstallDirs"
  1454.         bBadPath% = FALSE
  1455.             szDir$ = MakeDir(GetListItem(szList$, SCANNERS))
  1456.             WriteToLogFile "szDir$ of scanners: "+szDir$
  1457.             '' If the directory is not writable, tell the user and don't update it.
  1458.             IF szDir$ = "" OR IsDirWritable( szDir$ ) = 0 THEN
  1459.                 WriteToLogFile "Directory has a problem: "+ szDir$
  1460.                 Dialog% = ERRORBADPATH
  1461.                 GOSUB INFO
  1462.                 bBadPath% = TRUE
  1463.                 RETURN
  1464.             ENDIF
  1465.             '' If the directory has changed - recalculate disk usage
  1466.             IF szDestScannersDir$ <> szDir$ THEN
  1467.                 szDestScannersDir$ = szDir$
  1468.                 RecalcOptFiles SCANNERS
  1469.             ENDIF
  1470.             WriteToLogFile "EndOf Subroutine.....SetDirFromSymbol"
  1471.     szDir$ = ""
  1472.     szList$ = ""
  1473. RETURN
  1474.  
  1475. '** This sub sets all files to load - sets directory structure to default
  1476. '*************************************************************************
  1477. SUB PrepInstall STATIC
  1478.  
  1479.     
  1480.     ''Set all sections to install
  1481.     FOR i% = DRAW TO NUMGROUPS
  1482.         afState(i%) = ALL
  1483.     NEXT i%
  1484.         afState(SCANNERS) = NONE
  1485.  
  1486.     SetSymbolValue FONTLIST1$, "{}"
  1487.     MakeFontList
  1488. END SUB
  1489.  
  1490.  
  1491. '** Set the subdirectories to their default values.
  1492. '*************************************************************************
  1493. SUB SetDirectories STATIC
  1494.     '$IFDEF DEBUG
  1495.         WriteToLogFile "SUB SetDirectories"
  1496.     '$ENDIF
  1497.     Drive$ = ""
  1498.     ini$ = MakePath( SrcDir$, TR_SETUP_INI )
  1499.     DIR(MAIN)         = GetIniKeyString( ini$, "Directories", TR_MAIN )
  1500.     DIR(DRAW)         = GetIniKeyString( ini$, "Directories", TR_DRAW )
  1501.     DIR(CHART)         = GetIniKeyString( ini$, "Directories", TR_CHART )
  1502.     DIR(SHOW)         = GetIniKeyString( ini$, "Directories", TR_SHOW )
  1503.     DIR(PHOTO)         = GetIniKeyString( ini$, "Directories", TR_PHOTOPNT )
  1504.     DIR(MOVE)         = GetIniKeyString( ini$, "Directories", TR_MOVE )
  1505.     DIR(TRACE)         = GetIniKeyString( ini$, "Directories", TR_TRACE )
  1506.     DIR(MOSAIC)     = GetIniKeyString( ini$, "Directories", TR_MOSAIC )
  1507.     szSymbolDir$  = GetIniKeyString( ini$, "Directories", TR_WFN )
  1508.     DIR(SCANNERS)    = GetIniKeyString( ini$, "Directories", TR_SCANNERS )
  1509.     szDestScannersDir$ = MakePath(WINDIR$,TR_TWAIN+"\"+TR_COREL)
  1510.     DIR(FILTERS)     = MakePath( DIR(MAIN), TR_PROGRAMS )
  1511.     DIR(FONTTT)     = GetIniKeyString( ini$, "Directories", TR_TTF )
  1512.     
  1513.     KeyVal$ = GetIniKeyString( ini$, "Directories", TR_FIXEDDRIVE )
  1514.     IF KeyVal$ = "CDROM" THEN
  1515.         bInstallWorkstation% = FALSE
  1516.         FOR i% = DRAW TO MAIN STEP 1
  1517.             DIR(i%) = MID$( ini$, 1, 1) + ":\" + DIR(i%)
  1518.             WriteToLogFile "Dir of " + STR$(i%) + " " + DIR(i%)
  1519.         NEXT i%
  1520.         szSymbolDir$ = MID$( ini$, 1, 1)+ ":\" + szSymbolDir$
  1521.     ELSE
  1522.         bInstallWorkstation% = TRUE
  1523.     ENDIF    
  1524.     IF KeyVal$ = "FALSE"  THEN
  1525.             FOR i% = DRAW TO MAIN 
  1526.                 DIR(i%) = MID$( ini$, 1, 1) + MID$( DIR(i%), 2, LEN(DIR(i%))-1 )
  1527.                 WriteToLogFile "Dir of " + STR$(i%) + " " + DIR(i%)
  1528.             NEXT i%
  1529.             szSymbolDir$ = MID$( ini$, 1, 1) + MID$( szSymbolDir$, 2, LEN(szSymbolDir$)-1 )
  1530.     ENDIF
  1531.     IF bInstallWorkstation% THEN
  1532.         szUserName$    = GetIniKeyString( ini$, "Registration", "UserName" )
  1533.         szSerialNumber$    = GetIniKeyString( ini$, "Registration", "SerialNumber" )
  1534.     ENDIF
  1535.     
  1536. END SUB
  1537.  
  1538.  
  1539. '** Make sure that the long wait dialog is displayed and the hourglass cursor
  1540. '** are being used
  1541. '*************************************************************************
  1542. SUB WaitOnBig STATIC
  1543.     IF nWaiting% = 0 THEN
  1544.         CursorSave% = ShowWaitCursor()
  1545.     ENDIF
  1546.     IF nWaiting% <> 2 THEN
  1547.         sz$ = UIStartDlg("mscuistf.dll", WAIT, "FModelessDlgProc", 0, "")
  1548.     ENDIF
  1549.     nWaiting% = 2
  1550. END SUB
  1551.  
  1552.  
  1553. '** Make sure that the hourglass cursor is being used
  1554. '*************************************************************************
  1555. SUB WaitOn STATIC
  1556.     IF nWaiting% = 0 THEN
  1557.         CursorSave% = ShowWaitCursor()
  1558.         nWaiting% = 1
  1559.     ENDIF
  1560. END SUB
  1561.  
  1562.  
  1563. '** Remove the long wait dialog if it is being displayed and reset the cursor
  1564. '** back to normal if it was set to the hourglass icon
  1565. '*************************************************************************
  1566. SUB WaitOff STATIC
  1567.     IF nWaiting% = 2 THEN
  1568.         UIPop 1
  1569.     ENDIF
  1570.     IF nWaiting% <> 0 THEN
  1571.         RestoreCursor CursorSave%
  1572.     ENDIF
  1573.     nWaiting% = 0
  1574. END SUB
  1575.  
  1576.  
  1577. '** Wrapper function - should reduce size of code segment.
  1578. '**
  1579. '** FileChangeString replaces szString1$ in szFile1$ with szString2$.
  1580. '** szFile2$ is a temporary file name.
  1581. '*************************************************************************
  1582. SUB    WrapFileChangeString( szFile1$, szFile2$, szString1$, szString2$ ) STATIC
  1583.     FileChangeString szFile1$, szFile2$, szString1$, szString2$
  1584. END SUB
  1585.  
  1586.  
  1587. '** Wrapper function - should reduce size of code segment.
  1588. '**
  1589. '** CommentIniSection checks to see whether or not the files mentioned in
  1590. '** szSection$ can be found in directory szPath$. If not, it sticks a ';'
  1591. '** in front of that line of the ini file. Otherwise it makes sure there
  1592. '** is not semi-colon commenting out that line.
  1593. '** Note: this function is heavily dependent on the format of coreldrw.ini
  1594. '*************************************************************************
  1595. SUB    WrapCommentIniSection( szFileName$, szTempFile$, szSection$, szPath$ ) STATIC
  1596.     CommentIniSection szFileName$, szTempFile$, szSection$, szPath$
  1597. END SUB
  1598.  
  1599.  
  1600. '** If the second file does not exist, backup szFile1$ as szFile2$
  1601. '*************************************************************************
  1602. SUB CheckBackupFile( szFile1$, szFile2$ ) STATIC
  1603.     IF DoesFileExist(szFile2$,femExists) = 0 AND DoesFileExist(szFile1$,femExists) THEN
  1604.         CopyFile szFile1$, szFile2$, cmoNone, 0
  1605.     ENDIF
  1606. END SUB
  1607.  
  1608. '*************************************************************************
  1609. FUNCTION CreateProgmanItem (szGroup$, szItem$, szCmd$, szOther$, cmo%) STATIC AS INTEGER
  1610.   szItemNew$ = szItem$
  1611.   IF szOther$ <> "" THEN
  1612.     szItemNew$ = szItem$ + "," + szOther$
  1613.   END IF
  1614.  
  1615.   IF FCreateProgManItem(szGroup$, szItemNew$, szCmd$, cmo%) = 0 THEN
  1616.         CreateProgmanItem = 1
  1617.     ELSE
  1618.         CreateProgmanItem = 0
  1619.   END IF
  1620.     szItemNew$ = ""
  1621. END FUNCTION
  1622.  
  1623.  
  1624. '** This sub Add fonts to the user choice list, if he didn't choose the group.
  1625. '** It add the fonts which will not be installed by the unsellected list
  1626. '*************************************************************************
  1627. SUB MakeFontList STATIC
  1628.     
  1629.      WriteToLogFile "SUB MakeFontList"
  1630.     SetSymbolValue FONTLIST2$, "{}"
  1631.             FOR i% = 1 TO GetListLength(szFontSectDisk$)
  1632.                     AddFilesToList GetListItem(szFontSectDisk$, i%), "FON"
  1633.             NEXT i%
  1634.             
  1635. END SUB
  1636.  
  1637.  
  1638. '***********************************************************************
  1639. '***********************************************************************
  1640. '**** Add Filters in Section to the Fileters List
  1641. '***********************************************************************
  1642. SUB AddFilesToList (SectionName$, FiltersList$) STATIC
  1643.         FAddFilesToList SectionName$, FiltersList$
  1644. END SUB
  1645.  
  1646. '***********************************************************************
  1647. '***********************************************************************
  1648. '**** Add Filter (If Exist in Section) to copy list ********************
  1649. '***********************************************************************
  1650. SUB AddFileToCopyList(AppendSect$, Section$, FilterName$) STATIC
  1651.         Destination$ = DIR(FILTERS)
  1652. ''        IF Section$ = "ImpKodak Photo-CD" THEN
  1653. ''            Destination$ = WINSYSDIR$
  1654. ''        ELSE
  1655. ''            IF Section$ = "ExpAdobe Illustrator" OR Section$ = "ExpAutoCAD DXF" Then
  1656. ''                Destination$ = MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_DATA)
  1657. ''            ENDIF
  1658. ''        ENDIF
  1659.         '$IFDEF DEBUG
  1660.             WriteToLogFile "Section: "+Section$+"  FilterName: "+FilterName$+"  Destination: "+Destination$
  1661.         '$ENDIF
  1662.         FAddFileToCopyList AppendSect$, Section$, FilterName$, SrcDir$, Destination$
  1663.         Destination$ = ""
  1664. END SUB
  1665.  
  1666. '**    Adds each file in the given section to the list of files to be copied,
  1667. '** after checking to see if the file was installed by the administrator.
  1668. '*************************************************************************
  1669. SUB TestAddSectionFilesToCopyList (szSection$,szFrom$,szTo$) STATIC
  1670.     MakeListFromSectionKeys TempList$, szSection$
  1671.     FOR i% = 1 TO GetListLength(TempList$)
  1672.         szKey$ = GetListItem(TempList$, i%)
  1673.         szFileName$ = GetSectionKeyFilename( szSection$, szKey$ )
  1674.         IF DoesFileExist( MakePath(szFrom$,szFileName$), femExists) = 1 THEN 
  1675.             AddSectionKeyFileToCopyList szSection$, szKey$, szFrom$, szTo$
  1676.         ENDIF
  1677.     NEXT i%
  1678.     szFileName$ = ""
  1679.     szKey$ = ""
  1680. END SUB
  1681.  
  1682.