home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 3 Comm / 03-Comm.zip / haotd1_2.zip / UNINST.CMD < prev   
OS/2 REXX Batch file  |  1995-10-12  |  2KB  |  93 lines

  1. /* Uninst.cmd  */
  2.  
  3. /*  $Revision: 1.1 $  */
  4. /*  $Date: 1995/10/10 08:58:36 $      */
  5.  
  6. PARSE ARG arg1
  7.  
  8. /* Load RexxUtil functions */
  9. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  10. call SysLoadFuncs
  11.  
  12. /* Clear screen */
  13. rv = SysCls()
  14.  
  15. /*Check for setup.cmd */
  16. rc = SysFileTree("uninst.cmd", 'stem', 'O')
  17. IF stem.0 = 0 THEN
  18.     SIGNAL err
  19. AppPath = DIRECTORY()
  20.  
  21. Confirm:
  22.  
  23.     say ' '
  24.     say ' '
  25.     say 'Are you sure you want to UNINSTALL HyperACCESS Test Drive? [y/n]'
  26.     key = SysGetKey()
  27.     IF key = 'y' && key = 'Y' THEN
  28.         SIGNAL Delete
  29.     ELSE
  30.         DO
  31.             IF key = 'n' && key = 'N' THEN
  32.                 DO
  33.                     say ' '
  34.                     say ' '
  35.                     say 'Uninstall Aborted!'
  36.                     SIGNAL Cleanup
  37.                 END
  38.             ELSE
  39.                 SIGNAL Confirm
  40.         END
  41.  
  42. Delete:
  43.  
  44.     say ' '
  45.     say ' '
  46.     say 'Deleting HyperACCESS files...'
  47.     say ' '
  48.     szFileSpec = AppPath'\*.*'
  49.     rv = SysFileTree(szFileSpec, 'stem', 'O')
  50.     DO i = 1 to stem.0
  51.         rv = SysFileDelete(stem.i)
  52.         IF rv <> 0 THEN
  53.             say 'ERROR:  ' stem.i 'not deleted.'
  54.     END
  55.  
  56.     
  57.  
  58. RemoveObj:
  59.     say 'Removing desktop objects...'
  60.     say ' '
  61.     rv = SysDestroyObject('<HAOS2>')
  62.     IF rv <> 1 THEN
  63.         say 'ERROR: HyperACCESS folder not removed!'
  64.     ELSE
  65.         DO
  66.             say 'HyperACCESS folder removed.'
  67.             say ' '
  68.         END
  69.  
  70.  
  71.     say 'Uninstall completed!'
  72.     SIGNAL Cleanup
  73.  
  74.  
  75. Err:
  76.     /* if not in installation directory */
  77.     rc = SysCls()
  78.     say ' '
  79.     say ' '
  80.     say ' '
  81.     say ' '
  82.     SAY 'Please log onto the drive/directory that contains the HyperACCESS'
  83.     say 'program files and type UNINST'
  84.     SAY ' '
  85.     SIGNAL Cleanup
  86.  
  87. Cleanup:
  88.     /* Drop RexxUtil functions */
  89.     call SysDropFuncs
  90.  
  91.     EXIT
  92.  
  93.