home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1997 June / PCO_06_97.ISO / filesbbs / OS2 / TBOX3_08.ARJ / TBOX3_08.ZIP / install.exe / install.cmd < prev    next >
Encoding:
Text File  |  1997-04-05  |  2.3 KB  |  81 lines

  1. /*  K.A.Ash (c) Copyright 1996                                          */
  2. /*  install.cmd                                                         */
  3. /*  -----------                                                         */
  4. /*      A very simple installation script.                              */
  5.  
  6. options etmode
  7. options exmode
  8. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  9. call SysLoadFuncs
  10.  
  11. programName = SysSearchPath('PATH', 'TaskBox.exe')
  12. if programName = '' then
  13. do
  14.    say 'Error: Could not find TaskBox.exe in PATH directories.'
  15.    exit
  16. end
  17.  
  18. if stream('TaskBox.dll', 'command', 'query exists') = '' then
  19. do
  20.    say 'Error: Could not find TaskBox.dll in the current directory.'
  21.    exit 1
  22. end
  23.  
  24. if SysCreateObject('WPProgram', 'TaskBox', '<WP_DESKTOP>',,
  25.          'EXENAME='programName';STARTUPDIR='directory() || ,
  26.          ';PROGTYPE=PM;OBJECTID=<TaskBox>;PARAMETERS=/SILENT_EXIT /WATCH 90 /P:F:0%',,
  27.          'u') = 0 then
  28.    say 'Error: Could not create object.'
  29. else
  30.    say 'The program object was successfully created on the desktop.'
  31.  
  32. CALL inst_modules
  33.  
  34. exit 0
  35.  
  36. inst_modules:
  37.  
  38. IF SysFileTree( "module.1st", "file", "FOS" ) THEN DO
  39.          SAY 'Error: SysFileTree failed'
  40.          RETURN
  41.          END
  42.  
  43. DO i = 1 to file.0
  44.      j = LASTPOS( '\', file.i )
  45.      IF j ¬= 0 THEN j = j - 1
  46.      CALL do_module SUBSTR( file.i, 1, j )
  47. END
  48.  
  49. RETURN
  50.  
  51. do_module:      /* arg directory containing module.1st */
  52. ARG     dir
  53. file = dir||'\module.1st'
  54. module = LINEIN( file )
  55. DO WHILE LINES( file )
  56.         line =LINEIN( file )
  57.         IF line = "COMMAND:" THEN LEAVE
  58.         SAY line
  59. END
  60.  
  61. Say 'Do you wish to install "'module'"(Yes/No) ?'
  62. PULL ans .
  63. IF SUBSTR(ans,1,1) = 'Y' THEN DO
  64.      '@copy 'dir||'\'||module' . '
  65.      IF rc = 0 THEN
  66.        IF line = 'COMMAND:' THEN DO
  67.                         cur_dir = DIRECTORY()
  68.                         CALL DIRECTORY( dir )
  69.                         DO WHILE LINES( file )
  70.                            cmd = LINEIN( file )
  71.                            INTERPRET cmd
  72.                            END
  73.                         CALL DIRECTORY( cur_dir )
  74.                         END
  75.      IF rc = 0 THEN SAY module' installed.'
  76.      ELSE SAY 'Failed to install 'module
  77.      END
  78. ELSE
  79.      SAY 'Skiping this "'module'"'
  80. RETURN
  81.