home *** CD-ROM | disk | FTP | other *** search
/ Photo Light / PHOTO_LIGHT.iso / photoshp / photoshp.mst < prev    next >
Text File  |  1995-07-04  |  18KB  |  575 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 TRIAL1       = 101
  34. CONST DESTPATH     = 200
  35. CONST EXITFAILURE  = 300
  36. CONST EXITQUIT     = 400
  37. CONST EXITSUCCESS  = 500
  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.  
  121.     ''CustInst list symbols
  122.     CHECKSTATES$ = "CheckItemsState"
  123.     STATUSTEXT$  = "StatusItemsText"
  124.     DRIVETEXT$   = "DriveStatusText"
  125.  
  126.     AddListItem CHECKSTATES$, "ON"
  127.     FOR i% = 2 TO NUMGROUPS STEP 1
  128.         AddListItem CHECKSTATES$, "OFF"
  129.     NEXT i%
  130.     FOR i% = 1 TO NUMGROUPS STEP 1
  131.         AddListItem STATUSTEXT$, ""
  132.     NEXT i%
  133.     FOR i% = 1 TO 7 STEP 1
  134.         AddListItem DRIVETEXT$, ""
  135.     NEXT i%
  136.     ReplaceListItem DRIVETEXT$, 7, DEST$
  137.  
  138.     ''Disk cost list symbols
  139.  
  140.     PROGRAMNEEDS$  = "ProgramNeeds"
  141.     TUTORIALNEEDS$ = "TutorialNeeds"
  142.     PATTERNNEEDS$  = "PatternNeeds"
  143.     DUOTONENEEDS$  = "DuotoneNeeds"
  144.     FILTERNEEDS$   = "FilterNeeds"
  145.  
  146.     EXTRACOSTS$ = "ExtraCosts"
  147.     BIGLIST$    = "BigList"
  148.  
  149.     FOR i% = 1 TO NUMGROUPS STEP 1
  150.         AddListItem BIGLIST$, ""
  151.     NEXT i%
  152.     FOR i% = 1 TO 26 STEP 1
  153.         AddListItem EXTRACOSTS$, "0"
  154.     NEXT i%
  155.  
  156.     RecalcPath
  157.     SetDriveStatus
  158.  
  159. '$IFDEF DEBUG
  160.     i% = SetSizeCheckMode(scmOnIgnore)    '' could use scmOff; def = scmOnFatal
  161. '$ENDIF ''DEBUG
  162.  
  163.  
  164.  
  165. INTRO:
  166.     sz$ = UIStartDlg(INSTALLDLL$, TRIAL1, "FInfo0DlgProc", 0, "" )
  167.   
  168.     IF sz$ = "CONTINUE" THEN
  169.         UIPop 1
  170.     GOTO CUSTINST
  171.     ELSEIF sz$ = "REACTIVATE" THEN
  172.     GOTO INTRO
  173.     ELSE
  174.     UIPopAll
  175.     ERROR STFQUIT
  176.     END IF
  177.  
  178.  
  179. CUSTINST:    
  180.     sz$ = UIStartDlg(INSTALLDLL$, CUSTINST, "FCustInstDlgProc", APPHELP, HELPPROC$)
  181.  
  182.     IF sz$ = "CONTINUE" THEN
  183.         ''Install only if it will fit.
  184.         IF ENOUGHDISK% = 0 THEN
  185.           GOSUB TOOBIG
  186.           GOTO CUSTINST
  187.         END IF
  188.         UIPop 1
  189.         GOTO INSTALL
  190.     ELSEIF sz$ = "PATH" THEN
  191.         GOTO GETPATH
  192.     ELSEIF sz$ = "CHK1" THEN
  193.         RecalcOptFiles PROGRAMFILES
  194.         SetDriveStatus
  195.         GOTO CUSTINST
  196.     ELSEIF sz$ = "CHK2" THEN
  197.         RecalcOptFiles TUTORIALFILES
  198.         SetDriveStatus
  199.         GOTO CUSTINST
  200.     ELSEIF sz$ = "CHK3" THEN
  201.         RecalcOptFiles PATTERNFILES
  202.         SetDriveStatus
  203.         GOTO CUSTINST
  204.     ELSEIF sz$ = "CHK4" THEN
  205.         RecalcOptFiles DUOTONEFILES
  206.         SetDriveStatus
  207.         GOTO CUSTINST
  208.     ELSEIF sz$ = "CHK5" THEN
  209.         RecalcOptFiles FILTERFILES
  210.         SetDriveStatus
  211.         GOTO CUSTINST
  212.     ELSEIF sz$ = "REACTIVATE" THEN
  213.         RecalcPath
  214.         SetDriveStatus
  215.         GOTO CUSTINST
  216.     ELSE
  217.         GOSUB ASKQUIT
  218.         GOTO CUSTINST
  219.     END IF
  220.  
  221.  
  222.  
  223. INSTALL:
  224.  
  225.     CreateDir DEST$, cmoNone
  226.  
  227.       IF GetListItem( CHECKSTATES$, PROGRAMFILES ) = "ON" THEN
  228.     RemoveFile GetWindowsDir() + "PHOTOSHP.INI", cmoNone
  229. ''    RemoveFile GetWindowsDir() + "PHOTOSHP.PSP", cmoNone
  230.         CreateDir DEST$ + "\PLUGINS", cmoNone
  231. ''        CreateDir DEST$ + "\CALIBRAT", cmoNone
  232. ''        CreateDir DEST$ + "\BRUSHES", cmoNone
  233. ''        CreateDir DEST$ + "\PALETTES", cmoNone
  234.     END IF
  235.  
  236.     ClearCopyList
  237.     AddOptFilesToCopyList PROGRAMFILES, 0
  238.     CopyFilesInCopyList
  239.  
  240.     IF GetListItem(CHECKSTATES$, PROGRAMFILES) = "ON" THEN
  241.         CreateProgmanGroup "Adobe", "", cmoNone
  242.         ShowProgmanGroup  "Adobe", 1, cmoNone
  243.         CreateProgmanItem "Adobe", "Photoshop 2.5.1 Tryout", MakePath( DEST$, "photoshp.exe" ), "", cmoOverwrite
  244.         CreateProgmanItem "Adobe", "Photoshop ReadMe", "notepad.exe " + MakePath( DEST$, "psreadme.txt" ), "", cmoOverwrite
  245.     ''Updating PHOTOSHOP.INI and SYSTEM.INI
  246.     CreateIniKeyValue GetWindowsDir() + "photoshp.ini", "Photoshop", "PHOTOSHOPDIRECTORY", DEST$, cmoOverwrite
  247.     CreateIniKeyValue GetWindowsDir() + "photoshp.ini", "Photoshop", "PLUGINDIRECTORY", DEST$ + "\PLUGINS", cmoOverwrite
  248.     CopyFile GetWindowsDir() + "system.ini", GetWindowsDir() + "system.bak", cmoOverwrite, 0
  249.     CreateIniKeyValue GetWindowsDir() + "system.ini", "drivers", "adobekey", "adobekey.drv", cmoOverwrite
  250.     CreateIniKeyValue GetWindowsDir() + "system.ini", "drivers", "adobemse", "adobemse.drv", cmoOverwrite
  251.         X$ = "Adobe Photoshop Tryout Version          "
  252.         R$ = CHR$(40) + X$
  253.         X$ = "                                        "
  254.           R$ = R$ + CHR$(40) + X$
  255.         StampResource "SplitFiles", "Stamp", DEST$, 6, &H276, R$, 82
  256.       END IF                            
  257.       
  258. QUIT:
  259.     ON ERROR GOTO ERRQUIT
  260.  
  261.     IF ERR = 0 THEN
  262.         dlg% = EXITSUCCESS
  263.     ELSEIF ERR = STFQUIT THEN
  264.         dlg% = EXITQUIT
  265.     ELSE
  266.         dlg% = EXITFAILURE
  267.     END IF
  268. QUITL1:
  269.     sz$ = UIStartDlg(INSTALLDLL$, dlg%, "FInfo0DlgProc", 0, "")
  270.     IF sz$ = "REACTIVATE" THEN
  271.         GOTO QUITL1
  272.     END IF
  273.     UIPop 1
  274.  
  275.     END
  276.  
  277. ERRQUIT:
  278.     i% = DoMsgBox(C$, B$, MB_OK+MB_TASKMODAL+MB_ICONHAND)
  279.     END
  280.  
  281.  
  282.  
  283. GETPATH:
  284.     SetSymbolValue "EditTextIn", DEST$
  285.     SetSymbolValue "EditFocus", "END"
  286. GETPATHL1:
  287.     sz$ = UIStartDlg(INSTALLDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
  288.  
  289.     IF sz$ = "CONTINUE" THEN
  290.         olddest$ = DEST$
  291.         DEST$ = GetSymbolValue("EditTextOut")
  292.  
  293.         ''Validate new path.
  294.         IF IsDirWritable(DEST$) = 0 THEN
  295.             GOSUB BADPATH
  296.             GOTO GETPATHL1
  297.         END IF
  298.         UIPop 1
  299.  
  300.         ''Truncate display if too long.
  301.         IF LEN(DEST$) > 23 THEN
  302.             ReplaceListItem DRIVETEXT$, 7, MID$(DEST$, 1, 23)+"..."
  303.         ELSE
  304.             ReplaceListItem DRIVETEXT$, 7, DEST$
  305.         END IF
  306.  
  307.         ''Recalc if path changed.
  308.         IF (olddest$ <> DEST$) AND (olddest$ <> DEST$+"\") AND (olddest$+"\" <> DEST$) THEN
  309.             RecalcPath
  310.             SetDriveStatus
  311.         END IF
  312.  
  313.         olddest$ = ""
  314.         GOTO CUSTINST
  315.     ELSEIF sz$ = "REACTIVATE" THEN
  316.         RecalcPath
  317.         SetDriveStatus
  318.         GOTO GETPATHL1
  319.     ELSEIF sz$ = "EXIT" THEN
  320.         GOSUB ASKQUIT
  321.         GOTO GETPATHL1
  322.     ELSE
  323.         UIPop 1
  324.         GOTO CUSTINST
  325.     END IF
  326.  
  327.  
  328.  
  329. TOOBIG:
  330.     sz$ = UIStartDlg(INSTALLDLL$, TOOBIG, "FInfo0DlgProc", 0, "")
  331.     IF sz$ = "REACTIVATE" THEN
  332.         RecalcPath
  333.         SetDriveStatus
  334.         GOTO TOOBIG
  335.     END IF
  336.     UIPop 1
  337.     RETURN
  338.  
  339.  
  340.  
  341. BADPATH:
  342.     sz$ = UIStartDlg(INSTALLDLL$, BADPATH, "FInfo0DlgProc", 0, "")
  343.     IF sz$ = "REACTIVATE" THEN
  344.         RecalcPath
  345.         SetDriveStatus
  346.         GOTO BADPATH
  347.     END IF
  348.     UIPop 1
  349.     RETURN
  350.  
  351.  
  352.  
  353. ASKQUIT:
  354.     sz$ = UIStartDlg(INSTALLDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  355.  
  356.     IF sz$ = "EXIT" THEN
  357.         UIPopAll
  358.         ERROR STFQUIT
  359.     ELSEIF sz$ = "REACTIVATE" THEN
  360.         GOTO ASKQUIT
  361.     ELSE
  362.         UIPop 1
  363.     END IF
  364.     RETURN
  365.  
  366.  
  367.  
  368. '**
  369. '** Purpose:
  370. '**     Adds the specified option files to the copy list.
  371. '** Arguments:
  372. '**     ftype%  - type of files to add, one of the following:
  373. '**             PROGRAMFILES, DUOTONEFILES ...
  374. '** Returns:
  375. '**     none.
  376. '*************************************************************************
  377. SUB AddOptFilesToCopyList (ftype%, bogus%) STATIC
  378.  
  379.     IF GetListItem(CHECKSTATES$, ftype%) = "ON" THEN
  380.         SrcDir$ = GetSymbolValue("STF_SRCDIR")
  381.         IF ftype% = PROGRAMFILES THEN
  382.             AddSectionFilesToCopyList "ProgramFiles", SrcDir$, DEST$
  383.             AddSectionFilesToCopyList "PluginFiles", SrcDir$, DEST$ + "\plugins"
  384.             AddSectionFilesToCopyList "ProgramWinFiles", SrcDir$, GetWindowsDir()
  385.             AddSectionFilesToCopyList "ProgramWinSysFiles", SrcDir$, GetWindowsSysDir()
  386. ''            AddSectionFilesToCopyList "CalibrateFiles", SrcDir$, DEST$ + "\calibrat"
  387. ''            AddSectionFilesToCopyList "BrushFiles", SrcDir$, DEST$ + "\brushes"
  388. ''            AddSectionFilesToCopyList "PaletteFiles", SrcDir$, DEST$ + "\palettes"
  389.       IF bogus% = 1 THEN
  390.             AddSectionFilesToCopyList "BogusFiles", SrcDir$, DEST$
  391.       ELSE
  392.             AddSectionFilesToCopyList "SplitFiles", SrcDir$, DEST$
  393.       END IF
  394.         ELSEIF ftype% = TUTORIALFILES THEN
  395.             AddSectionFilesToCopyList "TutorialFiles", SrcDir$, DEST$ + "\tutorial"
  396.         ELSEIF ftype% = PATTERNFILES THEN
  397.             AddSectionFilesToCopyList "PatternFiles", SrcDir$, DEST$ + "\patterns"
  398.         ELSEIF ftype% = DUOTONEFILES THEN
  399.             AddSectionFilesToCopyList "DuoDuoPms", SrcDir$, DEST$ + "\duotones\duotone\pms"
  400.             AddSectionFilesToCopyList "DuoDuoProc", SrcDir$, DEST$ + "\duotones\duotone\process"
  401.             AddSectionFilesToCopyList "DuoDuoGray", SrcDir$, DEST$ + "\duotones\duotone\gray"
  402.             AddSectionFilesToCopyList "DuoTriPms", SrcDir$, DEST$ + "\duotones\tritone\pms"
  403.             AddSectionFilesToCopyList "DuoTriProc", SrcDir$, DEST$ + "\duotones\tritone\process"
  404.             AddSectionFilesToCopyList "DuoTriGray", SrcDir$, DEST$ + "\duotones\tritone\gray"
  405.             AddSectionFilesToCopyList "DuoQuadPms", SrcDir$, DEST$ + "\duotones\quadtone\pms"
  406.             AddSectionFilesToCopyList "DuoQuadProc", SrcDir$, DEST$ + "\duotones\quadtone\process"
  407.             AddSectionFilesToCopyList "DuoQuadGray", SrcDir$, DEST$ + "\duotones\quadtone\gray"
  408.     ELSEIF ftype% = FILTERFILES THEN
  409.             AddSectionFilesToCopyList "FilterFiles", SrcDir$, DEST$ + "\plugins"
  410.             AddSectionFilesToCopyList "FilterDispFiles", SrcDir$, DEST$ + "\plugins\dispmaps"
  411.             AddSectionFilesToCopyList "FilterVideoFiles", SrcDir$, DEST$ + "\plugins\video"
  412.             AddSectionFilesToCopyList "ThirdPartyFiles", SrcDir$, DEST$ + "\3rdparty"
  413.             AddSectionFilesToCopyList "XL77xxFiles", SrcDir$, DEST$ + "\3rdparty\xl77xx"
  414.             AddSectionFilesToCopyList "XL77xxTableFiles", SrcDir$, DEST$ + "\3rdparty\xl77xx\tables"
  415.         END IF
  416.         SrcDir$ = ""
  417.     END IF
  418. END SUB
  419.  
  420.  
  421. '**
  422. '** Purpose:
  423. '**     Recalculates disk space for the given option files and sets
  424. '**     the status info symbol "StatusItemsText".
  425. '** Arguments:
  426. '**     ftype% - type of files to add, one of the following:
  427. '**             PROGRAMFILES, PLUGINFILES...
  428. '** Returns:
  429. '**     none.
  430. '*************************************************************************
  431. SUB RecalcOptFiles (ftype%) STATIC
  432.     CursorSave% = ShowWaitCursor()
  433.     ClearCopyList
  434.     AddOptFilesToCopyList ftype%, 1
  435.  
  436.     fExtra% = 0
  437.     IF ftype% = PROGRAMFILES THEN
  438.         ListSym$ = PROGRAMNEEDS$
  439.         IF GetListItem(CHECKSTATES$, PROGRAMFILES) = "ON" THEN
  440.             ''Add extra cost to Windows drive for ini/progman, etc.
  441.             ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  442.             ReplaceListItem EXTRACOSTS$, ndrive%, "10240"
  443.             fExtra% = 1
  444.         END IF
  445.     ELSEIF ftype% = TUTORIALFILES THEN
  446.         ListSym$ = TUTORIALNEEDS$
  447.     ELSEIF ftype% = PATTERNFILES THEN
  448.         ListSym$ = PATTERNNEEDS$
  449.     ELSEIF ftype% = DUOTONEFILES THEN
  450.         ListSym$ = DUOTONENEEDS$
  451.     ELSEIF ftype% = FILTERFILES THEN
  452.     ListSym$ = FILTERNEEDS$
  453.     END IF
  454.  
  455.     StillNeed& = GetCopyListCost(EXTRACOSTS$, ListSym$, "")
  456.  
  457.     cost& = 0
  458.     FOR i% = 1 TO 26 STEP 1
  459.         cost&  = cost& + VAL(GetListItem(ListSym$, i%))
  460.     NEXT i%
  461.     ReplaceListItem STATUSTEXT$, ftype%, STR$(cost& / 1024) + " K"
  462.  
  463.     IF StillNeed& > 0 THEN
  464.         ReplaceListItem BIGLIST$, ftype%, "YES"
  465.     ELSE
  466.         ReplaceListItem BIGLIST$, ftype%, ""
  467.     END IF
  468.  
  469.     IF fExtra% THEN
  470.         ReplaceListItem EXTRACOSTS$, ndrive%, "0"
  471.     END IF
  472.     RestoreCursor CursorSave%
  473.     ListSym$ = ""
  474. END SUB
  475.  
  476.  
  477. '**
  478. '** Purpose:
  479. '**     Recalculates disk space and sets option status info according
  480. '**     to the current destination path.
  481. '** Arguments:
  482. '**     none.
  483. '** Returns:
  484. '**     none.
  485. '*************************************************************************
  486. SUB RecalcPath STATIC
  487.  
  488.     CursorSave% = ShowWaitCursor()
  489.  
  490.     RecalcOptFiles PROGRAMFILES
  491.     RecalcOptFiles TUTORIALFILES
  492.     RecalcOptFiles PATTERNFILES
  493.     RecalcOptFiles DUOTONEFILES
  494.     RecalcOptFiles FILTERFILES
  495.  
  496.     RestoreCursor CursorSave%
  497. END SUB
  498.  
  499.  
  500. '**
  501. '** Purpose:
  502. '**     Sets drive status info according to latest disk space calcs.
  503. '** Arguments:
  504. '**     none.
  505. '** Returns:
  506. '**     none.
  507. '*************************************************************************
  508. SUB SetDriveStatus STATIC
  509.  
  510.     ENOUGHDISK% = 1
  511.     drive$ = MID$(DEST$, 1, 1)
  512.     ndrive% = ASC(ucase$(drive$)) - ASC("A") + 1
  513.     cost& = VAL( GetListItem( PROGRAMNEEDS$, ndrive% ) )
  514.     cost& = cost& + VAL( GetListItem( TUTORIALNEEDS$, ndrive% ) )
  515.     cost& = cost& + VAL( GetListItem( PATTERNNEEDS$, ndrive% ) )
  516.     cost& = cost& + VAL( GetListItem( DUOTONENEEDS$, ndrive% ) )
  517.     cost& = cost& + VAL( GetListItem( FILTERNEEDS$, ndrive% ) )
  518.     free& = GetFreeSpaceForDrive(drive$)
  519.     ReplaceListItem DRIVETEXT$, 1, drive$ + ":"
  520.     ReplaceListItem DRIVETEXT$, 2, STR$(cost& / 1024) + " K"
  521.     ReplaceListItem DRIVETEXT$, 3, STR$(free& / 1024) + " K"
  522.     IF cost& > free& THEN
  523.       ENOUGHDISK% = 0
  524.     END IF
  525.  
  526.     IF drive$ = WINDRIVE$ THEN
  527.         ReplaceListItem DRIVETEXT$, 4, ""
  528.         ReplaceListItem DRIVETEXT$, 5, ""
  529.         ReplaceListItem DRIVETEXT$, 6, ""
  530.     ELSE
  531.         ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  532.         cost& = VAL( GetListItem( PROGRAMNEEDS$, ndrive% ) )
  533.         cost& = cost& + VAL( GetListItem( TUTORIALNEEDS$, ndrive% ) )
  534.         cost& = cost& + VAL( GetListItem( PATTERNNEEDS$, ndrive% ) )
  535.         cost& = cost& + VAL( GetListItem( DUOTONENEEDS$, ndrive% ) )
  536.         cost& = cost& + VAL( GetListItem( FILTERNEEDS$, ndrive% ) )
  537.         IF cost& = 0 THEN
  538.             ReplaceListItem DRIVETEXT$, 4, ""
  539.             ReplaceListItem DRIVETEXT$, 5, ""
  540.             ReplaceListItem DRIVETEXT$, 6, ""
  541.         ELSE
  542.             free& = GetFreeSpaceForDrive(WINDRIVE$)
  543.             ReplaceListItem DRIVETEXT$, 4, WINDRIVE$ + ":"
  544.             ReplaceListItem DRIVETEXT$, 5, STR$(cost& / 1024) + " K"
  545.             ReplaceListItem DRIVETEXT$, 6, STR$(free& / 1024) + " K"
  546.             IF cost& > free& THEN
  547.               ENOUGHDISK% = 0
  548.             END IF
  549.         END IF
  550.     END IF
  551. END SUB
  552.  
  553.  
  554. '**
  555. '** Purpose:
  556. '**     Appends a file name to the end of a directory path,
  557. '**     inserting a backslash character as needed.
  558. '** Arguments:
  559. '**     szDir$  - full directory path (with optional ending "\")
  560. '**     szFile$ - filename to append to directory
  561. '** Returns:
  562. '**     Resulting fully qualified path name.
  563. '*************************************************************************
  564. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  565.     IF szDir$ = "" THEN
  566.         MakePath = szFile$
  567.     ELSEIF szFile$ = "" THEN
  568.         MakePath = szDir$
  569.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  570.         MakePath = szDir$ + szFile$
  571.     ELSE
  572.         MakePath = szDir$ + "\" + szFile$
  573.     END IF
  574. END FUNCTION
  575.