home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0330 - 0339 / ibm0330-0339 / ibm0333.tar / ibm0333 / HPCOPIER.ZIP / HPCOPIER.MST < prev    next >
Encoding:
Text File  |  1994-08-30  |  18.3 KB  |  619 lines

  1. '**************************************************************************
  2. '*
  3. '*                          HP Copier v1.0 Setup
  4. '*
  5. '*            Version for HP DeskScan II v2.1 Distribution Disks
  6. '*
  7. '* History:
  8. '* -------
  9. '*   940612 klb Inherited from Microsoft Windows v3.1 SDK (SAMPLE1.MST)
  10. '*   940721 klb Initial modifications and Turn-on complete for HP Copier.
  11. '*
  12. '* (c) Copyright Hewlett-Packard Company, 1994.
  13. '* All rights are reserved. Copying or other reproduction of
  14. '* this program except for archival purposes is prohibited
  15. '* without the prior written consent of Hewlett-Packard Company.
  16. '*
  17. '*                   RESTRICTED RIGHTS LEGEND
  18. '*
  19. '* Use, duplication, or disclosure by the Government is subject to 
  20. '* restrictions as set forth in paragraph (b) (3) (B) of the Rights 
  21. '* in Technical Data and Computer Software clause in DAR 7-104.9(a).
  22. '*
  23. '* HEWLETT-PACKARD COMPANY
  24. '* Greeley, Colorado
  25. '*****************************************************************************/
  26. '*
  27. '**************************************************************************
  28.  
  29. ''$DEFINE DEBUG  ''Define for script development/debugging
  30.  
  31. '$INCLUDE 'setupapi.inc'
  32. '$INCLUDE 'msdetect.inc'
  33. '$INCLUDE 'cpcui.inc'
  34.  
  35. '' *******************************
  36. '' ********** CONSTANTS **********
  37. '' *******************************
  38.  
  39. '' ********** Bitmap ID **********
  40.  
  41. CONST LOGO               = 10
  42.  
  43. '' ********* Dialog ID's *********
  44.  
  45. CONST DLG_WELCOME        = 100
  46. CONST DLG_HELPWELCOME    = 200
  47. CONST DLG_DESTPATH       = 300
  48. CONST DLG_HELPDESTPATH   = 400
  49. CONST DLG_CONFIRMINFO    = 500
  50. CONST DLG_GROUPNAME      = 600
  51. CONST DLG_HELPGROUPNAME  = 700
  52. CONST DLG_EXITINCOMPLETE = 2000
  53. CONST DLG_EXITSUCCESS    = 2100
  54. CONST DLG_ERRBADPATH     = 4000
  55. CONST DLG_ERRSETUPFAILED = 4100
  56. CONST DLG_ERRTOOBIG      = 4200
  57.  
  58. '' ********* String ID's *********
  59.  
  60. CONST STR_ABOUT1         = 10
  61. CONST STR_ABOUT2         = 20
  62. CONST STR_GROUPSTRING    = 30
  63. CONST STR_NOTEPAD        = 40
  64. CONST STR_PROGMANGROUP   = 50
  65. CONST STR_README         = 60
  66. CONST STR_SETUP          = 70
  67. CONST STR_TITLE          = 80
  68. CONST STR_UIDLL          = 90
  69. CONST STR_INFNAME        = 100
  70. CONST STR_DEFPATH        = 110
  71. CONST STR_ININAME        = 120
  72. CONST STR_HPCOPIER       = 130
  73. CONST STR_INSTALLPATH    = 140
  74. CONST STR_NAME           = 150
  75. CONST ERR_CORRUPTSOURCES = 1000
  76. CONST ERR_DOSVERSION     = 1010
  77. CONST ERR_WINDOWSMODE    = 1020
  78. CONST ERR_WINDOWSVERSION = 1030
  79.  
  80. '' ********** GLOBALS ************
  81.  
  82. GLOBAL gHELPPROC$                        ''Proc handle for Help routine
  83. GLOBAL gWINDIR$                            ''Path to WINDOWS directory
  84.  
  85. '' ******** SUBROUTINES **********
  86.  
  87. DECLARE SUB Install                        ''Where the installation action is
  88. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  89.  
  90.  
  91. ''***************************************************************************
  92. ''***********                 BEGINNING OF SCRIPT                  **********
  93. ''***************************************************************************
  94.  
  95. INIT:
  96.     dim sz$                                ''Generic string return code
  97.     dim errStr$                            ''Generic error string
  98.     dim szAbout1$                        ''First line of the About box
  99.     dim szAbout2$                        ''Second line of the About box
  100.     dim szCuiName$                        ''File name of our custom UI DLL
  101.     dim szDestDir$                        ''Destination directory for the files
  102.     dim szDefGroup$                        ''Default ProgMan group name
  103.     dim szDestDisk$                        ''Disk Drive to install onto
  104.     dim szNotepad$                        ''File name of the NOTEPAD utility
  105.     dim szReadme$                        ''File name of the readme file
  106.     dim szSelGroup$                        ''Selected group name
  107.     dim szTitle$                        ''Title of the main window
  108.  
  109.     dim dlg%                            ''Generic dialog identifier
  110.     dim DlgMode%                        ''Mode used for DoMsgBox() calls
  111.     dim hWnd%                            ''Window handle of the main window
  112.     dim i%                                ''Generic integer return code
  113.     dim ListMade%                        ''0=Haven't made ProgMan combo box list
  114.                                         ''1=ProgMan combo box list initialized
  115.     dim MajVer%                            ''Major version number (Windows or DOS)
  116.     dim MinVer%                            ''Minor version number (Windows or DOS)
  117.     dim WinMode%                        ''Windows operating mode
  118.     dim ShowReadme%                        ''0=Don't show README.TXT file
  119.                                         ''1=Show README.TXT file after install
  120.     dim FreeSpace&                        ''Free space on dest disk (in bytes)
  121.  
  122.  
  123.     ''Some general initialization...
  124.     hWnd%        = HwndFrame()            ''Handle to our main window
  125.     DlgMode%     = MB_TASKMODAL+MB_ICONHAND+MB_OK
  126.     ListMade%    = 0                    ''ProgMan group list not initialized
  127.     ShowReadme%  = 1                    ''Assume that README.TXT will be shown
  128.  
  129.     gHELPPROC$   = "FHelpDlgProc"        ''Help procedure
  130.     gWINDIR$     = GetWindowsDir()        ''WINDOWS directory path (+ ending '\')
  131.  
  132.     szAbout1$    = STRING$(256,0)
  133.     szAbout2$    = STRING$(64,0)
  134.     szCuiName$   = STRING$(16,0)
  135.     szDefGroup$  = STRING$(64,0)
  136.     szDestDir$   = STRING$(144,0)
  137.     szDestDisk$  = STRING$(16,0)
  138.     szNotepad$   = STRING$(16,0)
  139.     szReadme$    = STRING$(16,0)
  140.     szSelGroup$  = STRING$(64,0)
  141.     szTitle$     = STRING$(32,0)
  142.  
  143.     i%           = FAcquireString(STR_ABOUT1,      szAbout1$,   256)
  144.     i%           = FAcquireString(STR_ABOUT2,      szAbout2$,   64)
  145.     i%           = FAcquireString(STR_UIDLL,       szCuiName$,  16)
  146.     i%           = FAcquireString(STR_GROUPSTRING, szDefGroup$, 64)
  147.     i%           = FAcquireString(STR_DEFPATH,     szDestDir$,  144)
  148.     i%           = FAcquireString(STR_NOTEPAD,     szNotepad$,  16)
  149.     i%           = FAcquireString(STR_README,      szReadme$,   16)
  150.     i%           = FAcquireString(STR_TITLE,       szTitle$,    32)
  151.  
  152.     szDestDisk$  = MID$(szDestDir$, 1, 1)
  153.     FreeSpace&   = GetFreeSpaceForDrive(szDestDisk$)
  154.  
  155.     IF (FreeSpace& < 0) THEN
  156.         FreeSpace& = 0
  157.     END IF
  158.  
  159.  
  160.     ''Create place holders for setup information that will be displayed
  161.     ''in a "ConfirmInfo" dialog.  One "AddListItem" is needed for each
  162.     ''piece of data that will be displayed.  The NULLs will be replaced
  163.     ''based on information entered by the user.
  164.  
  165.     AddListItem "ConfirmTextIn", ""            ''Destination Drive
  166.     AddListItem "ConfirmTextIn", ""            ''ProgMan Group Name
  167.  
  168.     ''Initialize the Default Install Directory and Destination Directory 
  169.     ''symbols.  They're initially the same directory...
  170.     SetSymbolValue "symDefaultDirectory", szDestDir$
  171.     SetSymbolValue "symDestDirectory", szDestDir$
  172.     
  173.     ''Remember how much disk space is available on the default drive...
  174.     SetSymbolValue "symSpaceAvail", STR$(FreeSpace& / 1024) + " K"
  175.  
  176.     ''Initialize the Program Manager Group Name string stuff...
  177.     SetSymbolValue "symSelectedGroup", szDefGroup$
  178.  
  179.  
  180.     ''Verify DOS version:  Must be DOS 5.0 or better...
  181.     MajVer% = GetDOSMajorVersion()
  182.     MinVer% = GetDOSMinorVersion()
  183.     IF (MajVer% < 5) THEN
  184.         i%   = FAcquireString(ERR_DOSVERSION, errStr$, 128)
  185.         i%   = DoMsgBox(errStr$, szTitle$, DlgMode%)
  186.         dlg% = EXITFAILURE
  187.         GOTO QUIT1
  188.     END IF
  189.  
  190.  
  191.     ''Verify Windows version and mode:  Must be Windows 3.1 or better...
  192.     MajVer% = GetWindowsMajorVersion()
  193.     MinVer% = GetWindowsMinorVersion()
  194.     IF (MajVer% < 3) OR ((MajVer% = 3) AND (MinVer% < 1)) THEN
  195.         i%   = FAcquireString(ERR_WINDOWSVERSION, errStr$, 128)
  196.         i%   = DoMsgBox(errStr$, szTitle$, DlgMode%)
  197.         dlg% = EXITFAILURE
  198.         GOTO QUIT1
  199.     END IF
  200.  
  201.     WinMode% = GetWindowsMode()
  202.     IF WinMode% = 0 THEN
  203.         i%   = FAcquireString(ERR_WINDOWSMODE, errStr$, 128)
  204.         i%   = DoMsgBox(errStr$,  szTitle$, DlgMode%)
  205.         dlg% = EXITFAILURE
  206.         GOTO QUIT1
  207.     END IF
  208.  
  209.  
  210.     ''Set up the About box to identify our particular installation process.
  211.     ''Set the main window title, read the background bitmap and display the
  212.     ''window...
  213.     i% = MoveWindow(hWnd%, 0, 0, GetScreenWidth(), GetScreenHeight(), 0) 
  214.     SetAbout  szAbout1$, szAbout2$
  215.     SetTitle  szTitle$
  216.     SetBitmap szCuiName$, LOGO
  217.  
  218.  
  219.     ''Find out where the .INF file is, then read it...
  220.     szInf$ = STRING$(144,0)
  221.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  222.  
  223.     IF szInf$ = "" THEN
  224.         szInfName$ = STRING$(16,0)
  225.         i%         = FAcquireString(STR_INFNAME, szInfName$, 16)
  226.         szInf$     = GetSymbolValue("STF_CWDDIR") + szInfName$
  227.         szInfName$ = STRING$(0,0)
  228.     END IF
  229.  
  230.     ReadInfFile szInf$
  231.     szInf$ = STRING$(0,0)
  232.  
  233.  
  234. ''    add '[General]' and 'ExePath' to resource.h and cui.rc files
  235.     szININame$ = STRING$(16,0)
  236.     i%         = FAcquireString(STR_ININAME, szININame, 16)
  237.  
  238.     IF (DoesFileExist(MakePath(gWINDIR$, szININame$), femExists) = 1) THEN
  239.         ''Open the INI file
  240.         ''Read the ExePath string
  241.         ''Set szDestDir$ to that path
  242.     END IF
  243.     szININame$ = STRING$(0,0)
  244.     
  245.  
  246. '$IFDEF DEBUG
  247.     i% = SetSizeCheckMode(scmOnIgnore)        '' could use scmOff; def = scmOnFatal
  248.     WinDrive$ = MID$(GetWindowsDir, 1, 1)
  249.  
  250.     IF IsDriveValid(WinDrive$) = 0 THEN
  251.         i% = DoMsgBox("Windows drive ('"+WinDrive$+"') is not a valid drive.", "DEBUG", MB_TASKMODAL+MB_ICONHAND+MB_OK)
  252.         GOTO QUIT
  253.     END IF
  254. '$ENDIF ''DEBUG
  255.  
  256.  
  257.  
  258. WELCOME:
  259.     '' **********************
  260.     '' *** Welcome dialog ***
  261.     '' **********************
  262.     sz$ = UIStartDlg(szCuiName$, DLG_WELCOME, "FWelcomeDlgProc", DLG_HELPWELCOME, gHELPPROC$)
  263.  
  264.     IF sz$ = "CONTINUE" THEN        ''Continue button pressed
  265.         UIPop 1
  266.         GOTO CONFIRMINFO
  267.         
  268.     ELSEIF sz$ = "REACTIVATE" THEN
  269.         GOTO WELCOME
  270.     
  271.     ELSE                            ''Handle Help and Exit buttons
  272.         GOSUB ASKQUIT
  273.         GOTO WELCOME
  274.     END IF
  275.  
  276.  
  277.  
  278. CONFIRMINFO:    ''Initialize the Confirm Installation Settings dialog
  279.     szSelGroup$ = GetSymbolValue("symSelectedGroup")
  280.     szDestDir$  = GetSymbolValue("symDestDirectory")
  281.  
  282.     tmpStr$ = STRING$(64,0)
  283.     i% = FAcquireString(STR_INSTALLPATH, tmpStr$, 64)
  284.     ReplaceListItem "ConfirmTextIn", 1, tmpStr$+":  "+szDestDir$
  285.     i% = FAcquireString(STR_PROGMANGROUP, tmpStr$, 64)
  286.     ReplaceListItem "ConfirmTextIn", 2, tmpStr$+":  "+szSelGroup$
  287.     tmpStr$ = STRING$(0,0)
  288.     
  289. ''COULD ADD CODE TO CALCULATE HOW MUCH SPACE WILL BE REQUIRED BY THE FILES...
  290.  
  291. CONFIRMINFO1:
  292.     '' ********************************************
  293.     '' *** Confirm Installation Settings dialog *** 
  294.     '' ********************************************
  295.     sz$ = UIStartDlg(szCuiName$, DLG_CONFIRMINFO, "FConfirmDlgProc", 0, "")
  296.  
  297.     IF sz$ = "CONTINUE" THEN        ''OK button pressed
  298.         UIPop 1
  299.         GOTO STARTINSTALL            ''Skip over Path and Group Name dialogs
  300.  
  301.     ELSEIF sz$ = "BACK" THEN        ''Change button pressed
  302.         UIPop 1
  303.         GOTO GETPATH                ''Modify the Install Path...
  304.  
  305.     ELSEIF sz$ = "REACTIVATE" THEN
  306.         GOTO CONFIRMINFO
  307.         
  308.     ELSE                            ''Why would we get here???
  309.         GOSUB ASKQUIT
  310.         GOTO CONFIRMINFO
  311.     END IF
  312.  
  313.  
  314.  
  315. GETPATH:
  316. ''  SetSymbolValue "symDefaultDirectory", szDestDir$
  317.     SetSymbolValue "symEditBoxFocus", "ALL"
  318.     
  319. GETPATH1:
  320.     '' ***********************************************
  321.     '' *** Installation Directory Selection dialog ***
  322.     '' ***********************************************
  323.     sz$ = UIStartDlg(szCuiName$, DLG_DESTPATH, "FDestPathDlgProc", DLG_HELPDESTPATH, gHELPPROC$)
  324.  
  325.     szDestDir$ = GetSymbolValue("symDestDirectory")    ''What's the path the user chose?
  326.  
  327.     IF sz$ = "CONTINUE" THEN        ''Path chosen by the user
  328.         IF IsDirWritable(szDestDir$) = 0 THEN
  329.             GOSUB BADPATH            ''Path isn't valid,
  330.             GOTO GETPATH1            ''so try again...
  331.         END IF
  332.  
  333.         UIPop 1                        ''Close the dialog
  334.  
  335.         ''Calculate the available space for the new (or old) drive...
  336.         szDestDisk$ = MID$(szDestDir$, 1, 1)
  337.         FreeSpace&  = GetFreeSpaceForDrive(szDestDisk$)
  338.         IF (FreeSpace& < 0) THEN
  339.             FreeSpace& = 0
  340.         END IF
  341.         SetSymbolValue "symSpaceAvail", STR$(FreeSpace& / 1024) + " K"
  342.  
  343.         '' Choose the appropriate ProgMan Group Name handler...        
  344.         IF ListMade% = 0 THEN        ''Get the Group Name for icon(s)
  345.             GOTO GETGROUPNAME        ''Don't reinitialize Group Name list
  346.         ELSE
  347.             GOTO GETGROUPNAME1        ''Initialize the ProgMan Group Name list
  348.         END IF
  349.         
  350.     ELSEIF sz$ = "BACK" THEN        ''Back button pressed
  351.         UIPop 1
  352.         GOTO CONFIRMINFO            ''Must not REALLY want to modify defaults
  353.         
  354.     ELSEIF sz$ = "REACTIVATE" THEN
  355.         GOTO GETPATH1
  356.         
  357.     ELSE                            ''Why would we get here???
  358.         GOSUB ASKQUIT
  359.         GOTO GETPATH
  360.     END IF
  361.     
  362.     
  363.     
  364. GETGROUPNAME:        ''Initialize the ProgMan Group Name list...
  365.     IF ListMade% = 0 THEN
  366.         ListMade% = 1
  367.         AddListItem "ListGroupsIn", szSelGroup$
  368.     END IF
  369.  
  370.     SetSymbolValue "symGroupListOut", szSelGroup$
  371.  
  372. GETGROUPNAME1:
  373.     '' *******************************************
  374.     '' *** Select Program Manager Group dialog ***
  375.     '' *******************************************
  376.     sz$ = UIStartDlg(szCuiName$, DLG_GROUPNAME, "FGroupNameDlgProc", DLG_HELPGROUPNAME, gHELPPROC$)
  377.  
  378.     szSelGroup$ = GetSymbolValue("EditGroupOut")
  379.     SetSymbolValue "symSelectedGroup", szSelGroup$
  380.  
  381.     IF sz$ = "CONTINUE" THEN        ''Continue button pressed
  382.         UIPop 1
  383.         GOTO CONFIRMINFO            ''Loop back to the top for verification...
  384.  
  385.     ELSEIF sz$ = "BACK" THEN        ''Back button pressed
  386.         UIPop 1
  387.         GOTO GETPATH
  388.         
  389.     ELSEIF sz$ = "EXIT" THEN        ''Exit button pressed
  390. ''        UIPop 1
  391.         GOSUB ASKQUIT
  392.         GOTO GETGROUPNAME1
  393.  
  394.     ELSEIF sz$ = "REACTIVATE" THEN
  395.         GOTO GETGROUPNAME1
  396.  
  397.     ELSE                            ''Why would we ever get here?
  398.         UIPop 1
  399.         GOSUB ASKQUIT
  400.         GOTO GETGROUPNAME1
  401.     END IF
  402.  
  403.  
  404.  
  405. STARTINSTALL:        ''Do the installation (copy the files and stuff like that)...
  406.     Install
  407.  
  408.  
  409.  
  410. QUIT:
  411.     ON ERROR GOTO ERRQUIT
  412.     dlg% = 0
  413.  
  414.     ''ERR is an MS Test variable with the following definition from the MS Test
  415.     ''documentation:  "The ERR variable is a global integer containing the
  416.     ''error code of the last trappable run-time error that occurred."
  417.     
  418.     IF ERR = 0 THEN                    ''Everything worked fine...
  419.         dlg% = DLG_EXITSUCCESS
  420.         ShowReadme% = 1
  421.  
  422.     ELSEIF ERR = STFQUIT THEN        ''setupapi.inc pre-defined error level
  423.         dlg% = DLG_ERRSETUPFAILED
  424.         ShowReadme% = 0
  425.         
  426.     ELSE                            ''Something bad happened...
  427.         dlg% = DLG_ERRSETUPFAILED
  428.         ShowReadme% = 0
  429.     END IF
  430.     
  431. QUIT1:
  432.     '' *********************************************************************
  433.     '' The dialog that's displayed depends on the value of dlg% set in QUIT:
  434.     '' *********************************************************************
  435.     sz$ = UIStartDlg(szCuiName$, dlg%, "FNoExitButtonDlgProc", 0, "")
  436.     
  437.     IF sz$ = "REACTIVATE" THEN
  438.         GOTO QUIT1
  439.     END IF
  440.     
  441.     UIPop 1
  442.  
  443.     IF ShowReadme% = 1 THEN
  444.         GOTO README
  445.     ELSE
  446.         GOTO ALL_DONE
  447.     END IF
  448.  
  449.  
  450.  
  451.  
  452. README:                                '' Show the readme file
  453.     IF (1 = DoesFileExist(MakePath(szDestDir$, szReadme$), femExists)) THEN
  454.         RUN szNotepad$+" "+MakePath(szDestDir$, szReadme$), NOWAIT
  455.     END IF
  456.  
  457.  
  458.  
  459.  
  460. ALL_DONE:
  461.     END                                ''This is the exit point for the script
  462.  
  463.  
  464.  
  465.  
  466. ERRQUIT:
  467.     i% = FAcquireString(ERR_CORRUPTSOURCES, errStr$, 144)
  468.     i% = DoMsgBox(errStr$, szTitle$, DlgMode%)
  469.     GOTO ALL_DONE
  470.  
  471.  
  472.  
  473. BADPATH:
  474.     '' **********************************************
  475.     '' *** Unknown Path or Directory Error dialog ***
  476.     '' **********************************************
  477.     sz$ = UIStartDlg(szCuiName$, DLG_ERRBADPATH, "FNoExitButtonDlgProc", 0, "")
  478.     
  479.     IF sz$ = "REACTIVATE" THEN
  480.         GOTO BADPATH
  481.  
  482.     ELSE
  483.         UIPop 1
  484.     END IF
  485.     
  486.     RETURN
  487.  
  488.  
  489.  
  490. ASKQUIT:
  491.     '' *******************************
  492.     '' *** Incomplete Setup dialog ***
  493.     '' *******************************
  494.     sz$ = UIStartDlg(szCuiName$, DLG_EXITINCOMPLETE, "FExitIncompleteDlgProc", 0, "")
  495.  
  496.     IF sz$ = "EXIT" THEN            ''Pressed the "Quit" button
  497.         UIPopAll
  498.         ERROR STFQUIT
  499.         
  500.     ELSEIF sz$ = "REACTIVATE" THEN
  501.         GOTO ASKQUIT
  502.         
  503.     ELSE
  504.         UIPop 1                        ''Pressed the "Back" button--Pop the error alert
  505.     END IF
  506.     
  507.     RETURN
  508.  
  509.  
  510. '' ****************************************
  511. '' ********** END OF MAIN SCRIPT **********
  512. '' ****************************************
  513.  
  514.  
  515.  
  516.  
  517. '*************************************************************************
  518. '** Routine:  Install
  519. '**
  520. '** Purpose:  Builds the copy list and performs all installation operations.
  521. '**
  522. '** Arguments:
  523. '**     none.
  524. '**
  525. '** Returns:  None.
  526. '**
  527. '** History:
  528. '**   940612 klb Inherited from Microsoft Windows v3.1 SDK (SAMPLE1.MST)
  529. '**
  530. '*************************************************************************
  531. SUB Install STATIC
  532.  
  533.     szDestDir$  = STRING$(144,0)
  534.     szSrcDir$   = STRING$(144,0)
  535.     szSelGroup$ = STRING$(64,0)
  536.  
  537.     szSrcDir$   = GetSymbolValue("STF_SRCDIR")
  538.     szDestDir$  = GetSymbolValue("symDestDirectory")
  539.     szSelGroup$ = GetSymbolValue("symSelectedGroup")
  540.  
  541.     CreateDir szDestDir$, cmoNone
  542.  
  543. '$IFDEF DEBUG
  544.     OpenLogFile MakePath(szDestDir$, "LOGFILE.OUT"), 0
  545.     WriteToLogFile ""
  546.     WriteToLogFile "  User chose as destination directory: '" + szDestDir$ + "'"
  547. ''  WriteToLogFile "  User chose option: '" + OPTCUR$ + "'"
  548.     WriteToLogFile ""
  549.     WriteToLogFile "May have had to create the directory: " + szDestDir$
  550.     WriteToLogFile ""
  551. '$ENDIF
  552.  
  553.     AddSectionFilesToCopyList "Files", szSrcDir$, szDestDir$
  554.     CopyFilesInCopyList
  555.  
  556.     szName$     = STRING$(32,0)
  557.     szReadme$   = STRING$(16,0)
  558.     szNotepad$  = STRING$(16,0)
  559.     szHPCopier$ = STRING$(16,0)
  560.  
  561.     i% = FAcquireString(STR_NAME, szName$, 32)
  562.     i% = FAcquireString(STR_README, szReadme$, 16)
  563.     i% = FAcquireString(STR_NOTEPAD, szNotepad$, 16)
  564.     i% = FAcquireString(STR_HPCOPIER, szHPCopier$, 16)
  565.     
  566.     CreateProgmanGroup szSelGroup, "", cmoNone
  567.     ShowProgmanGroup   szSelGroup, 1,  cmoNone
  568.     CreateProgmanItem  szSelGroup, szName$, MakePath(szDestDir$,szHPCopier$), "", cmoOverwrite
  569.     CreateProgmanItem  szSelGroup, szReadme$, szNotepad$+" "+MakePath(szDestDir$,szReadme$), "", cmoOverwrite
  570.  
  571.     szName$     = STRING$(0,0)
  572.     szReadme$   = STRING$(0,0)
  573.     szNotepad$  = STRING$(0,0)
  574.     szHPCopier$ = STRING$(0,0)
  575.     szDestDir$  = STRING$(0,0)
  576.     szSelGroup$ = STRING$(0,0)
  577.     szSrcDir$   = STRING$(0,0)
  578.  
  579. '$IFDEF DEBUG
  580.     CloseLogFile
  581. '$ENDIF
  582.  
  583. END SUB
  584.  
  585.  
  586.  
  587. '*************************************************************************
  588. '** Routine:  FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  589. '**
  590. '** Purpose:  Appends a file name to the end of a directory path,
  591. '**           inserting a backslash character as needed.
  592. '**
  593. '** Arguments:
  594. '**    szDir$  - full directory path (with optional ending "\")
  595. '**    szFile$ - filename to append to directory
  596. '**
  597. '** Returns:     Resulting fully qualified path name.
  598. '**
  599. '** History:
  600. '**   940612 klb Inherited from Microsoft Windows v3.1 SDK (SAMPLE1.MST)
  601. '*************************************************************************
  602. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  603.  
  604.     IF szDir$ = "" THEN
  605.         MakePath = szFile$
  606.  
  607.     ELSEIF szFile$ = "" THEN
  608.         MakePath = szDir$
  609.  
  610.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  611.         MakePath = szDir$ + szFile$
  612.  
  613.     ELSE
  614.         MakePath = szDir$ + "\" + szFile$
  615.     END IF
  616.  
  617. END FUNCTION
  618.  
  619.