home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 3 Comm / 03-Comm.zip / crl073b1.zip / install.cmd < prev    next >
OS/2 REXX Batch file  |  1998-04-19  |  3KB  |  91 lines

  1. /*************************************************************************/
  2. /*  CARRIE R. LUST installation file - Creates a wps-object for C.R.L.   */
  3. /*  To run this file, just type "install" on the OS/2 command line.      */
  4. /*************************************************************************/
  5.  
  6. PARSE SOURCE operSystem . sourceFile
  7.  
  8. IF \(operSystem = "OS/2") THEN DO
  9.     SAY "Please use only with IBM-OS/2 Operating system!"
  10.     EXIT
  11.     END
  12.  
  13. /*************************************************************************/
  14.  
  15. '@ECHO OFF'
  16.  
  17. CALL rxfuncadd 'sysloadfuncs', 'rexxutil', 'sysloadfuncs'
  18. CALL sysloadfuncs
  19.  
  20. /*************************************************************************/
  21.  
  22. ClustDir = FILESPEC("drive", sourceFile)FILESPEC("path", sourceFile)
  23.  
  24. CALL SysFileTree ClustDir"CLUST.EXE",'file','F'
  25. IF file.0 = 0 THEN DO
  26.     SAY "CLUST.EXE was not found in the same directory as ",
  27.     FILESPEC("name",sourceFile)
  28.  
  29.     DO UNTIL \(file.0 = 0)
  30.         SAY ""
  31.         SAY "Please give the full path to the file CLUST.EXE."
  32.         SAY "(Press ENTER/RETURN alone to exit)"
  33.         PULL ClustDir
  34.         IF ClustDir = "" THEN EXIT
  35.         IF (FILESPEC("drive",ClustDir) = "") | (FILESPEC("path",ClustDir) = "")
  36.         THEN SAY 'You must give a full path in format "d:\path\"'
  37.         ELSE DO
  38.             IF \(SUBSTR(ClustDir,length(ClustDir),1) = "\" )
  39.             THEN ClustDir = ClustDir"\"
  40.             CALL SysFileTree ClustDir"CLUST.EXE",'file','F'
  41.             IF file.0 = 0
  42.             THEN SAY "Can not find" ClustDir"CLUST.EXE there - please give the right directory"
  43.             END
  44.         END
  45.     SAY ""
  46.     END
  47.  
  48. /*************************************************************************/
  49.  
  50. setup = 'PROGTYPE=OS2;EXENAME='ClustDir'CLUST.EXE;STARTUPDIR='ClustDir';'
  51. setup = setup'ICONFILE 'ClustDir'CLUST.ICO;'
  52.  
  53. SAY "* Creating Carrie R. Lust wps-object ..."
  54. check = SysCreateObject('WPProgram', 'Carrie R. Lust 0.73b1', '<WP_DESKTOP>', setup)
  55.  
  56. IF check = 0 THEN DO
  57.     SAY "* Could not create wps-object!"
  58.     SAY "  (Does perhaps an object for Carrie already exist?)"
  59.     CALL CHAROUT , "* Do you want to update the existing object [Y/N] ? "
  60.     PULL answer
  61.     IF \(SUBSTR(answer,1,1) = "Y") THEN EXIT
  62.  
  63.     SAY "* Updating Carrie wps-object ..."
  64.     check = SysCreateObject('WPProgram','Carrie R. Lust 0.73b1','<WP_DESKTOP>',setup,"update")
  65.  
  66.     IF check = 0 THEN DO
  67.         SAY ""
  68.         SAY "* Sorry, object-creation failed again. Aborting ..."
  69.         EXIT
  70.         END
  71.     ELSE DO
  72.         SAY ""
  73.         SAY "* Carrie R. Lust wps-object updated successfully!"
  74.         END
  75.     END
  76. ELSE DO
  77.     SAY ""
  78.     SAY "* Carrie R. Lust wps-object created successfully!"
  79.     END
  80.  
  81. CALL SysFileTree ClustDir"CLUST.ICO",'file','F'
  82. IF file.0 = 0 THEN DO
  83.     SAY "* CLUST.ICO not found!"
  84.     SAY "  Please set the Carrie R. Lust icon manually."
  85.     SAY ""
  86.     END
  87.  
  88. /*************************************************************************/
  89.  
  90. EXIT
  91.