home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / pktdem.zip / INSTALL.CMD next >
OS/2 REXX Batch file  |  1993-07-09  |  2KB  |  77 lines

  1. /* PocketMail Installation */
  2.  
  3. /* install expects to find a pathname specified as a command tail */
  4.  
  5. arg filename
  6.  
  7. if filename = '' then do
  8.    say
  9.    Say "You must enter a valid directory name in order to install PocketMail."
  10.    Say "The directory name should take the form c:\directory where"
  11.    Say "c: is any valid hard drive and \directory is the directory "
  12.    Say "on that drive into which PocketMail is to be installed.  "
  13.    Say "If the directory does not exist, it is created for you."
  14.    say
  15.    exit
  16. end
  17.  
  18. requestDrive = substr(filename,1,2)
  19. requestPath = substr(filename,3)
  20.  
  21. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  22. call SysLoadFuncs
  23.  
  24. /* edit to verify that drive requested is a valid local drive */
  25.  
  26. map = SysDriveMap(,LOCAL)
  27. nbrDrives = words(map)
  28. driveIndex = 1
  29.  
  30. do while driveIndex <= nbrDrives
  31.   if word(map,driveIndex) = requestDrive then leave
  32.   driveIndex = driveIndex + 1
  33. end
  34.  
  35. if driveIndex > nbrDrives then do
  36.   say
  37.   say "The drive you requested ("||requestDrive||") is not a valid local drive."
  38.   say "Your valid local drives are:" map
  39.   say
  40.   exit
  41. end
  42.  
  43. /* verify there is enough space to install PocketMail */
  44.  
  45. info = SysDriveInfo(requestDrive)
  46.  
  47. parse value info with . availableSpace .
  48.  
  49. remainingAfter = availableSpace - 2100000
  50.  
  51. if remainingAfter < 0 then do
  52.   say
  53.   say "You need at least 2.1 MB of available disk space to install PocketMail."
  54.   say "Drive" drive "has" availableSpace "bytes available."
  55.   say "You need to make at least" abs(remainingAfter) "bytes available."
  56.   say
  57.   exit
  58. end
  59.  
  60. "pkunzip2 -dx pktdemo "||filename
  61. "md "||filename||"\REC"
  62. "md "||filename||"\MES"
  63. "md "||filename||"\LOG"
  64.  
  65. setupString =  "OBJECTID=<UWPSP_PKTDEMO>;EXENAME="||filename||"\PKTDEMO.EXE;STARTUPDIR="||filename
  66.  
  67. rc = SysCreateObject("WPProgram",,
  68.  "PocketMail(TM) for OS/2^1.0 Demo version",,
  69.  "<WP_DESKTOP>",,
  70.  setupString,,
  71.  "FailIfExists")
  72.  
  73. if rc = 0 then
  74.    say "The PocketMail program object already exists on the desktop"
  75.  
  76. "exit"
  77.