home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 July / Chip_1997-07_cd.bin / tema / mattes / ip / ip25 / disk1 / ip.mst < prev    next >
Text File  |  1994-07-31  |  17KB  |  603 lines

  1. '**************************************************************************
  2. '*                       MSSetup Toolkit Sample 1
  3. '**************************************************************************
  4.  
  5. '$DEFINE DEBUG  ''Define for script development/debugging
  6.  
  7. '$INCLUDE 'setupapi.inc'
  8. '$INCLUDE 'msdetect.inc'
  9. '$INCLUDE 'msregdb.inc'
  10.  
  11. ''Dialog ID's
  12. CONST CUSTINST      = 3
  13. CONST WELCOME       = 100
  14. CONST ASKQUIT       = 200
  15. CONST DESTPATH      = 300
  16. CONST EXITFAILURE   = 400
  17. CONST EXITQUIT      = 600
  18. CONST EXITSUCCESS   = 700
  19. CONST OPTIONS       = 800
  20. CONST OPTIONS1      = 800
  21. CONST OPTIONS2      = 800
  22. CONST APPHELP       = 900
  23. CONST TOOBIG        = 6300
  24. CONST BADPATH       = 6400
  25.  
  26. CONST PROGRAM       = 451
  27. CONST COMPLEX       = 452
  28. CONST DEMOS         = 453
  29. CONST EXPERIMENTS   = 454
  30. CONST INTERACTIONS  = 455
  31.  
  32. CONST APPFILES     = 1
  33. CONST DEMOFILES    = 2
  34. CONST INTERACTIONFILES    = 3
  35.  
  36. ''Bitmap ID
  37. CONST LOGO = 1
  38.  
  39. GLOBAL DEST$        ''Default destination directory.
  40. GLOBAL WINDRIVE$    ''Windows drive letter.
  41. GLOBAL OPTCUR$      ''Option selection from option dialog.
  42. GLOBAL OPT1OPT$     ''Option selection from DemoFiles option dialog.
  43. GLOBAL OPT2OPT$     ''Option selection from InteractionFiles option dialog.
  44.  
  45. ''CustInst list symbol names
  46. GLOBAL APPNEEDS$    ''Option list costs per drive
  47. GLOBAL OPT1NEEDS$
  48. GLOBAL OPT2NEEDS$
  49. GLOBAL EXTRACOSTS$  ''List of extra costs to add per drive
  50. GLOBAL BIGLIST$     ''List of option files cost calc results (boolean)
  51.  
  52. ''Dialog list symbol names
  53. GLOBAL CHECKSTATES$
  54. GLOBAL STATUSTEXT$
  55. GLOBAL DRIVETEXT$
  56.  
  57. DECLARE SUB Install
  58. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  59. DECLARE SUB AddOptFilesToCopyList (ftype%)
  60. DECLARE SUB RecalcOptFiles (ftype%)
  61. DECLARE SUB RecalcPath
  62. DECLARE SUB SetDriveStatus
  63.  
  64.  
  65. INIT:
  66.     CUIDLL$ = "mscuistf.dll"            ''Custom user interface dll
  67.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  68.  
  69.     SetBitmap CUIDLL$, LOGO
  70.     SetTitle "Interactive Physics 2.5 Installer"
  71.  
  72.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  73.     IF szInf$ = "" THEN
  74.         szInf$ = GetSymbolValue("STF_CWDDIR") + "ip.INF"
  75.     END IF
  76.     ReadInfFile szInf$
  77.  
  78.     OPTCUR$ = "1"
  79.     DEST$ = "C:\ip25"
  80.  
  81. '$IFDEF DEBUG
  82.     i% = SetSizeCheckMode(scmOnIgnore)    '' could use scmOff; def = scmOnFatal
  83.     WinDrive$ = MID$(GetWindowsDir, 1, 1)
  84.     IF IsDriveValid(WinDrive$) = 0 THEN
  85.         i% = DoMsgBox("Windows drive ('"+WinDrive$+"') is not a valid drive.", "DEBUG", MB_TASKMODAL+MB_ICONHAND+MB_OK)
  86.         GOTO QUIT
  87.     END IF
  88. '$ENDIF ''DEBUG
  89.  
  90.     ''CustInst list symbols
  91.     CHECKSTATES$ = "CheckItemsState"
  92.     STATUSTEXT$  = "StatusItemsText"
  93.     DRIVETEXT$   = "DriveStatusText"
  94.     FOR i% = 1 TO 3 STEP 1
  95.         AddListItem CHECKSTATES$, "ON"
  96.     NEXT i%
  97.     FOR i% = 1 TO 3 STEP 1
  98.         AddListItem STATUSTEXT$, ""
  99.     NEXT i%
  100.     FOR i% = 1 TO 7 STEP 1
  101.         AddListItem DRIVETEXT$, ""
  102.     NEXT i%
  103.     ReplaceListItem DRIVETEXT$, 7, DEST$
  104.  
  105.     ''Disk cost list symbols
  106.     APPNEEDS$   = "AppNeeds"
  107.     OPT1NEEDS$  = "Opt1Needs"
  108.     OPT2NEEDS$  = "Opt2Needs"
  109.     EXTRACOSTS$ = "ExtraCosts"
  110.     BIGLIST$    = "BigList"
  111.     FOR i% = 1 TO 3 STEP 1
  112.         AddListItem BIGLIST$, ""
  113.     NEXT i%
  114.     FOR i% = 1 TO 26 STEP 1
  115.         AddListItem EXTRACOSTS$, "0"
  116.     NEXT i%
  117.  
  118.     ''File Option Variables
  119.     OPT1OPT$ = "1"
  120.     OPT2OPT$ = "1"
  121.  
  122.     RecalcPath
  123.     SetDriveStatus
  124.  
  125.  
  126. WELCOME:
  127.     sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
  128.     IF sz$ = "CONTINUE" THEN
  129.         UIPop 1
  130.     ELSE
  131.         GOSUB ASKQUIT
  132.         GOTO WELCOME
  133.     END IF
  134.  
  135.  
  136. OPTION:
  137.     SetSymbolValue "RadioDefault", OPTCUR$
  138. OPTL1:
  139.     sz$ = UIStartDlg(CUIDLL$, OPTIONS, "FRadioDlgProc", APPHELP, HELPPROC$)
  140.     OPTCUR$ = GetSymbolValue("ButtonChecked")
  141.  
  142.     IF sz$ = "CONTINUE" THEN
  143.         UIPop(1)
  144.     ELSEIF sz$ = "REACTIVATE" THEN
  145.         GOTO OPTL1
  146.     ELSEIF sz$ = "BACK" THEN
  147.         UIPop(1)
  148.         GOTO WELCOME
  149.     ELSE
  150.         GOSUB ASKQUIT
  151.         GOTO OPTION
  152.     END IF
  153.  
  154.     IF OPTCUR$ = "1" THEN
  155. GETPATH:
  156.         SetSymbolValue "EditFocus", "END"
  157. GETPATHL1:
  158.         SetSymbolValue "EditTextIn", DEST$
  159.         sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
  160.         DEST$ = GetSymbolValue("EditTextOut")
  161.  
  162.         IF sz$ = "CONTINUE" THEN
  163.             DEST$ = GetSymbolValue("EditTextOut")
  164.             IF IsDirWritable(DEST$) = 0 THEN
  165.                 GOSUB BADPATH
  166.                 GOTO GETPATHL1
  167.             END IF
  168.             ''Install only if it will fit.
  169.             SetDriveStatus
  170.             RecalcOptFiles APPFILES
  171.             RecalcOptFiles DEMOFILES
  172.             RecalcOptFiles INTERACTIONFILES
  173.             FOR i% = 1 TO 3 STEP 1
  174.                    IF GetListItem(BIGLIST$, i%) <> "" THEN
  175.                        GOSUB TOOBIG
  176.                     GOTO GETPATH
  177.                 END IF
  178.             NEXT i%
  179.             UIPop 1
  180.         ELSEIF sz$ = "REACTIVATE" THEN
  181.             GOTO GETPATHL1
  182.         ELSEIF sz$ = "BACK" THEN
  183.             UIPop 1
  184.             GOTO OPTION
  185.         ELSE
  186.             GOSUB ASKQUIT
  187.             GOTO GETPATH
  188.         END IF
  189.  
  190.         GOTO FINI
  191.     ELSE
  192. CUSTINST:
  193.         sz$ = UIStartDlg(CUIDLL$, CUSTINST, "FCustInstDlgProc", APPHELP, HELPPROC$)
  194.  
  195.         IF sz$ = "CONTINUE" THEN
  196.             ''Install only if it will fit.
  197.             SetDriveStatus
  198.             RecalcOptFiles APPFILES
  199.             RecalcOptFiles DEMOFILES
  200.             RecalcOptFiles INTERACTIONFILES
  201.             FOR i% = 1 TO 3 STEP 1
  202.                 IF GetListItem(BIGLIST$, i%) <> "" THEN
  203.                     GOSUB TOOBIG
  204.                     GOTO CUSTINST
  205.                 END IF
  206.             NEXT i%
  207.             UIPop 1
  208.             GOTO FINI
  209.         ELSEIF sz$ = "PATH" THEN
  210. GETPATH2:
  211.             SetSymbolValue "EditFocus", "END"
  212. GETPATH2L1:
  213.             SetSymbolValue "EditTextIn", DEST$
  214.             sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
  215.  
  216.             IF sz$ = "CONTINUE" THEN
  217.                 DEST$ = GetSymbolValue("EditTextOut")
  218.                 IF IsDirWritable(DEST$) = 0 THEN
  219.                     GOSUB BADPATH
  220.                     GOTO GETPATH2L1
  221.                 END IF
  222.                 UIPop 1
  223.  
  224.                 ''Truncate display if too long.
  225.                 IF LEN(DEST$) > 23 THEN
  226.                     ReplaceListItem DRIVETEXT$, 7, MID$(DEST$, 1, 23)+"..."
  227.                 ELSE
  228.                     ReplaceListItem DRIVETEXT$, 7, DEST$
  229.                 END IF
  230.  
  231.                 ''Recalc if path changed.
  232.                 IF (olddest$ <> DEST$) AND (olddest$ <> DEST$+"\") AND (olddest$+"\" <> DEST$) THEN
  233.                     RecalcPath
  234.                     SetDriveStatus
  235.                 END IF
  236.  
  237.                 olddest$ = ""
  238.  
  239.                 GOTO CUSTINST
  240.             ELSEIF sz$ = "REACTIVATE" THEN
  241.                 DEST$ = GetSymbolValue("EditTextOut")
  242.                 GOTO GETPATH2L1
  243.             ELSEIF sz$ = "BACK" THEN
  244.                 UIPop 1
  245.                 GOTO GETPATH2L1
  246.             ELSE
  247.                 GOSUB ASKQUIT
  248.                 GOTO GETPATH2
  249.             END IF
  250.         ELSEIF sz$ = "CHK1" THEN
  251.             RecalcOptFiles APPFILES
  252.             SetDriveStatus
  253.             GOTO CUSTINST
  254.            ELSEIF sz$ = "CHK2" THEN
  255.             RecalcOptFiles DEMOFILES
  256.             SetDriveStatus
  257.             GOTO CUSTINST
  258.         ELSEIF sz$ = "CHK3" THEN
  259.             RecalcOptFiles INTERACTIONFILES
  260.             SetDriveStatus
  261.             GOTO CUSTINST
  262.         ELSEIF sz$ = "BTN2" THEN
  263.             GOTO DEMOFILES
  264.         ELSEIF sz$ = "BTN3" THEN
  265.             GOTO INTERACTIONFILES
  266.         ELSEIF sz$ = "REACTIVATE" THEN
  267.             GOTO CUSTINST
  268.          ELSEIF sz$ = "BACK" THEN
  269.             UIPop 1
  270.             GOTO OPTION
  271.         ELSE
  272.             GOSUB ASKQUIT
  273.             GOTO CUSTINST
  274.         END IF
  275.     END IF
  276.  
  277. FINI:
  278.     Install
  279.  
  280.  
  281. QUIT:
  282.     ON ERROR GOTO ERRQUIT
  283.  
  284.     IF ERR = 0 THEN
  285.         dlg% = EXITSUCCESS
  286.     ELSEIF ERR = STFQUIT THEN
  287.         dlg% = EXITQUIT
  288.     ELSE
  289.         dlg% = EXITFAILURE
  290.     END IF
  291. QUITL1:
  292.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  293.     IF sz$ = "REACTIVATE" THEN
  294.         GOTO QUITL1
  295.     END IF
  296.     UIPop 1
  297.  
  298.     END
  299.  
  300. ERRQUIT:
  301.     i% = DoMsgBox("Setup sources were corrupted, call 555-1212!", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  302.     END
  303.  
  304.  
  305.  
  306. BADPATH:
  307.     sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
  308.     IF sz$ = "REACTIVATE" THEN
  309.         GOTO BADPATH
  310.     END IF
  311.     UIPop 1
  312.     RETURN
  313.  
  314.  
  315.  
  316. ASKQUIT:
  317.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  318.  
  319.     IF sz$ = "EXIT" THEN
  320.         UIPopAll
  321.         ERROR STFQUIT
  322.     ELSEIF sz$ = "REACTIVATE" THEN
  323.         GOTO ASKQUIT
  324.     ELSE
  325.         UIPop 1
  326.     END IF
  327.     RETURN
  328.  
  329.  
  330.  
  331. DEMOFILES:
  332.     SetSymbolValue "RadioDefault", OPT1OPT$
  333. OPT1L1:
  334.     sz$ = UIStartDlg(CUIDLL$, OPTIONS1, "FRadioDlgProc", APPHELP, HELPPROC$)
  335.     newopt$ = GetSymbolValue("ButtonChecked")
  336.  
  337.     IF sz$ = "CONTINUE" THEN
  338.         UIPop 1
  339.         IF newopt$ <> OPT1OPT$ THEN
  340.             OPT1OPT$ = newopt$
  341.         END IF
  342.         newopt$ = ""
  343.         GOTO CUSTINST
  344.     ELSEIF sz$ = "REACTIVATE" THEN
  345.         GOTO OPT1L1
  346.     ELSEIF sz$ = "EXIT" THEN
  347.         GOSUB ASKQUIT
  348.         GOTO OPT1L1
  349.     ELSE
  350.         UIPop 1
  351.         newopt$ = ""
  352.         GOTO CUSTINST
  353.     END IF
  354.  
  355.  
  356.  
  357. INTERACTIONFILES:
  358.     SetSymbolValue "RadioDefault", OPT2OPT$
  359. OPT2L1:
  360.     sz$ = UIStartDlg(CUIDLL$, OPTIONS2, "FRadioDlgProc", APPHELP, HELPPROC$)
  361.     newopt$ = GetSymbolValue("ButtonChecked")
  362.  
  363.     IF sz$ = "CONTINUE" THEN
  364.         UIPop 1
  365.         IF newopt$ <> OPT2OPT$ THEN
  366.             OPT2OPT$ = newopt$
  367.         END IF
  368.         newopt$ = ""
  369.         GOTO CUSTINST
  370.     ELSEIF sz$ = "REACTIVATE" THEN
  371.         GOTO OPT2L1
  372.     ELSEIF sz$ = "EXIT" THEN
  373.         GOSUB ASKQUIT
  374.         GOTO OPT2L1
  375.     ELSE
  376.         UIPop 1
  377.         newopt$ = ""
  378.         GOTO CUSTINST
  379.     END IF
  380.  
  381. TOOBIG:
  382.     sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfo0DlgProc", 0, "")
  383.     IF sz$ = "REACTIVATE" THEN
  384.         GOTO TOOBIG
  385.     END IF
  386.     UIPop 1
  387.     RETURN
  388.  
  389. '**
  390. '** Purpose:
  391. '**     Builds the copy list and performs all installation operations.
  392. '** Arguments:
  393. '**     none.
  394. '** Returns:
  395. '**     none.
  396. '*************************************************************************
  397. SUB Install STATIC
  398.  
  399.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  400.     CreateDir DEST$, cmoNone
  401.  
  402.     OpenLogFile MakePath(DEST$, "LOGFILE.OUT"), 0
  403.     WriteToLogFile ""
  404.     WriteToLogFile "  User chose as destination directory: '" + DEST$ + "'"
  405.     WriteToLogFile "  User chose option: '" + OPTCUR$ + "'"
  406.     WriteToLogFile ""
  407.     WriteToLogFile "May have had to create the directory: " + DEST$
  408.     WriteToLogFile ""
  409.  
  410.     IF GetListItem(CHECKSTATES$, APPFILES) = "ON" THEN
  411.         AddSectionFilesToCopyList "AppFiles", SrcDir$, DEST$
  412.     ENDIF
  413.     IF GetListItem(CHECKSTATES$, DEMOFILES) = "ON" THEN
  414.         AddSectionFilesToCopyList "DemoFiles", SrcDir$, DEST$
  415.     ENDIF
  416.     IF GetListItem(CHECKSTATES$, INTERACTIONFILES) = "ON" THEN
  417.         AddSectionFilesToCopyList "InteractionFiles", SrcDir$, DEST$
  418.     ENDIF
  419. ''    AddSectionKeyFileToCopyList "Options", OPTCUR$, SrcDir$, DEST$
  420.     CopyFilesInCopyList
  421.  
  422. ''    ini$ = MakePath(DEST$, "DEMO.INI")
  423. ''    CreateIniKeyValue "WIN.INI", "MSSetup Sample 1", "Option", OPTCUR$, cmoNone
  424. ''    CreateIniKeyValue ini$, "Section 1", "Key 1", "Value 1" , cmoNone
  425. ''    CreateIniKeyValue ini$, "Section 2", "Key 2", "Value 2" , cmoNone
  426. ''    CreateIniKeyValue ini$, "Section 3", "Key 3", "Value 3" , cmoNone
  427.  
  428.     CreateProgmanGroup "Interactive Physics 2.5", "", cmoNone
  429.     ShowProgmanGroup  "Interactive Physics 2.5", 1, cmoNone
  430.     CreateProgmanItem "Interactive Physics 2.5", "Interactive Physics 2.5", MakePath(DEST$,"ip.exe"), "", cmoOverwrite
  431.     CreateProgmanItem "Interactive Physics 2.5", "Read Me", MakePath(DEST$,"readme.wri"), "", cmoOverwrite
  432.     CreateProgmanItem "Interactive Physics 2.5", "Release Notes", MakePath(DEST$,"relnotes.wri"), "", cmoOverwrite
  433.     CreateRegKeyValue ".ip", "IPII"
  434.     CreateRegKeyValue "IPII", "Interactive Physics 2.5 Document"
  435.     CreateRegKeyValue "IPII\shell\open\command", MakePath(DEST$,"ip.exe")+ " %1"
  436.  
  437.     AddDos5Help "YOURAPP", "A brief help text for your Windows application."+chr$(10)+"It can be continued on another line with chr$(10).", cmoNone
  438.  
  439.     CloseLogFile
  440.  
  441. END SUB
  442.  
  443.  
  444.  
  445. '**
  446. '** Purpose:
  447. '**     Appends a file name to the end of a directory path,
  448. '**     inserting a backslash character as needed.
  449. '** Arguments:
  450. '**     szDir$  - full directory path (with optional ending "\")
  451. '**     szFile$ - filename to append to directory
  452. '** Returns:
  453. '**     Resulting fully qualified path name.
  454. '*************************************************************************
  455. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  456.     IF szDir$ = "" THEN
  457.         MakePath = szFile$
  458.     ELSEIF szFile$ = "" THEN
  459.         MakePath = szDir$
  460.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  461.         MakePath = szDir$ + szFile$
  462.     ELSE
  463.         MakePath = szDir$ + "\" + szFile$
  464.     END IF
  465. END FUNCTION
  466.  
  467. '**
  468. '** Purpose:
  469. '**     Adds the specified option files to the copy list.
  470. '** Arguments:
  471. '**     ftype%  - type of files to add, one of the following:
  472. '**             APPFILES, DEMOFILES, INTERACTIONFILES
  473. '** Returns:
  474. '**     none.
  475. '*************************************************************************
  476. SUB AddOptFilesToCopyList (ftype%) STATIC
  477.  
  478.     IF GetListItem(CHECKSTATES$, ftype%) = "ON" THEN
  479.         SrcDir$ = GetSymbolValue("STF_SRCDIR")
  480.         IF ftype% = APPFILES THEN
  481.             AddSectionFilesToCopyList "AppFiles", SrcDir$, DEST$
  482.         ELSEIF ftype% = DEMOFILES THEN
  483.             AddSectionFilesToCopyList "DemoFiles", SrcDir$, DEST$
  484.         ELSEIF ftype% = INTERACTIONFILES THEN
  485.             AddSectionFilesToCopyList "InteractionFiles", SrcDir$, DEST$
  486.         END IF
  487.         SrcDir$ = ""
  488.     END IF
  489. END SUB
  490.  
  491.  
  492. '**
  493. '** Purpose:
  494. '**     Recalculates disk space for the given option files and sets
  495. '**     the status info symbol "StatusItemsText".
  496. '** Arguments:
  497. '**     ftype% - type of files to add, one of the following:
  498. '**             APPFILES, DEMOFILES, INTERACTIONFILES
  499. '** Returns:
  500. '**     none.
  501. '*************************************************************************
  502. SUB RecalcOptFiles (ftype%) STATIC
  503.     CursorSave% = ShowWaitCursor()
  504.     ClearCopyList
  505.     AddOptFilesToCopyList ftype%
  506.  
  507.     fExtra% = 0
  508.     IF ftype% = APPFILES THEN
  509.         ListSym$ = APPNEEDS$
  510.         IF GetListItem(CHECKSTATES$, APPFILES) = "ON" THEN
  511.             ''Add extra cost to Windows drive for ini/progman, etc.
  512.             ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  513.             ReplaceListItem EXTRACOSTS$, ndrive%, "10240"
  514.             fExtra% = 1
  515.         END IF
  516.     ELSEIF ftype% = DEMOFILES THEN
  517.         ListSym$ = OPT1NEEDS$
  518.     ELSEIF ftype% = INTERACTIONFILES THEN
  519.         ListSym$ = OPT2NEEDS$
  520.     END IF
  521.  
  522.     StillNeed& = GetCopyListCost(EXTRACOSTS$, ListSym$, "")
  523.  
  524.     cost& = 0
  525.     FOR i% = 1 TO 26 STEP 1
  526.         cost&  = cost& + VAL(GetListItem(ListSym$, i%))
  527.     NEXT i%
  528.     ReplaceListItem STATUSTEXT$, ftype%, STR$(cost& / 1024) + " K"
  529.  
  530.     IF StillNeed& > 0 THEN
  531.         ReplaceListItem BIGLIST$, ftype%, "YES"
  532.     ELSE
  533.         ReplaceListItem BIGLIST$, ftype%, ""
  534.     END IF
  535.  
  536.     IF fExtra% THEN
  537.         ReplaceListItem EXTRACOSTS$, ndrive%, "0"
  538.     END IF
  539.     RestoreCursor CursorSave%
  540.     ListSym$ = ""
  541. END SUB
  542.  
  543.  
  544. '**
  545. '** Purpose:
  546. '**     Recalculates disk space and sets option status info according
  547. '**     to the current destination path.
  548. '** Arguments:
  549. '**     none.
  550. '** Returns:
  551. '**     none.
  552. '*************************************************************************
  553. SUB RecalcPath STATIC
  554.  
  555.     CursorSave% = ShowWaitCursor()
  556.  
  557.     RecalcOptFiles APPFILES
  558.     RecalcOptFiles DEMOFILES
  559.     RecalcOptFiles INTERACTIONFILES
  560.  
  561.     RestoreCursor CursorSave%
  562. END SUB
  563.  
  564.  
  565. '**
  566. '** Purpose:
  567. '**     Sets drive status info according to latest disk space calcs.
  568. '** Arguments:
  569. '**     none.
  570. '** Returns:
  571. '**     none.
  572. '*************************************************************************
  573. SUB SetDriveStatus STATIC
  574.  
  575.     drive$ = MID$(DEST$, 1, 1)
  576.     ndrive% = ASC(ucase$(drive$)) - ASC("A") + 1
  577.     cost& = VAL(GetListItem(APPNEEDS$, ndrive%)) + VAL(GetListItem(OPT1NEEDS$, ndrive%)) + VAL(GetListItem(OPT2NEEDS$, ndrive%))
  578.     free& = GetFreeSpaceForDrive(drive$)
  579.     ReplaceListItem DRIVETEXT$, 1, drive$ + ":"
  580.     ReplaceListItem DRIVETEXT$, 2, STR$(cost& / 1024) + " K"
  581.     ReplaceListItem DRIVETEXT$, 3, STR$(free& / 1024) + " K"
  582.  
  583.     IF drive$ = WINDRIVE$ THEN
  584.         ReplaceListItem DRIVETEXT$, 4, ""
  585.         ReplaceListItem DRIVETEXT$, 5, ""
  586.         ReplaceListItem DRIVETEXT$, 6, ""
  587.     ELSE
  588.         ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  589.         cost& = VAL(GetListItem(APPNEEDS$, ndrive%)) + VAL(GetListItem(OPT1NEEDS$, ndrive%)) + VAL(GetListItem(OPT2NEEDS$, ndrive%))
  590.         IF cost& = 0 THEN
  591.             ReplaceListItem DRIVETEXT$, 4, ""
  592.             ReplaceListItem DRIVETEXT$, 5, ""
  593.             ReplaceListItem DRIVETEXT$, 6, ""
  594.         ELSE
  595.             free& = GetFreeSpaceForDrive(WINDRIVE$)
  596.             ReplaceListItem DRIVETEXT$, 4, WINDRIVE$ + ":"
  597.             ReplaceListItem DRIVETEXT$, 5, STR$(cost& / 1024) + " K"
  598.             ReplaceListItem DRIVETEXT$, 6, STR$(free& / 1024) + " K"
  599.         END IF
  600.     END IF
  601. END SUB
  602.  
  603.