home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: InfoMgt / InfoMgt.zip / wanda104.zip / install.cmd < prev    next >
OS/2 REXX Batch file  |  1999-09-20  |  3KB  |  100 lines

  1. /*************************************************************************/
  2. /*  Wanda installation file - Creates a WPS-object for Wanda             */
  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. Ver = "1.04"
  23. WandaDir = FILESPEC("drive", sourceFile)FILESPEC("path", sourceFile)
  24.  
  25. SAY ""
  26.  
  27. /*************************************************************************/
  28.  
  29. CALL SysFileTree WandaDir"WANDA.EXE",'file','F'
  30. IF file.0 = 0 THEN DO
  31.     SAY "WANDA.EXE was not found in the same directory as ",
  32.     FILESPEC("name",sourceFile)
  33.  
  34.     DO UNTIL \(file.0 = 0)
  35.         SAY ""
  36.         SAY "Please give the full path to the file WANDA.EXE."
  37.         SAY "(Press ENTER/RETURN alone to exit)"
  38.         PULL WandaDir
  39.         IF WandaDir = "" THEN
  40.             EXIT
  41.         IF (FILESPEC("drive",WandaDir) = "") | (FILESPEC("path",WandaDir) = "") THEN
  42.             SAY 'You must give a full path in format "d:\path\"'
  43.         ELSE DO
  44.             IF \(SUBSTR(WandaDir,length(WandaDir),1) = "\" ) THEN
  45.                 WandaDir = WandaDir"\"
  46.             CALL SysFileTree WandaDir"WANDA.EXE",'file','F'
  47.             IF file.0 = 0 THEN
  48.                 SAY "Can not find "WandaDir"WANDA.EXE. Please try again."
  49.             END
  50.         END
  51.     SAY ""
  52.     END
  53.  
  54. /*************************************************************************/
  55.  
  56. setup = 'PROGTYPE=PM;EXENAME='WandaDir'Wanda.EXE;STARTUPDIR='WandaDir';'
  57. setup = setup'OBJECTID=<THTH_WANDA>;'
  58.  
  59. SAY ""
  60. SAY "* Creating Wanda WPS-object ..."
  61. check = SysCreateObject('WPProgram', 'Wanda 'Ver, '<WP_DESKTOP>', setup)
  62.  
  63. IF check = 0 THEN DO
  64.     SAY "* Could not create WPS-object!"
  65.     SAY "  (Does perhaps an object for Wanda already exist?)"
  66.     CALL CHAROUT , "* Do you want to replace the existing object [Y/N] ? "
  67.     key = SysGetKey('ECHO')
  68.     PARSE upper var key key
  69.     SAY ""
  70.     IF key <> 'Y' THEN
  71.         EXIT
  72.  
  73.     SAY "* Replacing old Wanda WPS-object ..."
  74.     check = SysCreateObject('WPProgram','Wanda 'Ver,'<WP_DESKTOP>',setup,"r")
  75.  
  76.     IF check = 0 THEN DO
  77.         SAY ""
  78.         SAY "* Sorry, object-creation failed again. Aborting ..."
  79.         EXIT
  80.         END
  81.     ELSE DO
  82.         SAY ""
  83.         SAY "* Old Wanda WPS-object replaced successfully!"
  84.         END
  85.     END
  86. ELSE DO
  87.     SAY ""
  88.     SAY "* Wanda WPS-object created successfully!"
  89.     END
  90.  
  91. /*************************************************************************/
  92.  
  93. SAY ""
  94. SAY "* See WANDA.INF for more information about Wanda!"
  95. SAY ""
  96.  
  97. /*************************************************************************/
  98.  
  99. EXIT
  100.