home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 7 Games / 07-Games.zip / xe0971o.zip / install.cmd < prev    next >
OS/2 REXX Batch file  |  1998-04-13  |  4KB  |  133 lines

  1. /*************************************************************************/
  2. /*  XENED installation file - Creates a wps-object for Xened             */
  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. XenedDir = FILESPEC("drive", sourceFile)FILESPEC("path", sourceFile)
  23.  
  24. CALL SysFileTree XenedDir"XENED.EXE",'file','F'
  25. IF file.0 = 0 THEN DO
  26.     SAY "XENED.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 XENED.EXE."
  32.         SAY "(Press ENTER/RETURN alone to exit)"
  33.         PULL XenedDir
  34.         IF XenedDir = "" THEN EXIT
  35.         IF (FILESPEC("drive",XenedDir) = "") | (FILESPEC("path",XenedDir) = "")
  36.         THEN SAY 'You must give a full path in format "d:\path\"'
  37.         ELSE DO
  38.             IF \(SUBSTR(XenedDir,length(XenedDir),1) = "\" )
  39.             THEN XenedDir = XenedDir"\"
  40.             CALL SysFileTree XenedDir"XENED.EXE",'file','F'
  41.             IF file.0 = 0
  42.             THEN SAY "Can not find" XenedDir"XENED.EXE there - please give the right directory"
  43.             END
  44.         END
  45.     SAY ""
  46.     END
  47.  
  48. /*************************************************************************/
  49.  
  50. setup = 'PROGTYPE=OS2;EXENAME='XenedDir'XENED.EXE;STARTUPDIR='XenedDir';'
  51. setup = setup'ICONFILE 'XenedDir'XENED.ICO;'
  52.  
  53. SAY "* Creating XENED wps-object ..."
  54. check = SysCreateObject('WPProgram', 'Xened 0.97.1', '<WP_DESKTOP>', setup)
  55.  
  56. IF check = 0 THEN DO
  57.     SAY "* Could not create wps-object!"
  58.     SAY "  (Does perhaps an object for Xened 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 Xened wps-object ..."
  64.     check = SysCreateObject('WPProgram','Xened 0.97.1','<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 "* Xened wps-object updated successfully!"
  74.         END
  75.     END
  76. ELSE DO
  77.     SAY ""
  78.     SAY "* Xened wps-object created successfully!"
  79.     END
  80.  
  81. CALL SysFileTree XenedDir"XENED.ICO",'file','F'
  82. IF file.0 = 0 THEN DO
  83.     SAY "* XENED.ICO not found!"
  84.     SAY "  Please set the XENED icon manually."
  85.     SAY ""
  86.     END
  87.  
  88. /*************************************************************************/
  89.  
  90. setup = 'PROGTYPE=OS2;EXENAME='VIEW.EXE';PARAMETERS='XenedDir'XENED.INF;'
  91. setup = setup'ICONFILE 'XenedDir'XENDOC.ICO;'
  92.  
  93. SAY ""
  94. SAY "* Creating XENED documentation wps-object ..."
  95. check = SysCreateObject('WPProgram', 'Xened 0.97.1 Documentation', '<WP_DESKTOP>', setup)
  96.  
  97. IF check = 0 THEN DO
  98.     SAY "* Could not create wps-object!"
  99.     SAY "  (Does perhaps an object for Xened documentation already exist?)"
  100.     CALL CHAROUT , "* Do you want to update the existing object [Y/N] ? "
  101.     PULL answer
  102.     IF \(SUBSTR(answer,1,1) = "Y") THEN EXIT
  103.  
  104.     SAY "* Updating Xened documentation wps-object ..."
  105.     check = SysCreateObject('WPProgram','Xened 0.97.1 Documentation','<WP_DESKTOP>',setup,"update")
  106.  
  107.     IF check = 0 THEN DO
  108.         SAY ""
  109.         SAY "* Sorry, object-creation failed again. Aborting ..."
  110.         EXIT
  111.         END
  112.     ELSE DO
  113.         SAY ""
  114.         SAY "* Xened documentation wps-object updated successfully!"
  115.         END
  116.     END
  117. ELSE DO
  118.     SAY ""
  119.     SAY "* Xened documentation wps-object created successfully!"
  120.     END
  121.  
  122. SAY ""
  123. SAY "* Read "XenedDir"XENED.INF for details."
  124.  
  125. CALL SysFileTree XenedDir"XENDOC.ICO",'file','F'
  126. IF file.0 = 0 THEN DO
  127.     SAY "* XENDOC.ICO not found!"
  128.     SAY "  Please set the XENED documentation icon manually."
  129.     SAY ""
  130.     END
  131.  
  132. EXIT
  133.