home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / m / m051 / 1.img / DRAW.MS_ / DRAW.MS
Encoding:
Text File  |  1992-05-15  |  63.7 KB  |  1,856 lines

  1. '' $Keywords: draw.mst 1.65 14May92 07:58am$ $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                RegisterDraw LIB "mscuistf.dll" (szDrawExePath$)
  16. DECLARE SUB                LoadStringResource LIB "mscuistf.dll" (nID%, szStr$, nStrLen%) 
  17. DECLARE SUB                RegisterFont LIB "mscuistf.dll" (szFOTName$, szTTFName$) 
  18. DECLARE SUB                FileChangeString LIB "mscuistf.dll" (szFile1$, szFile2$, szString1$, szString2$)
  19. DECLARE SUB                ExecCommand LIB "mscuistf.dll" (szCommand$)
  20. DECLARE FUNCTION    ScanList LIB "mscuistf.dll" (szSymbol$, nIndex%) AS INTEGER
  21. DECLARE FUNCTION    GetFilenameFromPath LIB "mscuistf.dll" (szPath$) AS INTEGER
  22. DECLARE FUNCTION    IsTTFEnabled LIB "mscuistf.dll" AS INTEGER
  23.  
  24. ''Strings for loading string resources
  25. GLOBAL szString$
  26. GLOBAL szString2$
  27. CONST     STRINGLEN =    66
  28. szString$ = string$( STRINGLEN+1, 32 )
  29. szString2$ = string$( STRINGLEN+1, 32 )
  30.  
  31. ''setup main window
  32. CONST IMSG_TITLE                = 9302            ''must match the constant in dialogs.h
  33. CONST LOGO                            = 9100            ''must match the constant in dialogs.h
  34. LoadStringResource IMSG_TITLE, szString$, STRINGLEN
  35. SetTitle szString$
  36. InitializeInstall hinstFrame(), HwndFrame()        ''corel style buttons; max window
  37. SetBitmap "mscuistf.dll", LOGO
  38.  
  39. '$INCLUDE 'msdetect.inc'
  40.  
  41. '' '$DEFINE DEBUG  ''Define for script development/debugging
  42.  
  43. ''Dialog ID's
  44. ''Note: These constants MUST match the constants in dialogs.h
  45. CONST WELCOME            = 9900
  46. CONST ASKQUIT            = 9901
  47. CONST DESTPATH           = 9902
  48. CONST EXITFAILURE        = 9903
  49. CONST EXITQUIT           = 9904
  50. CONST EXITSUCCESS        = 9905
  51. CONST OPTIONS            = 9906
  52. CONST CUSTINST           = 9907
  53. CONST TOOBIG             = 9908
  54. CONST BADPATH            = 9909
  55. CONST CUSTDRAW            = 9910
  56. CONST CUSTCHART            = 9911
  57. CONST CUSTSHOW            = 9912
  58. CONST CUSTPHOTO            = 9913
  59. CONST CUSTTRACE            = 9914
  60. CONST CUSTMOSAIC        = 9915
  61. CONST SELECTFILTERS    = 9916
  62. CONST SELECTFONTSYM    = 9917
  63. CONST WAIT                    = 9919
  64. CONST ABOUT                    = 9920
  65. CONST SELECTGROUPS    = 9921
  66. CONST ASKINSTALL        = 9922
  67. CONST CUSTGROUPS        = 9925
  68. CONST BILLBOARD            = 9926
  69. CONST UPDATEDAUTOEXEC    = 9930
  70. CONST UPDATEAUTOEXEC    = 9931
  71. CONST WAITREGISTER    = 9932
  72. CONST WELCOMEHELP        = 9800
  73. CONST OPTIONSHELP        = 9801
  74. CONST GETPATHHELP   = 9802
  75. CONST CUSTINSTHELP  = 9803
  76. CONST CUSTINST2HELP = 9804
  77. CONST SELECTHELP    = 9806
  78. CONST SELECTGROUPSHELP    = 9807
  79. CONST ASKINSTALLHELP        = 9808
  80. CONST CUSTGROUPSHELP    = 9809
  81. ''String Resource IDs
  82. CONST IMSG_ERRQUIT            = 9300
  83. CONST IMSG_SETUPMESSAGE    = 9301
  84. CONST IMSG_TOOLGROUP        = 9303
  85. CONST IMSG_RELEASENOTES    = 9304
  86. CONST IMSG_CORELDRAW        = 9306
  87. CONST IMSG_CORELCHART        = 9307
  88. CONST IMSG_CORELSHOW        = 9308
  89. CONST IMSG_CORELPHOTO        = 9309
  90. CONST IMSG_CORELTRACE        = 9310
  91. CONST IMSG_MOSAIC                = 9311
  92. CONST IMSG_FONTSYM            = 9312
  93. CONST IMSG_MAIN                    = 9313
  94. CONST IMSG_T1FONTS            = 9314
  95. CONST IMSG_TTF                    = 9315
  96. ''Logfile string constants
  97. CONST ILOG_FULLINSTALL        = 9350
  98. CONST ILOG_MININSTALL            = 9351
  99. CONST ILOG_CUSTOMINSTALL    = 9352
  100. CONST ILOG_SETUPSUCCEEDED    = 9353
  101. CONST ILOG_SETUPFAILED        = 9354
  102. CONST ILOG_SETUPQUIT            = 9355
  103. CONST ILOG_SETUPCORRUPTED    = 9356
  104. CONST ILOG_PROGMANGROUP        = 9357
  105. CONST ILOG_BASEDIR                = 9358
  106. CONST ILOG_DIRECTORIES        = 9359
  107. CONST ILOG_ASTERIXES            = 9360
  108. CONST ILOG_CUSTOMSELECT        = 9361
  109. CONST ILOG_CUSTOMMESSAGE  = 9362
  110.  
  111. ''Constants representing each line in the custinst dialog
  112. CONST DRAW          = 1
  113. CONST CHART         = 2
  114. CONST SHOW            = 3
  115. CONST PHOTO            = 4
  116. CONST TRACE            = 5
  117. CONST MOSAIC        = 6
  118. CONST FONTSYM        = 7
  119. CONST NUMCUST      = FONTSYM
  120. CONST MAIN            = NUMCUST + 1
  121. CONST NUMGROUPS    = MAIN
  122.  
  123. CONST FALSE    = 0
  124. CONST TRUE    = 1
  125.  
  126. '' Set this constant to the type of install interested in.
  127. CONST INSTALLCD = FALSE
  128.  
  129. '' used as values for afState(NUMCUST) array.
  130. CONST ALL        = 1
  131. CONST    SOME    = 2
  132. CONST    NONE    = 3
  133.  
  134. '' set 'customize' variables
  135.  
  136. ''Customized installation settings
  137. GLOBAL OPTS(MOSAIC) AS STRING
  138. OPTS(DRAW)        = "DrawOpt"
  139. OPTS(CHART)        = "ChartOpt"
  140. OPTS(SHOW)        = "ShowOpt"
  141. OPTS(PHOTO)        = "PhotoOpt"
  142. OPTS(TRACE)        = "TraceOpt"
  143. OPTS(MOSAIC)    = "MosaicOpt"
  144. ''lists of reference keys for filters, fonts and symbols. 1 = install, 2 = don't
  145. GLOBAL IMPFILTERLIST1$
  146. IMPFILTERLIST1$    = "ImportFilterList1"
  147. GLOBAL IMPFILTERLIST2$
  148. IMPFILTERLIST2$    = "ImportFilterList2"
  149. GLOBAL EXPFILTERLIST1$
  150. EXPFILTERLIST1$    = "ExportFilterList1"
  151. GLOBAL EXPFILTERLIST2$
  152. EXPFILTERLIST2$    = "ExportFilterList2"
  153. GLOBAL FONTLIST1$
  154. FONTLIST1$        = "FontList1"
  155. GLOBAL FONTLIST2$
  156. FONTLIST2$        = "FontList2"
  157. GLOBAL SYMBOLLIST1$
  158. SYMBOLLIST1$    = "SymbolList1"
  159. GLOBAL SYMBOLLIST2$
  160. SYMBOLLIST2$    = "SymbolList2"
  161. ''information text for custom installation window
  162. GLOBAL STATUSTEXT$
  163. STATUSTEXT$  = "StatusItemsText"
  164. GLOBAL DRIVETEXT$
  165. DRIVETEXT$   = "DriveStatusText"
  166. ''used as a parm to GetCopyListCost only
  167. GLOBAL EXTRACOSTS$
  168. EXTRACOSTS$ = "ExtraCosts"
  169. GLOBAL afTooBig%
  170. afTooBig% = FALSE
  171. GLOBAL CustomGroups%        '' TRUE ==> user went through SELECTCUSTGROUPS
  172. CustomGroups% = FALSE
  173. GLOBAL fInstallATM$            '' Should the type 1 fonts be installed?
  174. GLOBAL bInstallWinDLL%    '' Should the dlls be copied to the windows system dir?
  175.                                                 '' Note: redists are always copied under win 3.0
  176. bInstallWinDLL% = FALSE
  177. GLOBAL bInstallDLL%            '' Should the dlls be copied to the executable dirs?
  178. bInstallDLL% = TRUE
  179.  
  180. ''list of sections (1..NUMGROUPS) :- TRUE => not enough space.
  181. GLOBAL afState(NUMCUST) AS INTEGER        ''list of selections for main options
  182. GLOBAL DIR(NUMGROUPS) AS STRING        ''list of directories for main options
  183. GLOBAL NUM(3) AS STRING                                ''string representations of 1 .. 3
  184. ''CustInst list of symbol names - each is a list of 26 numbers corresponding
  185. ''  to the space required on that numbered drive for the files in the
  186. ''  corresponding group
  187. GLOBAL aszNEEDS(NUMGROUPS) AS STRING
  188.  
  189. GLOBAL WINDIR$        ''Windows directory.
  190. GLOBAL WINSYSDIR$        ''Windows directory.
  191. GLOBAL WINDRIVE$    ''Windows drive letter.
  192. GLOBAL DEST$        ''destination directory.
  193.  
  194. GLOBAL TOOLGROUP$                    '' Group in which tools are to be installed
  195. GLOBAL aszGroups(MOSAIC) AS STRING    '' Custom progman groups
  196.  
  197. ''Windows version numbers
  198. GLOBAL WinMinor%
  199.  
  200. ''Variables to fake subroutines with parameters
  201. GLOBAL szFlist1a$
  202. GLOBAL szFlist1b$
  203. GLOBAL szFlist2a$
  204. GLOBAL szFlist2b$
  205. GLOBAL Dialog%
  206. GLOBAL SelectType%
  207. GLOBAL szOptions$
  208.  
  209. ''TRUE => must do a global recalculation after GetPath - starts TRUE
  210. GLOBAL bRecalc%
  211.  
  212. ''Globals for WaitOn and WaitOff
  213. GLOBAL nWaiting%
  214. GLOBAL CursorSave%
  215.  
  216. GLOBAL bLogging%            ''If set then the logfile has been opened
  217.  
  218. Global bPathAltered%    '' If set then autoexec.bat has been changed
  219.  
  220. ''local MSTest functions
  221. DECLARE SUB SetStateFromSymbol
  222. DECLARE SUB WaitOnBig
  223. DECLARE SUB WaitOn
  224. DECLARE SUB WaitOff
  225. DECLARE SUB SetDirectories
  226. DECLARE SUB SetProgmanGroups
  227. DECLARE SUB FullInstall
  228. DECLARE SUB MinInstall
  229. DECLARE SUB AddOptFilesToCopyList (ftype%)
  230. DECLARE SUB RecalcOptFiles (ftype%)
  231. DECLARE SUB RecalcPath
  232. DECLARE SUB SetDriveStatus
  233. DECLARE SUB TestWriteToLogFile (szMsg$)
  234. DECLARE SUB WriteStringToLogFile (nResourceConst%)
  235. DECLARE SUB TestWriteStringToLogFile (nResourceConst%)
  236. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  237. DECLARE FUNCTION MakeDir (szDir$) AS STRING
  238.  
  239. INIT:
  240.     '' set waiting cursor
  241.     nWaiting% = 0
  242.     WaitOn
  243.     
  244.     ''Set default directory names
  245.     WINDIR$ = GetWindowsDir
  246.     WINSYSDIR$ = GetWindowsSysDir
  247.     WINDRIVE$ = MID$(WINDIR$, 1, 1)
  248.     DEST$ = WINDRIVE$ + ":\CORELDRW"
  249.     SetDirectories
  250.  
  251.     ''Open the logfile at the root of their windrive$
  252.     ''GetLocalHardDrivesList "LocalHardDrives"
  253.     ''szDrive$ = GetListItem( "LocalHardDrives", 1 )
  254.     ''IF szDrive$ <> "" THEN
  255.         ''OpenLogfile szDrive$ + ":\logfile.txt", 0
  256.         ''bLogging% = TRUE
  257.     ''ENDIF
  258.     ''RemoveSymbol "LocalHardDrives"
  259.     OpenLogfile WINDRIVE$ + ":\logfile.txt", 0
  260.     bLogging% = TRUE
  261.  
  262.     ''find and read .inf file
  263.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  264.     IF szInf$ = "" THEN
  265.         szInf$ = GetSymbolValue("STF_CWDDIR") + "draw.INF"
  266.     ENDIF
  267.     ReadInfFile szInf$
  268.     szInf$ = ""
  269.  
  270.     SetSymbolValue STATUSTEXT$, "{"""","""","""","""","""","""","""",""""}"
  271.     SetSymbolValue DRIVETEXT$, "{"""","""","""","""","""","""","""","""","""","""","""","""","""","""",""""}"
  272.  
  273.     ''Disk cost list symbols
  274.     FOR i% = 1 TO NUMGROUPS STEP 1
  275.         aszNEEDS(i%)        = "DrawNeeds" + STR$(i%)
  276.     NEXT i%
  277.     
  278.     ''basic initialization
  279.     NUM(1) = "1"
  280.     NUM(2) = "2"
  281.     NUM(3) = "3"
  282.     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""}"
  283.     
  284.     ''Set windows version - for use with installing windows 3.1 DLL's
  285.     WinMinor% = GetWindowsMinorVersion
  286.     IF WinMinor% = 0 THEN
  287.         bInstallWinDLL% = TRUE
  288.     ENDIF
  289.     
  290.     ''set the default progman group to put everything in
  291.     LoadStringResource IMSG_TOOLGROUP, szString$, STRINGLEN
  292.     TOOLGROUP$    = szString$
  293.  
  294.  
  295. '' Put up the Welcome dialog
  296. WELCOME:
  297.     WaitOff
  298.     sz$ = UIStartDlg( "mscuistf.dll", WELCOME, "FInfoDlgProc", WELCOMEHELP, "FHelpDlgProc" )
  299.     SELECT CASE sz$
  300.     CASE "CONTINUE"
  301.         UIPop 1
  302.     CASE "ABOUT"
  303.         Dialog% = ABOUT
  304.         GOSUB INFO
  305.         GOTO WELCOME
  306.     CASE "REACTIVATE"
  307.         GOTO WELCOME
  308.     CASE ELSE
  309.         GOSUB ASKQUIT
  310.         GOTO WELCOME
  311.     END SELECT
  312.  
  313.  
  314. '' fall through from WELCOME
  315. '' Allow the user to select between full, minimal and custom installation
  316. OPTIONS:
  317.     WaitOff
  318.     sz$ = UIStartDlg( "mscuistf.dll", OPTIONS, "FButtonsDlgProc", OPTIONSHELP, "FHelpDlgProc" )
  319.     SELECT CASE sz$
  320.     CASE "F"
  321.         UIPop(1)
  322.         ''At least one recalculation must be made to determine that everything fits
  323.         bRecalc% = TRUE
  324.         FullInstall
  325.         SetProgmanGroups
  326.         TestWriteStringToLogfile ILOG_FULLINSTALL
  327.         TestWriteToLogfile ""
  328.         GOSUB GETPATH
  329.     CASE "M"
  330.         UIPop(1)
  331.         ''At least one recalculation must be made to determine that everything fits
  332.         bRecalc% = TRUE
  333.         MinInstall
  334.         SetProgmanGroups
  335.         TestWriteStringToLogfile ILOG_MININSTALL
  336.         TestWriteToLogfile ""
  337.         GOSUB GETPATH
  338.     CASE "C"
  339.         UIPop(1)
  340.         ''At least one recalculation must be made to determine that everything fits
  341.         bRecalc% = TRUE
  342.         FullInstall
  343.         TestWriteStringToLogfile ILOG_CUSTOMINSTALL
  344.         TestWriteToLogfile ""
  345.         GOSUB GETPATH
  346.         GOSUB CUSTINST
  347.     CASE "REACTIVATE"
  348.         GOTO OPTIONS
  349.     CASE ELSE
  350.         GOSUB ASKQUIT
  351.         GOTO OPTIONS
  352.     END SELECT
  353.  
  354. '' fall through from OPTIONS
  355. '' Do the installation using afState, OPTS(DRAW) .. OPT(MOSAIC), etc. to
  356. '' indicate which files should be installed.
  357. INSTALL:
  358.     WaitOn
  359.     ''Make sure there is enough space for CorelDRAW!
  360.     IF bRecalc% = TRUE THEN
  361.         WaitOnBig
  362.         bRecalc% = FALSE
  363.         RecalcPath
  364.         SetDriveStatus
  365.     ENDIF
  366.     IF afTooBig% <> FALSE THEN
  367.         Dialog% = TOOBIG
  368.         GOSUB INFO
  369.         GOTO OPTIONS
  370.     ENDIF
  371.     
  372.     ClearCopyList
  373.     ''Create all directories needed and assign all the files to copy
  374.     FOR i% = 1 TO NUMGROUPS STEP 1
  375.         IF afState(i%) <> NONE THEN
  376.             CreateDir DIR(i%), cmoNone
  377.             AddOptFilesToCopyList i%
  378.         ENDIF
  379.     NEXT i%
  380.     CreateDir DIR(MAIN), cmoNone
  381.     
  382.     IF afState(DRAW) <> NONE THEN
  383.         IF afState(DRAW) = ALL OR GetListItem( OPTS(DRAW), 1 ) = "ON" THEN
  384.             CreateDir MakePath( DIR(MAIN), "autoback" ), cmoNone
  385.         ENDIF
  386.         IF afState(DRAW) = ALL OR GetListItem( OPTS(DRAW), 4 ) = "ON" THEN
  387.             CreateDir MakePath( DIR(DRAW), "samples" ), cmoNone
  388.         ENDIF
  389.         IF INSTALLCD = FALSE THEN
  390.             IF afState(DRAW) = ALL OR GetListItem( OPTS(DRAW), 5 ) = "ON" THEN
  391.                 CreateDir MakePath( DIR(DRAW), "clipart" ), cmoNone
  392.                 CreateDir MakePath( DIR(DRAW), "clipart\aircraft" ), cmoNone
  393.                 CreateDir MakePath( DIR(DRAW), "clipart\bird" ), cmoNone
  394.                 CreateDir MakePath( DIR(DRAW), "clipart\celebrat" ), cmoNone
  395.                 CreateDir MakePath( DIR(DRAW), "clipart\dental" ), cmoNone
  396.                 CreateDir MakePath( DIR(DRAW), "clipart\emergenc" ), cmoNone
  397.                 CreateDir MakePath( DIR(DRAW), "clipart\equipmen" ), cmoNone
  398.                 CreateDir MakePath( DIR(DRAW), "clipart\flag" ), cmoNone
  399.                 CreateDir MakePath( DIR(DRAW), "clipart\food" ), cmoNone
  400.                 CreateDir MakePath( DIR(DRAW), "clipart\icon" ), cmoNone
  401.                 CreateDir MakePath( DIR(DRAW), "clipart\mammal" ), cmoNone
  402.                 CreateDir MakePath( DIR(DRAW), "clipart\man" ), cmoNone
  403.                 CreateDir MakePath( DIR(DRAW), "clipart\map" ), cmoNone
  404.                 CreateDir MakePath( DIR(DRAW), "clipart\medical" ), cmoNone
  405.                 CreateDir MakePath( DIR(DRAW), "clipart\misc" ), cmoNone
  406.                 CreateDir MakePath( DIR(DRAW), "clipart\money" ), cmoNone
  407.                 CreateDir MakePath( DIR(DRAW), "clipart\politica" ), cmoNone
  408.                 CreateDir MakePath( DIR(DRAW), "clipart\sign" ), cmoNone
  409.                 CreateDir MakePath( DIR(DRAW), "clipart\sports" ), cmoNone
  410.                 CreateDir MakePath( DIR(DRAW), "clipart\theme_bo" ), cmoNone
  411.                 CreateDir MakePath( DIR(DRAW), "clipart\woman" ), cmoNone
  412.             ENDIF
  413.         ENDIF
  414.     ENDIF
  415.             
  416.     IF afState(CHART) <> NONE THEN
  417.         IF afState(CHART) = ALL OR GetListItem( OPTS(CHART), 1 ) = "ON" THEN
  418.             CreateDir MakePath( DIR(CHART), "3driser" ), cmoNone
  419.             CreateDir MakePath( DIR(CHART), "3dscat" ), cmoNone
  420.             CreateDir MakePath( DIR(CHART), "area" ), cmoNone
  421.             CreateDir MakePath( DIR(CHART), "bar" ), cmoNone
  422.             CreateDir MakePath( DIR(CHART), "bitmaps" ), cmoNone
  423.             CreateDir MakePath( DIR(CHART), "effects" ), cmoNone
  424.             CreateDir MakePath( DIR(CHART), "hilo" ), cmoNone
  425.             CreateDir MakePath( DIR(CHART), "hist" ), cmoNone
  426.             CreateDir MakePath( DIR(CHART), "line" ), cmoNone
  427.             CreateDir MakePath( DIR(CHART), "picto" ), cmoNone
  428.             CreateDir MakePath( DIR(CHART), "pie" ), cmoNone
  429.             CreateDir MakePath( DIR(CHART), "scatter" ), cmoNone
  430.             CreateDir MakePath( DIR(CHART), "spectral" ), cmoNone
  431.             CreateDir MakePath( DIR(CHART), "temp" ), cmoNone
  432.             CreateDir MakePath( DIR(CHART), "table" ), cmoNone
  433.             CreateDir MakePath( DIR(CHART), "vectors" ), cmoNone
  434.         ENDIF
  435.         IF afState(CHART) = ALL OR GetListItem( OPTS(CHART), 3 ) = "ON" THEN
  436.             CreateDir MakePath( DIR(CHART), "samples" ), cmoNone
  437.         ENDIF
  438.     ENDIF
  439.     
  440.     IF afState(SHOW) <> NONE THEN
  441.         IF afState(SHOW) = ALL OR GetListItem( OPTS(SHOW), 3 ) = "ON" THEN
  442.             CreateDir MakePath( DIR(SHOW), "samples" ), cmoNone
  443.             CreateDir MakePath( DIR(SHOW), "flics" ), cmoNone
  444.             CreateDir MakePath( DIR(SHOW), "backgrds" ), cmoNone
  445.         ENDIF
  446.     ENDIF
  447.     
  448.     IF afState(PHOTO) <> NONE THEN
  449.         IF afState(PHOTO) = ALL OR GetListItem( OPTS(PHOTO), 1 ) = "ON" THEN
  450.             CreateDir MakePath( DIR(PHOTO), "palettes" ), cmoNone
  451.             CreateDir MakePath( DIR(PHOTO), "tiles" ), cmoNone
  452.         ENDIF
  453.         IF afState(PHOTO) = ALL OR GetListItem( OPTS(PHOTO), 3 ) = "ON" THEN
  454.             CreateDir MakePath( DIR(PHOTO), "samples" ), cmoNone
  455.         ENDIF
  456.     ENDIF
  457.             
  458.     '' add the extra stuff for root files
  459.     CreateDir DEST$, cmoNone
  460.     bCreateDir% = FALSE
  461.     IF afState(DRAW) = ALL THEN
  462.         bCreateDir% = TRUE
  463.     ELSEIF afState(DRAW) = SOME AND GetListItem( OPTS(DRAW), 4 ) = "ON" THEN
  464.         bCreateDir% = TRUE
  465.     ENDIF
  466.     IF afState(CHART) = ALL THEN
  467.         bCreateDir% = TRUE
  468.     ELSEIF afState(CHART) = SOME AND GetListItem( OPTS(CHART), 4 ) = "ON" THEN
  469.         bCreateDir% = TRUE
  470.     ENDIF
  471.     IF afState(TRACE) = ALL THEN
  472.         bCreateDir% = TRUE
  473.     ELSEIF afState(TRACE) = SOME AND GetListItem( OPTS(TRACE), 3 ) = "ON" THEN
  474.         bCreateDir% = TRUE
  475.     ENDIF
  476.     IF bCreateDir% = TRUE THEN
  477.         CreateDir MakePath(DEST$,"FILTERS"), cmoNone
  478.     ENDIF
  479.     AddSectionFilesToCopyList "Main", GetSymbolValue("STF_SRCDIR"), DEST$
  480.     
  481.      '' Add billboards
  482.     AddToBillBoardList "mscuistf.dll", BILLBOARD, "FModelessBitmapDlgProc", 10
  483.     AddToBillBoardList "mscuistf.dll", BILLBOARD, "FModelessBitmapDlgProc", 10
  484.     AddToBillBoardList "mscuistf.dll", BILLBOARD, "FModelessBitmapDlgProc", 10
  485.     AddToBillBoardList "mscuistf.dll", BILLBOARD, "FModelessBitmapDlgProc", 10
  486.     AddToBillBoardList "mscuistf.dll", BILLBOARD, "FModelessBitmapDlgProc", 10
  487.     
  488.      '' Get rid of the WAIT dialog
  489.     WaitOff
  490.     WaitOn
  491.     
  492.     ''Copy all the files over
  493.     CopyFilesInCopyList
  494.     
  495.         
  496.     '' Register all the ttf fonts with Windows
  497.     IF WinMinor% > 0 AND afState(FONTSYM) <> NONE THEN
  498.         IF IsTTFEnabled = 1 THEN
  499.             sz$ = UIStartDlg("mscuistf.dll", WAITREGISTER, "FModelessDlgProc", 0, "")
  500.             IF afState(FONTSYM) = ALL THEN
  501.                 MakeListFromSectionKeys FONTLIST2$, "Fonts"
  502.             ENDIF
  503.             NeedsList$ = GetSymbolValue( FONTLIST2$ )
  504.             nIndex% = 0
  505.             nIndexInc% = ScanList(NeedsList$,nIndex%)
  506.             WHILE nIndexInc% > 0
  507.                 szFilename$ = GetSectionKeyFilename( "Fonts", MID$(NeedsList$, nIndex%+3, nIndexInc%-3) )
  508.                 IF MID$( szFilename$, LEN(szFilename$)-2, 3 ) = "ttf" THEN
  509.                     index% = GetFilenameFromPath( szFilename$ )
  510.                     szFilename2$ = MID$( szFilename$, index%, LEN(szFilename$) - index% + 1 )
  511.                     szFOTName$ = MID$(szFilename2$,1,LEN(szFilename2$)-3) + "fot"
  512.                     RegisterFont MakePath(WINSYSDIR$,szFOTName$), MakePath(WINSYSDIR$,szFilename2$)
  513.                     temp% = GetTypeFaceNameFromTTF( MakePath(WINSYSDIR$,szFilename2$), szString$, STRINGLEN )
  514.                     LoadStringResource IMSG_TTF, szString2$, STRINGLEN
  515.                     CreateIniKeyValue "WIN.INI", "fonts", szString$+" "+szString2$, MakePath(WINSYSDIR$,szFOTName$), cmoOverWrite
  516.                 ENDIF
  517.                 nIndex% = nIndex% + nIndexInc%
  518.                 nIndexInc% = ScanList(NeedsList$,nIndex%)
  519.             WEND
  520.             UIPop 1
  521.         ENDIF
  522.     ENDIF
  523.     szFilename$ = ""
  524.     szFilename2$ = ""
  525.     szFOTName$ = ""
  526.  
  527.     IF afState(DRAW) <> NONE THEN
  528.         IF afState(DRAW) = ALL OR GetListItem(OPTS(DRAW), 1) = "ON" THEN
  529.         
  530.             '' setup coreldrw.reg
  531.             FileChangeString MakePath(DIR(DRAW),"coreldrw.reg"), MakePath(DIR(DRAW),"___temp_"), "coreldrw.exe", MakePath(DIR(DRAW),"CORELDRW.EXE")
  532.             ExecCommand "regload /s " + MakePath(DIR(DRAW),"coreldrw.reg")
  533.             
  534.             ini$ = MakePath(DIR(DRAW), "CORELDRW.INI")
  535.             CreateIniKeyValue "WIN.INI", "Extensions", "cdr", MakePath(DIR(DRAW),"coreldrw.exe ^.cdr"), cmoOverWrite
  536.             CreateIniKeyValue "WIN.INI", "CorelDraw3", "DrawDir", MakeDir(DIR(DRAW)), cmoOverWrite
  537.             CreateIniKeyValue ini$, "CDrawConfig", "Applic", MakeDir(DIR(DRAW)), cmoOverwrite
  538.             CreateIniKeyValue ini$, "CDrawConfig", "ConfigDir", MakeDir(DIR(DRAW)), cmoOverwrite
  539.             CreateIniKeyValue ini$, "CDrawConfig", "FontsDir", MakeDir(DIR(FONTSYM)), cmoOverwrite
  540.             CreateIniKeyValue ini$, "CDrawConfig", "CorelFiltersDir", MakePath(DIR(MAIN),"FILTERS"), cmoOverwrite
  541.             CreateIniKeyValue ini$, "CDrawConfig", "AutoBackupDir", MakePath(DIR(MAIN),"AUTOBACK"), cmoOverwrite
  542.             CreateIniKeyValue ini$, "Mosaic", "Applic", MakePath(DIR(MOSAIC),"MOSAIC.EXE"), cmoOverwrite
  543.         
  544.             ''Register CorelDRAW! as OLE
  545.             RegisterDraw MakePath(DIR(DRAW),"CORELDRW.EXE")
  546.         
  547.             CreateProgmanGroup aszGroups(DRAW), "", cmoNone
  548.             ShowProgmanGroup  aszGroups(DRAW), 1, cmoNone
  549.             LoadStringResource IMSG_RELEASENOTES, szString$, STRINGLEN
  550.             CreateProgmanItem aszGroups(DRAW), szString$, "notepad.exe " + MakePath(DEST$,"readme.txt"), "", cmoOverwrite
  551.             LoadStringResource IMSG_CORELDRAW, szString$, STRINGLEN
  552.            CreateProgmanItem aszGroups(DRAW), szString$, MakePath(DIR(DRAW),"coreldrw.exe"), "", cmoOverwrite
  553.         ENDIF
  554.     ENDIF
  555.     DIR(FONTSYM) = ""
  556.  
  557.     IF afState(CHART) <> NONE THEN
  558.         IF afState(CHART) = ALL OR GetListItem(OPTS(CHART), 1) = "ON" THEN
  559.         
  560.             '' setup corelcht.reg
  561.             FileChangeString MakePath(DIR(CHART),"corelcht.reg"), MakePath(DIR(CHART),"___temp_"), "corelcht.exe", MakePath(DIR(CHART),"CORELCHT.EXE")
  562.             ExecCommand "regload /s " + MakePath(DIR(CHART),"corelcht.reg")
  563.             
  564.             CreateIniKeyValue "WIN.INI", "Extensions", "cch", MakePath(DIR(CHART),"corelcht.exe ^.cch"), cmoOverWrite
  565.             CreateIniKeyValue "WIN.INI", "CorelDraw3", "ChartDir", MakeDir(DIR(CHART)), cmoOverWrite
  566.             ini$ = MakePath(WINDIR$, "CORELCHT.INI")
  567.             CreateIniKeyValue ini$, "CorelChart", "GATO_PATH", MakeDir(DIR(CHART)), cmoOverwrite
  568.             CreateIniKeyValue ini$, "CorelChart", "F3DF_3DRISER", MakePath(DIR(CHART),"3DRISER"), cmoOverwrite
  569.             CreateIniKeyValue ini$, "CorelChart", "F3DF_3DSCAT", MakePath(DIR(CHART),"3DSCAT"), cmoOverwrite
  570.             CreateIniKeyValue ini$, "CorelChart", "F3DF_AREA", MakePath(DIR(CHART),"AREA"), cmoOverwrite
  571.             CreateIniKeyValue ini$, "CorelChart", "F3DF_BAR", MakePath(DIR(CHART),"BAR"), cmoOverwrite
  572.             CreateIniKeyValue ini$, "CorelChart", "F3DF_HILO", MakePath(DIR(CHART),"HILO"), cmoOverwrite
  573.             CreateIniKeyValue ini$, "CorelChart", "F3DF_HIST", MakePath(DIR(CHART),"HIST"), cmoOverwrite
  574.             CreateIniKeyValue ini$, "CorelChart", "F3DF_LINE", MakePath(DIR(CHART),"LINE"), cmoOverwrite
  575.             CreateIniKeyValue ini$, "CorelChart", "F3DF_PICTO", MakePath(DIR(CHART),"PICTO"), cmoOverwrite
  576.             CreateIniKeyValue ini$, "CorelChart", "F3DF_PIE", MakePath(DIR(CHART),"PIE"), cmoOverwrite
  577.             CreateIniKeyValue ini$, "CorelChart", "F3DF_SCATTER", MakePath(DIR(CHART),"SCATTER"), cmoOverwrite
  578.             CreateIniKeyValue ini$, "CorelChart", "F3DF_SPECTRAL", MakePath(DIR(CHART),"SPECTRAL"), cmoOverwrite
  579.             CreateIniKeyValue ini$, "CorelChart", "F3DF_TABLE", MakePath(DIR(CHART),"TABLE"), cmoOverwrite
  580.             CreateIniKeyValue ini$, "CorelChart", "F3DF_TEXT", MakePath(DIR(CHART),"TEXT"), cmoOverwrite
  581.             CreateIniKeyValue ini$, "CorelChart", "F3FX_EFFECTS", MakePath(DIR(CHART),"EFFECTS"), cmoOverwrite
  582.             CreateIniKeyValue ini$, "CorelChart", "F3FX_FILTERS", MakePath(DIR(MAIN),"FILTERS"), cmoOverwrite
  583.             CreateIniKeyValue ini$, "CorelChart", "F3FX_TEMPDIR", MakePath(DIR(CHART),"TEMP"), cmoOverwrite
  584.             CreateIniKeyValue ini$, "CorelChart", "F3FX_PICTIONARY", MakePath(DIR(CHART),"BITMAPS"), cmoOverwrite
  585.             CreateIniKeyValue ini$, "CorelChart", "Vector_path", MakePath(DIR(CHART),"VECTORS"), cmoOverwrite
  586.             CreateProgmanGroup aszGroups(CHART), "", cmoNone
  587.             ShowProgmanGroup  aszGroups(CHART), 1, cmoNone
  588.             LoadStringResource IMSG_CORELCHART, szString$, STRINGLEN
  589.           CreateProgmanItem aszGroups(CHART), szString$, MakePath(DIR(CHART),"corelcht.exe"), "", cmoOverwrite
  590.         ENDIF
  591.     ENDIF
  592.     IF afState(SHOW) <> NONE THEN
  593.         IF afState(SHOW) = ALL OR GetListItem(OPTS(SHOW), 1) = "ON" THEN
  594.         
  595.             '' setup corelshw.reg
  596.             FileChangeString MakePath(DIR(SHOW),"corelshw.reg"), MakePath(DIR(SHOW),"___temp_"), "corelshw.exe", MakePath(DIR(SHOW),"CORELSHW.EXE")
  597.             ExecCommand "regload /s " + MakePath(DIR(SHOW),"corelshw.reg")
  598.             
  599.             CreateIniKeyValue "WIN.INI", "Extensions", "shw", MakePath(DIR(SHOW),"corelshw.exe ^.shw"), cmoOverWrite
  600.             CreateIniKeyValue "WIN.INI", "Extensions", "shb", MakePath(DIR(SHOW),"corelshw.exe ^.shb"), cmoOverWrite
  601.             CreateIniKeyValue "WIN.INI", "CorelDraw3", "ShowDir", MakeDir(DIR(SHOW)), cmoOverWrite
  602.             CreateIniKeyValue "WIN.INI", "CorelShow", "Dir", MakeDir(DIR(SHOW)), cmoOverWrite
  603.             CreateIniKeyValue "WIN.INI", "AAPLAY Animation", "WaveAudio", "c,522", cmoOverWrite
  604.             CreateIniKeyValue "WIN.INI", "AAPLAY Animation", "Sequencer", "x,523", cmoOverWrite
  605.             CreateIniKeyValue "WIN.INI", "AAPLAY Animation", "FullScreen", "AAVGA.DLL", cmoOverWrite
  606.             CreateIniKeyValue "WIN.INI", "AAPLAY Animation", "DualScreen", "no", cmoOverWrite
  607.             ini$ = MakePath(DIR(SHOW), "CORELSHW.INI")
  608.             CreateIniKeyValue ini$, "CShowConfig", "ConfigDir", MakeDir(DIR(SHOW)), cmoOverwrite
  609.             CreateIniKeyValue ini$, "MasterBackGround", "defaultfile", MakePath(DIR(SHOW),"backgrds\sample.shb"), cmoOverwrite
  610.             CreateProgmanGroup aszGroups(SHOW), "", cmoNone
  611.             ShowProgmanGroup  aszGroups(SHOW), 1, cmoNone
  612.             LoadStringResource IMSG_CORELSHOW, szString$, STRINGLEN
  613.           CreateProgmanItem aszGroups(SHOW), szString$, MakePath(DIR(SHOW),"corelshw.exe"), "", cmoOverwrite
  614.         ENDIF
  615.     ENDIF
  616.     IF afState(PHOTO) <> NONE THEN
  617.         IF afState(PHOTO) = ALL OR GetListItem(OPTS(PHOTO), 1) = "ON" THEN
  618.         
  619.             '' Register photo with OLE
  620.             FileChangeString MakePath(DIR(PHOTO),"corelpnt.reg"), MakePath(DIR(PHOTO),"___temp_"), "corelpnt.exe", MakePath(DIR(PHOTO),"CORELPNT.EXE")
  621.             ExecCommand "regload /s " + MakePath(DIR(PHOTO),"corelpnt.reg")
  622.             
  623.             CreateIniKeyValue "WIN.INI", "Extensions", "pcx", MakePath(DIR(PHOTO),"corelpnt.exe ^.pcx"), cmoOverWrite
  624.             CreateIniKeyValue "WIN.INI", "CorelDraw3", "PhotoPaintDir", MakeDir(DIR(PHOTO)), cmoOverWrite
  625.             CreateIniKeyValue "WIN.INI", "PhotoPaint", "Path", MakeDir(DIR(PHOTO)), cmoOverWrite
  626.             CreateIniKeyValue "WIN.INI", "CorelPaintDll", "PCX 16 Color/Gray", MakePath(DIR(PHOTO),"pcx16.dll,*.pcx"), cmoOverWrite
  627.             CreateProgmanGroup aszGroups(PHOTO), "", cmoNone
  628.             ShowProgmanGroup  aszGroups(PHOTO), 1, cmoNone
  629.             LoadStringResource IMSG_CORELPHOTO, szString$, STRINGLEN
  630.             CreateProgmanItem aszGroups(PHOTO), szString$, MakePath(DIR(PHOTO),"corelpnt.exe"), "", cmoOverwrite
  631.         ENDIF
  632.     ENDIF
  633.     IF afState(TRACE) <> NONE THEN
  634.         IF afState(TRACE) = ALL OR GetListItem(OPTS(TRACE), 1) = "ON" THEN
  635.             CreateIniKeyValue "WIN.INI", "CorelDraw3", "TraceDir", MakeDir(DIR(TRACE)), cmoOverWrite
  636.             ini$ = MakePath(DIR(TRACE), "CORELTRC.INI")
  637.             CreateIniKeyValue ini$, "CorelTrace", "OutPath", MakePath(WINDIR$,""), cmoOverWrite
  638.             CreateIniKeyValue ini$, "CorelTrace", "InPath", MakePath(WINDIR$,""), cmoOverWrite
  639.             CreateIniKeyValue ini$, "CorelTrace", "ApplPath", MakeDir(DIR(TRACE)), cmoOverWrite
  640.             CreateIniKeyValue ini$, "CorelTrace", "TraceFiltersDir", MakePath(DIR(MAIN),"FILTERS\"), cmoOverWrite
  641.             CreateProgmanGroup aszGroups(TRACE), "", cmoNone
  642.             ShowProgmanGroup  aszGroups(TRACE), 1, cmoNone
  643.             LoadStringResource IMSG_CORELTRACE, szString$, STRINGLEN
  644.              CreateProgmanItem aszGroups(TRACE), szString$, MakePath(DIR(TRACE),"coreltrc.exe"), "", cmoOverwrite
  645.         ENDIF
  646.     ENDIF
  647.     IF afState(MOSAIC) <> NONE THEN
  648.         IF afState(MOSAIC) = ALL OR GetListItem(OPTS(MOSAIC), 1) = "ON" THEN
  649.             CreateIniKeyValue "WIN.INI", "CorelDraw3", "MosaicDir", MakeDir(DIR(MOSAIC)), cmoOverwrite
  650.             ini$ = MakePath(DIR(DRAW), "CORELDRW.INI")
  651.             CreateIniKeyValue ini$, "Mosaic", "Applic", MakePath(DIR(MOSAIC),"mosaic3.exe"), cmoOverwrite
  652.             CreateProgmanGroup aszGroups(MOSAIC), "", cmoNone
  653.             ShowProgmanGroup  aszGroups(MOSAIC), 1, cmoNone
  654.             LoadStringResource IMSG_MOSAIC, szString$, STRINGLEN
  655.           CreateProgmanItem aszGroups(MOSAIC), szString$, MakePath(DIR(MOSAIC),"mosaic3.exe"), "", cmoOverwrite
  656.         ENDIF
  657.     ENDIF
  658.     ini$ = ""
  659.     
  660.     '' Prepend the chart directory to the users path if possible
  661.     IF WinMinor% = 0 AND afState(CHART) <> NONE THEN
  662.         bPathAltered% = FALSE
  663.         IF afState(CHART) = ALL OR GetListItem(OPTS(CHART),1) = "ON" THEN
  664.             IF DoesFileExist("c:\autoexec.bat",femWrite) = 1 AND DoesFileExist("c:\autoexec.bak",femRead) = 0 THEN
  665.                 szPath$ = GetEnvVariableValue( "path" )
  666.                 IF LEN( szPath$ ) + LEN( MakeDir(DIR(CHART)) ) < 128 THEN
  667.                     RenameFile "c:\autoexec.bat", "autoexec.bak"
  668.                     PrependToPath "c:\autoexec.bak", "c:\autoexec.bat", MakeDir(DIR(CHART)), cmoNone
  669.                     bPathAltered% = TRUE
  670.                 ENDIF
  671.             ENDIF
  672.         ENDIF
  673.         '' Display the info dialog telling the user what we did
  674.         IF bPathAltered% = TRUE THEN
  675.             Dialog% = UPDATEDAUTOEXEC
  676.             GOSUB INFO
  677.         ELSE
  678.             Dialog% = UPDATEAUTOEXEC
  679.             GOSUB INFO
  680.         ENDIF
  681.     ENDIF
  682.     
  683. '' User has completed run of setup or has unconditionally decided to quit
  684. QUIT:
  685.     WaitOff
  686.     '' On MSTest errors report "setup file corrupted" and abort
  687.     ON ERROR GOTO ERRQUIT
  688.  
  689.     IF ERR = 0 THEN
  690.         dlg% = EXITSUCCESS
  691.         TestWriteStringToLogfile ILOG_SETUPSUCCEEDED
  692.         TestWriteToLogfile ""
  693.     ELSEIF ERR = STFQUIT THEN
  694.         dlg% = EXITQUIT
  695.         TestWriteStringToLogfile ILOG_SETUPQUIT
  696.         TestWriteToLogfile ""
  697.     ELSE
  698.         dlg% = EXITFAILURE
  699.         TestWriteStringToLogfile ILOG_SETUPFAILED
  700.         TestWriteToLogfile ""
  701.     ENDIF
  702.     
  703.  
  704. '' Put up one of the exit message dialog boxes
  705. QUITL1:
  706.     sz$ = UIStartDlg("mscuistf.dll", dlg%, "FInfo0DlgProc", 0, "")
  707.     IF sz$ = "REACTIVATE" THEN
  708.         GOTO QUITL1
  709.     ENDIF
  710.     UIPop 1
  711.     ShutDownInstall
  712.     CloseLogFile
  713.     END
  714.  
  715.  
  716. '' An error has occurred in MSTest. Tell the user and abort.
  717. ERRQUIT:
  718.     LoadStringResource IMSG_ERRQUIT, szString$, STRINGLEN
  719.     LoadStringResource IMSG_SETUPMESSAGE, szString2$, STRINGLEN
  720.     i% = DoMsgBox( szString$, szString2$, MB_OK+MB_TASKMODAL+MB_ICONHAND)
  721.     TestWriteStringToLogfile ILOG_SETUPCORRUPTED
  722.     TestWriteToLogfile ""
  723.     ShutDownInstall
  724.     CloseLogFile
  725.     END
  726.  
  727.  
  728. '' allow the user to select all the customize options
  729. CUSTINST:
  730.     RemoveSymbol "InstallDirs"
  731.     RemoveSymbol "InstallState"
  732.     '' pass current directories and custom install state to dlgproc
  733.     FOR i% = 1 to NUMCUST STEP 1
  734.         AddListItem "InstallDirs", DIR(i%)
  735.         AddListItem "InstallState", NUM(afState(i%))
  736.     NEXT i%
  737.     AddListItem "InstallDirs", DIR(MAIN)
  738.     
  739. CUSTINSTL1:
  740.     WaitOn
  741.     ''Do a full recalculation if necessary
  742.     IF bRecalc% = TRUE THEN
  743.         WaitOnBig
  744.         bRecalc% = FALSE
  745.         RecalcPath
  746.     ENDIF
  747.     SetDriveStatus                '' set DriveText$ and StatusText$
  748.     WaitOff
  749.     
  750.     sz$ = UIStartDlg("mscuistf.dll", CUSTINST, "FCustInstDlgProc", CUSTINSTHELP, "FHelpDlgProc")
  751.     
  752.     SELECT CASE sz$
  753.     CASE "CONTINUE"
  754.         WaitOn
  755.         SetStateFromSymbol            '' set afState array from "InstallState"
  756.         GOSUB SetDirFromSymbol    '' set DIR array from "InstallDirs"
  757.         IF afTooBig% <> FALSE THEN
  758.             Dialog% = TOOBIG
  759.             GOSUB INFO
  760.             GOTO CUSTINSTL1
  761.         ENDIF
  762.         
  763.         IF bLogging% THEN
  764.             WriteStringToLogfile ILOG_DIRECTORIES
  765.             FOR i% = DRAW TO MAIN
  766.                 LoadStringResource IMSG_CORELDRAW + i% - 1, szString$, STRINGLEN
  767.                 WriteToLogfile szString$ + " - " + DIR(i%)
  768.             NEXT i%
  769.             WriteStringToLogfile ILOG_CUSTOMSELECT
  770.             WriteStringToLogfile ILOG_CUSTOMMESSAGE
  771.             FOR i% = DRAW TO MOSAIC STEP 1
  772.                 LoadStringResource IMSG_CORELDRAW + i% - 1, szString$, STRINGLEN
  773.                 WriteToLogfile szString$ + " - " + STR$(afState(i%)) + " - " + GetSymbolValue( OPTS(i%) )
  774.             NEXT i%
  775.             LoadStringResource IMSG_FONTSYM, szString$, STRINGLEN
  776.             WriteToLogfile szString$ + " - " + STR$(afState(FONTSYM))
  777.             LoadStringResource IMSG_T1FONTS, szString$, STRINGLEN
  778.             WriteToLogFile szString$ + " - " + FInstallATM$
  779.             ''Maybe should add filters/fonts/symbols here
  780.             WriteStringToLogfile ILOG_ASTERIXES
  781.         ENDIF
  782.         
  783.     CASE "CUST1"
  784.         WaitOn
  785.         szOptions$ = OPTS(DRAW)
  786.         Dialog% = CUSTDRAW
  787.         SelectType% = DRAW
  788.         SetStateFromSymbol            '' set afState array from "InstallState"
  789.         GOSUB SetDirFromSymbol    '' set DIR array from "InstallDirs"
  790.         GOSUB CUSTINST2
  791.         GOTO CUSTINSTL1
  792.     CASE "CUST2"
  793.         WaitOn
  794.         szOptions$ = OPTS(CHART)
  795.         Dialog% = CUSTCHART
  796.         SelectType% = CHART
  797.         SetStateFromSymbol            '' set afState array from "InstallState"
  798.         GOSUB SetDirFromSymbol    '' set DIR array from "InstallDirs"
  799.         GOSUB CUSTINST2
  800.         GOTO CUSTINSTL1
  801.     CASE "CUST3"
  802.         WaitOn
  803.         szOptions$ = OPTS(SHOW)
  804.         Dialog% = CUSTSHOW
  805.         SelectType% = SHOW
  806.         SetStateFromSymbol            '' set afState array from "InstallState"
  807.         GOSUB SetDirFromSymbol    '' set DIR array from "InstallDirs"
  808.         GOSUB CUSTINST2
  809.         GOTO CUSTINSTL1
  810.     CASE "CUST4"
  811.         WaitOn
  812.         szOptions$ = OPTS(PHOTO)
  813.         Dialog% = CUSTPHOTO
  814.         SelectType% = PHOTO
  815.         SetStateFromSymbol            '' set afState array from "InstallState"
  816.         GOSUB SetDirFromSymbol    '' set DIR array from "InstallDirs"
  817.         GOSUB CUSTINST2
  818.         GOTO CUSTINSTL1
  819.     CASE "CUST5"
  820.         WaitOn
  821.         szOptions$ = OPTS(TRACE)
  822.         Dialog% = CUSTTRACE
  823.         SelectType% = TRACE
  824.         SetStateFromSymbol            '' set afState array from "InstallState"
  825.         GOSUB SetDirFromSymbol    '' set DIR array from "InstallDirs"
  826.         GOSUB CUSTINST2
  827.         GOTO CUSTINSTL1
  828.     CASE "CUST6"
  829.         WaitOn
  830.         szOptions$ = OPTS(MOSAIC)
  831.         Dialog% = CUSTMOSAIC
  832.         SelectType% = MOSAIC
  833.         SetStateFromSymbol            '' set afState array from "InstallState"
  834.         GOSUB SetDirFromSymbol    '' set DIR array from "InstallDirs"
  835.         GOSUB CUSTINST2
  836.         GOTO CUSTINSTL1
  837.     CASE "CUST7"
  838.         WaitOn
  839.         szFList1a$ = FONTLIST1$
  840.         szFList1b$ = FONTLIST2$
  841.         szFList2a$ = SYMBOLLIST1$
  842.         szFList2b$ = SYMBOLLIST2$
  843.         Dialog% = SELECTFONTSYM
  844.         SelectType% = FONTSYM
  845.         SetStateFromSymbol            '' set afState array from "InstallState"
  846.         GOSUB SetDirFromSymbol    '' set DIR array from "InstallDirs"
  847.         GOSUB SELECTFILES
  848.         GOTO CUSTINSTL1
  849.         
  850.     ''reset afState, the drive status and status text
  851.     CASE "RESET"
  852.         WaitOn
  853.         SetStateFromSymbol            '' set afState array from "InstallState"
  854.         GOSUB SetDirFromSymbol    '' set DIR array from "InstallDirs"
  855.         GOTO CUSTINSTL1
  856.         
  857.     CASE "REACTIVATE"
  858.         bRecalc% = TRUE
  859.         GOTO CUSTINSTL1
  860.         
  861.     CASE "CANCEL", "BACK"
  862.         WaitOn
  863.         UIPop 1
  864.         GOTO OPTIONS
  865.         
  866.     CASE ELSE
  867.         GOSUB ASKQUIT
  868.         SetStateFromSymbol            '' set afState array from "InstallState"
  869.         GOSUB SetDirFromSymbol    '' set DIR array from "InstallDirs"
  870.         GOTO CUSTINSTL1
  871.     END SELECT
  872.     UIPop 1
  873.     
  874.  
  875. '' Fall through from CUSTINST
  876. ''set the default progman group to put everything in
  877. LoadStringResource IMSG_TOOLGROUP, szString$, STRINGLEN
  878. TOOLGROUP$    = szString$
  879.  
  880. '' Let the user select the progman group where all executables will be stored
  881. SELECTGROUPS:
  882.     RemoveSymbol "EditText"
  883.     AddListItem "EditText", TOOLGROUP$
  884. SELECTGROUPSL1:
  885.     WaitOff
  886.     sz$ = UIStartDlg( "mscuistf.dll", SELECTGROUPS, "FMultiEditDlgProc", SELECTGROUPSHELP, "FHelpDlgProc" )
  887.     SELECT CASE sz$
  888.     CASE "CONTINUE"
  889.         TOOLGROUP$ = GetListItem("EditText",1)
  890.         SetProgmanGroups
  891.     CASE "CANCEL", "BACK"
  892.         UIPop 1
  893.         GOTO CUSTINST
  894.     CASE "REACTIVATE"
  895.         bRecalc% = TRUE
  896.         GOTO SELECTGROUPSL1
  897.     CASE "BTN1"
  898.         TOOLGROUP$ = GetListItem("EditText",1)
  899.         SetProgmanGroups
  900.         UIPop 1
  901.         GOTO SELECTCUSTGROUPS
  902.     CASE ELSE
  903.         GOSUB ASKQUIT
  904.         GOTO SELECTGROUPSL1
  905.     END SELECT
  906.     LoadStringResource ILOG_PROGMANGROUP, szString$, STRINGLEN
  907.     TestWriteToLogFile szString$ + TOOLGROUP$
  908.     TestWriteToLogfile ""
  909.     UIPop 1
  910.     CustomGroups% = FALSE
  911.     
  912. ''Fall through from SelectGroups - or from SelectCustGroups
  913. '' Ask the user if he wants to change any of his selections. If so, let him
  914. ''   work his way back by hitting the "back" button
  915. ASKINSTALL:
  916.     WaitOff
  917.     sz$ = UIStartDlg( "mscuistf.dll", ASKINSTALL, "FInfoDlgProc", ASKINSTALLHELP, "FHelpDlgProc" )
  918.     SELECT CASE sz$
  919.     CASE "CONTINUE"
  920.         ''Do nothing
  921.     CASE "CANCEL", "BACK"
  922.         UIPop 1
  923.         IF CustomGroups% = TRUE THEN
  924.             GOTO SELECTCUSTGROUPS
  925.         ELSE
  926.             GOTO SELECTGROUPS
  927.         ENDIF
  928.     CASE "REACTIVATE"
  929.         bRecalc% = TRUE
  930.         GOTO ASKINSTALL
  931.     CASE ELSE
  932.         GOSUB ASKQUIT
  933.         GOTO ASKINSTALL
  934.     END SELECT
  935.     UIPop 1
  936. RETURN        ''return to OPTIONS - going to INSTALL
  937.     
  938.  
  939. '' Let the user customize the progman groups where each executable will be
  940. '' stored
  941. SELECTCUSTGROUPS:
  942.     RemoveSymbol "EditText"
  943.     FOR i% = DRAW TO MOSAIC STEP 1
  944.         AddListItem "EditText", aszGroups( i% )
  945.     NEXT i%
  946. SELECTCUSTGROUPSL1:
  947.     WaitOff
  948.     sz$ = UIStartDlg( "mscuistf.dll", CUSTGROUPS, "FMultiEditDlgProc", CUSTGROUPSHELP, "FHelpDlgProc" )
  949.     SELECT CASE sz$
  950.     CASE "CONTINUE"
  951.         FOR i% = DRAW TO MOSAIC STEP 1
  952.             aszGroups( i% ) = GetListItem( "EditText", i% )
  953.         NEXT i%
  954.     CASE "CANCEL", "BACK"
  955.         UIPop 1
  956.         GOTO SELECTGROUPS
  957.     CASE "REACTIVATE"
  958.         bRecalc% = TRUE
  959.         GOTO SELECTCUSTGROUPSL1
  960.     CASE ELSE
  961.         GOSUB ASKQUIT
  962.         GOTO SELECTCUSTGROUPSL1
  963.     END SELECT
  964.     IF bLogging% THEN
  965.         WriteStringToLogfile ILOG_PROGMANGROUP
  966.         FOR i% = DRAW TO MOSAIC STEP 1
  967.             LoadStringResource IMSG_CORELDRAW + i% - 1, szString$, STRINGLEN
  968.             WriteToLogfile szString$ + " - " + aszGroups(i%)
  969.         NEXT i%
  970.         WriteStringToLogfile ILOG_ASTERIXES
  971.         WriteToLogfile ""
  972.     ENDIF
  973.     UIPop 1
  974.     CustomGroups% = TRUE
  975.     GOTO ASKINSTALL
  976.  
  977.  
  978. '' Input the custom installation choices for DRAW .. MOSAIC
  979. CUSTINST2:
  980.     SetSymbolValue "CheckItemsIn", GetSymbolValue( szOptions$ )
  981.     szOldExpFilterList1$ = GetSymbolValue( EXPFILTERLIST1$ )
  982.     szOldExpFilterList2$ = GetSymbolValue( EXPFILTERLIST2$ )
  983.     szOldImpFilterList1$ = GetSymbolValue( IMPFILTERLIST1$ )
  984.     szOldImpFilterList2$ = GetSymbolValue( IMPFILTERLIST2$ )
  985. CUSTINST2L1:
  986.     WaitOff
  987.     sz$ = UIStartDlg("mscuistf.dll", Dialog%, "FCheckDlgProc", CUSTINST2HELP, "FHelpDlgProc")
  988.  
  989.     SELECT CASE sz$
  990.     CASE "CONTINUE"
  991.         WaitOn
  992.         newopt$ = GetSymbolValue("CheckItemsOut")
  993.         IF SelectType% = DRAW OR SelectType% = CHART OR SelectType% = TRACE THEN
  994.             '' if we might have customized the filters, always recalc MAIN
  995.             IF newopt$ <> GetSymbolValue(szOptions$) THEN
  996.                 SetSymbolValue szOptions$, newopt$
  997.                 RecalcOptFiles SelectType%
  998.             ENDIF
  999.             RecalcOptFiles MAIN
  1000.         ELSEIF newopt$ <> GetSymbolValue(szOptions$) THEN
  1001.             '' otherwise, only recalc if we changed things and win 3.0
  1002.             SetSymbolValue szOptions$, newopt$
  1003.             RecalcOptFiles SelectType%
  1004.             IF WinMinor% = 0 THEN
  1005.                 RecalcOptFiles MAIN
  1006.             ENDIF
  1007.         ENDIF
  1008.         newopt$ = ""
  1009.         
  1010.     CASE "BTN1"
  1011.         ''This will only happen if customizing filter selection
  1012.         szFList1a$ = EXPFILTERLIST1$
  1013.         szFList1b$ = EXPFILTERLIST2$
  1014.         szFList2a$ = IMPFILTERLIST1$
  1015.         szFList2b$ = IMPFILTERLIST2$
  1016.         oldDialog% = Dialog%
  1017.         Dialog% = SELECTFILTERS
  1018.         GOSUB SELECTFILES
  1019.         Dialog% = oldDialog%
  1020.         GOTO CUSTINST2L1
  1021.         
  1022.     CASE "REACTIVATE"
  1023.         bRecalc% = TRUE
  1024.         GOTO CUSTINST2L1
  1025.         
  1026.     CASE "CANCEL", "BACK"
  1027.         '' reset filters
  1028.         SetSymbolValue EXPFILTERLIST1$, szOldExpFilterList1$
  1029.         SetSymbolValue EXPFILTERLIST2$, szOldExpFilterList2$
  1030.         SetSymbolValue IMPFILTERLIST1$, szOldImpFilterList1$
  1031.         SetSymbolValue IMPFILTERLIST2$, szOldImpFilterList2$
  1032.         
  1033.     CASE ELSE
  1034.         GOSUB ASKQUIT
  1035.         GOTO CUSTINST2L1
  1036.         
  1037.     END SELECT
  1038.     szOldExpFilterList1$ = ""
  1039.     szOldExpFilterList2$ = ""
  1040.     szOldImpFilterList1$ = ""
  1041.     szOldImpFilterList2$ = ""
  1042.     UIPop 1
  1043. RETURN
  1044.  
  1045.  
  1046. '' Display an information dialog
  1047. '' Uses the global Dialog% to identify which dialog to display
  1048. INFO:
  1049.     WaitOff
  1050.     sz$ = UIStartDlg( "mscuistf.dll", Dialog%, "FInfo0DlgProc", 0, "" )
  1051.     SELECT CASE sz$
  1052.     CASE "CONTINUE"
  1053.         ''Do nothing
  1054.     CASE "REACTIVATE"
  1055.         bRecalc% = TRUE
  1056.         GOTO INFO
  1057.     CASE "EXIT"
  1058.         GOSUB ASKQUIT
  1059.         GOTO INFO
  1060.     END SELECT
  1061.     UIPop 1
  1062. RETURN
  1063.  
  1064.  
  1065. '' Get the base directory under which CorelDRAW! will be installed
  1066. GETPATH:
  1067.     SetSymbolValue "EditTextIn", DEST$
  1068.     SetSymbolValue "EditFocus", "END"
  1069. GETPATHL1:
  1070.     WaitOff
  1071.     sz$ = UIStartDlg("mscuistf.dll", DESTPATH, "FEditDlgProc", GETPATHHELP, "FHelpDlgProc")
  1072.     SELECT CASE sz$
  1073.     CASE "CONTINUE"
  1074.         WaitOn
  1075.         olddest$ = DEST$
  1076.         DEST$ = GetSymbolValue("EditTextOut")
  1077.  
  1078.         ''Validate new path.
  1079.         IF IsDirWritable(DEST$) = 0 THEN
  1080.             Dialog% = BADPATH
  1081.             GOSUB INFO
  1082.             GOTO GETPATHL1
  1083.         ENDIF
  1084.  
  1085.         ''Set Recalc and change subdirectories if DEST$ changed
  1086.         IF (olddest$ <> DEST$) AND (olddest$ <> DEST$+"\") AND (olddest$+"\" <> DEST$) THEN
  1087.             bRecalc% = TRUE
  1088.             SetDirectories
  1089.         ENDIF
  1090.         olddest$ = ""
  1091.         
  1092.     CASE "REACTIVATE"
  1093.         bRecalc% = TRUE
  1094.         GOTO GETPATHL1
  1095.     CASE "CANCEL", "BACK"
  1096.         UIPop 1
  1097.         GOTO OPTIONS
  1098.     CASE ELSE
  1099.         GOSUB ASKQUIT
  1100.         GOTO GETPATHL1
  1101.     END SELECT
  1102.     LoadStringResource ILOG_BASEDIR, szString$, STRINGLEN
  1103.     TestWriteToLogfile szString$ + DEST$
  1104.     TestWriteToLogfile ""
  1105.     UIPop 1
  1106. RETURN
  1107.  
  1108.  
  1109. '' The user has asked to quit - confirm his decision
  1110. ASKQUIT:
  1111.     WaitOff
  1112.     sz$ = UIStartDlg("mscuistf.dll", ASKQUIT, "FQuitDlgProc", 0, "")
  1113.     SELECT CASE sz$
  1114.     CASE "EXIT"
  1115.         UIPopAll
  1116.         ERROR STFQUIT
  1117.     CASE "REACTIVATE"
  1118.         bRecalc% = TRUE
  1119.         GOTO ASKQUIT
  1120.     CASE ELSE
  1121.         ''Do nothing
  1122.     END SELECT
  1123.     UIPop 1
  1124. RETURN
  1125.  
  1126.  
  1127. '' Permit the user to select which filters or fonts/symbols he wants to install
  1128. SELECTFILES:
  1129.     SetSymbolValue "ListItems1a", GetSymbolValue( szFList1a$ )
  1130.     SetSymbolValue "ListItems1b", GetSymbolValue( szFList1b$ )
  1131.     SetSymbolValue "ListItems2a", GetSymbolValue( szFList2a$ )
  1132.     SetSymbolValue "ListItems2b", GetSymbolValue( szFList2b$ )
  1133.     SetSymbolValue "Button1", fInstallATM$
  1134.  
  1135. SELECTL1:
  1136.     WaitOff
  1137.     sz$ = UIStartDlg("mscuistf.dll", Dialog%, "FList4DlgProc", SELECTHELP, "FHelpDlgProc")
  1138.     
  1139.     SELECT CASE sz$
  1140.     CASE "CONTINUE"
  1141.         bRecalcOpt% = FALSE
  1142.         WaitOn
  1143.         ''If lists have been modified, reset them and recalculate
  1144.         newlist$ = GetSymbolValue( "ListItems1a" )
  1145.         IF newlist$ <> GetSymbolValue( szFList1a$ ) THEN
  1146.             IF newlist$ = "" THEN
  1147.                 SetSymbolValue szFList1a$, "{}"
  1148.             ELSE
  1149.                 SetSymbolValue szFList1a$, newlist$
  1150.             ENDIF
  1151.             newlist$ = GetSymbolValue( "ListItems1b" )
  1152.             IF newlist$ = "" THEN
  1153.                 SetSymbolValue szFList1b$, "{}"
  1154.             ELSE
  1155.                 SetSymbolValue szFList1b$, newlist$
  1156.             ENDIF
  1157.             bRecalcOpt = TRUE
  1158.         ENDIF
  1159.         newlist$ = GetSymbolValue( "ListItems2a" )
  1160.         IF newlist$ <> GetSymbolValue( szFList2a$ ) THEN
  1161.             IF newlist$ = "" THEN
  1162.                 SetSymbolValue szFList2a$, "{}"
  1163.             ELSE
  1164.                 SetSymbolValue szFList2a$, newlist$
  1165.             ENDIF
  1166.             newlist$ = GetSymbolValue( "ListItems2b" )
  1167.             IF newlist$ = "" THEN
  1168.                 SetSymbolValue szFList2b$, "{}"
  1169.             ELSE
  1170.                 SetSymbolValue szFList2b$, newlist$
  1171.             ENDIF
  1172.             bRecalcOpt% = TRUE
  1173.         ENDIF
  1174.         newlist$ = GetSymbolValue( "Button1" )
  1175.         IF( newlist$ <> fInstallATM$ ) THEN
  1176.             fInstallATM$ = newlist$
  1177.             bRecalcOpt% = TRUE
  1178.         ENDIF
  1179.         UIPop 1
  1180.         IF bRecalcOpt% = TRUE THEN
  1181.             WaitOnBig
  1182.             RecalcOptFiles SelectType%
  1183.         ENDIF
  1184.         newlist$ = ""
  1185.     CASE "REACTIVATE"
  1186.         bRecalc% = TRUE
  1187.         GOTO SELECTL1
  1188.     CASE "CANCEL", "BACK"
  1189.         UIPop 1
  1190.     CASE ELSE
  1191.         GOSUB ASKQUIT
  1192.         GOTO SELECTL1
  1193.     END SELECT
  1194.     RemoveSymbol "ListItems1a"
  1195.     RemoveSymbol "ListItems1b"
  1196.     RemoveSymbol "ListItems2a"
  1197.     RemoveSymbol "ListItems2b"
  1198. RETURN
  1199.  
  1200. '**
  1201. '** Purpose:
  1202. '**     Adds the specified option files to the copy list.
  1203. '** Arguments:
  1204. '**     ftype%  - type of files to add, one of the following:
  1205. '**             DRAW, CHART, SHOW, PHOTO, TRACE, MOSAIC or FONTSYM
  1206. '** Returns:
  1207. '**     none.
  1208. '*************************************************************************
  1209. SUB AddOptFilesToCopyList (ftype%) STATIC
  1210.  
  1211.     fState% = afState(ftype%)
  1212.     IF fState% <> NONE THEN
  1213.         SrcDir$ = GetSymbolValue("STF_SRCDIR")
  1214.         
  1215.         SELECT CASE ftype%
  1216.         CASE DRAW
  1217.             IF fState% = ALL OR GetListItem( OPTS(DRAW), 1 ) = "ON" THEN
  1218.                 IF bInstallWinDLL% = TRUE THEN
  1219.                     AddSectionFilesToCopyList "DrawDLL", SrcDir$, WINSYSDIR$
  1220.                 ENDIF
  1221.                 IF bInstallDLL% = TRUE THEN
  1222.                     AddSectionFilesToCopyList "DrawDLL", SrcDir$, DIR(DRAW)
  1223.                 ENDIF
  1224.                 AddSectionFilesToCopyList "DrawDraw", SrcDir$, DIR(DRAW)
  1225.             ENDIF
  1226.             IF fState% = ALL OR GetListItem( OPTS(DRAW), 2 ) = "ON" THEN
  1227.                 AddSectionFilesToCopyList "DrawHelp", SrcDir$, DIR(DRAW)
  1228.             ENDIF
  1229.             IF fState% = ALL OR GetListItem( OPTS(DRAW), 3 ) = "ON" THEN
  1230.                 AddSectionFilesToCopyList "DrawSamples", SrcDir$, MakePath(DIR(DRAW),"SAMPLES")
  1231.             ENDIF
  1232.             IF fState% = ALL OR GetListItem( OPTS(DRAW), 5 ) = "ON" THEN
  1233.                 IF INSTALLCD = FALSE THEN
  1234.                     AddSectionFilesToCopyList "ArtAircraft", SrcDir$, MakePath(DIR(DRAW),"CLIPART\AIRCRAFT")
  1235.                     AddSectionFilesToCopyList "ArtBird", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Bird")
  1236.                     AddSectionFilesToCopyList "ArtCelebrat", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Celebrat")
  1237.                     AddSectionFilesToCopyList "ArtDental", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Dental")
  1238.                     AddSectionFilesToCopyList "ArtEmergenc", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Emergenc")
  1239.                     AddSectionFilesToCopyList "ArtEquipmen", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Equipmen")
  1240.                     AddSectionFilesToCopyList "ArtFlag", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Flag")
  1241.                     AddSectionFilesToCopyList "ArtFood", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Food")
  1242.                     AddSectionFilesToCopyList "ArtIcon", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Icon")
  1243.                     AddSectionFilesToCopyList "ArtMammal", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Mammal")
  1244.                     AddSectionFilesToCopyList "ArtMan", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Man")
  1245.                     AddSectionFilesToCopyList "ArtMap", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Map")
  1246.                     AddSectionFilesToCopyList "ArtMedical", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Medical")
  1247.                     AddSectionFilesToCopyList "ArtMisc", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Misc")
  1248.                     AddSectionFilesToCopyList "ArtMoney", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Money")
  1249.                     AddSectionFilesToCopyList "ArtPolitica", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Politica")
  1250.                     AddSectionFilesToCopyList "ArtSign", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Sign")
  1251.                     AddSectionFilesToCopyList "ArtSports", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Sports")
  1252.                     AddSectionFilesToCopyList "ArtTheme_bo", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Theme_bo")
  1253.                     AddSectionFilesToCopyList "ArtWoman", SrcDir$, MakePath(DIR(DRAW),"CLIPART\Woman")
  1254.                 ELSE
  1255.                     AddSectionFilesToCopyList "DrawTutorial", SrcDir$, DIR(DRAW)
  1256.                 ENDIF
  1257.             ENDIF
  1258.             
  1259.         CASE CHART
  1260.             IF fState% = ALL OR GetListItem( OPTS(CHART), 1 ) = "ON" THEN
  1261.                 AddSectionFilesToCopyList "ChartIni", SrcDir$, WINDIR$
  1262.                 AddSectionFilesToCopyList "ChartDLL", SrcDir$, DIR(CHART)
  1263.                 AddSectionFilesToCopyList "ChartChart", SrcDir$, DIR(CHART)
  1264.                 AddSectionFilesToCopyList "Chart3driser", SrcDir$, MakePath(DIR(CHART),"3DRISER")
  1265.                 AddSectionFilesToCopyList "Chart3dscat", SrcDir$, MakePath(DIR(CHART),"3DSCAT")
  1266.                 AddSectionFilesToCopyList "ChartArea", SrcDir$, MakePath(DIR(CHART),"AREA")
  1267.                 AddSectionFilesToCopyList "ChartBar", SrcDir$, MakePath(DIR(CHART),"BAR")
  1268.                 AddSectionFilesToCopyList "ChartBitmaps", SrcDir$, MakePath(DIR(CHART),"BITMAPS")
  1269.                 AddSectionFilesToCopyList "ChartEffects", SrcDir$, MakePath(DIR(CHART),"EFFECTS")
  1270.                 AddSectionFilesToCopyList "ChartHilo", SrcDir$, MakePath(DIR(CHART),"HILO")
  1271.                 AddSectionFilesToCopyList "ChartHist", SrcDir$, MakePath(DIR(CHART),"HIST")
  1272.                 AddSectionFilesToCopyList "ChartLine", SrcDir$, MakePath(DIR(CHART),"LINE")
  1273.                 AddSectionFilesToCopyList "ChartPie", SrcDir$, MakePath(DIR(CHART),"PIE")
  1274.                 AddSectionFilesToCopyList "ChartPicto", SrcDir$, MakePath(DIR(CHART),"PICTO")
  1275.                 AddSectionFilesToCopyList "ChartScatter", SrcDir$, MakePath(DIR(CHART),"SCATTER")
  1276.                 AddSectionFilesToCopyList "ChartSpectral", SrcDir$, MakePath(DIR(CHART),"SPECTRAL")
  1277.                 AddSectionFilesToCopyList "ChartTable", SrcDir$, MakePath(DIR(CHART),"TABLE")
  1278.                 AddSectionFilesToCopyList "ChartVectors", SrcDir$, MakePath(DIR(CHART),"VECTORS")
  1279.             ENDIF
  1280.             IF fState% = ALL OR GetListItem( OPTS(CHART), 2 ) = "ON" THEN
  1281.                 AddSectionFilesToCopyList "ChartHelp", SrcDir$, DIR(CHART)
  1282.             ENDIF
  1283.             IF fState% = ALL OR GetListItem( OPTS(CHART), 3 ) = "ON" THEN
  1284.                 AddSectionFilesToCopyList "ChartSamples", SrcDir$, MakePath(DIR(CHART),"SAMPLES")
  1285.             ENDIF
  1286.             
  1287.         CASE SHOW
  1288.             IF fState% = ALL OR GetListItem( OPTS(SHOW), 1 ) = "ON" THEN
  1289.                 IF bInstallWinDLL% = TRUE THEN
  1290.                     AddSectionFilesToCopyList "ShowDLL", SrcDir$, WINSYSDIR$
  1291.                 ENDIF
  1292.                 IF bInstallDLL% = TRUE THEN
  1293.                     AddSectionFilesToCopyList "ShowDLL", SrcDir$, DIR(SHOW)
  1294.                 ENDIF
  1295.                 AddSectionFilesToCopyList "ShowShow", SrcDir$, DIR(SHOW)
  1296.             ENDIF
  1297.             IF fState% = ALL OR GetListItem( OPTS(SHOW), 2 ) = "ON" THEN
  1298.                 AddSectionFilesToCopyList "ShowHelp", SrcDir$, DIR(SHOW)
  1299.             ENDIF
  1300.             IF fState% = ALL OR GetListItem( OPTS(SHOW), 3 ) = "ON" THEN
  1301.                 AddSectionFilesToCopyList "ShowSamples", SrcDir$, MakePath(DIR(SHOW),"SAMPLES")
  1302.                 AddSectionFilesToCopyList "ShowFlics", SrcDir$, MakePath(DIR(SHOW),"FLICS")
  1303.                 AddSectionFilesToCopyList "ShowBackgrds", SrcDir$, MakePath(DIR(SHOW),"BACKGRDS")
  1304.             ENDIF
  1305.             
  1306.         CASE PHOTO
  1307.             IF fState% = ALL OR GetListItem( OPTS(PHOTO), 1 ) = "ON" THEN
  1308.                 IF bInstallWinDLL% = TRUE THEN
  1309.                     AddSectionFilesToCopyList "PhotoDLL", SrcDir$, WINSYSDIR$
  1310.                 ENDIF
  1311.                 IF bInstallDLL% = TRUE THEN
  1312.                     AddSectionFilesToCopyList "PhotoDLL", SrcDir$, DIR(PHOTO)
  1313.                 ENDIF
  1314.                 AddSectionFilesToCopyList "PhotoPhoto", SrcDir$, DIR(PHOTO)
  1315.                 AddSectionFilesToCopyList "PhotoTiles", SrcDir$, MakePath(DIR(PHOTO),"tiles")
  1316.                 AddSectionFilesToCopyList "PhotoPalettes", SrcDir$, MakePath(DIR(PHOTO),"palettes")
  1317.             ENDIF
  1318.             IF fState% = ALL OR GetListItem( OPTS(PHOTO), 2 ) = "ON" THEN
  1319.                 AddSectionFilesToCopyList "PhotoHelp", SrcDir$, DIR(PHOTO)
  1320.             ENDIF
  1321.             IF fState% = ALL OR GetListItem( OPTS(PHOTO), 3 ) = "ON" THEN
  1322.                 AddSectionFilesToCopyList "PhotoSamples", SrcDir$, MakePath(DIR(PHOTO),"SAMPLES")
  1323.             ENDIF
  1324.             
  1325.         CASE TRACE
  1326.             IF fState% = ALL OR GetListItem( OPTS(TRACE), 1 ) = "ON" THEN
  1327.                 IF bInstallWinDLL% = TRUE THEN
  1328.                     AddSectionFilesToCopyList "TraceDLL", SrcDir$, WINSYSDIR$
  1329.                 ENDIF
  1330.                 IF bInstallDLL% = TRUE THEN
  1331.                     AddSectionFilesToCopyList "TraceDLL", SrcDir$, DIR(TRACE)
  1332.                 ENDIF
  1333.                 AddSectionFilesToCopyList "TraceTrace", SrcDir$, DIR(TRACE)
  1334.             ENDIF
  1335.             IF fState% = ALL OR GetListItem( OPTS(TRACE), 2 ) = "ON" THEN
  1336.                 AddSectionFilesToCopyList "TraceHelp", SrcDir$, DIR(TRACE)
  1337.             ENDIF
  1338.             
  1339.         CASE MOSAIC
  1340.             IF fState% = ALL OR GetListItem( OPTS(MOSAIC), 1 ) = "ON" THEN
  1341.                 IF bInstallWinDLL% = TRUE THEN
  1342.                     AddSectionFilesToCopyList "MosaicDLL", SrcDir$, WINSYSDIR$
  1343.                 ENDIF
  1344.                 IF bInstallDLL% = TRUE THEN
  1345.                     AddSectionFilesToCopyList "MosaicDLL", SrcDir$, DIR(MOSAIC)
  1346.                 ENDIF
  1347.                 AddSectionFilesToCopyList "MosaicMosaic", SrcDir$, DIR(MOSAIC)
  1348.             ENDIF
  1349.             IF fState% = ALL OR GetListItem( OPTS(MOSAIC), 2 ) = "ON" THEN
  1350.                 AddSectionFilesToCopyList "MosaicHelp", SrcDir$, DIR(MOSAIC)
  1351.             ENDIF
  1352.             
  1353.         CASE FONTSYM
  1354.             '' Add the type one fonts to the windows system directory
  1355.             IF INSTALLCD = TRUE THEN
  1356.                 IF fState% = ALL OR fInstallATM$ = "TRUE" THEN
  1357.                     AddSectionFilesToCopyList "T1", SrcDir$, WINSYSDIR$
  1358.                 ENDIF
  1359.             ENDIF
  1360.             IF fstate% = ALL THEN
  1361.                 AddSectionFilesToCopyList "Fonts", SrcDir$, WINSYSDIR$
  1362.                 AddSectionFilesToCopyList "Symbols", SrcDir$, DIR(FONTSYM)
  1363.             ELSE
  1364.                 ''Add all the fonts specified using SelectFonts
  1365.                 NeedsList$ = GetSymbolValue( FONTLIST2$ )
  1366.                 nIndex% = 0
  1367.                 nIndexInc% = ScanList(NeedsList$,nIndex%)
  1368.                 WHILE nIndexInc% > 0
  1369.                     AddSectionKeyFileToCopyList "Fonts", MID$(NeedsList$, nIndex%+3, nIndexInc%-3), SrcDir$, WINSYSDIR$
  1370.                     nIndex% = nIndex% + nIndexInc%
  1371.                     nIndexInc% = ScanList(NeedsList$,nIndex%)
  1372.                 WEND
  1373.                 ''Add all the symbols specified using SelectSymbols or default
  1374.                 NeedsList$ = GetSymbolValue( SYMBOLLIST2$ )
  1375.                 nIndex% = 0
  1376.                 nIndexInc% = ScanList(NeedsList$,nIndex%)
  1377.                 WHILE nIndexInc% > 0
  1378.                     AddSectionKeyFileToCopyList "Symbols", MID$(NeedsList$, nIndex%+3, nIndexInc%-3), SrcDir$, DIR(FONTSYM)
  1379.                     nIndex% = nIndex% + nIndexInc%
  1380.                     nIndexInc% = ScanList(NeedsList$,nIndex%)
  1381.                 WEND
  1382.             ENDIF
  1383.             
  1384.         CASE MAIN
  1385.         
  1386.             bAddOptFiles% = FALSE
  1387.             FOR i% = DRAW TO PHOTO STEP 1
  1388.                 IF afState(i%) = ALL THEN
  1389.                     bAddOptFiles% = TRUE
  1390.                 ELSEIF afState(i%) = SOME AND GetListItem( OPTS(i%), 1 ) = "ON" THEN
  1391.                     bAddOptFiles% = TRUE
  1392.                 ENDIF
  1393.             NEXT i%
  1394.             IF bAddOptFiles% = TRUE THEN
  1395.                 AddSectionFilesToCopyList "Win31Exe", SrcDir$, WINSYSDIR$
  1396.             ENDIF
  1397.             IF WinMinor% = 0 THEN
  1398.                 '' Add winhelp.exe and redistributable dlls if necessary
  1399.                 bAddOptFiles% = FALSE
  1400.                 bAddOptFiles2% = FALSE
  1401.                 FOR i% = DRAW TO MOSAIC STEP 1
  1402.                     IF afState(i%) = ALL THEN
  1403.                         bAddOptFiles% = TRUE
  1404.                         bAddOptFiles2% = TRUE
  1405.                     ELSEIF afState(i%) = SOME THEN
  1406.                         IF GetListItem( OPTS(i%), 1 ) = "ON" THEN
  1407.                             bAddOptFiles% = TRUE
  1408.                         ENDIF
  1409.                         IF GetListItem( OPTS(i%), 2 ) = "ON" THEN
  1410.                             bAddOptFiles2% = TRUE
  1411.                         ENDIF
  1412.                     ENDIF
  1413.                 NEXT i%
  1414.                 IF bAddOptFiles% = TRUE THEN
  1415.                     AddSectionFilesToCopyList "Win30DLL", SrcDir$, WINSYSDIR$
  1416.                 ENDIF
  1417.                 IF bAddOptFiles2% = TRUE THEN
  1418.                     AddSectionFilesToCopyList "WinHelp", SrcDir$, WINSYSDIR$
  1419.                 ENDIF
  1420.             ENDIF
  1421.             
  1422.             ''Add all necessary import filters
  1423.             bAddOptFiles% = FALSE
  1424.             IF afState(DRAW) = ALL OR afState(CHART) = ALL OR afState(TRACE) = ALL THEN
  1425.                 AddSectionFilesToCopyList "ImpFilters", SrcDir$, MakePath(DIR(MAIN),"FILTERS")
  1426.                 AddSectionFilesToCopyList "Filters", SrcDir$, MakePath(DIR(MAIN),"FILTERS")
  1427.             ELSEIF afState(DRAW) = SOME AND GetListItem( OPTS(DRAW), 4 ) = "ON" THEN
  1428.                 bAddOptFiles% = TRUE
  1429.             ELSEIF afState(CHART) = SOME AND GetListItem( OPTS(CHART), 4 ) = "ON" THEN
  1430.                 bAddOptFiles% = TRUE
  1431.             ELSEIF afState(TRACE) = SOME AND GetListItem( OPTS(TRACE), 3 ) = "ON" THEN
  1432.                 bAddOptFiles% = TRUE
  1433.             ELSEIF afState(DRAW) = SOME AND GetListItem( OPTS(DRAW), 1 ) = "ON" THEN
  1434.                 AddSectionFilesToCopyList "Filters", SrcDir$, MakePath(DIR(MAIN),"FILTERS")
  1435.             ENDIF
  1436.             IF bAddOptFiles% = TRUE THEN
  1437.                 AddSectionFilesToCopyList "Filters", SrcDir$, MakePath(DIR(MAIN),"FILTERS")
  1438.                 ''Add all the import filters specified using SelectFilters or default
  1439.                 NeedsList$ = GetSymbolValue( IMPFILTERLIST2$ )
  1440.                 nIndex% = 0
  1441.                 nIndexInc% = ScanList(NeedsList$,nIndex%)
  1442.                 WHILE nIndexInc% > 0
  1443.                     AddSectionKeyFileToCopyList "ImpFilters", MID$(NeedsList$, nIndex%+3, nIndexInc%-3), SrcDir$, MakePath(DIR(MAIN),"FILTERS")
  1444.                     nIndex% = nIndex% + nIndexInc%
  1445.                     nIndexInc% = ScanList(NeedsList$,nIndex%)
  1446.                 WEND
  1447.             ENDIF
  1448.  
  1449.             ''Add all necessary export filters
  1450.             bAddOptFiles% = FALSE
  1451.             IF afState(DRAW) = ALL OR afState(CHART) = ALL THEN
  1452.                 AddSectionFilesToCopyList "ExpFilters", SrcDir$, MakePath(DIR(MAIN),"FILTERS")
  1453.             ELSEIF afState(DRAW) = SOME AND GetListItem( OPTS(DRAW), 4 ) = "ON" THEN
  1454.                 bAddOptFiles% = TRUE
  1455.             ELSEIF afState(CHART) = SOME AND GetListItem( OPTS(CHART), 4 ) = "ON" THEN
  1456.                 bAddOptFiles% = TRUE
  1457.             ENDIF
  1458.             IF bAddOptFiles% = TRUE THEN
  1459.                 ''Add all the export filters specified using SelectFilters or default
  1460.                 NeedsList$ = GetSymbolValue( EXPFILTERLIST2$ )
  1461.                 nIndex% = 0
  1462.                 nIndexInc% = ScanList(NeedsList$,nIndex%)
  1463.                 WHILE nIndexInc% > 0
  1464.                     AddSectionKeyFileToCopyList "ExpFilters", MID$(NeedsList$, nIndex%+3, nIndexInc%-3), SrcDir$, MakePath(DIR(MAIN),"FILTERS")
  1465.                     nIndex% = nIndex% + nIndexInc%
  1466.                     nIndexInc% = ScanList(NeedsList$,nIndex%)
  1467.                 WEND
  1468.             ENDIF
  1469.  
  1470.         END SELECT
  1471.         
  1472.         SrcDir$ = ""
  1473.         NeedsList$ = ""
  1474.     ENDIF
  1475.  
  1476. END SUB
  1477.  
  1478.  
  1479. '**
  1480. '** Purpose:
  1481. '**     Recalculates disk space for the given option files and sets
  1482. '**     the status info symbol "StatusItemsText".
  1483. '** Arguments:
  1484. '**     ftype% - type of files to add, one of the following:
  1485. '**             DRAW, CHART, SHOW, PHOTO, TRACE, MOSAIC, FONTSYM, MAIN
  1486. '** Returns:
  1487. '**     none.
  1488. '*************************************************************************
  1489. SUB RecalcOptFiles (ftype%) STATIC
  1490.     ClearCopyList
  1491.     AddOptFilesToCopyList ftype%
  1492.     bExtra% = FALSE
  1493.     ''TBD: must do more sophisticated testing here, set memory correctly
  1494.     IF ftype% = MAIN THEN
  1495.         ''Add extra cost to Windows drive for logfile.txt + ini/progman, etc.
  1496.         ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  1497.         ReplaceListItem EXTRACOSTS$, ndrive%, "250000"
  1498.         bExtra% = TRUE
  1499.     ELSEIF ftype% = FONTSYM AND afState(FONTSYM) <> NONE THEN
  1500.         ''Add extra cost to Windows drive for .fot files
  1501.         ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  1502.         IF afState(FONTSYM) = ALL THEN
  1503.             lSpace& = 1450 * 256
  1504.         ELSE
  1505.             lSpace& = 1450 * GetListLength(FONTLIST2$)
  1506.         ENDIF
  1507.         ReplaceListItem EXTRACOSTS$, ndrive%, STR$(lSpace&)
  1508.         bExtra% = TRUE
  1509.     ENDIF
  1510.     
  1511.     ''Get symbol to store space requirements for drives 'A' - 'Z'
  1512.     ListSym$ = aszNEEDS(ftype%)
  1513.  
  1514.     StillNeed& = GetCopyListCost(EXTRACOSTS$, ListSym$, "")
  1515.  
  1516.     '' Sum the costs for drives 'A' - 'Z' and store in STATUSTEXT$
  1517.     '' - This might be faster if we only add the cost of the given drive and
  1518.     ''   windows drive together.
  1519.     cost& = 0
  1520.     NeedsList$ = GetSymbolValue( ListSym$ )
  1521.     nIndex% = 0
  1522.     nIndexInc% = ScanList(NeedsList$,nIndex%)
  1523.     WHILE nIndexInc% > 0
  1524.         cost&  = cost& + VAL( MID$(NeedsList$, nIndex%+3, nIndexInc%-3) )
  1525.         nIndex% = nIndex% + nIndexInc%
  1526.         nIndexInc% = ScanList(NeedsList$,nIndex%)
  1527.     WEND
  1528.     ReplaceListItem STATUSTEXT$, ftype%, STR$(cost& / 1024) + " K"
  1529.  
  1530.     IF bExtra% = TRUE THEN
  1531.         ReplaceListItem EXTRACOSTS$, ndrive%, "0"
  1532.     ENDIF
  1533.     ListSym$ = ""
  1534.     NeedsList$ = ""
  1535. END SUB
  1536.  
  1537.  
  1538. '**
  1539. '** Purpose:
  1540. '**     Recalculates disk space and sets option status info according
  1541. '**     to the current destination path.
  1542. '** Arguments:
  1543. '**     none.
  1544. '** Returns:
  1545. '**     none.
  1546. '*************************************************************************
  1547. SUB RecalcPath STATIC
  1548.     FOR i% = 1 TO NUMGROUPS STEP 1
  1549.         RecalcOptFiles i%
  1550.     NEXT i%
  1551. END SUB
  1552.  
  1553.  
  1554. '**
  1555. '** Purpose:
  1556. '**     Sets drive status info according to latest disk space calcs.
  1557. '**     Checks that enough space is available on all drives.
  1558. '** Arguments:
  1559. '**     none.
  1560. '** Returns:
  1561. '**     none.
  1562. '*************************************************************************
  1563. SUB SetDriveStatus STATIC
  1564.  
  1565.     DIM alCosts(26) AS LONG
  1566.     
  1567.     ''Calculate total costs for each drive
  1568.     
  1569.     FOR i% = 1 TO 26 STEP 1
  1570.         alCosts(i%) = 0
  1571.     NEXT i%
  1572.     
  1573.     FOR i% = 1 to NUMGROUPS STEP 1
  1574.         drive$ = MID$(DIR(i%), 1, 1)
  1575.         ndrive% = ASC(ucase$(drive$)) - ASC("A") + 1
  1576.         alCosts(ndrive%) = alCosts(ndrive%) + VAL(GetListItem(aszNEEDS(i%), ndrive%))
  1577.         IF drive$ <> WINDRIVE$ THEN
  1578.             ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  1579.             alCosts(ndrive%) = VAL(GetListItem(aszNEEDS(i%), ndrive%)) + alCosts(ndrive%)
  1580.         ENDIF
  1581.   NEXT i%
  1582.     
  1583.     ''Store the costs and free space for the first five drives used
  1584.     afTooBig% = FALSE
  1585.     j% = 0
  1586.     FOR i% = 1 TO 26 STEP 1
  1587.         if alCosts(i%) > 0 THEN
  1588.             j% = j% + 1
  1589.             drive$ = CHR$( i% - 1 + ASC("A") )
  1590.             free& = GetFreeSpaceForDrive(drive$)
  1591.             IF free& < alCosts(i%) THEN
  1592.                 afTooBig% = TRUE
  1593.             ENDIF
  1594.             IF j% < 6 THEN
  1595.                 ReplaceListItem DRIVETEXT$, j%*3-2, drive$ + ":"
  1596.                 ReplaceListItem DRIVETEXT$, j%*3-1, STR$(alCosts(i%) / 1024) + " K"
  1597.                 ReplaceListItem DRIVETEXT$, j%*3, STR$(free& / 1024) + " K"
  1598.             ENDIF
  1599.         ENDIF
  1600.     NEXT i%
  1601.     ''wipe clean all remaining directory information
  1602.     FOR i% = j%*3+1 TO 15 STEP 1
  1603.         ReplaceListItem DRIVETEXT$, i%, ""
  1604.     NEXT i%
  1605.     drive$ = ""
  1606.     drive2$ = ""
  1607.  
  1608. END SUB
  1609.  
  1610.  
  1611. '**
  1612. '** Purpose:
  1613. '**     Removes the optional trailing "\"
  1614. '** Arguments:
  1615. '**     szDir$  - full directory path (with optional ending "\")
  1616. '** Returns:
  1617. '**     szDir$ without a trailing "\"
  1618. '*************************************************************************
  1619. FUNCTION MakeDir (szDir$) STATIC AS STRING
  1620.     IF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  1621.         MakeDir = MID$( szDir$, 1, LEN(szDir$) - 1 )
  1622.     ELSE
  1623.         MakeDir = szDir$
  1624.     ENDIF
  1625. END FUNCTION
  1626.  
  1627.  
  1628. '**
  1629. '** Purpose:
  1630. '**     Appends a file name to the end of a directory path,
  1631. '**     inserting a backslash character as needed.
  1632. '** Arguments:
  1633. '**     szDir$  - full directory path (with optional ending "\")
  1634. '**     szFile$ - filename to append to directory
  1635. '** Returns:
  1636. '**     Resulting fully qualified path name.
  1637. '*************************************************************************
  1638. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  1639.     IF szDir$ = "" THEN
  1640.         MakePath = szFile$
  1641.     ELSEIF szFile$ = "" THEN
  1642.         MakePath = szDir$
  1643.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  1644.         MakePath = szDir$ + szFile$
  1645.     ELSE
  1646.         MakePath = szDir$ + "\" + szFile$
  1647.     ENDIF
  1648. END FUNCTION
  1649.  
  1650.  
  1651. ''** If the logfile is open, write szMsg$ to it.
  1652. '*************************************************************************
  1653. SUB TestWriteToLogfile (szMsg$) STATIC
  1654.     IF bLogging% THEN
  1655.         WriteToLogfile szMsg$
  1656.     ENDIF
  1657. END SUB
  1658.  
  1659.  
  1660. ''** Load the string resource associated with nResourceConst% and write it.
  1661. '*************************************************************************
  1662. SUB WriteStringToLogfile (nResourceConst%) STATIC
  1663.     LoadStringResource nResourceConst%, szString$, STRINGLEN
  1664.     WriteToLogfile szString$
  1665. END SUB
  1666.  
  1667.  
  1668. ''** If the logfile is open, load the string resource associated with
  1669. ''**   nResourceCount% and write it.
  1670. '*************************************************************************
  1671. SUB TestWriteStringToLogfile (nResourceConst%) STATIC
  1672.     IF bLogging% THEN
  1673.         LoadStringResource nResourceConst%, szString$, STRINGLEN
  1674.         WriteToLogfile szString$
  1675.     ENDIF
  1676. END SUB
  1677.  
  1678.  
  1679. '** This sub converts the symbol "InstallState" into the afState array,
  1680. '** recalculating disk usage if anything has changed.
  1681. '*************************************************************************
  1682. SUB SetStateFromSymbol STATIC
  1683.     bRecalcMain% = FALSE
  1684.     FOR i% = 1 TO NUMCUST STEP 1
  1685.         fNewState% = ASC( GetListItem("InstallState",i%) ) - ASC("1") + 1
  1686.         IF fNewState% <> afState(i%) THEN
  1687.             afState(i%) = fNewState%
  1688.             RecalcOptFiles i%
  1689.             IF fNewState% <> 2 THEN
  1690.                 bRecalcMain% = TRUE
  1691.             ENDIF
  1692.         ENDIF
  1693.     NEXT i%
  1694.     IF bRecalcMain% = TRUE THEN
  1695.         RecalcOptFiles MAIN
  1696.     ENDIF
  1697. END SUB
  1698.  
  1699.  
  1700. '** This sub converts the symbol "InstallDirs" into the DIR array,
  1701. '** recalculating disk usage if anything has changed.
  1702. '** NOTE: this a only a simulated subroutine because we want to be
  1703. '**       able to GOSUB BADPATH from inside it.
  1704. '*************************************************************************
  1705. SetDirFromSymbol:
  1706.     szList$ = GetSymbolValue("InstallDirs")
  1707.     nIndex% = 0
  1708.     nIndexInc% = ScanList(szList$,nIndex%)
  1709.     i% = 1
  1710.     WHILE nIndexInc% > 0
  1711.         szDir$ = MID$(szList$, nIndex%+3, nIndexInc%-3)
  1712.         '' If the directory is not writable, tell the user and don't update it.
  1713.         IF IsDirWritable( szDir$ ) = 0 THEN
  1714.             Dialog% = BADPATH
  1715.             GOSUB INFO
  1716.             GOTO CUSTINSTL1
  1717.         ENDIF
  1718.         '' If the directory has changed - recalculate disk usage
  1719.         IF DIR(i%) <> szDir$ THEN
  1720.             DIR(i%) = szDir$
  1721.             RecalcOptFiles i%
  1722.         ENDIF
  1723.         i% = i% + 1
  1724.         nIndex% = nIndex% + nIndexInc%
  1725.         nIndexInc% = ScanList(szList$, nIndex%)
  1726.     WEND
  1727.     szDir$ = ""
  1728.     szList$ = ""
  1729. RETURN
  1730.  
  1731.  
  1732. '** This sub sets all files to load - sets directory structure to default
  1733. '*************************************************************************
  1734. SUB FullInstall STATIC
  1735.     ''Set directories to default
  1736.     SetDirectories
  1737.     ''Set all sections to install
  1738.     FOR i% = 1 TO NUMGROUPS STEP 1
  1739.         afState(i%) = ALL
  1740.     NEXT i%
  1741.     '' Temporarily set FONTSYM to SOME to handle ATMs
  1742.     IF INSTALLCD = TRUE THEN
  1743.         afState(FONTSYM) = SOME
  1744.     ENDIF
  1745.  
  1746.     SetSymbolValue OPTS(DRAW), "{""ON"",""ON"",""ON"",""ON"",""ON""}"
  1747.     SetSymbolValue OPTS(CHART), "{""ON"",""ON"",""ON"",""ON""}"
  1748.     SetSymbolValue OPTS(SHOW), "{""ON"",""ON"",""ON""}"
  1749.     SetSymbolValue OPTS(PHOTO), "{""ON"",""ON"",""ON""}"
  1750.     SetSymbolValue OPTS(TRACE), "{""ON"",""ON"",""ON""}"
  1751.     SetSymbolValue OPTS(MOSAIC), "{""ON"",""ON""}"
  1752.     ''Prepare lists for customized selection of filters, fonts and symbols
  1753.     SetSymbolValue IMPFILTERLIST1$, "{}"
  1754.     SetSymbolValue EXPFILTERLIST1$, "{}"
  1755.     SetSymbolValue FONTLIST1$, "{}"
  1756.     SetSymbolValue SYMBOLLIST1$, "{}"
  1757.     MakeListFromSectionKeys EXPFILTERLIST2$, "ExpFilters"
  1758.     MakeListFromSectionKeys IMPFILTERLIST2$, "ImpFilters"
  1759.     MakeListFromSectionKeys FONTLIST2$, "Fonts"
  1760.     MakeListFromSectionKeys SYMBOLLIST2$, "Symbols"
  1761.     '' Set no ATMs to install
  1762.     fInstallATM$ = "FALSE"
  1763. END SUB
  1764.  
  1765.  
  1766. '** This sub sets only a minimal set of files to load
  1767. '**   - sets directory structure to default
  1768. '*************************************************************************
  1769. SUB MinInstall STATIC
  1770.     ''Set directories to default
  1771.     SetDirectories
  1772.     ''Set draw, fonts and symbols only to install
  1773.     FOR i% = 1 TO NUMGROUPS STEP 1
  1774.         afState(i%) = NONE
  1775.     NEXT i%
  1776.     SetSymbolValue OPTS(DRAW), "{""ON"",""OFF"",""OFF"",""OFF"",""OFF""}"
  1777.     SetSymbolValue OPTS(CHART), "{""ON"",""ON"",""ON"",""ON""}"
  1778.     SetSymbolValue OPTS(SHOW), "{""ON"",""ON"",""ON""}"
  1779.     SetSymbolValue OPTS(PHOTO), "{""ON"",""ON"",""ON""}"
  1780.     SetSymbolValue OPTS(TRACE), "{""ON"",""ON"",""ON""}"
  1781.     SetSymbolValue OPTS(MOSAIC), "{""ON"",""ON""}"
  1782.     afState(DRAW) = SOME
  1783.     afState(FONTSYM) = SOME
  1784.     afState(MAIN) = ALL
  1785.     '' Set no ATMs to install
  1786.     fInstallATM$ = "FALSE"
  1787.     ''Should change to minimal font and symbol selection here(?)
  1788.     SetSymbolValue FONTLIST1$, "{}"
  1789.     SetSymbolValue SYMBOLLIST1$, "{}"
  1790.     MakeListFromSectionKeys FONTLIST2$, "MinFonts"
  1791.     MakeListFromSectionKeys SYMBOLLIST2$, "Symbols"
  1792. END SUB
  1793.  
  1794.  
  1795. '** Set the subdirectories to their default values.
  1796. '*************************************************************************
  1797. SUB SetDirectories STATIC
  1798.     DIR(DRAW) = MakePath( DEST$, "DRAW\" )
  1799.     DIR(CHART) = MakePath( DEST$, "CHART\" )
  1800.     DIR(SHOW) = MakePath( DEST$, "SHOW\" )
  1801.     DIR(PHOTO) = MakePath( DEST$, "PHOTOPNT\" )
  1802.     DIR(TRACE) = MakePath( DEST$, "DRAW\" )
  1803.     DIR(MOSAIC) = MakePath( DEST$, "DRAW\" )
  1804.     DIR(FONTSYM) = MakePath( DEST$, "FONTS\" )
  1805.     DIR(MAIN) = DEST$
  1806. END SUB
  1807.  
  1808.  
  1809. '** Set the custom progman groups (aszGroups()) to all be TOOLGROUP$
  1810. '****************************************************************************
  1811. SUB SetProgmanGroups STATIC
  1812.     FOR i% = DRAW to MOSAIC STEP 1
  1813.         aszGroups(i%) = TOOLGROUP$
  1814.     NEXT i%
  1815. END SUB
  1816.  
  1817.  
  1818. '** Make sure that the long wait dialog is displayed and the hourglass cursor
  1819. '** are being used
  1820. '*************************************************************************
  1821. SUB WaitOnBig STATIC
  1822.     IF nWaiting% = 0 THEN
  1823.         CursorSave% = ShowWaitCursor()
  1824.         sz$ = UIStartDlg("mscuistf.dll", WAIT, "FModelessDlgProc", 0, "")
  1825.         nWaiting% = 2
  1826.     ELSEIF nWaiting% = 1 THEN
  1827.         sz$ = UIStartDlg("mscuistf.dll", WAIT, "FModelessDlgProc", 0, "")
  1828.         nWaiting% = 2
  1829.     ENDIF
  1830. END SUB
  1831.  
  1832.  
  1833. '** Make sure that the hourglass cursor is being used
  1834. '*************************************************************************
  1835. SUB WaitOn STATIC
  1836.     IF nWaiting% = 0 THEN
  1837.         CursorSave% = ShowWaitCursor()
  1838.         nWaiting% = 1
  1839.     ENDIF
  1840. END SUB
  1841.  
  1842.  
  1843. '** Remove the long wait dialog if it is being displayed and reset the cursor
  1844. '** back to normal if it was set to the hourglass icon
  1845. '*************************************************************************
  1846. SUB WaitOff STATIC
  1847.     IF nWaiting% = 2 THEN
  1848.         UIPop 1
  1849.         RestoreCursor CursorSave%
  1850.         nWaiting% = 0
  1851.     ELSEIF nWaiting% = 1 THEN
  1852.         RestoreCursor CursorSave%
  1853.         nWaiting% = 0
  1854.     ENDIF
  1855. END SUB
  1856.