home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 11 / 11.iso / m / m415 / 1.ddi / PHOTOSHP.MST < prev    next >
Encoding:
Text File  |  1993-10-12  |  19.0 KB  |  613 lines

  1. '*           Adobe Photoshop Installer
  2. '*
  3. '* June 5, 1993  Marshall Spight (original Premiere ver)
  4. '* June 16, 1993 Dave Corboy (modified for Photoshop)
  5. '*
  6. '*
  7. '*
  8. '*
  9.  
  10. '$DEFINE DEBUG  ''Define for script development/debugging
  11.  
  12. '$INCLUDE 'setupapi.inc'
  13. '$INCLUDE 'msdetect.inc'
  14.  
  15. CONST A$ = "Adobe Photoshop requires Microsoft Windows version 3.10 or greater.  Please upgrade your version of Windows."
  16. CONST B$ = "Installation Problem"
  17. CONST C$ = "Setup sources were corrupted!"
  18.  
  19. ''following were taken from windows.h. &H means they're hex
  20. CONST WS_VISIBLE=&H10000000
  21. CONST WS_BORDER =&H00800000
  22. CONST WS_CLIPCHILDREN =&H02000000
  23. CONST GWL_STYLE =-16
  24. CONST SW_SHOWMAXIMIZED=3
  25.  
  26.  
  27. DECLARE FUNCTION ShowWindow  LIB "user.exe" (hWnd%,iShow%) AS INTEGER
  28. DECLARE FUNCTION SetWindowLong LIB "user.exe" (hWnd%, offset%, style&) AS LONG
  29.  
  30.  
  31. ''Dialog ID's
  32. CONST ASKQUIT      = 100
  33. CONST DESTPATH     = 200
  34. CONST EXITFAILURE  = 300
  35. CONST EXITQUIT     = 400
  36. CONST EXITSUCCESS  = 500
  37. CONST EXITRESTART  = 550
  38. CONST OPTIONS      = 600
  39. CONST APPHELP      = 700
  40. CONST CUSTINST     = 800
  41. CONST TOOBIG       = 900
  42. CONST BADPATH      = 1000
  43.  
  44. CONST PERSONALIZE  = 10000
  45.  
  46. ''Bitmap ID
  47. CONST LOGO         = 1
  48.  
  49. ''File Types
  50.  
  51. CONST PROGRAMFILES  = 1
  52. CONST TUTORIALFILES = 2
  53. CONST PATTERNFILES  = 3
  54. CONST DUOTONEFILES  = 4
  55. CONST FILTERFILES   = 5
  56.  
  57. CONST    NUMGROUPS      = 5    '' Number of file groups: PROGRAM to TUTORIAL
  58.  
  59.  
  60. GLOBAL DEST$        ''Default destination directory.
  61. GLOBAL WINDRIVE$    ''Windows drive letter.
  62. GLOBAL ENOUGHDISK%  ''Enough space to install
  63.  
  64. ''CustInst list symbol names
  65.  
  66. GLOBAL PROGRAMNEEDS$
  67. GLOBAL TUTORIALNEEDS$
  68. GLOBAL PATTERNNEEDS$
  69. GLOBAL DUOTONENEEDS$
  70. GLOBAL FILTERNEEDS$
  71.  
  72. GLOBAL EXTRACOSTS$  ''List of extra costs to add per drive
  73. GLOBAL BIGLIST$     ''List of option files cost calc results (boolean)
  74.  
  75. ''Dialog list symbol names
  76. GLOBAL CHECKSTATES$
  77. GLOBAL STATUSTEXT$
  78. GLOBAL DRIVETEXT$
  79.  
  80.  
  81. DECLARE SUB AddOptFilesToCopyList (ftype%, bogus%)
  82. DECLARE SUB RecalcOptFiles (ftype%)
  83. DECLARE SUB RecalcPath
  84. DECLARE SUB SetDriveStatus
  85. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  86. DECLARE SUB X1 LIB "mscuistf.dll" (arg$)
  87. DECLARE SUB X2 LIB "mscuistf.dll" (arg$)
  88. DECLARE SUB X3 LIB "mscuistf.dll" (arg$)
  89. DECLARE SUB FixScreenProc LIB "mscuistf.dll" (arg%)
  90.  
  91.  
  92. INIT:
  93.     hWnd%=HwndFrame()
  94.     FixScreenProc ( hWnd% )
  95.     SWLxx&=SetWindowLong(hWnd%,GWL_STYLE,WS_VISIBLE+WS_BORDER+WS_CLIPCHILDREN)
  96.     SWyy%=ShowWindow(hWnd%,SW_SHOWMAXIMIZED)
  97.  
  98.     INSTALLDLL$ = "mscuistf.dll"        ''custom functions
  99.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  100.  
  101.     SetBitmap INSTALLDLL$, LOGO
  102.     SetTitle "Adobe Photoshop Installer"
  103.  
  104.     MajorVer% = GetWindowsMajorVersion()
  105.     MinorVer% = GetWindowsMinorVersion()
  106.  
  107.     IF  MajorVer% < 3 OR (MajorVer% = 3 AND MinorVer% < 10) THEN
  108.     i% = DoMsgBox(A$, B$, MB_OK+MB_TASKMODAL+MB_ICONHAND)
  109.         END
  110.     END IF
  111.  
  112.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  113.     IF szInf$ = "" THEN
  114.         szInf$ = GetSymbolValue("STF_CWDDIR") + "PHOTOSHP.INF"
  115.     END IF
  116.     ReadInfFile szInf$
  117.  
  118.     WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
  119.     DEST$ = WINDRIVE$ + ":\PHOTOSHP"
  120.     SetRestartDir WINDRIVE$ + ":\ADOBETMP"
  121.  
  122.     ''CustInst list symbols
  123.     CHECKSTATES$ = "CheckItemsState"
  124.     STATUSTEXT$  = "StatusItemsText"
  125.     DRIVETEXT$   = "DriveStatusText"
  126.     FOR i% = 1 TO NUMGROUPS STEP 1
  127.         AddListItem CHECKSTATES$, "ON"
  128.     NEXT i%
  129.     FOR i% = 1 TO NUMGROUPS STEP 1
  130.         AddListItem STATUSTEXT$, ""
  131.     NEXT i%
  132.     FOR i% = 1 TO 7 STEP 1
  133.         AddListItem DRIVETEXT$, ""
  134.     NEXT i%
  135.     ReplaceListItem DRIVETEXT$, 7, DEST$
  136.  
  137.     ''Disk cost list symbols
  138.  
  139.     PROGRAMNEEDS$  = "ProgramNeeds"
  140.     TUTORIALNEEDS$ = "TutorialNeeds"
  141.     PATTERNNEEDS$  = "PatternNeeds"
  142.     DUOTONENEEDS$  = "DuotoneNeeds"
  143.     FILTERNEEDS$   = "FilterNeeds"
  144.  
  145.     EXTRACOSTS$ = "ExtraCosts"
  146.     BIGLIST$    = "BigList"
  147.  
  148.     FOR i% = 1 TO NUMGROUPS STEP 1
  149.         AddListItem BIGLIST$, ""
  150.     NEXT i%
  151.     FOR i% = 1 TO 26 STEP 1
  152.         AddListItem EXTRACOSTS$, "0"
  153.     NEXT i%
  154.  
  155.     RecalcPath
  156.     SetDriveStatus
  157.  
  158. '$IFDEF DEBUG
  159.     i% = SetSizeCheckMode(scmOnIgnore)    '' could use scmOff; def = scmOnFatal
  160. '$ENDIF ''DEBUG
  161.  
  162.  
  163.  
  164. CUSTINST:
  165.     sz$ = UIStartDlg(INSTALLDLL$, CUSTINST, "FCustInstDlgProc", APPHELP, HELPPROC$)
  166.  
  167.     IF sz$ = "CONTINUE" THEN
  168.         ''Install only if it will fit.
  169.         IF ENOUGHDISK% = 0 THEN
  170.           GOSUB TOOBIG
  171.           GOTO CUSTINST
  172.         END IF
  173.         UIPop 1
  174.         GOTO INSTALL
  175.     ELSEIF sz$ = "PATH" THEN
  176.         GOTO GETPATH
  177.     ELSEIF sz$ = "CHK1" THEN
  178.         RecalcOptFiles PROGRAMFILES
  179.         SetDriveStatus
  180.         GOTO CUSTINST
  181.     ELSEIF sz$ = "CHK2" THEN
  182.         RecalcOptFiles TUTORIALFILES
  183.         SetDriveStatus
  184.         GOTO CUSTINST
  185.     ELSEIF sz$ = "CHK3" THEN
  186.         RecalcOptFiles PATTERNFILES
  187.         SetDriveStatus
  188.         GOTO CUSTINST
  189.     ELSEIF sz$ = "CHK4" THEN
  190.         RecalcOptFiles DUOTONEFILES
  191.         SetDriveStatus
  192.         GOTO CUSTINST
  193.     ELSEIF sz$ = "CHK5" THEN
  194.         RecalcOptFiles FILTERFILES
  195.         SetDriveStatus
  196.         GOTO CUSTINST
  197.     ELSEIF sz$ = "REACTIVATE" THEN
  198.         RecalcPath
  199.         SetDriveStatus
  200.         GOTO CUSTINST
  201.     ELSE
  202.         GOSUB ASKQUIT
  203.         GOTO CUSTINST
  204.     END IF
  205.  
  206.  
  207.  
  208. INSTALL:
  209.  
  210.     CreateDir DEST$, cmoNone
  211.  
  212.     IF GetListItem(CHECKSTATES$, PROGRAMFILES) = "ON" THEN
  213.          sz$ = UIStartDlg(INSTALLDLL$, PERSONALIZE, "dlgPERinstall", 0, "" )
  214.          IF sz$ <> "VALID" THEN
  215.              sz$ = UIStartDlg(INSTALLDLL$, EXITFAILURE, "FInfo0DlgProc", 0, "")
  216.              UIPop 1
  217.              END
  218.          END IF
  219.     END IF
  220.  
  221.     IF GetListItem( CHECKSTATES$, PROGRAMFILES ) = "ON" THEN
  222.     RemoveFile GetWindowsDir() + "PHOTOSHP.INI", cmoNone
  223. ''    RemoveFile GetWindowsDir() + "PHOTOSHP.PSP", cmoNone
  224.         CreateDir DEST$ + "\PLUGINS", cmoNone
  225.         CreateDir DEST$ + "\CALIBRAT", cmoNone
  226.         CreateDir DEST$ + "\BRUSHES", cmoNone
  227.         CreateDir DEST$ + "\PALETTES", cmoNone
  228.     END IF
  229.  
  230.     IF GetListItem( CHECKSTATES$, TUTORIALFILES ) = "ON" THEN
  231.         CreateDir DEST$ + "\TUTORIAL", cmoNone
  232.     END IF
  233.  
  234.     IF GetListItem( CHECKSTATES$, PATTERNFILES ) = "ON" THEN
  235.         CreateDir DEST$ + "\PATTERNS", cmoNone
  236.     END IF
  237.  
  238.     IF GetListItem( CHECKSTATES$, DUOTONEFILES ) = "ON" THEN
  239.         CreateDir DEST$ + "\DUOTONES\DUOTONE\PMS", cmoNone
  240.         CreateDir DEST$ + "\DUOTONES\DUOTONE\PROCESS", cmoNone
  241.         CreateDir DEST$ + "\DUOTONES\DUOTONE\GRAY", cmoNone
  242.         CreateDir DEST$ + "\DUOTONES\TRITONE\PMS", cmoNone
  243.         CreateDir DEST$ + "\DUOTONES\TRITONE\PROCESS", cmoNone
  244.         CreateDir DEST$ + "\DUOTONES\TRITONE\GRAY", cmoNone
  245.         CreateDir DEST$ + "\DUOTONES\QUADTONE\PMS", cmoNone
  246.         CreateDir DEST$ + "\DUOTONES\QUADTONE\PROCESS", cmoNone
  247.         CreateDir DEST$ + "\DUOTONES\QUADTONE\GRAY", cmoNone
  248.     END IF
  249.  
  250.     IF GetListItem( CHECKSTATES$, FILTERFILES ) = "ON" THEN
  251.         CreateDir DEST$ + "\PLUGINS", cmoNone
  252.     CreateDir DEST$ + "\3RDPARTY", cmoNone
  253.     CreateDir DEST$ + "\3RDPARTY\XL77XX\TABLES", cmoNone
  254.     END IF
  255.  
  256.     ClearCopyList
  257.     AddOptFilesToCopyList PROGRAMFILES, 0
  258.     AddOptFilesToCopyList TUTORIALFILES, 0
  259.     AddOptFilesToCopyList PATTERNFILES, 0
  260.     AddOptFilesToCopyList DUOTONEFILES, 0
  261.     AddOptFilesToCopyList FILTERFILES, 0
  262.     CopyFilesInCopyList
  263.  
  264.     IF GetListItem(CHECKSTATES$, PROGRAMFILES) = "ON" THEN
  265.         CreateProgmanGroup "Adobe", "", cmoNone
  266.         ShowProgmanGroup  "Adobe", 1, cmoNone
  267.         CreateProgmanItem "Adobe", "Photoshop 2.5.1", MakePath( DEST$, "photoshp.exe" ), "", cmoOverwrite
  268.         CreateProgmanItem "Adobe", "Photoshop ReadMe", "notepad.exe " + MakePath( DEST$, "psreadme.txt" ), "", cmoOverwrite
  269.     ''Updating PHOTOSHOP.INI and SYSTEM.INI
  270.     CreateIniKeyValue GetWindowsDir() + "photoshp.ini", "Photoshop", "PHOTOSHOPDIRECTORY", DEST$, cmoOverwrite
  271.     CreateIniKeyValue GetWindowsDir() + "photoshp.ini", "Photoshop", "PLUGINDIRECTORY", DEST$ + "\PLUGINS", cmoOverwrite
  272.     CopyFile GetWindowsDir() + "system.ini", GetWindowsDir() + "system.bak", cmoOverwrite, 0
  273.     CreateIniKeyValue GetWindowsDir() + "system.ini", "drivers", "adobekey", "adobekey.drv", cmoOverwrite
  274.     CreateIniKeyValue GetWindowsDir() + "system.ini", "drivers", "adobemse", "adobemse.drv", cmoOverwrite
  275.         X$ = "                                        "
  276.         X1 ( X$ )
  277.     R$ = CHR$(40) + X$
  278.         X$ = "                                        "
  279.         X2 ( X$ )
  280.     R$ = R$ + CHR$(40) + X$
  281.         StampResource "SplitFiles", "Stamp", DEST$, 6, &H276, R$, 82
  282.       END IF                            
  283.       
  284. QUIT:
  285.     ON ERROR GOTO ERRQUIT
  286.  
  287.     IF ERR = 0 THEN
  288.     IF RestartListEmpty() = 0 THEN
  289.         GOTO QUITR
  290.     ELSE
  291.             dlg% = EXITSUCCESS
  292.     END IF
  293.     ELSEIF ERR = STFQUIT THEN
  294.         dlg% = EXITQUIT
  295.     ELSE
  296.         dlg% = EXITFAILURE
  297.     END IF
  298. QUITL1:
  299.     sz$ = UIStartDlg(INSTALLDLL$, dlg%, "FInfo0DlgProc", 0, "")
  300.     IF sz$ = "REACTIVATE" THEN
  301.         GOTO QUITL1
  302.     END IF
  303.     UIPop 1
  304.  
  305.     END
  306.  
  307. QUITR:
  308.     sz$ = UIStartDlg(INSTALLDLL$, EXITRESTART, "FInfo0DlgProc", 0, "")
  309.     IF sz$ = "REACTIVATE" THEN
  310.     GOTO QUITR
  311.     END IF
  312.     UIPop 1
  313.     
  314.     i% = ExitExecRestart()
  315.     GOTO QUITR
  316.  
  317. ERRQUIT:
  318.     i% = DoMsgBox(C$, B$, MB_OK+MB_TASKMODAL+MB_ICONHAND)
  319.     END
  320.  
  321. GETPATH:
  322.     SetSymbolValue "EditTextIn", DEST$
  323.     SetSymbolValue "EditFocus", "END"
  324. GETPATHL1:
  325.     sz$ = UIStartDlg(INSTALLDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
  326.  
  327.     IF sz$ = "CONTINUE" THEN
  328.         olddest$ = DEST$
  329.         DEST$ = GetSymbolValue("EditTextOut")
  330.  
  331.         ''Validate new path.
  332.         IF IsDirWritable(DEST$) = 0 THEN
  333.             GOSUB BADPATH
  334.             GOTO GETPATHL1
  335.         END IF
  336.         UIPop 1
  337.  
  338.         ''Truncate display if too long.
  339.         IF LEN(DEST$) > 23 THEN
  340.             ReplaceListItem DRIVETEXT$, 7, MID$(DEST$, 1, 23)+"..."
  341.         ELSE
  342.             ReplaceListItem DRIVETEXT$, 7, DEST$
  343.         END IF
  344.  
  345.         ''Recalc if path changed.
  346.         IF (olddest$ <> DEST$) AND (olddest$ <> DEST$+"\") AND (olddest$+"\" <> DEST$) THEN
  347.             RecalcPath
  348.             SetDriveStatus
  349.         END IF
  350.  
  351.         olddest$ = ""
  352.         GOTO CUSTINST
  353.     ELSEIF sz$ = "REACTIVATE" THEN
  354.         RecalcPath
  355.         SetDriveStatus
  356.         GOTO GETPATHL1
  357.     ELSEIF sz$ = "EXIT" THEN
  358.         GOSUB ASKQUIT
  359.         GOTO GETPATHL1
  360.     ELSE
  361.         UIPop 1
  362.         GOTO CUSTINST
  363.     END IF
  364.  
  365.  
  366.  
  367. TOOBIG:
  368.     sz$ = UIStartDlg(INSTALLDLL$, TOOBIG, "FInfo0DlgProc", 0, "")
  369.     IF sz$ = "REACTIVATE" THEN
  370.         RecalcPath
  371.         SetDriveStatus
  372.         GOTO TOOBIG
  373.     END IF
  374.     UIPop 1
  375.     RETURN
  376.  
  377.  
  378.  
  379. BADPATH:
  380.     sz$ = UIStartDlg(INSTALLDLL$, BADPATH, "FInfo0DlgProc", 0, "")
  381.     IF sz$ = "REACTIVATE" THEN
  382.         RecalcPath
  383.         SetDriveStatus
  384.         GOTO BADPATH
  385.     END IF
  386.     UIPop 1
  387.     RETURN
  388.  
  389.  
  390.  
  391. ASKQUIT:
  392.     sz$ = UIStartDlg(INSTALLDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  393.  
  394.     IF sz$ = "EXIT" THEN
  395.         UIPopAll
  396.         ERROR STFQUIT
  397.     ELSEIF sz$ = "REACTIVATE" THEN
  398.         GOTO ASKQUIT
  399.     ELSE
  400.         UIPop 1
  401.     END IF
  402.     RETURN
  403.  
  404.  
  405.  
  406. '**
  407. '** Purpose:
  408. '**     Adds the specified option files to the copy list.
  409. '** Arguments:
  410. '**     ftype%  - type of files to add, one of the following:
  411. '**             PROGRAMFILES, DUOTONEFILES ...
  412. '** Returns:
  413. '**     none.
  414. '*************************************************************************
  415. SUB AddOptFilesToCopyList (ftype%, bogus%) STATIC
  416.  
  417.     IF GetListItem(CHECKSTATES$, ftype%) = "ON" THEN
  418.         SrcDir$ = GetSymbolValue("STF_SRCDIR")
  419.         IF ftype% = PROGRAMFILES THEN
  420.             AddSectionFilesToCopyList "ProgramFiles", SrcDir$, DEST$
  421.             AddSectionFilesToCopyList "PluginFiles", SrcDir$, DEST$ + "\plugins"
  422.             AddSectionFilesToCopyList "ProgramWinFiles", SrcDir$, GetWindowsDir()
  423.             AddSectionFilesToCopyList "ProgramWinSysFiles", SrcDir$, GetWindowsSysDir()
  424.             AddSectionFilesToCopyList "CalibrateFiles", SrcDir$, DEST$ + "\calibrat"
  425.             AddSectionFilesToCopyList "BrushFiles", SrcDir$, DEST$ + "\brushes"
  426.             AddSectionFilesToCopyList "PaletteFiles", SrcDir$, DEST$ + "\palettes"
  427.       IF bogus% = 1 THEN
  428.             AddSectionFilesToCopyList "BogusFiles", SrcDir$, DEST$
  429.       ELSE
  430.             AddSectionFilesToCopyList "SplitFiles", SrcDir$, DEST$
  431.       END IF
  432.         ELSEIF ftype% = TUTORIALFILES THEN
  433.             AddSectionFilesToCopyList "TutorialFiles", SrcDir$, DEST$ + "\tutorial"
  434.         ELSEIF ftype% = PATTERNFILES THEN
  435.             AddSectionFilesToCopyList "PatternFiles", SrcDir$, DEST$ + "\patterns"
  436.         ELSEIF ftype% = DUOTONEFILES THEN
  437.             AddSectionFilesToCopyList "DuoDuoPms", SrcDir$, DEST$ + "\duotones\duotone\pms"
  438.             AddSectionFilesToCopyList "DuoDuoProc", SrcDir$, DEST$ + "\duotones\duotone\process"
  439.             AddSectionFilesToCopyList "DuoDuoGray", SrcDir$, DEST$ + "\duotones\duotone\gray"
  440.             AddSectionFilesToCopyList "DuoTriPms", SrcDir$, DEST$ + "\duotones\tritone\pms"
  441.             AddSectionFilesToCopyList "DuoTriProc", SrcDir$, DEST$ + "\duotones\tritone\process"
  442.             AddSectionFilesToCopyList "DuoTriGray", SrcDir$, DEST$ + "\duotones\tritone\gray"
  443.             AddSectionFilesToCopyList "DuoQuadPms", SrcDir$, DEST$ + "\duotones\quadtone\pms"
  444.             AddSectionFilesToCopyList "DuoQuadProc", SrcDir$, DEST$ + "\duotones\quadtone\process"
  445.             AddSectionFilesToCopyList "DuoQuadGray", SrcDir$, DEST$ + "\duotones\quadtone\gray"
  446.     ELSEIF ftype% = FILTERFILES THEN
  447.             AddSectionFilesToCopyList "FilterFiles", SrcDir$, DEST$ + "\plugins"
  448.             AddSectionFilesToCopyList "FilterDispFiles", SrcDir$, DEST$ + "\plugins\dispmaps"
  449.             AddSectionFilesToCopyList "FilterVideoFiles", SrcDir$, DEST$ + "\plugins\video"
  450.             AddSectionFilesToCopyList "ThirdPartyFiles", SrcDir$, DEST$ + "\3rdparty"
  451.             AddSectionFilesToCopyList "XL77xxFiles", SrcDir$, DEST$ + "\3rdparty\xl77xx"
  452.             AddSectionFilesToCopyList "XL77xxTableFiles", SrcDir$, DEST$ + "\3rdparty\xl77xx\tables"
  453.         END IF
  454.         SrcDir$ = ""
  455.     END IF
  456. END SUB
  457.  
  458.  
  459. '**
  460. '** Purpose:
  461. '**     Recalculates disk space for the given option files and sets
  462. '**     the status info symbol "StatusItemsText".
  463. '** Arguments:
  464. '**     ftype% - type of files to add, one of the following:
  465. '**             PROGRAMFILES, PLUGINFILES...
  466. '** Returns:
  467. '**     none.
  468. '*************************************************************************
  469. SUB RecalcOptFiles (ftype%) STATIC
  470.     CursorSave% = ShowWaitCursor()
  471.     ClearCopyList
  472.     AddOptFilesToCopyList ftype%, 1
  473.  
  474.     fExtra% = 0
  475.     IF ftype% = PROGRAMFILES THEN
  476.         ListSym$ = PROGRAMNEEDS$
  477.         IF GetListItem(CHECKSTATES$, PROGRAMFILES) = "ON" THEN
  478.             ''Add extra cost to Windows drive for ini/progman, etc.
  479.             ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  480.             ReplaceListItem EXTRACOSTS$, ndrive%, "10240"
  481.             fExtra% = 1
  482.         END IF
  483.     ELSEIF ftype% = TUTORIALFILES THEN
  484.         ListSym$ = TUTORIALNEEDS$
  485.     ELSEIF ftype% = PATTERNFILES THEN
  486.         ListSym$ = PATTERNNEEDS$
  487.     ELSEIF ftype% = DUOTONEFILES THEN
  488.         ListSym$ = DUOTONENEEDS$
  489.     ELSEIF ftype% = FILTERFILES THEN
  490.     ListSym$ = FILTERNEEDS$
  491.     END IF
  492.  
  493.     StillNeed& = GetCopyListCost(EXTRACOSTS$, ListSym$, "")
  494.  
  495.     cost& = 0
  496.     FOR i% = 1 TO 26 STEP 1
  497.         cost&  = cost& + VAL(GetListItem(ListSym$, i%))
  498.     NEXT i%
  499.     ReplaceListItem STATUSTEXT$, ftype%, STR$(cost& / 1024) + " K"
  500.  
  501.     IF StillNeed& > 0 THEN
  502.         ReplaceListItem BIGLIST$, ftype%, "YES"
  503.     ELSE
  504.         ReplaceListItem BIGLIST$, ftype%, ""
  505.     END IF
  506.  
  507.     IF fExtra% THEN
  508.         ReplaceListItem EXTRACOSTS$, ndrive%, "0"
  509.     END IF
  510.     RestoreCursor CursorSave%
  511.     ListSym$ = ""
  512. END SUB
  513.  
  514.  
  515. '**
  516. '** Purpose:
  517. '**     Recalculates disk space and sets option status info according
  518. '**     to the current destination path.
  519. '** Arguments:
  520. '**     none.
  521. '** Returns:
  522. '**     none.
  523. '*************************************************************************
  524. SUB RecalcPath STATIC
  525.  
  526.     CursorSave% = ShowWaitCursor()
  527.  
  528.     RecalcOptFiles PROGRAMFILES
  529.     RecalcOptFiles TUTORIALFILES
  530.     RecalcOptFiles PATTERNFILES
  531.     RecalcOptFiles DUOTONEFILES
  532.     RecalcOptFiles FILTERFILES
  533.  
  534.     RestoreCursor CursorSave%
  535. END SUB
  536.  
  537.  
  538. '**
  539. '** Purpose:
  540. '**     Sets drive status info according to latest disk space calcs.
  541. '** Arguments:
  542. '**     none.
  543. '** Returns:
  544. '**     none.
  545. '*************************************************************************
  546. SUB SetDriveStatus STATIC
  547.  
  548.     ENOUGHDISK% = 1
  549.     drive$ = MID$(DEST$, 1, 1)
  550.     ndrive% = ASC(ucase$(drive$)) - ASC("A") + 1
  551.     cost& = VAL( GetListItem( PROGRAMNEEDS$, ndrive% ) )
  552.     cost& = cost& + VAL( GetListItem( TUTORIALNEEDS$, ndrive% ) )
  553.     cost& = cost& + VAL( GetListItem( PATTERNNEEDS$, ndrive% ) )
  554.     cost& = cost& + VAL( GetListItem( DUOTONENEEDS$, ndrive% ) )
  555.     cost& = cost& + VAL( GetListItem( FILTERNEEDS$, ndrive% ) )
  556.     free& = GetFreeSpaceForDrive(drive$)
  557.     ReplaceListItem DRIVETEXT$, 1, drive$ + ":"
  558.     ReplaceListItem DRIVETEXT$, 2, STR$(cost& / 1024) + " K"
  559.     ReplaceListItem DRIVETEXT$, 3, STR$(free& / 1024) + " K"
  560.     IF cost& > free& THEN
  561.       ENOUGHDISK% = 0
  562.     END IF
  563.  
  564.     IF drive$ = WINDRIVE$ THEN
  565.         ReplaceListItem DRIVETEXT$, 4, ""
  566.         ReplaceListItem DRIVETEXT$, 5, ""
  567.         ReplaceListItem DRIVETEXT$, 6, ""
  568.     ELSE
  569.         ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  570.         cost& = VAL( GetListItem( PROGRAMNEEDS$, ndrive% ) )
  571.         cost& = cost& + VAL( GetListItem( TUTORIALNEEDS$, ndrive% ) )
  572.         cost& = cost& + VAL( GetListItem( PATTERNNEEDS$, ndrive% ) )
  573.         cost& = cost& + VAL( GetListItem( DUOTONENEEDS$, ndrive% ) )
  574.         cost& = cost& + VAL( GetListItem( FILTERNEEDS$, ndrive% ) )
  575.         IF cost& = 0 THEN
  576.             ReplaceListItem DRIVETEXT$, 4, ""
  577.             ReplaceListItem DRIVETEXT$, 5, ""
  578.             ReplaceListItem DRIVETEXT$, 6, ""
  579.         ELSE
  580.             free& = GetFreeSpaceForDrive(WINDRIVE$)
  581.             ReplaceListItem DRIVETEXT$, 4, WINDRIVE$ + ":"
  582.             ReplaceListItem DRIVETEXT$, 5, STR$(cost& / 1024) + " K"
  583.             ReplaceListItem DRIVETEXT$, 6, STR$(free& / 1024) + " K"
  584.             IF cost& > free& THEN
  585.               ENOUGHDISK% = 0
  586.             END IF
  587.         END IF
  588.     END IF
  589. END SUB
  590.  
  591.  
  592. '**
  593. '** Purpose:
  594. '**     Appends a file name to the end of a directory path,
  595. '**     inserting a backslash character as needed.
  596. '** Arguments:
  597. '**     szDir$  - full directory path (with optional ending "\")
  598. '**     szFile$ - filename to append to directory
  599. '** Returns:
  600. '**     Resulting fully qualified path name.
  601. '*************************************************************************
  602. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  603.     IF szDir$ = "" THEN
  604.         MakePath = szFile$
  605.     ELSEIF szFile$ = "" THEN
  606.         MakePath = szDir$
  607.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  608.         MakePath = szDir$ + szFile$
  609.     ELSE
  610.         MakePath = szDir$ + "\" + szFile$
  611.     END IF
  612. END FUNCTION
  613.