home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / vpeval.zip / REMOVE.CMD < prev    next >
OS/2 REXX Batch file  |  1993-06-15  |  4KB  |  136 lines

  1. /* Copyright 1993 HockWare Inc. */
  2. Call RxFuncadd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  3. Call SysLoadFuncs
  4. say ''
  5. say '  VisPro/REXX (tm) by HockWare (tm) Inc.'
  6. say ''
  7. say '  This command file is used to help you remove VisPro/REXX'
  8. say '  from your system.'
  9. say ''
  10. say '  This program does NOT remove any program files or projects'
  11. say '  that you may have created using VisPro/REXX.  This is left'
  12. say '  to the only person who can make that decision, you.  The'
  13. say '  VisPro/REXX samples are not removed, since you may have'
  14. say '  changed them.'
  15. say ''
  16. say "  You don't need to use this command file if you want to"
  17. say '  install over a previous version of VisPro/REXX.  To'
  18. say '  reinstall, you can use the SETUP program.'
  19. say ''
  20. say '  Note: before continuing, make certain that all VisPro/REXX'
  21. say '  windows are closed.  Otherwise, the removal will not work.'
  22. say ''
  23. say '  Are you sure you want to remove VisPro/REXX(Y/N)?'
  24. PARSE UPPER VALUE LINEIN() with RESPONSE
  25. IF RESPONSE<>'Y' THEN EXIT
  26. say ''
  27.  
  28. /* Get value of OS/2 boot path */
  29. OSPATH=SysSearchPath('PATH','CMD.EXE')
  30. OSDIR=OVERLAY('        ',OSPATH,LENGTH(OSPATH)-LENGTH('CMD.EXE'))
  31. OSDIR=STRIP(OSDIR)
  32.  
  33. /* Get value of VisPro/REXX installation directory */
  34. CONFIG=LEFT(OSDIR,2)||'\CONFIG.SYS'
  35. call SysFileSearch 'SET VISPRORX=', CONFIG, 'hits.'
  36.  
  37. /* look at the last line with our configuration statement    */
  38. /* Is it an exact match to what we need?. If so, we are done */
  39. /* Also, if there are no hits, but we are installing to the  */
  40. /* C drive, we are also done                                 */
  41. i=hits.0
  42.  
  43. if i=0 THEN
  44.    PRODUCTDIR='C:\VISPRORX'
  45. ELSE DO
  46.    PRODUCTDIR=STRIP(DELSTR(hits.i,1,13))
  47.    END
  48.  
  49. PROJECTDIR=PRODUCTDIR||'\'||'Projects'
  50. SAMPLESDIR=PROJECTDIR||'\'||'SAMPLES'
  51.  
  52. /* Check if VPForm class is active */
  53. found='FALSE'
  54. call SysQueryClassList "list."
  55. do i = 1 to list.0
  56.    parse upper var list.i class .
  57.    if class='VPFORM' then do
  58.       found='TRUE'
  59.       leave
  60.    end
  61. end
  62.  
  63. /* If VPForm active, deregister */
  64. if (found='TRUE') THEN DO
  65.    say '  Deregistering VisPro/REXX class...'
  66.    ret = SysDeregisterObjectClass( "VPForm");
  67.    if ret = 0 THEN do
  68.       say '  The VisPro/REXX class could not be deregistered.'
  69.       say '  Close all VisPro/REXX windows and retry this command.'
  70.       exit
  71.       end
  72.    else
  73.       say '  VisPro/REXX class deregistered successfully.'
  74. end
  75.  
  76. say ''
  77. say '  Removing VisPro/REXX program files...'
  78.  
  79. res = SysIni('SYSTEM', 'VISPROREXX', 'VERSION', 'DELETE:')
  80. call REMOVEFILE PRODUCTDIR'\visprorx.exe'
  81. call REMOVEFILE PRODUCTDIR'\runit.exe'
  82. call REMOVEFILE PRODUCTDIR'\template.exe'
  83. call REMOVEFILE PRODUCTDIR'\VpDemo.exe'
  84. call REMOVEFILE PRODUCTDIR'\hockware.bmp'
  85. call REMOVEFILE PRODUCTDIR'\read.me'
  86. call REMOVEFILE PRODUCTDIR'\P00.BMP'
  87. call REMOVEFILE PRODUCTDIR'\P01.BMP'
  88. call REMOVEFILE PRODUCTDIR'\P02.BMP'
  89. call REMOVEFILE PRODUCTDIR'\P03.BMP'
  90. call REMOVEFILE PRODUCTDIR'\P04.BMP'
  91. call REMOVEFILE PRODUCTDIR'\P05.BMP'
  92. call REMOVEFILE PRODUCTDIR'\P06.BMP'
  93. call REMOVEFILE PRODUCTDIR'\P07.BMP'
  94. call REMOVEFILE PRODUCTDIR'\P08.BMP'
  95. call REMOVEFILE PRODUCTDIR'\P09.BMP'
  96. call REMOVEFILE PRODUCTDIR'\P10.BMP'
  97. call REMOVEFILE PRODUCTDIR'\P11.BMP'
  98. call REMOVEFILE PRODUCTDIR'\P12.BMP'
  99. call REMOVEFILE PRODUCTDIR'\P13.BMP'
  100. call REMOVEFILE PRODUCTDIR'\P14.BMP'
  101. call REMOVEFILE PRODUCTDIR'\P15.BMP'
  102. call REMOVEFILE PRODUCTDIR'\P16.BMP'
  103. call REMOVEFILE PRODUCTDIR'\P17.BMP'
  104. call REMOVEFILE PRODUCTDIR'\P18.BMP'
  105. call REMOVEFILE PRODUCTDIR'\FORM.OPT'
  106. call REMOVEFILE OSDIR'\HELP\VISPRORX.HLP'
  107.  
  108. rc = SysFileDelete(OSDIR'\DLL\VPFORM.DLL')
  109. if (rc > 4) then do
  110.    say '  The 'OSDIR'\DLL\VPFORM.DLL file could not be erased.'
  111.    say ''
  112.    say '  Perform an OS/2 Shutdown to release this DLL.'
  113.    say '  After rebooting, you can erase this DLL '
  114.    say '  by reinvoking this command file.'
  115. end
  116. else do
  117.    say '  VisPro/REXX was successfully removed.  To finish'
  118.    say '  the cleanup, you need to go to the end of your'
  119.    say '  CONFIG.SYS and remove the SET VISPRORX statement'
  120.    say '  In addition, remove any shadows and program references'
  121.    say '  left in the PROJECTS folder'
  122. end
  123. EXIT
  124.  
  125. REMOVEFILE:
  126. Arg Filename
  127.  
  128. say '  Removing file 'FileName
  129. rc = SysFileDelete(FileName)
  130. if (rc > 4) then do
  131.    say '  Error removing file 'FileName'.'
  132.    say '  Make certain that all VisPro/REXX windows are closed.'
  133.    say '  Then retry this command.'
  134. end
  135. RETURN
  136.