home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1998 September / PCO_0998.ISO / filesbbs / os2 / fm2_300.arj / FM2_300.ZIP / uninstal.cmd < prev    next >
Encoding:
Text File  |  1998-07-16  |  3.9 KB  |  125 lines

  1. /*****************************************************************************
  2.  *     FM/2 3.x deinstallation program copyright (c) 1994-98 by M. Kimes     *
  3.  *****************************************************************************
  4.  *                                                                           *
  5.  * This program removes the FM/2 folder and any OS2USER.INI records          *
  6.  * for FM/2.  Optionally it will wipe all files and remove all directories   *
  7.  * created by the FM/2 installation program.  Run from the FM/2 directory.   *
  8.  *                                                                           *
  9.  *****************************************************************************
  10.  * For unattended deinstallation, call with /UNATTENDED as the first         *
  11.  * argument.                                                                 *
  12.  *****************************************************************************
  13.  *                                                                           *
  14.  *                        UNINSTAL /? for usage help.                        *
  15.  *                                                                           *
  16.  *****************************************************************************/
  17.  
  18. '@Echo off'
  19. 'cls'
  20. 'echo  ┌───────────────────────────────────────────────────────────────────┐'
  21. 'echo  │                 FM/2 3.x Deinstallation Program                   │'
  22. 'echo  │             FM/2 is copyright (c) 1993-98 by M. Kimes             │'
  23. 'echo  │                       All rights reserved                         │'
  24. 'echo  └───────────────────────────────────────────────────────────────────┘'
  25.  
  26. /* see if we might be in the right directory... */
  27.  
  28. curdir = directory()
  29.  
  30. rc = stream('fm3.exe','c','query exists')
  31. if rc = '' then
  32. do
  33.   say 'Sorry, FM3.EXE not found.  Must not be right directory.  Terminating.'
  34.   exit
  35. end
  36.  
  37. /* tell user what we're doing, give him a chance to hit CTRL-C */
  38.  
  39. say ''
  40. say ' **WARNING:  This program uninstalls FM/2.'
  41. say ''
  42.  
  43. parse upper arg dummy
  44.  
  45. if dummy = '/?' then
  46. do
  47.   say ''
  48.   say 'Usage:  UNINSTAL [/UNATTENDED]'
  49.   say ''
  50.   say ' /UNATTENDED          don''t ask any questions; run without stopping.'
  51.   say ''
  52.   say 'Examples:'
  53.   say ' UNINSTAL'
  54.   say ' UNINSTAL /UNATTENDED'
  55.   exit
  56. end
  57.  
  58. if dummy = '/UNATTENDED' then unattended = ''
  59. if unattended = '' then say '     /UNATTENDED = TRUE'
  60.  
  61. if unattended = 'UNATTENDED' then
  62. do
  63.   say 'Press [Enter] (or CTRL-C then [Enter] to abort).'
  64.   Pull dummy .
  65.   say ''
  66.   /* to be extra safe... */
  67.   if dummy \= '' then
  68.   do
  69.     say 'Something besides just [Enter] pressed -- aborting.'
  70.     exit
  71.   end
  72. end
  73.  
  74. /* load rexx utility functions */
  75.  
  76. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  77. call SysLoadFuncs
  78.  
  79. say 'Working...'
  80.  
  81. /* remove FM/2 folder object */
  82. call SysDestroyObject "<FM3_Folder>"
  83.  
  84. /* remove all FM/2-related information from user ini file */
  85. call SysIni 'USER', 'FM/2'
  86. call SysIni 'USER', 'FM2'
  87. call SysIni 'USER', 'FM/3'
  88. call SysIni 'USER', 'FM/4'
  89.  
  90. /* done */
  91.  
  92. dummy = ''
  93. if unattended = 'UNATTENDED' then
  94. do
  95.   say ''
  96.   say "Delete programs and directories "curdir
  97.   say "and "curdir"\utils"
  98.   say "as follows, and then you're done:"
  99.   say "CD\"
  100.   say "DEL "curdir"\UTILS\*"
  101.   say "RMDIR "curdir"\UTILS"
  102.   say "DEL "curdir"\*"
  103.   say "RMDIR "curdir
  104.   say ""
  105.   say "Shall I perform these tasks for you?"
  106.   parse upper pull dummy
  107. end
  108. else dummy = 'Y'
  109.  
  110. if left(dummy,1) = 'Y' then
  111. do
  112.   'CD\'
  113.   '@ECHO ON'
  114.   'ECHO Y | DEL 'curdir'\UTILS\* && RD 'curdir'\UTILS'
  115.   'ECHO Y | DEL 'curdir'\* && RD 'curdir
  116.   '@ECHO OFF'
  117. end
  118. else say "Okay, it's a simple enough operation that even a human can do it. :-)"
  119.  
  120. say ""
  121. say "Don't forget to remove any PATH statements from CONFIG.SYS that you"
  122. say "entered for FM/2 or its utilities."
  123. say ""
  124. say "I'm done now."
  125.