home *** CD-ROM | disk | FTP | other *** search
/ Computer Arts Interactive 1 / ARTS1.mdx / fasteddy / disk1 / fastdemo.mst < prev    next >
Encoding:
Text File  |  1994-05-19  |  15.4 KB  |  557 lines

  1. '**************************************************************************
  2. '* fastdemo.mst - The Fast Eddie Demonstration installation script
  3. '**************************************************************************
  4.  
  5. '$INCLUDE 'setupapi.inc'
  6. '$INCLUDE 'msdetect.inc'
  7. '$INCLUDE 'mscuistf.inc'
  8.  
  9. ''Dialog ID's
  10. CONST ASKQUIT      = 200
  11. CONST DESTPATH     = 300
  12. CONST EXITFAILURE  = 400
  13. CONST RESTART      = 500
  14. CONST EXITQUIT     = 600
  15. CONST EXITSUCCESS  = 700
  16. CONST APPHELP      = 900
  17.  
  18. CONST CUSTINST     = 6200
  19. CONST TOOBIG       = 6300
  20. CONST BADPATH      = 6400
  21.  
  22. CONST MKVOICE      = 1000
  23. CONST TOOMANYDRVRS = 1100
  24. CONST MKMUSIC      = 1200
  25. CONST MKMISC       = 1300
  26.  
  27. ''Bitmap ID
  28. CONST LOGO         = 1
  29.  
  30. ''File Types
  31. CONST TEDFILES     = 1
  32. CONST DRVRFILES    = 2
  33. CONST TUTORFILES   = 3
  34.  
  35. '' Drive Numbers
  36. CONST ADRIVE       = 1
  37. CONST BDRIVE       = 2
  38. CONST CDRIVE       = 3
  39. CONST DDRIVE       = 4
  40.  
  41. '' Booleans
  42. CONST TRUE       = 1
  43. CONST FALSE       = 0
  44.  
  45.  
  46. GLOBAL DEST$        ''Tedwin executable destination directory.
  47. GLOBAL SNDDEST$        ''Tutorial file destination directory.
  48. GLOBAL WINDRIVE$    ''Windows drive letter.
  49. GLOBAL SNDDRIVE$    ''Sound file drive letter.
  50. GLOBAL OPT1OPT$     ''Option selection from OptFiles1 option dialog.
  51. GLOBAL OPT2OPT$     ''Option selection from OptFiles2 option dialog.
  52.  
  53. ''CustInst list symbol names
  54. GLOBAL APPNEEDS$    ''Option list costs per drive
  55. GLOBAL OPT1NEEDS$
  56. GLOBAL OPT2NEEDS$
  57. GLOBAL EXTRACOSTS$  ''List of extra costs to add per drive
  58. GLOBAL BIGLIST$     ''List of option files cost calc results (boolean)
  59.  
  60. ''Dialog list symbol names
  61. GLOBAL CHECKSTATES$
  62. GLOBAL STATUSTEXT$
  63. GLOBAL DRIVETEXT$
  64.  
  65. GLOBAL GOON$
  66.  
  67.  
  68. DECLARE SUB AddOptFilesToCopyList (ftype%)
  69. DECLARE SUB RecalcOptFiles (ftype%)
  70. DECLARE SUB RecalcPath
  71. DECLARE SUB SetDriveStatus
  72. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  73.  
  74.  
  75.  
  76. INIT:
  77.     CUIDLL$ = "mscuistf.dll"            ''custom user interface dll
  78.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  79.  
  80.     SetBitmap CUIDLL$, LOGO
  81.     SetTitle "FastEddie"
  82.  
  83.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  84.     IF szInf$ = "" THEN
  85.         szInf$ = GetSymbolValue("STF_CWDDIR") + "FASTDEMO.INF"
  86.     END IF
  87.     ReadInfFile szInf$
  88.  
  89.     WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
  90.     DEST$ = WINDRIVE$ + ":\DEMOEDDI"
  91.  
  92.     ''CustInst list symbols
  93.     CHECKSTATES$ = "CheckItemsState"
  94.     STATUSTEXT$  = "StatusItemsText"
  95.     DRIVETEXT$   = "DriveStatusText"
  96.     SNDPATHTEXT$ = "SndPathText"
  97.  
  98.     FOR i% = 1 TO 3 STEP 1
  99.         AddListItem CHECKSTATES$, "ON"
  100.     NEXT i%
  101.     FOR i% = 1 TO 3 STEP 1
  102.         AddListItem STATUSTEXT$, ""
  103.     NEXT i%
  104.     FOR i% = 1 TO 7 STEP 1
  105.         AddListItem DRIVETEXT$, ""
  106.     NEXT i%
  107.     ReplaceListItem DRIVETEXT$, 7, DEST$
  108.  
  109.     AddListItem SNDPATHTEXT$, ""
  110.  
  111.     ''Disk cost list symbols
  112.     APPNEEDS$   = "AppNeeds"
  113.     OPT1NEEDS$  = "Opt1Needs"
  114.     OPT2NEEDS$  = "Opt2Needs"
  115.     EXTRACOSTS$ = "ExtraCosts"
  116.     BIGLIST$    = "BigList"
  117.     FOR i% = 1 TO 3 STEP 1
  118.         AddListItem BIGLIST$, ""
  119.     NEXT i%
  120.     FOR i% = 1 TO 26 STEP 1
  121.         AddListItem EXTRACOSTS$, "0"
  122.     NEXT i%
  123.  
  124.     ''File Option Variables
  125.     OPT1OPT$ = "1"
  126.     OPT2OPT$ = "1"
  127.  
  128.     IF DriveAvailp(DDRIVE) = TRUE THEN
  129.     SNDDEST$ = "D:\SND"
  130.     ELSE
  131.     SNDDEST$ = DEST$
  132.     END IF
  133.  
  134.     RecalcPath
  135.     SetDriveStatus
  136.  
  137.  
  138. CUSTINST:
  139.     ReplaceListItem SNDPATHTEXT$, 1, SNDDEST$
  140.     sz$ = UIStartDlg(CUIDLL$, CUSTINST, "FCustInstDlgProc", APPHELP, HELPPROC$)
  141.  
  142.     IF sz$ = "CONTINUE" THEN
  143.         ''Install only if it will fit.
  144.         FOR i% = 1 TO 3 STEP 1
  145.             IF GetListItem(BIGLIST$, i%) <> "" THEN
  146.         GOTO TOOBIG
  147.             END IF
  148.         NEXT i%
  149.         UIPop 1
  150.         GOTO INSTALL
  151.     ELSEIF sz$ = "PATH" THEN
  152.         GOTO GETPATH
  153.     ELSEIF sz$ = "SNDPATH" THEN
  154.         GOTO GETSNDPATH
  155.     ELSEIF sz$ = "CHK1" THEN
  156.         RecalcOptFiles TEDFILES
  157.         SetDriveStatus
  158.         GOTO CUSTINST
  159.     ELSEIF sz$ = "CHK2" THEN
  160.         RecalcOptFiles DRVRFILES
  161.         SetDriveStatus
  162.         GOTO CUSTINST
  163.     ELSEIF sz$ = "CHK3" THEN
  164.         RecalcOptFiles TUTORFILES
  165.         SetDriveStatus
  166.         GOTO CUSTINST
  167.     ELSEIF sz$ = "REACTIVATE" THEN
  168.         RecalcPath
  169.         SetDriveStatus
  170.         GOTO CUSTINST
  171.     ELSE
  172.         GOSUB ASKQUIT
  173.         GOTO CUSTINST
  174.     END IF
  175.  
  176.  
  177. INSTALL:
  178.     ClearCopyList
  179.     AddOptFilesToCopyList TEDFILES
  180.     AddOptFilesToCopyList DRVRFILES
  181.     AddOptFilesToCopyList TUTORFILES
  182.     CreateDir DEST$, cmoNone
  183.     CreateDir SNDDEST$, cmoNone
  184.     CopyFilesInCopyList
  185.  
  186.  
  187.     '' Merge the pieces-parts into the tutorial .wav files.
  188.     IF GetListItem(CHECKSTATES$, TUTORFILES) = "ON" THEN
  189.     '' Expand the one-file .wav's to 44.1 kHz.
  190.     sz$ = UIStartDlg(CUIDLL$, MKMISC, "FModelessDlgProc", 0, "")
  191.     result = MkMiscFiles(SNDDEST$)
  192.     UIPop 1
  193.  
  194.     IF result <> 0 THEN
  195.         GOSUB ASKQUIT
  196.     END IF
  197.  
  198.     END IF
  199.  
  200.     IF GetListItem(CHECKSTATES$, TEDFILES) = "ON" THEN
  201.         CreateProgmanGroup "Fast Eddie Demo", "", cmoNone
  202.         ShowProgmanGroup  "Fast Eddie Demo", 1, cmoNone
  203.         CreateProgmanItem "Fast Eddie Demo", "Fast Eddie Demo", MakePath(DEST$,"fasteddi.exe"), "", cmoOverwrite
  204.         CreateProgmanItem "Fast Eddie Demo", "Catalog Demo", MakePath(DEST$,"catalf.exe"), "", cmoOverwrite
  205.         CreateProgmanItem "Fast Eddie Demo", "Playlist Demo", MakePath(DEST$,"tededlf.exe"), "", cmoOverwrite
  206.     END IF
  207.  
  208.     IF GetListItem(CHECKSTATES$, DRVRFILES) = "ON" THEN
  209.     '' The driver has been copied to the system dir; configure it
  210.     '' result = DoMsgBox("Creating FASTEDDI.INI", "Tedwin setup", MB_OK)
  211.         ini$ = MakePath(GetWindowsDir, "FASTEDDI.INI")
  212.         CreateIniKeyValue ini$, "Options", "default_dir", SNDDEST$ , cmoOverwrite
  213.     GOTO CADDDED
  214.     END IF
  215.  
  216. QUIT:
  217.     ON ERROR GOTO ERRQUIT
  218.  
  219.     IF ERR = 0 THEN
  220.         dlg% = EXITSUCCESS
  221.     ELSEIF ERR = STFQUIT THEN
  222.         dlg% = EXITQUIT
  223.     ELSE
  224.         dlg% = EXITFAILURE
  225.     END IF
  226. QUITL1:
  227.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  228.     IF sz$ = "REACTIVATE" THEN
  229.         GOTO QUITL1
  230.     END IF
  231.     UIPop 1
  232.  
  233.     END
  234.  
  235. ERRQUIT:
  236.     i% = DoMsgBox("Setup sources were corrupted, contact Digital Audio Labs Customer Support.", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  237.     END
  238.  
  239.  
  240. GETPATH:
  241.     SetSymbolValue "EditTextIn", DEST$
  242.     SetSymbolValue "EditFocus", "END"
  243. GETPATHL1:
  244.     sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
  245.  
  246.     IF sz$ = "CONTINUE" THEN
  247.         olddest$ = DEST$
  248.         DEST$ = GetSymbolValue("EditTextOut")
  249.  
  250.         ''Validate new path.
  251.         IF IsDirWritable(DEST$) = 0 THEN
  252.             GOSUB BADPATH
  253.             GOTO GETPATHL1
  254.         END IF
  255.         UIPop 1
  256.  
  257.         ''Truncate display if too long.
  258.         IF LEN(DEST$) > 23 THEN
  259.             ReplaceListItem DRIVETEXT$, 7, MID$(DEST$, 1, 23)+"..."
  260.         ELSE
  261.             ReplaceListItem DRIVETEXT$, 7, DEST$
  262.         END IF
  263.  
  264.         ''Recalc if path changed.
  265.         IF (olddest$ <> DEST$) AND (olddest$ <> DEST$+"\") AND (olddest$+"\" <> DEST$) THEN
  266.             RecalcPath
  267.             SetDriveStatus
  268.         END IF
  269.  
  270.         olddest$ = ""
  271.         GOTO CUSTINST
  272.     ELSEIF sz$ = "REACTIVATE" THEN
  273.         RecalcPath
  274.         SetDriveStatus
  275.         GOTO GETPATHL1
  276.     ELSEIF sz$ = "EXIT" THEN
  277.         GOSUB ASKQUIT
  278.         GOTO GETPATHL1
  279.     ELSE
  280.         UIPop 1
  281.         GOTO CUSTINST
  282.     END IF
  283.  
  284. GETSNDPATH:
  285.     SetSymbolValue "EditTextIn", SNDDEST$
  286.     SetSymbolValue "EditFocus", "END"
  287. GETSNDPATHL1:
  288.     sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
  289.  
  290.     IF sz$ = "CONTINUE" THEN
  291.         oldsnddest$ = SNDDEST$
  292.         SNDDEST$ = GetSymbolValue("EditTextOut")
  293.     ReplaceListItem SNDPATHTEXT$, 1, SNDDEST$
  294.  
  295.         ''Validate new path.
  296.         IF IsDirWritable(SNDDEST$) = 0 THEN
  297.             GOSUB BADPATH
  298.             GOTO GETPATHL1
  299.         END IF
  300.         UIPop 1
  301.  
  302.         ''Recalc if path changed.
  303.         IF (oldsnddest$ <> SNDDEST$) AND (oldsnddest$ <> SNDDEST$+"\") AND (oldsnddest$+"\" <> SNDDEST$) THEN
  304.             RecalcPath
  305.             SetDriveStatus
  306.         END IF
  307.  
  308.         oldsnddest$ = ""
  309.         GOTO CUSTINST
  310.     ELSEIF sz$ = "REACTIVATE" THEN
  311.         GOTO GETSNDPATHL1
  312.     ELSEIF sz$ = "EXIT" THEN
  313.         GOSUB ASKQUIT
  314.         GOTO GETSNDPATHL1
  315.     ELSE
  316.         UIPop 1
  317.         GOTO CUSTINST
  318.     END IF
  319.  
  320.  
  321.  
  322. BADPATH:
  323.     sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
  324.     IF sz$ = "REACTIVATE" THEN
  325.         RecalcPath
  326.         SetDriveStatus
  327.         GOTO BADPATH
  328.     END IF
  329.     UIPop 1
  330.     RETURN
  331.  
  332.  
  333.  
  334. CADDDED:
  335.     '' Add the tasker driver definition.  If there's already a "midi" driver
  336.     '' try midi1, midi2, etc. through midi8 until an open slot is found.
  337.     ''     
  338.     ini$ = MakePath(GetWindowsDir, "SYSTEM.INI")
  339.     curdrvr$ = GetIniKeyString(ini$, "drivers", "midi")
  340.     IF curdrvr$ <> "tasker.drv" THEN
  341.     IF curdrvr$ = "" THEN
  342.         CreateIniKeyValue ini$, "drivers", "midi", "tasker.drv", cmoOverwrite
  343.     ELSE
  344.         FOR i% = ASC("1") TO ASC("9") STEP 1
  345.         curdrvr$ = GetIniKeyString(ini$, "drivers", "midi" + CHR$(i%))
  346.         IF curdrvr$ = "" THEN
  347.             CreateIniKeyValue ini$, "drivers", "midi" + CHR$(i%), "tasker.drv", cmoOverwrite
  348.             GOTO TADDDED
  349.         END IF
  350.         NEXT i%
  351.         sz$ = UIStartDlg(CUIDLL$, TOOMANYDRVRS, "FInfoDlgProc", 0, "")
  352.         UIPop 1
  353.         END
  354.     END IF
  355.     END IF
  356.  
  357. TADDDED:
  358.     ini$ = MakePath(GetWindowsDir, "CONTROL.INI")
  359.  
  360.     CreateIniKeyValue ini$, "drivers.desc", "tasker.drv", "Digital Audio Labs Tasker(tm) MIDI splitter", cmoOverwrite
  361.     sz$ = UIStartDlg(CUIDLL$, RESTART, "FInfoDlgProc", 0, "")
  362.     UIPop 1
  363.     GOTO QUIT
  364.  
  365.  
  366. ASKQUIT:
  367.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  368.  
  369.     IF sz$ = "EXIT" THEN
  370.         UIPopAll
  371.         ERROR STFQUIT
  372.     ELSEIF sz$ = "REACTIVATE" THEN
  373.         GOTO ASKQUIT
  374.     ELSE
  375.         UIPop 1
  376.     END IF
  377.     RETURN
  378.  
  379.  
  380. TOOBIG:
  381.     sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfoDlgProc", 0, "")
  382.     UIPop 1
  383.     IF sz$ = "CONTINUE" THEN
  384.         GOTO INSTALL
  385.     END IF
  386.     GOTO CUSTINST
  387.  
  388.  
  389.  
  390. '**
  391. '** Purpose:
  392. '**     Adds the specified option files to the copy list.
  393. '** Arguments:
  394. '**     ftype%  - type of files to add, one of the following:
  395. '**             TEDFILES, DRVRFILES, TUTORFILES
  396. '** Returns:
  397. '**     none.
  398. '*************************************************************************
  399. SUB AddOptFilesToCopyList (ftype%) STATIC
  400.  
  401.     IF GetListItem(CHECKSTATES$, ftype%) = "ON" THEN
  402.         SrcDir$ = GetSymbolValue("STF_SRCDIR")
  403.         IF ftype% = TEDFILES THEN
  404.             AddSectionFilesToCopyList "tedwin", SrcDir$, DEST$
  405.         ELSEIF ftype% = DRVRFILES THEN
  406.             AddSectionFilesToCopyList "driver", SrcDir$, GetWindowsSysDir 
  407.         ELSEIF ftype% = TUTORFILES THEN
  408.             AddSectionFilesToCopyList "tutorial", SrcDir$, SNDDEST$
  409.         END IF
  410.         SrcDir$ = ""
  411.     END IF
  412. END SUB
  413.  
  414.  
  415. '**
  416. '** Purpose:
  417. '**     Recalculates disk space for the given option files and sets
  418. '**     the status info symbol "StatusItemsText".
  419. '** Arguments:
  420. '**     ftype% - type of files to add, one of the following:
  421. '**             TEDFILES, DRVRFILES, TUTORFILES
  422. '** Returns:
  423. '**     none.
  424. '*************************************************************************
  425. SUB RecalcOptFiles (ftype%) STATIC
  426.     CursorSave% = ShowWaitCursor()
  427.     ClearCopyList
  428.     AddOptFilesToCopyList ftype%
  429.  
  430.     fExtra% = 0
  431.     IF ftype% = TEDFILES THEN
  432.         ListSym$ = APPNEEDS$
  433.         IF GetListItem(CHECKSTATES$, TEDFILES) = "ON" THEN
  434.             ''Add extra cost to Windows drive for ini/progman, etc.
  435.             ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  436.             ReplaceListItem EXTRACOSTS$, ndrive%, "10240"
  437.             fExtra% = 1
  438.         END IF
  439.     ELSEIF ftype% = DRVRFILES THEN
  440.         ListSym$ = OPT1NEEDS$
  441.     ELSEIF ftype% = TUTORFILES THEN
  442.         ListSym$ = OPT2NEEDS$
  443.         IF GetListItem(CHECKSTATES$, TUTORFILES) = "ON" THEN
  444.             ''Add extra cost for completed VOICE.WAV and MUSIC.WAV
  445.         SNDDRIVE$ = MID$(SNDDEST$, 1, 1)
  446.             ndrive% = ASC(ucase$(SNDDRIVE$)) - ASC("A") + 1
  447.             ReplaceListItem EXTRACOSTS$, ndrive%, "7300000"
  448.             fExtra% = 1
  449.         END IF
  450.     END IF
  451.  
  452.     StillNeed& = GetCopyListCost(EXTRACOSTS$, ListSym$, "")
  453.  
  454.     cost& = 0
  455.     FOR i% = 1 TO 26 STEP 1
  456.         cost&  = cost& + VAL(GetListItem(ListSym$, i%))
  457.     NEXT i%
  458.     ReplaceListItem STATUSTEXT$, ftype%, STR$(cost& / 1024) + " K"
  459.  
  460.     IF StillNeed& > 0 THEN
  461.         ReplaceListItem BIGLIST$, ftype%, "YES"
  462.     ELSE
  463.         ReplaceListItem BIGLIST$, ftype%, ""
  464.     END IF
  465.  
  466.     IF fExtra% THEN
  467.         ReplaceListItem EXTRACOSTS$, ndrive%, "0"
  468.     END IF
  469.     RestoreCursor CursorSave%
  470.     ListSym$ = ""
  471. END SUB
  472.  
  473.  
  474. '**
  475. '** Purpose:
  476. '**     Recalculates disk space and sets option status info according
  477. '**     to the current destination path.
  478. '** Arguments:
  479. '**     none.
  480. '** Returns:
  481. '**     none.
  482. '*************************************************************************
  483. SUB RecalcPath STATIC
  484.  
  485.     CursorSave% = ShowWaitCursor()
  486.  
  487.     RecalcOptFiles TEDFILES
  488.     RecalcOptFiles DRVRFILES
  489.     RecalcOptFiles TUTORFILES
  490.  
  491.     RestoreCursor CursorSave%
  492. END SUB
  493.  
  494.  
  495. '**
  496. '** Purpose:
  497. '**     Sets drive status info according to latest disk space calcs.
  498. '** Arguments:
  499. '**     none.
  500. '** Returns:
  501. '**     none.
  502. '*************************************************************************
  503. SUB SetDriveStatus STATIC
  504.  
  505.     drive$ = MID$(DEST$, 1, 1)
  506.     SNDDRIVE$ = MID$(SNDDEST$, 1, 1)
  507.     ndrive% = ASC(ucase$(drive$)) - ASC("A") + 1
  508.     cost& = VAL(GetListItem(APPNEEDS$, ndrive%)) + VAL(GetListItem(OPT1NEEDS$, ndrive%)) + VAL(GetListItem(OPT2NEEDS$, ndrive%))
  509.     free& = GetFreeSpaceForDrive(drive$)
  510.     ReplaceListItem DRIVETEXT$, 1, drive$ + ":"
  511.     ReplaceListItem DRIVETEXT$, 2, STR$(cost& / 1024) + " K"
  512.     ReplaceListItem DRIVETEXT$, 3, STR$(free& / 1024) + " K"
  513.  
  514.     IF drive$ = SNDDRIVE$ THEN
  515.         ReplaceListItem DRIVETEXT$, 4, ""
  516.         ReplaceListItem DRIVETEXT$, 5, ""
  517.         ReplaceListItem DRIVETEXT$, 6, ""
  518.     ELSE
  519.         ndrive% = ASC(ucase$(SNDDRIVE$)) - ASC("A") + 1
  520.         cost& = VAL(GetListItem(APPNEEDS$, ndrive%)) + VAL(GetListItem(OPT1NEEDS$, ndrive%)) + VAL(GetListItem(OPT2NEEDS$, ndrive%))
  521.         IF cost& = 0 THEN
  522.             ReplaceListItem DRIVETEXT$, 4, ""
  523.             ReplaceListItem DRIVETEXT$, 5, ""
  524.             ReplaceListItem DRIVETEXT$, 6, ""
  525.         ELSE
  526.             free& = GetFreeSpaceForDrive(SNDDRIVE$)
  527.             ReplaceListItem DRIVETEXT$, 4, SNDDRIVE$ + ":"
  528.             ReplaceListItem DRIVETEXT$, 5, STR$(cost& / 1024) + " K"
  529.             ReplaceListItem DRIVETEXT$, 6, STR$(free& / 1024) + " K"
  530.         END IF
  531.     END IF
  532. END SUB
  533.  
  534.  
  535. '**
  536. '** Purpose:
  537. '**     Appends a file name to the end of a directory path,
  538. '**     inserting a backslash character as needed.
  539. '** Arguments:
  540. '**     szDir$  - full directory path (with optional ending "\")
  541. '**     szFile$ - filename to append to directory
  542. '** Returns:
  543. '**     Resulting fully qualified path name.
  544. '*************************************************************************
  545. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  546.     IF szDir$ = "" THEN
  547.         MakePath = szFile$
  548.     ELSEIF szFile$ = "" THEN
  549.         MakePath = szDir$
  550.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  551.         MakePath = szDir$ + szFile$
  552.     ELSE
  553.         MakePath = szDir$ + "\" + szFile$
  554.     END IF
  555. END FUNCTION
  556.  
  557.