home *** CD-ROM | disk | FTP | other *** search
/ Corel Draw 3 / CorelDRAW-v3.0.iso / draw.mst < prev    next >
Text File  |  1992-10-25  |  48KB  |  1,345 lines

  1. '' $Keywords: draw.mst 2.41 11Nov92 11:18am$ $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.  
  10. '$INCLUDE 'setupapi.inc'
  11.  
  12. ''C functions
  13. DECLARE SUB                InitializeInstall LIB "mscuistf.dll" (hInstance%, hMainWind% )
  14. DECLARE SUB                ShutDownInstall LIB "mscuistf.dll"
  15. DECLARE SUB                RegisterFont LIB "mscuistf.dll" (szFOTName$, szTTFName$) 
  16. DECLARE SUB                InitPrintTestFile LIB "mscuistf.dll"
  17. DECLARE SUB                ShutDownPrintTestFile LIB "mscuistf.dll"
  18. DECLARE SUB                FileChangeString LIB "mscuistf.dll" (szFile1$, szFile2$, szString1$, szString2$)
  19. DECLARE SUB                ExecCommand LIB "mscuistf.dll" (szCommand$)
  20. DECLARE SUB                CommentIniSection LIB "mscuistf.dll" (szFileName$, szTempFile$, szSection$, szPath$ )
  21. DECLARE FUNCTION    ScanList LIB "mscuistf.dll" (szSymbol$, nIndex%) AS INTEGER
  22. DECLARE FUNCTION    PrintTestFile LIB "mscuistf.dll" (szFileName$, bLast% ) AS INTEGER
  23. DECLARE FUNCTION    GetFilenameFromPath LIB "mscuistf.dll" (szPath$) AS INTEGER
  24. DECLARE FUNCTION    IsTTFEnabled LIB "mscuistf.dll" AS INTEGER
  25. DECLARE FUNCTION    GetMinFileSize LIB "mscuistf.dll" (cDrive%) AS LONG
  26. DECLARE FUNCTION    TestDoUpgrade LIB "mscuistf.dll" (szDir$) AS INTEGER
  27.  
  28. '$INCLUDE 'translat.inc'
  29.  
  30. ''Strings for loading string resources
  31. GLOBAL szString$
  32. CONST     STRINGLEN =    66
  33. szString$ = string$( STRINGLEN+1, 32 )
  34.  
  35. ''setup main window
  36. CONST LOGO                            = 9100            ''must match the constant in dialogs.h
  37. SetTitle TR_TITLE
  38. InitializeInstall hinstFrame(), HwndFrame()        ''corel style buttons; max window
  39. SetBitmap "mscuistf.dll", LOGO
  40.  
  41. '$INCLUDE 'msdetect.inc'
  42.  
  43. '' '$DEFINE DEBUG  ''Define for script development/debugging
  44.  
  45. ''Dialog ID's
  46. ''Note: These constants MUST match the constants in dialogs.h
  47. CONST WELCOME            = 9900
  48. CONST ASKQUIT            = 9901
  49. CONST DESTPATH           = 9902
  50. CONST EXITFAILURE        = 9903
  51. CONST EXITQUIT           = 9904
  52. CONST EXITSUCCESS        = 9905
  53. CONST OPTIONS            = 9906
  54. CONST CUSTINST           = 9907
  55. CONST TOOBIG             = 9908
  56. CONST BADPATH            = 9909
  57. CONST CUSTDRAW            = 9910
  58. CONST CUSTCHART            = 9911
  59. CONST CUSTSHOW            = 9912
  60. CONST CUSTPHOTO            = 9913
  61. CONST CUSTTRACE            = 9914
  62. CONST SELECTFILTERS    = 9916
  63. CONST SELECTFONTSYM    = 9917
  64. CONST WAIT                    = 9919
  65. CONST ABOUT                    = 9920
  66. CONST SELECTGROUPS    = 9921
  67. CONST ASKINSTALL        = 9922
  68. CONST CUSTGROUPS        = 9925
  69. CONST BILLBOARD            = 9926
  70. CONST UPDATEDAUTOEXEC    = 9930
  71. CONST UPDATEAUTOEXEC    = 9931
  72. CONST WAITREGISTER    = 9932
  73. CONST BADGROUP            = 9933
  74. CONST PRINTTEST            = 9937
  75. CONST SUCCESS                = 9938
  76. CONST WINREADONLY        = 9943
  77. CONST NETINSTWELCOME    = 9944
  78. CONST CHECKUPGRADE    = 9945
  79. CONST CHECKUPGRADEFAIL    = 9946
  80. CONST NETADDITEMFAILED    = 9949
  81. CONST NETADMINABOUT    = 9950
  82. CONST WELCOMEHELP        = 9800
  83. CONST OPTIONSHELP        = 9801
  84. CONST GETPATHHELP   = 9802
  85. CONST CUSTINSTHELP  = 9803
  86. CONST CUSTINST2HELP = 9804
  87. CONST SELECTHELP    = 9806
  88. CONST SELECTGROUPSHELP    = 9807
  89. CONST ASKINSTALLHELP        = 9808
  90. CONST CUSTGROUPSHELP        = 9809
  91. CONST PRINTTESTHELP            = 9811
  92. CONST CHECKUPGRADEHELP    = 9812
  93.  
  94. ''Constants representing each line in the custinst dialog
  95. CONST DRAW          = 1
  96. CONST CHART         = 2
  97. CONST SHOW            = 3
  98. CONST PHOTO            = 4
  99. CONST TRACE            = 5
  100. CONST MOSAIC        = 6
  101. CONST AGRAPHIX    = 7
  102. CONST FONTSYM        = 8
  103. CONST NUMCUST      = FONTSYM
  104. CONST MAIN            = NUMCUST + 1
  105. CONST NUMGROUPS    = MAIN
  106.  
  107. CONST FALSE    = 0
  108. CONST TRUE    = 1
  109.  
  110. '' Set this constant to the type of install interested in.
  111. '$DEFINE INSTALLCD        ''When this is set, Draw will install off cd-rom
  112. '$UNDEF UPGRADE  ''When this is set, Draw will only install as an upgrade
  113.  
  114. '' used as values for afState(NUMCUST) array.
  115. CONST ALL        = 1
  116. CONST    SOME    = 2
  117. CONST    NONE    = 3
  118.  
  119. '' set 'customize' variables
  120.  
  121. ''Customized installation settings
  122. GLOBAL OPTS(TRACE) AS STRING
  123. OPTS(DRAW)        = "DrawOpt"
  124. OPTS(CHART)        = "ChartOpt"
  125. OPTS(SHOW)        = "ShowOpt"
  126. OPTS(PHOTO)        = "PhotoOpt"
  127. OPTS(TRACE)        = "TraceOpt"
  128. ''lists of reference keys for filters, fonts and symbols. 1 = install, 2 = don't
  129. GLOBAL IMPFILTERLIST1$
  130. IMPFILTERLIST1$    = "ImportFilterList1"
  131. GLOBAL IMPFILTERLIST2$
  132. IMPFILTERLIST2$    = "ImportFilterList2"
  133. GLOBAL EXPFILTERLIST1$
  134. EXPFILTERLIST1$    = "ExportFilterList1"
  135. GLOBAL EXPFILTERLIST2$
  136. EXPFILTERLIST2$    = "ExportFilterList2"
  137. GLOBAL FONTLIST1$
  138. FONTLIST1$        = "FontList1"
  139. GLOBAL FONTLIST2$
  140. FONTLIST2$        = "FontList2"
  141. GLOBAL SYMBOLLIST1$
  142. SYMBOLLIST1$    = "SymbolList1"
  143. GLOBAL SYMBOLLIST2$
  144. SYMBOLLIST2$    = "SymbolList2"
  145. ''information text for custom installation window
  146. GLOBAL STATUSTEXT$
  147. STATUSTEXT$  = "StatusItemsText"
  148. GLOBAL DRIVETEXT$
  149. DRIVETEXT$   = "DriveStatusText"
  150. ''used as a parm to GetCopyListCost only
  151. GLOBAL EXTRACOSTS$
  152. EXTRACOSTS$ = "ExtraCosts"
  153. GLOBAL bTooBig%
  154. bTooBig% = FALSE
  155. GLOBAL CustomGroups%        '' TRUE ==> user went through SELECTCUSTGROUPS
  156. CustomGroups% = FALSE
  157. GLOBAL bInstallWinDLL%    '' Should the dlls be copied to the windows system dir?
  158.                                                 '' Note: redists are always copied under win 3.0
  159. bInstallWinDLL% = FALSE
  160. GLOBAL bInstallNet%            '' Are we installing a network version?
  161. GLOBAL bAddedFilters%        '' Did we install any filters? 
  162.  
  163. ''list of sections (1..NUMGROUPS)
  164. GLOBAL afState(NUMCUST) AS INTEGER        ''list of selections for main options
  165. GLOBAL DIR(NUMGROUPS) AS STRING        ''list of directories for main options
  166. GLOBAL NUM(3) AS STRING                                ''string representations of 1 .. 3
  167. ''CustInst list of symbol names - each is a list of 26 numbers corresponding
  168. ''  to the space required on that numbered drive for the files in the
  169. ''  corresponding group
  170. GLOBAL aszNEEDS(NUMGROUPS) AS STRING
  171.  
  172. GLOBAL WINDIR$            ''Windows directory.
  173. GLOBAL WINSYSDIR$        ''Windows directory.
  174. GLOBAL WINDRIVE$        ''Windows drive letter.
  175. GLOBAL bWindowsIsNetworked%
  176. GLOBAL DEST$            ''destination directory.
  177. GLOBAL szFontDir$        ''directory for .ttf fonts
  178. GLOBAL szWWinDir$        ''Writable Windows directory
  179.  
  180. GLOBAL TOOLGROUP$                    '' Group in which tools are to be installed
  181. GLOBAL aszGroups(MOSAIC) AS STRING    '' Custom progman groups
  182.  
  183. ''Windows version numbers
  184. GLOBAL WinMinor%
  185.  
  186. ''Variables to fake subroutines with parameters
  187. GLOBAL szFlist1a$
  188. GLOBAL szFlist1b$
  189. GLOBAL szFlist2a$
  190. GLOBAL szFlist2b$
  191. GLOBAL Dialog%
  192. GLOBAL SelectType%
  193. GLOBAL szOptions$
  194. GLOBAL bRecalcOpt%
  195.  
  196. ''TRUE => must do a global recalculation after GetPath - starts TRUE
  197. GLOBAL bRecalc%
  198.  
  199. ''Globals for WaitOn and WaitOff
  200. GLOBAL nWaiting%
  201. GLOBAL CursorSave%
  202.  
  203. GLOBAL bPathAltered%    '' If set then autoexec.bat has been changed
  204. GLOBAL SrcDir$                '' Directory where files can be found
  205. SrcDir$ = GetSymbolValue("STF_SRCDIR")
  206.  
  207. ''local MSTest functions
  208. DECLARE SUB WaitOnBig
  209. DECLARE SUB WaitOn
  210. DECLARE SUB WaitOff
  211. DECLARE SUB SetDirectories
  212. DECLARE SUB SetProgmanGroups
  213. DECLARE SUB PrepInstall
  214. DECLARE SUB FullInstall
  215. DECLARE SUB MinInstall
  216. DECLARE SUB AddOptFilesToCopyList( ftype% )
  217. DECLARE SUB RecalcOptFiles( ftype% )
  218. DECLARE SUB RecalcPath
  219. DECLARE SUB SetDriveStatus
  220. DECLARE SUB SetFontRedistDir
  221. DECLARE SUB AddRedistSection( szSection$, bInstallRedist%, bRedistFiles% )
  222. DECLARE SUB    WrapFileChangeString( szFile1$, szFile2$, szString1$, szString2$ )
  223. DECLARE SUB    WrapExecCommand( szCommand$ )
  224. DECLARE SUB    WrapCommentIniSection( szFileName$, szTempFile$, szSection$, szPath$ )
  225. DECLARE    SUB    CheckBackupFile( szFile1$, szFile2$ )
  226. DECLARE FUNCTION CreateProgmanItem (szGroup$, szItem$, szCmd$, szOther$, cmo%) AS INTEGER
  227. DECLARE FUNCTION WrapScanList( szSymbol$, nIndex% ) AS INTEGER
  228. DECLARE FUNCTION MakePath( szDir$, szFile$ ) AS STRING
  229. DECLARE FUNCTION MakeDir( szDir$ ) AS STRING
  230.  
  231. INIT:
  232.     '' set waiting cursor
  233.     nWaiting% = 0
  234.     WaitOn
  235.     
  236.      '' Determine whether or not we are installing as a network administrator.
  237.     '' If we are, modify the copy of the .inf file to force files to be copied
  238.     '' as readonly.
  239.     IF GetSymbolValue("STF_MODE") = "ADMIN" THEN
  240.         bInstallNet% = TRUE
  241.         '' set the .inf readonly flag to true
  242.         szDir$ = GetSymbolValue("STF_CWDDIR")
  243.         WrapFileChangeString MakePath(szDir$,"draw.inf"), MakePath(szDir$,"___temp_"), """STF_READONLY""   = """"", """STF_READONLY""   = ""YES"""
  244.         szDir$ = ""
  245.     ELSE
  246.         bInstallNet% = FALSE
  247.     ENDIF
  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.     DEST$ = WINDRIVE$ + ":\"+TR_CORELDRW
  255.     SetDirectories
  256.  
  257.     OpenLogfile MakePath(WINDIR$, TR_LOGFILE), 0
  258.     
  259.     '$IFDEF INSTALLCD
  260.         WriteToLogFile TR_INSTALLCD
  261.     '$ELSE
  262.         WriteToLogFile TR_INSTALLFLOPPY
  263.     '$ENDIF
  264.     IF bInstallNet% THEN
  265.         WriteToLogFile TR_INSTALLNETADMIN
  266.     ENDIF
  267.     IF bWindowsIsNetworked% THEN
  268.         WriteToLogFile TR_NETWINDOWS
  269.     ENDIF
  270.     
  271.      '' Quit if installing a network version and windows is readonly on net
  272.     IF bWindowsIsNetworked% AND bInstallNet% AND IsDirWritable(WINSYSDIR$) = 0 THEN
  273.         Dialog% = WINREADONLY
  274.         GOSUB INFO
  275.         ERR = STFERR
  276.         GOTO QUIT
  277.     ENDIF
  278.  
  279.     ''find and read .inf file
  280.     ReadInfFile GetSymbolValue("STF_CWDDIR") + "draw.INF"
  281.  
  282.     SetSymbolValue STATUSTEXT$, "{"""","""","""","""","""","""","""","""",""""}"
  283.     SetSymbolValue DRIVETEXT$, "{"""","""","""","""","""","""","""","""","""","""","""","""","""","""",""""}"
  284.  
  285.     ''Disk cost list symbols
  286.     FOR i% = 1 TO NUMGROUPS STEP 1
  287.         aszNEEDS(i%)        = "DrawNeeds" + STR$(i%)
  288.     NEXT i%
  289.     
  290.     ''basic initialization
  291.     NUM(1) = "1"
  292.     NUM(2) = "2"
  293.     NUM(3) = "3"
  294.     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""}"
  295.     
  296.     ''Set windows version - for use with installing windows 3.1 DLL's
  297.     WinMinor% = GetWindowsMinorVersion
  298.     IF WinMinor% = 0 THEN
  299.         bInstallWinDLL% = TRUE
  300.     ENDIF
  301.     
  302.     ''set the default progman group to put everything in
  303.     TOOLGROUP$    = TR_TOOLGROUP
  304.  
  305.  
  306. '' Put up the Welcome dialog
  307. WELCOME:
  308.     WaitOff
  309.     IF bInstallNet% THEN
  310.         Dialog% = NETINSTWELCOME
  311.     ELSE
  312.         Dialog% = WELCOME
  313.     ENDIF
  314.     sz$ = UIStartDlg( "mscuistf.dll", Dialog%, "FInfoDlgProc", WELCOMEHELP, "FHelpDlgProc" )
  315.     SELECT CASE sz$
  316.     CASE "CONTINUE"
  317.         UIPop 1
  318.     CASE "ABOUT"
  319.         IF bInstallNet% THEN
  320.             Dialog% = NETADMINABOUT
  321.         ELSE
  322.             Dialog% = ABOUT
  323.         ENDIF
  324.         GOSUB INFO
  325.         GOTO WELCOME
  326.     CASE "REACTIVATE"
  327.         GOTO WELCOME
  328.     CASE ELSE
  329.         GOSUB ASKQUIT
  330.         GOTO WELCOME
  331.     END SELECT
  332.  
  333. '$ifdef UPGRADE
  334.     WriteToLogFile TR_UPGRADING
  335.     WriteToLogFile ""
  336.     SetSymbolValue "EditTextIn", DEST$
  337.     SetSymbolValue "EditFocus", "END"
  338. CHECKUPGRADE:
  339.     WaitOff
  340.     sz$ = UIStartDlg("mscuistf.dll", CHECKUPGRADE, "FEditDlgProc", CHECKUPGRADEHELP, "FHelpDlgProc")
  341.     SELECT CASE sz$
  342.     CASE "CONTINUE"
  343.         WaitOn
  344.         IF TestDoUpgrade( MakeDir(GetSymbolValue("EditTextOut")) ) = 0 THEN
  345.             Dialog% = CHECKUPGRADEFAIL
  346.             GOSUB INFO
  347.             GOTO CHECKUPGRADE
  348.         ENDIF
  349.     CASE "REACTIVATE"
  350.         bRecalc% = TRUE
  351.         GOTO CHECKUPGRADE
  352.     CASE ELSE
  353.         GOSUB ASKQUIT
  354.         GOTO CHECKUPGRADE
  355.     END SELECT
  356.     UIPop 1
  357. '$endif ''UPGRADE
  358.  
  359. '' fall through from WELCOME
  360. '' Allow the user to select between full, minimal and custom installation
  361. OPTIONS:
  362.     WaitOff
  363.     sz$ = UIStartDlg( "mscuistf.dll", OPTIONS, "FButtonsDlgProc", OPTIONSHELP, "FHelpDlgProc" )
  364.     SELECT CASE sz$
  365.     CASE "F"
  366.         UIPop(1)
  367.         ''At least one recalculation must be made to determine that everything fits
  368.         bRecalc% = TRUE
  369.         FullInstall
  370.         SetProgmanGroups
  371.         WriteToLogfile TR_FULLINSTALL
  372.         GOSUB GETPATH
  373.     CASE "M"
  374.         UIPop(1)
  375.         ''At least one recalculation must be made to determine that everything fits
  376.         bRecalc% = TRUE
  377.         MinInstall
  378.         SetProgmanGroups
  379.         WriteToLogfile TR_MININSTALL
  380.         GOSUB GETPATH
  381.     CASE "C"
  382.         UIPop(1)
  383.         ''At least one recalculation must be made to determine that everything fits
  384.         bRecalc% = TRUE
  385.         FullInstall
  386.         WriteToLogfile TR_CUSTOMINSTALL
  387.         GOSUB GETPATH
  388.         GOSUB CUSTINST
  389.     CASE "REACTIVATE"
  390.         GOTO OPTIONS
  391.     CASE ELSE
  392.         GOSUB ASKQUIT
  393.         GOTO OPTIONS
  394.     END SELECT
  395.  
  396. '' fall through from OPTIONS
  397. '' Do the installation using afState, OPTS(DRAW) .. OPT(TRACE), etc. to
  398. '' indicate which files should be installed.
  399. INSTALL:
  400.     WaitOn
  401.     ''Make sure there is enough space for CorelDRAW!
  402.     IF bRecalc% THEN
  403.         WaitOnBig
  404.         bRecalc% = FALSE
  405.         RecalcPath
  406.         SetDriveStatus
  407.     ENDIF
  408.     IF bTooBig% <> FALSE THEN
  409.         Dialog% = TOOBIG
  410.         GOSUB INFO
  411.         GOTO OPTIONS
  412.     ENDIF
  413.     
  414.     ClearCopyList
  415.     ''Create all directories needed and assign all the files to copy
  416.     FOR i% = 1 TO NUMGROUPS STEP 1
  417.         IF afState(i%) <> NONE THEN
  418.             CreateDir DIR(i%), cmoNone
  419.             AddOptFilesToCopyList i%
  420.         ENDIF
  421.     NEXT i%
  422.     
  423.     IF bInstallNet% THEN
  424.         CreateDir MakePath(DIR(MAIN),TR_SETUP), cmoNone
  425.         IF afState(FONTSYM) <> NONE THEN
  426.             CreateDir MakePath(DIR(FONTSYM),TR_TTF), cmoNone
  427.         ENDIF
  428.     ELSE
  429.         '' backup files to *.cor - do not overwrite
  430.         CheckBackupFile MakePath(WINDIR$,"win.ini"), MakePath(WINDIR$,"win.cor")
  431.         CheckBackupFile MakePath(WINDIR$,"reg.dat"), MakePath(WINDIR$,"reg.cor")
  432.         CheckBackupFile MakePath(WINDIR$,"progman.ini"), MakePath(WINDIR$,"progman.cor")
  433.     ENDIF
  434.     
  435.     IF afState(DRAW) <> NONE THEN
  436.         IF afState(DRAW) = ALL OR GetListItem( OPTS(DRAW), 1 ) = "ON" THEN
  437.             IF bInstallNet% = FALSE THEN
  438.                 CreateDir MakePath( DIR(MAIN), TR_AUTOBACK ), cmoNone
  439.             ENDIF
  440.             CreateDir MakePath( DIR(DRAW), TR_EHANDLER ), cmoNone
  441.         ENDIF
  442.         IF afState(DRAW) = ALL OR GetListItem( OPTS(DRAW), 3 ) = "ON" THEN
  443.             CreateDir MakePath( DIR(DRAW), TR_SAMPLES ), cmoNone
  444.         ENDIF
  445.         '$IFNDEF INSTALLCD
  446.             IF afState(DRAW) = ALL OR GetListItem( OPTS(DRAW), 6 ) = "ON" THEN
  447.                 CreateDir MakePath( DIR(DRAW), TR_CLIPART ), cmoNone
  448.                 CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_AIRCRAFT ), cmoNone
  449.                 CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_BIRD ), cmoNone
  450.                 CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_CELEBRAT ), cmoNone
  451.                 CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_DENTAL ), cmoNone
  452.                 CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_EMERGENC ), cmoNone
  453.                 CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_EQUIPMEN ), cmoNone
  454.                 CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_FLAG ), cmoNone
  455.                 CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_FOOD ), cmoNone
  456.                 CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_ICON ), cmoNone
  457.                 CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_MAMMAL ), cmoNone
  458.                 CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_MAN ), cmoNone
  459.                 CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_MAP ), cmoNone
  460.                 CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_MEDICAL ), cmoNone
  461.                 CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_MISC ), cmoNone
  462.                 CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_MONEY ), cmoNone
  463.                 CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_POLITICA ), cmoNone
  464.                 CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_SIGN ), cmoNone
  465.                 CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_SPORTS ), cmoNone
  466.                 CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_THEME_BO ), cmoNone
  467.                 CreateDir MakePath( DIR(DRAW), TR_CLIPART + "\" + TR_WOMAN ), cmoNone
  468.             ENDIF
  469.         '$ENDIF
  470.     ENDIF
  471.             
  472.     IF afState(CHART) <> NONE THEN
  473.         IF afState(CHART) = ALL OR GetListItem( OPTS(CHART), 1 ) = "ON" THEN
  474.             CreateDir MakePath( DIR(CHART), TR_3DRISER ), cmoNone
  475.             CreateDir MakePath( DIR(CHART), TR_3DSCAT ), cmoNone
  476.             CreateDir MakePath( DIR(CHART), TR_AREA ), cmoNone
  477.             CreateDir MakePath( DIR(CHART), TR_BAR ), cmoNone
  478.             CreateDir MakePath( DIR(CHART), TR_BITMAPS ), cmoNone
  479.             CreateDir MakePath( DIR(CHART), TR_EFFECTS ), cmoNone
  480.             CreateDir MakePath( DIR(CHART), TR_HILO ), cmoNone
  481.             CreateDir MakePath( DIR(CHART), TR_HIST ), cmoNone
  482.             CreateDir MakePath( DIR(CHART), TR_LINE ), cmoNone
  483.             CreateDir MakePath( DIR(CHART), TR_PICTO ), cmoNone
  484.             CreateDir MakePath( DIR(CHART), TR_PIE ), cmoNone
  485.             CreateDir MakePath( DIR(CHART), TR_SCATTER ), cmoNone
  486.             CreateDir MakePath( DIR(CHART), TR_SPECTRAL ), cmoNone
  487.             IF bInstallNet% = FALSE THEN
  488.                 CreateDir MakePath( DIR(CHART), TR_TEMP ), cmoNone
  489.             ENDIF
  490.             CreateDir MakePath( DIR(CHART), TR_TABLE ), cmoNone
  491.             CreateDir MakePath( DIR(CHART), TR_VECTORS ), cmoNone
  492.         ENDIF
  493.         IF afState(CHART) = ALL OR GetListItem( OPTS(CHART), 3 ) = "ON" THEN
  494.             CreateDir MakePath( DIR(CHART), TR_SAMPLES ), cmoNone
  495.         ENDIF
  496.     ENDIF
  497.     
  498.     IF afState(SHOW) <> NONE THEN
  499.         IF afState(SHOW) = ALL OR GetListItem( OPTS(SHOW), 3 ) = "ON" THEN
  500.             CreateDir MakePath( DIR(SHOW), TR_SAMPLES ), cmoNone
  501.             CreateDir MakePath( DIR(SHOW), TR_FLICS ), cmoNone
  502.             CreateDir MakePath( DIR(SHOW), TR_BACKGRDS ), cmoNone
  503.         ENDIF
  504.         IF afState(SHOW) = ALL OR GetListItem( OPTS(SHOW), 4 ) = "ON" THEN
  505.             CreateDir MakePath( DIR(SHOW), TR_SHOWRUN ), cmoNone
  506.         ENDIF
  507.     ENDIF
  508.     
  509.     IF afState(PHOTO) <> NONE THEN
  510.         IF afState(PHOTO) = ALL OR GetListItem( OPTS(PHOTO), 1 ) = "ON" THEN
  511.             CreateDir MakePath( DIR(PHOTO), TR_PALETTES ), cmoNone
  512.             CreateDir MakePath( DIR(PHOTO), TR_TILES ), cmoNone
  513.         ENDIF
  514.         IF afState(PHOTO) = ALL OR GetListItem( OPTS(PHOTO), 3 ) = "ON" THEN
  515.             CreateDir MakePath( DIR(PHOTO), TR_SAMPLES ), cmoNone
  516.         ENDIF
  517.     ENDIF
  518.     
  519.     IF afState(AGRAPHIX) <> NONE THEN
  520.         CreateDir MakePath( DIR(AGRAPHIX), TR_PRINTERS ), cmoNone
  521.         CreateDir MakePath( DIR(AGRAPHIX), TR_TOAGX ), cmoNone
  522.     ENDIF
  523.             
  524.     '' add the extra stuff for root files
  525.     IF bAddedFilters% THEN
  526.         CreateDir MakePath(DIR(MAIN),TR_FILTERS), cmoNone
  527.     ENDIF
  528.     
  529.      '' If installing as a network administrator, copy redists to redist dir
  530.     IF bInstallNet% THEN
  531.         CreateDir MakePath(DIR(MAIN),TR_REDIST), cmoNone
  532.     ENDIF
  533.     
  534.     AddSectionFilesToCopyList "Main", SrcDir$, DEST$
  535.     
  536.      '' Add billboards
  537.     FOR i% = 1 TO 6 STEP 1
  538.         AddToBillBoardList "mscuistf.dll", BILLBOARD, "FModelessBitmapDlgProc", 10
  539.     NEXT i%
  540.     
  541.     ''Copy all the files over
  542.     WaitOff
  543.     CopyFilesInCopyList
  544.     WaitOn
  545.         
  546.     '' By default we do not want to do the print test.
  547.     bDoPrintTest% = FALSE
  548.         
  549.     '' if installing as a network administrator don't create .fot files
  550.     IF bInstallNet% = FALSE THEN
  551.         '' Register all the ttf fonts with Windows
  552.         IF WinMinor% > 0 AND afState(FONTSYM) <> NONE THEN
  553.             IF IsTTFEnabled = 1 THEN
  554.                 sz$ = UIStartDlg("mscuistf.dll", WAITREGISTER, "FModelessDlgProc", 0, "")
  555.                 IF afState(FONTSYM) = ALL THEN
  556.                     MakeListFromSectionKeys FONTLIST2$, "Fonts"
  557.                 ENDIF
  558.                 NeedsList$ = GetSymbolValue( FONTLIST2$ )
  559.                 nIndex% = 0
  560.                 nIndexInc% = WrapScanList(NeedsList$,nIndex%)
  561.                 WHILE nIndexInc% > 0
  562.                     szFileName$ = GetSectionKeyFilename( "Fonts", MID$(NeedsList$, nIndex%+3, nIndexInc%-3) )
  563.                     index% = GetFilenameFromPath( szFileName$ )
  564.                     szFileName2$ = MID$( szFileName$, index%, LEN(szFileName$) - index% + 1 )
  565.                     szFOTName$ = MID$(szFileName2$,1,LEN(szFileName2$)-3) + "fot"
  566.                     RegisterFont MakePath(szWWinDir$,szFOTName$), MakePath(szFontDir$,szFileName2$)
  567.                     IF bInstallNet% = FALSE THEN
  568.                         temp% = GetTypeFaceNameFromTTF( MakePath(szFontDir$,szFileName2$), szString$, STRINGLEN )
  569.                         CreateIniKeyValue TR_WIN_INI, "fonts", szString$+" "+TR_TRUETYPE, UCASE$(szFOTName$), cmoOverWrite
  570.                     ENDIF
  571.                     nIndex% = nIndex% + nIndexInc%
  572.                     nIndexInc% = WrapScanList(NeedsList$,nIndex%)
  573.                 WEND
  574.                 UIPop 1
  575.             ENDIF
  576.         ENDIF
  577.     ENDIF
  578. ''    szFileName$ = ""
  579. ''    szFileName2$ = ""
  580. ''    szFOTName$ = ""
  581.     
  582.     '' When installing as a network administrator, register nothing
  583.     IF bInstallNet% = FALSE THEN
  584.     
  585.          nAddItemFailed% = 0
  586.         
  587.         IF afState(DRAW) <> NONE THEN
  588.             IF afState(DRAW) = ALL OR GetListItem(OPTS(DRAW), 1) = "ON" THEN
  589.             
  590.                 '' setup coreldrw.reg
  591.                 WrapFileChangeString MakePath(DIR(DRAW),TR_CORELDRW_REG), MakePath(DIR(DRAW),"___temp_"), TR_CORELDRW_EXE, MakePath(DIR(DRAW),TR_CORELDRW_EXE)
  592.                 WrapExecCommand TR_REGLOAD_S + " " + MakePath(DIR(DRAW),TR_CORELDRW_REG)
  593.                 
  594.                 ini$ = MakePath(DIR(DRAW), TR_CORELDRW_INI)
  595.                 CreateIniKeyValue TR_WIN_INI, "Extensions", "cdr", MakePath(DIR(DRAW),TR_CORELDRW_EXE+" ^.cdr"), cmoOverWrite
  596.                 CreateIniKeyValue TR_WIN_INI, "CorelDraw3", "DrawDir", DIR(DRAW), cmoOverWrite
  597.                 CreateIniKeyValue ini$, "CDrawConfig", "Applic", DIR(DRAW), cmoOverwrite
  598.                 CreateIniKeyValue ini$, "CDrawConfig", "ConfigDir", DIR(DRAW), cmoOverwrite
  599.                 CreateIniKeyValue ini$, "CDrawConfig", "FontsDir", DIR(FONTSYM), cmoOverwrite
  600.                 CreateIniKeyValue ini$, "CDrawConfig", "CorelFiltersDir", MakePath(DIR(MAIN),TR_FILTERS), cmoOverwrite
  601.                 CreateIniKeyValue ini$, "CDrawConfig", "AutoBackupDir", MakePath(DIR(MAIN),TR_AUTOBACK), cmoOverwrite
  602.                 CreateIniKeyValue ini$, "Mosaic", "Applic", MakePath(DIR(MOSAIC),TR_CORELMOS_EXE), cmoOverwrite
  603.                 WrapCommentIniSection ini$, MakePath(Dir(DRAW),"___temp_"), "CDrawImportFilters", MakePath(DIR(MAIN),TR_FILTERS+"\")
  604.                 WrapCommentIniSection ini$, MakePath(Dir(DRAW),"___temp_"), "CDrawExportFilters", MakePath(DIR(MAIN),TR_FILTERS+"\")
  605.                 WrapCommentIniSection ini$, MakePath(Dir(DRAW),"___temp_"), "CorelDrwFonts", MakePath(DIR(FONTSYM),"")
  606.                 WrapCommentIniSection ini$, MakePath(Dir(DRAW),"___temp_"), "CorelDrwSymbols", MakePath(DIR(FONTSYM),"")
  607.             
  608.                 CreateProgmanGroup aszGroups(DRAW), "", cmoNone
  609.                 ShowProgmanGroup  aszGroups(DRAW), 1, cmoNone
  610.                 nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( aszGroups(DRAW), TR_RELEASENOTES, TR_NOTEPAD_EXE + " " + MakePath(DIR(MAIN),TR_README_TXT), "", cmoOverwrite)
  611.                 nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( aszGroups(DRAW), TR_CORELDRAW, MakePath(DIR(DRAW),TR_CORELDRW_EXE), "", cmoOverwrite)
  612.             ENDIF
  613.             IF afState(DRAW) = ALL OR GetListItem(OPTS(DRAW), 5) = "ON" THEN
  614.                 CreateProgmanGroup aszGroups(DRAW), "", cmoNone
  615.                 ShowProgmanGroup  aszGroups(DRAW), 1, cmoNone
  616.                 '' Make sure we use our winhelp if we installed one
  617.                 IF WinMinor% = 0 THEN
  618.                     nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( aszGroups(DRAW), TR_CORELDRAW+" "+TR_TUTORIAL, MakePath(WINSYSDIR$,TR_WINHELP)+" "+MakePath(DIR(DRAW),TR_TUTORIAL_HLP), "", cmoOverwrite)
  619.                 ELSE
  620.                     nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( aszGroups(DRAW), TR_CORELDRAW+" "+TR_TUTORIAL, TR_WINHELP+" "+MakePath(DIR(DRAW),TR_TUTORIAL_HLP), "", cmoOverwrite)
  621.                 ENDIF
  622.             ENDIF
  623.         ENDIF
  624. ''        DIR(FONTSYM) = ""
  625.     
  626.         IF afState(CHART) <> NONE THEN
  627.             IF afState(CHART) = ALL OR GetListItem(OPTS(CHART), 1) = "ON" THEN
  628.             
  629.                 '' setup corelcht.reg
  630.                 WrapFileChangeString MakePath(DIR(CHART),TR_CORELCHT_REG), MakePath(DIR(CHART),"___temp_"), TR_CORELCHT_EXE, MakePath(DIR(CHART),TR_CORELCHT_EXE)
  631.                 WrapExecCommand TR_REGLOAD_S + " " + MakePath(DIR(CHART),TR_CORELCHT_REG)
  632.                 
  633.                 CreateIniKeyValue TR_WIN_INI, "Extensions", "cch", MakePath(DIR(CHART),TR_CORELCHT_EXE+" ^.cch"), cmoOverWrite
  634.                 CreateIniKeyValue TR_WIN_INI, "CorelDraw3", "ChartDir", DIR(CHART), cmoOverWrite
  635.                 ini$ = MakePath(WINDIR$, "CORELCHT.INI")
  636.                 CreateIniKeyValue ini$, "CorelChart", "GATO_PATH", DIR(CHART), cmoOverwrite
  637.                 CreateIniKeyValue ini$, "CorelChart", "F3DF_3DRISER", MakePath(DIR(CHART),TR_3DRISER), cmoOverwrite
  638.                 CreateIniKeyValue ini$, "CorelChart", "F3DF_3DSCAT", MakePath(DIR(CHART),TR_3DSCAT), cmoOverwrite
  639.                 CreateIniKeyValue ini$, "CorelChart", "F3DF_AREA", MakePath(DIR(CHART),TR_AREA), cmoOverwrite
  640.                 CreateIniKeyValue ini$, "CorelChart", "F3DF_BAR", MakePath(DIR(CHART),TR_BAR), cmoOverwrite
  641.                 CreateIniKeyValue ini$, "CorelChart", "F3DF_HILO", MakePath(DIR(CHART),TR_HILO), cmoOverwrite
  642.                 CreateIniKeyValue ini$, "CorelChart", "F3DF_HIST", MakePath(DIR(CHART),TR_HIST), cmoOverwrite
  643.                 CreateIniKeyValue ini$, "CorelChart", "F3DF_LINE", MakePath(DIR(CHART),TR_LINE), cmoOverwrite
  644.                 CreateIniKeyValue ini$, "CorelChart", "F3DF_PICTO", MakePath(DIR(CHART),TR_PICTO), cmoOverwrite
  645.                 CreateIniKeyValue ini$, "CorelChart", "F3DF_PIE", MakePath(DIR(CHART),TR_PIE), cmoOverwrite
  646.                 CreateIniKeyValue ini$, "CorelChart", "F3DF_SCATTER", MakePath(DIR(CHART),TR_SCATTER), cmoOverwrite
  647.                 CreateIniKeyValue ini$, "CorelChart", "F3DF_SPECTRAL", MakePath(DIR(CHART),TR_SPECTRAL), cmoOverwrite
  648.                 CreateIniKeyValue ini$, "CorelChart", "F3DF_TABLE", MakePath(DIR(CHART),TR_TABLE), cmoOverwrite
  649.                 CreateIniKeyValue ini$, "CorelChart", "F3FX_EFFECTS", MakePath(DIR(CHART),TR_EFFECTS), cmoOverwrite
  650.                 CreateIniKeyValue ini$, "CorelChart", "F3FX_FILTERS", MakePath(DIR(MAIN),TR_FILTERS), cmoOverwrite
  651.                 CreateIniKeyValue ini$, "CorelChart", "F3FX_TEMPDIR", MakePath(DIR(CHART),TR_TEMP), cmoOverwrite
  652.                 CreateIniKeyValue ini$, "CorelChart", "F3FX_PICTIONARY", MakePath(DIR(CHART),TR_BITMAPS), cmoOverwrite
  653.                 CreateIniKeyValue ini$, "CorelChart", "Vector_path", MakePath(DIR(CHART),TR_VECTORS), cmoOverwrite
  654.                 CreateProgmanGroup aszGroups(CHART), "", cmoNone
  655.                 ShowProgmanGroup  aszGroups(CHART), 1, cmoNone
  656.                 nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( aszGroups(CHART), TR_CORELCHART, MakePath(DIR(CHART),TR_CORELCHT_EXE), "", cmoOverwrite)
  657.             ENDIF
  658.         ENDIF
  659.         IF afState(SHOW) <> NONE THEN
  660.             IF afState(SHOW) = ALL OR GetListItem(OPTS(SHOW), 1) = "ON" THEN
  661.             
  662.                 '' setup corelshw.reg
  663.                 WrapFileChangeString MakePath(DIR(SHOW),TR_CORELSHW_REG), MakePath(DIR(SHOW),"___temp_"),TR_CORELSHW_EXE, MakePath(DIR(SHOW),TR_CORELSHW_EXE)
  664.                 WrapExecCommand TR_REGLOAD_S + " " + MakePath(DIR(SHOW),TR_CORELSHW_REG)
  665.                 
  666.                 CreateIniKeyValue TR_WIN_INI, "Extensions", "shw", MakePath(DIR(SHOW),TR_CORELSHW_EXE+" ^.shw"), cmoOverWrite
  667.                 CreateIniKeyValue TR_WIN_INI, "Extensions", "shb", MakePath(DIR(SHOW),TR_CORELSHW_EXE+" ^.shb"), cmoOverWrite
  668.                 CreateIniKeyValue TR_WIN_INI, "CorelDraw3", "ShowDir", DIR(SHOW), cmoOverWrite
  669.                 CreateIniKeyValue TR_WIN_INI, "AAPLAY Animation", "WaveAudio", "c,522", cmoOverWrite
  670.                 CreateIniKeyValue TR_WIN_INI, "AAPLAY Animation", "Sequencer", "x,523", cmoOverWrite
  671.                 CreateIniKeyValue TR_WIN_INI, "AAPLAY Animation", "FullScreen", "AAVGA.DLL", cmoOverWrite
  672.                 CreateIniKeyValue TR_WIN_INI, "AAPLAY Animation", "DualScreen", "no", cmoOverWrite
  673.                 ini$ = MakePath(DIR(SHOW), TR_CORELSHW_INI)
  674.                 CreateIniKeyValue ini$, "CShowConfig", "ConfigDir", DIR(SHOW), cmoOverWrite
  675.                 CreateIniKeyValue ini$, "MasterBackGround", "defaultfile", MakePath(DIR(SHOW),TR_BACKGRDS+"\"+TR_SAMPLE_SHB), cmoOverwrite
  676.                 CreateProgmanGroup aszGroups(SHOW), "", cmoNone
  677.                 ShowProgmanGroup  aszGroups(SHOW), 1, cmoNone
  678.                 nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( aszGroups(SHOW), TR_CORELSHOW, MakePath(DIR(SHOW),TR_CORELSHW_EXE), "", cmoOverwrite)
  679.             ENDIF
  680.             IF afState(SHOW) = ALL OR GetListItem(OPTS(SHOW), 4) = "ON" THEN
  681.                 CreateProgmanGroup aszGroups(SHOW), "", cmoNone
  682.                 ShowProgmanGroup  aszGroups(SHOW), 1, cmoNone
  683.                 nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( aszGroups(SHOW), TR_CORELSHOW_RUNTIME_PLAYER, MakePath(DIR(SHOW),TR_SHOWRUN+"\"+TR_SHOWRUN_EXE), "", cmoOverwrite)
  684.             ENDIF
  685.         ENDIF
  686.         IF afState(PHOTO) <> NONE THEN
  687.             IF afState(PHOTO) = ALL OR GetListItem(OPTS(PHOTO), 1) = "ON" THEN
  688.             
  689.                 '' Register photo with OLE
  690.                 WrapFileChangeString MakePath(DIR(PHOTO),TR_CORELPNT_REG), MakePath(DIR(PHOTO),"___temp_"),TR_CORELPNT_EXE, MakePath(DIR(PHOTO),TR_CORELPNT_EXE)
  691.                 WrapFileChangeString MakePath(DIR(PHOTO),TR_CORELPNT_REG), MakePath(DIR(PHOTO),"___temp_"),TR_PNTHNDLR_DLL, MakePath(DIR(PHOTO),TR_PNTHNDLR_DLL)
  692.                 WrapExecCommand TR_REGLOAD_S + " " + MakePath(DIR(PHOTO),TR_CORELPNT_REG)
  693.                 
  694.                 CreateIniKeyValue TR_WIN_INI, "Extensions", "pcx", MakePath(DIR(PHOTO),TR_CORELPNT_EXE+" ^.pcx"), cmoOverWrite
  695.                 CreateIniKeyValue TR_WIN_INI, "CorelDraw3", "PhotoPaintDir", DIR(PHOTO), cmoOverWrite
  696.                 ini$ = MakePath(DIR(PHOTO),TR_CORELPNT_INI)
  697.                 CreateIniKeyValue ini$, "CorelPaintDll", "PCX 16 Color/Gray", MakePath(DIR(PHOTO),"pcx16.dll,*.pcx"), cmoOverWrite
  698.                 CreateProgmanGroup aszGroups(PHOTO), "", cmoNone
  699.                 ShowProgmanGroup  aszGroups(PHOTO), 1, cmoNone
  700.                 nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( aszGroups(PHOTO), TR_CORELPHOTO, MakePath(DIR(PHOTO),TR_CORELPNT_EXE), "", cmoOverwrite)
  701.                 nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( aszGroups(PHOTO), TR_CCAPTURE, MakePath(DIR(PHOTO),TR_CCAPTURE_EXE), "", cmoOverwrite)
  702.             ENDIF
  703.         ENDIF
  704.         IF afState(TRACE) <> NONE THEN
  705.             IF afState(TRACE) = ALL OR GetListItem(OPTS(TRACE), 1) = "ON" THEN
  706.                 CreateIniKeyValue TR_WIN_INI, "CorelDraw3", "TraceDir", DIR(TRACE), cmoOverWrite
  707.                 ini$ = MakePath(DIR(TRACE),TR_CORELTRC_INI)
  708.                 CreateIniKeyValue ini$, "CorelTrace", "OutPath", MakePath(WINDIR$,""), cmoOverWrite
  709.                 CreateIniKeyValue ini$, "CorelTrace", "InPath", MakePath(WINDIR$,""), cmoOverWrite
  710.                 CreateIniKeyValue ini$, "CorelTrace", "ApplPath", DIR(TRACE), cmoOverWrite
  711.                 CreateIniKeyValue ini$, "CorelTrace", "TraceFiltersDir", MakePath(DIR(MAIN),TR_FILTERS+"\"), cmoOverWrite
  712.                 CreateProgmanGroup aszGroups(TRACE), "", cmoNone
  713.                 ShowProgmanGroup  aszGroups(TRACE), 1, cmoNone
  714.                 nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( aszGroups(TRACE), TR_CORELTRACE, MakePath(DIR(TRACE),TR_CORELTRC_EXE), "", cmoOverwrite)
  715.             ENDIF
  716.         ENDIF
  717.         IF afState(MOSAIC) <> NONE THEN
  718.             CreateIniKeyValue TR_WIN_INI, "CorelDraw3", "MosaicDir", DIR(MOSAIC), cmoOverwrite
  719.             CreateProgmanGroup aszGroups(MOSAIC), "", cmoNone
  720.             ShowProgmanGroup  aszGroups(MOSAIC), 1, cmoNone
  721.             nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( aszGroups(MOSAIC), TR_CORELMOSAIC, MakePath(DIR(MOSAIC),TR_CORELMOS_EXE), "", cmoOverwrite)
  722.         ENDIF
  723.         
  724.         IF nAddItemFailed% > 0 THEN
  725.             Dialog% = NETADDITEMFAILED
  726.             GOSUB INFO
  727.         ENDIF
  728.         
  729.         '' Update CorelDraw's ini file to correspond to new components if it was
  730.         '' previously installed
  731.         IF afState(DRAW) <> ALL AND DoesIniKeyExist(TR_WIN_INI,"CorelDraw3","DrawDir") = 1 THEN
  732.             IF afState(DRAW) <> SOME OR GetListItem(OPTS(DRAW), 1) = "OFF" THEN
  733.                 ini$ = MakePath(GetIniKeyString(TR_WIN_INI,"CorelDraw3","DrawDir"), TR_CORELDRW_INI)
  734.                 IF bAddedFilters% THEN
  735.                     WrapCommentIniSection ini$, MakePath(Dir(DRAW),"___temp_"), "CDrawImportFilters", MakePath(DIR(MAIN),TR_FILTERS+"\")
  736.                     WrapCommentIniSection ini$, MakePath(Dir(DRAW),"___temp_"), "CDrawExportFilters", MakePath(DIR(MAIN),TR_FILTERS+"\")
  737.                 ENDIF
  738.                 IF afState(MOSAIC) = ALL THEN
  739.                     CreateIniKeyValue ini$, "Mosaic", "Applic", MakePath(DIR(MOSAIC),TR_CORELMOS_EXE), cmoOverwrite
  740.                 ENDIF
  741.                 IF afState(FONTSYM) <> NONE THEN
  742.                     WrapCommentIniSection ini$, MakePath(Dir(DRAW),"___temp_"), "CorelDrwFonts", MakePath(DIR(FONTSYM),"")
  743.                     WrapCommentIniSection ini$, MakePath(Dir(DRAW),"___temp_"), "CorelDrwSymbols", MakePath(DIR(FONTSYM),"")
  744.                 ENDIF
  745.             ENDIF
  746.         ENDIF
  747. ''        ini$ = ""
  748.         
  749.         '' Prepend the chart directory to the users path if possible
  750.         IF WinMinor% = 0 AND afState(CHART) <> NONE THEN
  751.             bPathAltered% = FALSE
  752.             IF afState(CHART) = ALL OR GetListItem(OPTS(CHART),1) = "ON" THEN
  753.                 IF DoesFileExist("C:\"+TR_AUTOEXEC_BAT,femWrite) = 1 AND DoesFileExist("C:\"+TR_AUTOEXEC_BAK,femRead) = 0 THEN
  754.                     szPath$ = GetEnvVariableValue( "path" )
  755.                     IF LEN( szPath$ ) + LEN( DIR(CHART) ) < 127 THEN
  756.                         RenameFile "C:\"+TR_AUTOEXEC_BAT, TR_AUTOEXEC_BAK
  757.                         PrependToPath "C:\"+TR_AUTOEXEC_BAK, "C:\"+TR_AUTOEXEC_BAT, DIR(CHART), cmoNone
  758.                         bPathAltered% = TRUE
  759.                     ENDIF
  760.                 ENDIF
  761.             ENDIF
  762.             '' Display the info dialog telling the user what we did
  763.             IF bPathAltered% THEN
  764.                 Dialog% = UPDATEDAUTOEXEC
  765.                 GOSUB INFO
  766.             ELSE
  767.                 Dialog% = UPDATEAUTOEXEC
  768.                 GOSUB INFO
  769.             ENDIF
  770.         ENDIF
  771.  
  772.         '' Is the system set up to allow us to print the samples?
  773.         IF afState(DRAW) = ALL THEN
  774.             bDoPrintTest% = TRUE
  775.         ELSEIF afState(DRAW) = SOME AND GetListItem(OPTS(DRAW),1) = "ON" AND GetListItem(OPTS(DRAW),3) = "ON" THEN
  776.             bDoPrintTest% = TRUE
  777.         ENDIF
  778.         
  779.     ELSE            '' if a network administrator
  780.         ini$ = MakePath( DIR(MAIN), TR_SETUP+"\"+TR_SETUP_INI )
  781.         CreateIniKeyValue ini$, "Directories", TR_FIXEDDRIVE, "FALSE", cmoOverwrite
  782.         CreateIniKeyValue ini$, "Directories", TR_DRAW, DIR(DRAW), cmoOverwrite
  783.         CreateIniKeyValue ini$, "Directories", TR_CHART, DIR(CHART), cmoOverwrite
  784.         CreateIniKeyValue ini$, "Directories", TR_SHOW, DIR(SHOW), cmoOverwrite
  785.         CreateIniKeyValue ini$, "Directories", TR_PHOTOPNT, DIR(PHOTO), cmoOverwrite
  786.         CreateIniKeyValue ini$, "Directories", TR_TRACE, DIR(TRACE), cmoOverwrite
  787.         CreateIniKeyValue ini$, "Directories", TR_MOSAIC, DIR(MOSAIC), cmoOverwrite
  788.         CreateIniKeyValue ini$, "Directories", TR_FONTS, DIR(FONTSYM), cmoOverwrite
  789.         CreateIniKeyValue ini$, "Directories", TR_TTF, MakePath(DIR(FONTSYM),TR_TTF), cmoOverwrite
  790.         CreateIniKeyValue ini$, "Directories", TR_MAIN, DIR(MAIN), cmoOverwrite
  791.     ENDIF            '' end 'network administrator?'
  792.     
  793.      '' Do print test?
  794.     IF bDoPrintTest% THEN
  795.         GOSUB PRINTTEST
  796.     ENDIF
  797.  
  798.  
  799. '' User has completed run of setup or has unconditionally decided to quit
  800. QUIT:
  801.     WaitOff
  802.     '' On MSTest errors report "setup file corrupted" and abort
  803.     ON ERROR GOTO ERRQUIT
  804.  
  805.     IF ERR = 0 THEN
  806.         sz$ = UIStartDlg("mscuistf.dll", SUCCESS, "FSuccessBitmapDlgProc", 0, "")
  807.         dlg% = EXITSUCCESS
  808.         szDlgProc$ = "FInfo075DlgProc"
  809.         WriteToLogfile TR_SETUPSUCCEEDED
  810.     ELSEIF ERR = STFQUIT THEN
  811.         dlg% = EXITQUIT
  812.         szDlgProc$ = "FInfo0DlgProc"
  813.         WriteToLogfile TR_SETUPQUIT
  814.     ELSE
  815.         dlg% = EXITFAILURE
  816.         szDlgProc$ = "FInfo0DlgProc"
  817.         WriteToLogfile TR_SETUPFAILED
  818.     ENDIF
  819.     WriteToLogfile ""
  820.     
  821.  
  822. '' Put up one of the exit message dialog boxes
  823. QUITL1:
  824.     sz$ = UIStartDlg("mscuistf.dll", dlg%, szDlgProc, 0, "")
  825.     IF sz$ = "REACTIVATE" THEN
  826.         GOTO QUITL1
  827.     ENDIF
  828.     UIPopAll
  829.     ShutDownInstall
  830.     CloseLogFile
  831.     END
  832.  
  833.  
  834. '' An error has occurred in MSTest. Tell the user and abort.
  835. ERRQUIT:
  836.     i% = DoMsgBox( TR_ERRQUIT, TR_SETUPMESSAGE, MB_OK+MB_TASKMODAL+MB_ICONHAND)
  837.     WriteToLogfile TR_SETUPCORRUPTED
  838.     WriteToLogFile ""
  839.     ShutDownInstall
  840.     CloseLogFile
  841.     END
  842.  
  843.  
  844. '' allow the user to select all the customize options
  845. CUSTINST:
  846.     RemoveSymbol "InstallDirs"
  847.     RemoveSymbol "InstallState"
  848.     '' pass current directories and custom install state to dlgproc
  849.     FOR i%= 1 to NUMCUST STEP 1
  850.         AddListItem "InstallDirs", DIR(i%)
  851.         AddListItem "InstallState", NUM(afState(i%))
  852.     NEXT i%
  853.     AddListItem "InstallDirs", DIR(MAIN)
  854.     
  855. CUSTINSTL1:
  856.     WaitOn
  857.     ''Do a full recalculation if necessary
  858.     IF bRecalc% THEN
  859.         WaitOnBig
  860.         bRecalc% = FALSE
  861.         RecalcPath
  862.     ENDIF
  863.     SetDriveStatus                '' set DriveText$ and StatusText$
  864.     WaitOff
  865.     
  866.     sz$ = UIStartDlg("mscuistf.dll", CUSTINST, "FCustInstDlgProc", CUSTINSTHELP, "FHelpDlgProc")
  867.     
  868.     SELECT CASE sz$
  869.     CASE "CONTINUE"
  870.         WaitOn
  871.         GOSUB SetDirFromSymbol    '' set afState and DIR array from symbols
  872.         SetDriveStatus                    '' Test for not enough space
  873.         IF bTooBig% <> FALSE THEN
  874.             Dialog% = TOOBIG
  875.             GOSUB INFO
  876.             GOTO CUSTINSTL1
  877.         ENDIF
  878.         
  879.         WriteToLogFile TR_DIRECTORIES
  880.         WriteToLogFile TR_CORELDRAW + " - " + DIR(DRAW)
  881.         WriteToLogFile TR_CORELCHART + " - " + DIR(CHART)
  882.         WriteToLogFile TR_CORELSHOW + " - " + DIR(SHOW)
  883.         WriteToLogFile TR_CORELPHOTO + " - " + DIR(PHOTO)
  884.         WriteToLogFile TR_CORELTRACE + " - " + DIR(TRACE)
  885.         WriteToLogFile TR_CORELMOSAIC + " - " + DIR(MOSAIC)
  886.         WriteToLogFile TR_FONTSYM + " - " + DIR(FONTSYM)
  887.         WriteToLogFile TR_MAIN + " - " + DIR(MAIN)
  888.         WriteToLogFile TR_CUSTOMSELECT
  889.         WriteToLogFile TR_CUSTOMMESSAGE
  890.         WriteToLogFile TR_CORELDRAW + " - " + STR$(afState(DRAW)) + " - " + GetSymbolValue(OPTS(DRAW))
  891.         WriteToLogFile TR_CORELCHART + " - " + STR$(afState(CHART)) + " - " + GetSymbolValue(OPTS(CHART))
  892.         WriteToLogFile TR_CORELSHOW + " - " + STR$(afState(SHOW)) + " - " + GetSymbolValue(OPTS(SHOW))
  893.         WriteToLogFile TR_CORELPHOTO + " - " + STR$(afState(PHOTO)) + " - " + GetSymbolValue(OPTS(PHOTO))
  894.         WriteToLogFile TR_CORELTRACE + " - " + STR$(afState(TRACE)) + " - " + GetSymbolValue(OPTS(TRACE))
  895.         WriteToLogFile TR_CORELMOSAIC + " - " + STR$(afState(MOSAIC))
  896.         WriteToLogFile TR_AUTOGRAPHIX_SLIDE_SERVICE + " - " + STR$(afState(AGRAPHIX))
  897.         WriteToLogFile TR_FONTSYM + " - " + STR$(afState(FONTSYM))
  898.         ''Maybe should add filters/fonts/symbols here
  899.         WriteToLogFile TR_ASTERIXES
  900.         
  901.     CASE "CUST1"
  902.         WaitOn
  903.         szOptions$ = OPTS(DRAW)
  904.         Dialog% = CUSTDRAW
  905.         SelectType% = DRAW
  906.         GOSUB SetDirFromSymbol    '' set afState and DIR array from symbols
  907.         GOSUB CUSTINST2
  908.         GOTO CUSTINSTL1
  909.     CASE "CUST2"
  910.         WaitOn
  911.         szOptions$ = OPTS(CHART)
  912.         Dialog% = CUSTCHART
  913.         SelectType% = CHART
  914.         GOSUB SetDirFromSymbol    '' set afState and DIR array from symbols
  915.         GOSUB CUSTINST2
  916.         GOTO CUSTINSTL1
  917.     CASE "CUST3"
  918.         WaitOn
  919.         szOptions$ = OPTS(SHOW)
  920.         Dialog% = CUSTSHOW
  921.         SelectType% = SHOW
  922.         GOSUB SetDirFromSymbol    '' set afState and DIR array from symbols
  923.         GOSUB CUSTINST2
  924.         GOTO CUSTINSTL1
  925.     CASE "CUST4"
  926.         WaitOn
  927.         szOptions$ = OPTS(PHOTO)
  928.         Dialog% = CUSTPHOTO
  929.         SelectType% = PHOTO
  930.         GOSUB SetDirFromSymbol    '' set afState and DIR array from symbols
  931.         GOSUB CUSTINST2
  932.         GOTO CUSTINSTL1
  933.     CASE "CUST5"
  934.         WaitOn
  935.         szOptions = OPTS(TRACE)
  936.         Dialog% = CUSTTRACE
  937.         SelectType% = TRACE
  938.         GOSUB SetDirFromSymbol    '' set afState and DIR array from symbols
  939.         GOSUB CUSTINST2
  940.         GOTO CUSTINSTL1
  941.     CASE "CUST8"
  942.         WaitOn
  943.         szFList1a$ = FONTLIST1$
  944.         szFList1b$ = FONTLIST2$
  945.         szFList2a$ = SYMBOLLIST1$
  946.         szFList2b$ = SYMBOLLIST2$
  947.         Dialog% = SELECTFONTSYM
  948.         SelectType% = FONTSYM
  949.         IF afState(FONTSYM) <> SOME THEN
  950.             afState(FONTSYM) = SOME
  951.             bRecalcOpt% = TRUE
  952.         ELSE
  953.             bRecalcOpt% = FALSE
  954.         ENDIF
  955.         GOSUB SetDirFromSymbol    '' set afState and DIR array from symbols
  956.         GOSUB SELECTFILES
  957.         GOTO CUSTINSTL1
  958.         
  959.     ''reset afState, the drive status and status text
  960.     CASE "RESET"
  961.         WaitOn
  962.         GOSUB SetDirFromSymbol    '' set afState and DIR array from symbols
  963.         GOTO CUSTINSTL1
  964.         
  965.     CASE "REACTIVATE"
  966.         bRecalc% = TRUE
  967.         GOSUB SetDirFromSymbol    '' set afState and DIR array from symbols
  968.         GOTO CUSTINSTL1
  969.         
  970.     CASE "CANCEL", "BACK"
  971.         WaitOn
  972.         UIPop 1
  973.         GOTO OPTIONS
  974.         
  975.     CASE ELSE
  976.         GOSUB ASKQUIT
  977.         GOSUB SetDirFromSymbol    '' set afState and DIR array from symbols
  978.         GOTO CUSTINSTL1
  979.     END SELECT
  980.     UIPop 1
  981.     
  982. '' Don't ask what progman group to use if installing as an administrator
  983. IF bInstallNet% THEN
  984.     GOTO ASKINSTALL
  985. ENDIF
  986.  
  987. '' Fall through from CUSTINST
  988. ''set the default progman group to put everything in
  989. TOOLGROUP$    = TR_TOOLGROUP
  990.  
  991. '' Let the user select the progman group where all executables will be stored
  992. SELECTGROUPS:
  993.     RemoveSymbol "EditText"
  994.     AddListItem "EditText", TOOLGROUP$
  995. SELECTGROUPSL1:
  996.     WaitOff
  997.     sz$ = UIStartDlg( "mscuistf.dll", SELECTGROUPS, "FMultiEditDlgProc", SELECTGROUPSHELP, "FHelpDlgProc" )
  998.     SELECT CASE sz$
  999.     CASE "CONTINUE"
  1000.         group$ = GetListitem("EditText",1)
  1001.         IF LEN(group$) > 30 THEN
  1002.             Dialog% = BADGROUP
  1003.             GOSUB INFO
  1004.             GOTO SELECTGROUPSL1
  1005.         ENDIF
  1006.         TOOLGROUP$ = group$
  1007.         SetProgmanGroups
  1008.     CASE "CANCEL", "BACK"
  1009.         UIPop 1
  1010.         GOTO CUSTINST
  1011.     CASE "REACTIVATE"
  1012.         bRecalc% = TRUE
  1013.         GOTO SELECTGROUPSL1
  1014.     CASE "BTN1"
  1015.         TOOLGROUP$ = GetListItem("EditText",1)
  1016.         SetProgmanGroups
  1017.         UIPop 1
  1018.         GOTO SELECTCUSTGROUPS
  1019.     CASE ELSE
  1020.         GOSUB ASKQUIT
  1021.         GOTO SELECTGROUPSL1
  1022.     END SELECT
  1023.     WriteToLogFile TR_PROGMANGROUP + TOOLGROUP$
  1024.     WriteToLogFile ""
  1025.     UIPop 1
  1026.     CustomGroups% = FALSE
  1027.     
  1028. ''Fall through from SelectGroups - or from SelectCustGroups
  1029. '' Ask the user if he wants to change any of his selections. If so, let him
  1030. ''   work his way back by hitting the "back" button
  1031. ASKINSTALL:
  1032.     WaitOff
  1033.     sz$ = UIStartDlg( "mscuistf.dll", ASKINSTALL, "FInfoDlgProc", ASKINSTALLHELP, "FHelpDlgProc" )
  1034.     SELECT CASE sz$
  1035.     CASE "CONTINUE"
  1036.         ''Do nothing
  1037.     CASE "CANCEL", "BACK"
  1038.         UIPop 1
  1039.         IF bInstallNet% THEN
  1040.             GOTO CUSTINST
  1041.         ELSEIF CustomGroups% THEN
  1042.             GOTO SELECTCUSTGROUPS
  1043.         ELSE
  1044.             GOTO SELECTGROUPS
  1045.         ENDIF
  1046.     CASE "REACTIVATE"
  1047.         bRecalc% = TRUE
  1048.         GOTO ASKINSTALL
  1049.     CASE ELSE
  1050.         GOSUB ASKQUIT
  1051.         GOTO ASKINSTALL
  1052.     END SELECT
  1053.     UIPop 1
  1054. RETURN        ''return to OPTIONS - going to INSTALL
  1055.     
  1056.  
  1057. '' Let the user customize the progman groups where each executable will be
  1058. '' stored
  1059. SELECTCUSTGROUPS:
  1060.     RemoveSymbol "EditText"
  1061.     FOR i% = DRAW TO MOSAIC STEP 1
  1062.         AddListItem "EditText", aszGroups( i% )
  1063.     NEXT i%
  1064. SELECTCUSTGROUPSL1:
  1065.     WaitOff
  1066.     sz$ = UIStartDlg( "mscuistf.dll", CUSTGROUPS, "FMultiEditDlgProc", CUSTGROUPSHELP, "FHelpDlgProc" )
  1067.     SELECT CASE sz$
  1068.     CASE "CONTINUE"
  1069.         FOR i% = DRAW TO MOSAIC STEP 1
  1070.             group$ = GetListItem( "EditText", i% )
  1071.             IF LEN(group$) > 30 THEN
  1072.                 Dialog% = BADGROUP
  1073.                 GOSUB INFO
  1074.                 GOTO SELECTCUSTGROUPSL1
  1075.             ENDIF
  1076.             aszGroups( i% ) = group$
  1077.         NEXT i%
  1078.     CASE "CANCEL", "BACK"
  1079.         UIPop 1
  1080.         GOTO SELECTGROUPS
  1081.     CASE "REACTIVATE"
  1082.         bRecalc% = TRUE
  1083.         GOTO SELECTCUSTGROUPSL1
  1084.     CASE ELSE
  1085.         GOSUB ASKQUIT
  1086.         GOTO SELECTCUSTGROUPSL1
  1087.     END SELECT
  1088.     WriteToLogFile TR_PROGMANGROUP
  1089.     WriteToLogFile TR_CORELDRAW + " - " + aszGroups(DRAW)
  1090.     WriteToLogFile TR_CORELCHART + " - " + aszGroups(CHART)
  1091.     WriteToLogFile TR_CORELSHOW + " - " + aszGroups(SHOW)
  1092.     WriteToLogFile TR_CORELPHOTO + " - " + aszGroups(PHOTO)
  1093.     WriteToLogFile TR_CORELTRACE + " - " + aszGroups(TRACE)
  1094.     WriteToLogFile TR_CORELMOSAIC + " - " + aszGroups(MOSAIC)
  1095.     WriteToLogFile TR_ASTERIXES
  1096.     WriteToLogFile ""
  1097.     UIPop 1
  1098.     CustomGroups% = TRUE
  1099.     GOTO ASKINSTALL
  1100.  
  1101.  
  1102. '' Input the custom installation choices for DRAW .. TRACE
  1103. CUSTINST2:
  1104.     SetSymbolValue "CheckItemsIn", GetSymbolValue( szOptions$ )
  1105.     szOldExpFilterList1$ = GetSymbolValue( EXPFILTERLIST1$ )
  1106.     szOldExpFilterList2$ = GetSymbolValue( EXPFILTERLIST2$ )
  1107.     szOldImpFilterList1$ = GetSymbolValue( IMPFILTERLIST1$ )
  1108.     szOldImpFilterList2$ = GetSymbolValue( IMPFILTERLIST2$ )
  1109. CUSTINST2L1:
  1110.     WaitOff
  1111.     sz$ = UIStartDlg("mscuistf.dll", Dialog%, "FCheckDlgProc", CUSTINST2HELP, "FHelpDlgProc")
  1112.  
  1113.     SELECT CASE sz$
  1114.     CASE "CONTINUE"
  1115.         WaitOn
  1116.         newopt$ = GetSymbolValue("CheckItemsOut")
  1117.         IF SelectType% = DRAW OR SelectType% = CHART OR SelectType% = TRACE THEN
  1118.             '' if we might have customized the filters, always recalc MAIN
  1119.             IF newopt$ <> GetSymbolValue(szOptions$) THEN
  1120.                 SetSymbolValue szOptions$, newopt$
  1121.                 RecalcOptFiles SelectType%
  1122.             ENDIF
  1123.             RecalcOptFiles MAIN
  1124.         ELSEIF newopt$ <> GetSymbolValue(szOptions$) THEN
  1125.             '' otherwise, only recalc if we changed things and win 3.0
  1126.             SetSymbolValue szOptions$, newopt$
  1127.             RecalcOptFiles SelectType%
  1128.             IF WinMinor% = 0 THEN
  1129.                 RecalcOptFiles MAIN
  1130.             ENDIF
  1131.         ENDIF
  1132. ''        newopt$ = ""
  1133.         
  1134.     CASE "BTN1"
  1135.         ''This will only happen if customizing filter selection
  1136.         szFList1a$ = EXPFILTERLIST1$
  1137.         szFList1b$ = EXPFILTERLIST2$
  1138.         szFList2a$ = IMPFILTERLIST1$
  1139.         szFList2b$ = IMPFILTERLIST2$
  1140.         oldDialog% = Dialog%
  1141.         Dialog% = SELECTFILTERS
  1142.         GOSUB SELECTFILES
  1143.         Dialog% = oldDialog%
  1144.         GOTO CUSTINST2L1
  1145.         
  1146.     CASE "REACTIVATE"
  1147.         bRecalc% = TRUE
  1148.         GOTO CUSTINST2L1
  1149.         
  1150.     CASE "CANCEL", "BACK"
  1151.         '' reset filters
  1152.         SetSymbolValue EXPFILTERLIST1$, szOldExpFilterList1$
  1153.         SetSymbolValue EXPFILTERLIST2$, szOldExpFilterList2$
  1154.         SetSymbolValue IMPFILTERLIST1$, szOldImpFilterList1$
  1155.         SetSymbolValue IMPFILTERLIST2$, szOldImpFilterList2$
  1156.         
  1157.     CASE ELSE
  1158.         GOSUB ASKQUIT
  1159.         GOTO CUSTINST2L1
  1160.         
  1161.     END SELECT
  1162. ''    szOldExpFilterList1$ = ""
  1163. ''    szOldExpFilterList2$ = ""
  1164. ''    szOldImpFilterList1$ = ""
  1165. ''    szOldImpFilterList2$ = ""
  1166.     UIPop 1
  1167. RETURN
  1168.  
  1169.  
  1170. '' Display an information dialog
  1171. '' Uses the global Dialog% to identify which dialog to display
  1172. INFO:
  1173.     WaitOff
  1174.     sz$ = UIStartDlg( "mscuistf.dll", Dialog%, "FInfo0DlgProc", 0, "" )
  1175.     SELECT CASE sz$
  1176.     CASE "CONTINUE"
  1177.         ''Do nothing
  1178.     CASE "REACTIVATE"
  1179.         bRecalc% = TRUE
  1180.         GOTO INFO
  1181.     CASE "EXIT"
  1182.         GOSUB ASKQUIT
  1183.         GOTO INFO
  1184.     END SELECT
  1185.     UIPop 1
  1186. RETURN
  1187.  
  1188. '' Get the base directory under which CorelDRAW! will be installed
  1189. GETPATH:
  1190.     WriteToLogFile ""
  1191.     SetSymbolValue "EditTextIn", DEST$
  1192.     SetSymbolValue "EditFocus", "END"
  1193. GETPATHL1:
  1194.     WaitOff
  1195.     sz$ = UIStartDlg("mscuistf.dll", DESTPATH, "FEditDlgProc", GETPATHHELP, "FHelpDlgProc")
  1196.     SELECT CASE sz$
  1197.     CASE "CONTINUE"
  1198.         WaitOn
  1199.         olddest$ = DEST$
  1200.         DEST$ = GetSymbolValue("EditTextOut")
  1201.  
  1202.         ''Validate new path.
  1203.         IF IsDirWritable(DEST$) = 0 THEN
  1204.             Dialog% = BADPATH
  1205.             GOSUB INFO
  1206.             GOTO GETPATHL1
  1207.         ENDIF
  1208.  
  1209.         ''Set Recalc and change subdirectories if DEST$ changed
  1210.         IF (olddest$ <> DEST$) AND (olddest$ <> DEST$+"\") AND (olddest$+"\" <> DEST$) THEN
  1211.             bRecalc% = TRUE
  1212.             SetDirectories
  1213.         ENDIF
  1214. ''        olddest$ = ""
  1215.         
  1216.     CASE "REACTIVATE"
  1217.         bRecalc% = TRUE
  1218.         GOTO GETPATHL1
  1219.     CASE "CANCEL", "BACK"
  1220.         UIPop 1
  1221.         GOTO OPTIONS
  1222.     CASE ELSE
  1223.         GOSUB ASKQUIT
  1224.         GOTO GETPATHL1
  1225.     END SELECT
  1226.     WriteToLogFile TR_BASEDIR + DEST$
  1227.     WriteToLogFile ""
  1228.     UIPop 1
  1229. RETURN
  1230.  
  1231.  
  1232. '' The user has asked to quit - confirm his decision
  1233. ASKQUIT:
  1234.     WaitOff
  1235.     sz$ = UIStartDlg("mscuistf.dll", ASKQUIT, "FQuitDlgProc", 0, "")
  1236.     SELECT CASE sz$
  1237.     CASE "EXIT"
  1238.         UIPopAll
  1239.         ERROR STFQUIT
  1240.     CASE "REACTIVATE"
  1241.         bRecalc% = TRUE
  1242.         GOTO ASKQUIT
  1243.     CASE ELSE
  1244.         ''Do nothing
  1245.     END SELECT
  1246.     UIPop 1
  1247. RETURN
  1248.  
  1249.  
  1250. '' Permit the user to select which filters or fonts/symbols he wants to install
  1251. SELECTFILES:
  1252.     SetSymbolValue "ListItems1a", GetSymbolValue( szFList1a$ )
  1253.     SetSymbolValue "ListItems1b", GetSymbolValue( szFList1b$ )
  1254.     SetSymbolValue "ListItems2a", GetSymbolValue( szFList2a$ )
  1255.     SetSymbolValue "ListItems2b", GetSymbolValue( szFList2b$ )
  1256.  
  1257. SELECTL1:
  1258.     WaitOff
  1259.     sz$ = UIStartDlg("mscuistf.dll", Dialog%, "FList4DlgProc", SELECTHELP, "FHelpDlgProc")
  1260.     
  1261.     SELECT CASE sz$
  1262.     CASE "CONTINUE"
  1263.         WaitOn
  1264.         ''If lists have been modified, reset them and recalculate
  1265.         newlist$ = GetSymbolValue( "ListItems1a" )
  1266.         IF newlist$ <> GetSymbolValue( szFList1a$ ) THEN
  1267.             IF newlist$ = "" THEN
  1268.                 SetSymbolValue szFList1a$, "{}"
  1269.             ELSE
  1270.                 SetSymbolValue szFList1a$, newlist$
  1271.             ENDIF
  1272.             newlist$ = GetSymbolValue( "ListItems1b" )
  1273.             IF newlist$ = "" THEN
  1274.                 SetSymbolValue szFList1b$, "{}"
  1275.             ELSE
  1276.                 SetSymbolValue szFList1b$, newlist$
  1277.             ENDIF
  1278.             bRecalcOpt = TRUE
  1279.         ENDIF
  1280.         newlist$ = GetSymbolValue( "ListItems2a" )
  1281.         IF newlist$ <> GetSymbolValue( szFList2a$ ) THEN
  1282.             IF newlist$ = "" THEN
  1283.                 SetSymbolValue szFList2a$, "{}"
  1284.             ELSE
  1285.                 SetSymbolValue szFList2a$, newlist$
  1286.             ENDIF
  1287.             newlist$ = GetSymbolValue( "ListItems2b" )
  1288.             IF newlist$ = "" THEN
  1289.                 SetSymbolValue szFList2b$, "{}"
  1290.             ELSE
  1291.                 SetSymbolValue szFList2b$, newlist$
  1292.             ENDIF
  1293.             bRecalcOpt% = TRUE
  1294.         ENDIF
  1295.         UIPop 1
  1296.         IF SelectType% = FONTSYM AND bRecalcOpt% THEN
  1297.             WaitOnBig
  1298.             RecalcOptFiles SelectType%
  1299.         ENDIF
  1300. ''        newlist$ = ""
  1301.     CASE "REACTIVATE"
  1302.         bRecalc% = TRUE
  1303.         GOTO SELECTL1
  1304.     CASE "CANCEL", "BACK"
  1305.         UIPop 1
  1306.         IF SelectType% = FONTSYM THEN
  1307.             WaitOnBig
  1308.             RecalcOptFiles SelectType%
  1309.         ENDIF
  1310.     CASE ELSE
  1311.         GOSUB ASKQUIT
  1312.         GOTO SELECTL1
  1313.     END SELECT
  1314.     RemoveSymbol "ListItems1a"
  1315.     RemoveSymbol "ListItems1b"
  1316.     RemoveSymbol "ListItems2a"
  1317.     RemoveSymbol "ListItems2b"
  1318. RETURN
  1319.  
  1320.  
  1321. '' ask the user whether or not to print the test samples
  1322. PRINTTEST:
  1323.     WaitOff
  1324.     sz$ = UIStartDlg( "mscuistf.dll", PRINTTEST, "FButtonsDlgProc", PRINTTESTHELP, "FHelpDlgProc" )
  1325.     SELECT CASE sz$
  1326.     CASE "P"
  1327.         UIPop(1)
  1328.         ini$ = MakePath(DIR(DRAW), TR_CORELDRW_INI)
  1329.         CreateIniKeyValue ini$, "CDrawConfig", "MaximizeCDraw", "1", cmoOverwrite
  1330.         InitPrintTestFile
  1331.         IF PrintTestFile( MakePath( DIR(DRAW), TR_SAMPLES+"\"+TR_SCREENS_CDR ), FALSE ) THEN
  1332.             bTemp% = PrintTestFile( MakePath( DIR(DRAW), TR_SAMPLES+"\"+TR_COLORBAR_CDR ), TRUE )
  1333.         ENDIF
  1334.         CreateIniKeyValue ini$, "CDrawConfig", "MaximizeCDraw", "0", cmoOverwrite
  1335.         ShutDownPrintTestFile
  1336.     CASE "D"
  1337.         UIPop(1)
  1338.     CASE ELSE
  1339.         GOTO PRINTTEST
  1340.     END SELECT
  1341. RETURN
  1342.  
  1343.  
  1344. '$INCLUDE 'draw2.mst'
  1345.