home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / mems400b.zip / mem4b.zip / uninstal.cmd < prev   
OS/2 REXX Batch file  |  1999-11-06  |  3KB  |  141 lines

  1. /* UNINSTAL.CMD: Uninstall MEMSIZE. */
  2.  
  3. '@Echo Off'
  4. 'CHCP 850'
  5.  
  6.  
  7. /* Load REXXUTIL */
  8.  
  9. Call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs'
  10. Call SysLoadFuncs
  11.  
  12.  
  13. /* Initialize */
  14.  
  15. Signal On Failure Name FAILURE
  16. Signal On Halt Name HALT
  17. Signal On Syntax Name SYNTAX
  18.  
  19. /* Confirm the user's intentions. */
  20.  
  21. Call SysCls
  22. Say 'Do you wish to uninstall MEMSIZE? (Y/N)'
  23. Pull YesNo
  24. If \ ( YesNo = "Y" ) Then Signal Done
  25.  
  26.  
  27. /* Announce the start of the destruction . . . */
  28.  
  29. Say 'Removing MEMSIZE...'
  30. Say ''
  31.  
  32. /* Determine MEMSIZE directory. */
  33.  
  34. Default = SysIni('USER', 'MEMSIZE2', 'INIPATH' )
  35. If Default = 'ERROR:' Then Do
  36.   Say 'ERROR: MEMSIZE does not appear to be installed on this system.'
  37.   Signal DONE
  38.   End
  39.  
  40. If SUBSTR(Default,LENGTH(Default),1) <= ' '
  41.   Then Default = SUBSTR(Default,1,LENGTH(Default)-1)
  42.  
  43.  
  44. /* Remove every MEMSIZE file from the install directory. */
  45.  
  46. Result = SysFileTree( Default"\MEMSIZE2.EXE", 'Files', 'F' )
  47. If Files.0 > 0 Then Do
  48.   Say "Removing MEMSIZE2.exe."
  49.   'Erase' Default'\MEMSIZE2.exe'
  50.   End
  51.  
  52. Result = SysFileTree( Default"\MEMSIZE2.DLL", 'Files', 'F' )
  53. If Files.0 > 0 Then Do
  54.   Say "Removing MEMSIZE2.dll."
  55.   'Erase' Default'\MEMSIZE2.dll'
  56.   End
  57.  
  58. Result = SysFileTree( Default"\MEMSIZE2.HLP", 'Files', 'F' )
  59. If Files.0 > 0 Then Do
  60.   Say "Removing MEMSIZE2.hlp."
  61.   'Erase' Default'\MEMSIZE2.hlp'
  62.   End
  63.  
  64. Result = SysFileTree( Default"\MEMSIZE2.INI", 'Files', 'F' )
  65. If Files.0 > 0 Then Do
  66.   Say "Removing MEMSIZE2.INI."
  67.   'Erase' Default'\MEMSIZE2.INI'
  68.   End
  69.  
  70. Result = SysFileTree( Default"\MEMSIZE2.DOC", 'Files', 'F' )
  71. If Files.0 > 0 Then Do
  72.   Say "Removing MEMSIZE2.doc."
  73.   'Erase' Default'\MEMSIZE2.doc'
  74.   End
  75.  
  76. Result = SysFileTree( Default"\MEMSIZE2.INF", 'Files', 'F' )
  77. If Files.0 > 0 Then Do
  78.   Say "Removing MEMSIZE2.inf."
  79.   'Erase' Default'\MEMSIZE2.inf'
  80.   End
  81.  
  82. Result = SysFileTree( Default"\MEMSIZE2.LOG", 'Files', 'F' )
  83. If Files.0 > 0 Then Do
  84.    Say "Removing MEMSIZE2.log."
  85.    'Erase' Default'\MEMSIZE2.log'
  86.    End
  87.  
  88. Result = SysFileTree( Default"\SNPSHOT2.EXE", 'Files', 'F' )
  89. If Files.0 > 0 Then Do
  90.    Say "Removing SNPSHOT2.exe."
  91.    'Erase' Default'\SNPSHOT2.exe'
  92.    End
  93.  
  94. Result = SysFileTree( Default"\*.*", 'Files', 'F' )
  95. If Files.0 == 0 Then Do
  96.    Say "Removing directory "Default"."
  97.    'rmdir' Default
  98.    End
  99.  
  100.  
  101. /* Destroy the MEMSIZE WPS objects. */
  102.  
  103. Say "Removing WPS objects."
  104. Result = SysDestroyObject( "<MEMSIZE>" )
  105.  
  106.  
  107. /* Remove the USER/MEMSIZE/INIPATH entry. */
  108.  
  109. Say "Removing forwarding entry in OS2.INI."
  110. Result = SysIni('USER', 'MEMSIZE', 'DELETE:' )
  111. Result = SysIni('USER', 'MEMSIZE2', 'DELETE:' )
  112.  
  113.  
  114. /* Terminate procedure. */
  115.  
  116. If Files.0 == 0 Then Do
  117.    Say "Done.  You will still need to manually"
  118.    Say "  remove UNINSTAL.CMD."
  119.    End /* do */
  120. Else Do
  121.    Say "Done.  You will still need to manually"
  122.    Say "  remove UNINSTAL.CMD and the directory"
  123.    Say "  '"Default"'."
  124.    End /* do */
  125. Signal DONE
  126.  
  127. FAILURE:
  128. Say 'REXX failure.'
  129. Signal DONE
  130.  
  131. HALT:
  132. Say 'REXX halt.'
  133. Signal DONE
  134.  
  135. SYNTAX:
  136. Say 'REXX syntax error.'
  137. Signal DONE
  138.  
  139. DONE:
  140. Exit
  141.