home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / videotlk.zip / UNINST.CMD < prev   
OS/2 REXX Batch file  |  1998-10-28  |  8KB  |  321 lines

  1. /* Video Toolkit For OS/2 Uninstallation Script.        */
  2. /* Copyright (c) Abbotsbury Software Ltd. (UK), 1995-98 */
  3. echo off
  4.  
  5. say 'WARNING - WARNING - WARNING - This utility deletes all files in the'
  6. say 'current directory and its sub-directories.'
  7. say 'If in doubt type CTRL-C To stop this script deleting these directories'
  8. pause
  9.  
  10. /* Load the REXX utility */
  11. Call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  12. Call SysLoadFuncs
  13.  
  14. rc = RXFUNCADD('mciRxInit','MCIAPI','mciRxInit')
  15. InitRC = mciRxInit()
  16.  
  17.                                 /* query number of celebrities, prisms, etc */
  18. m = 2
  19. celebs = 0
  20. prisms = 0
  21. highqs = 0
  22. stubs = 0
  23. wcasts = 0
  24. DO FOREVER
  25.         cmd = 'info digitalvideo0'm 'product wait'
  26.         rc = SendString(cmd, ret_str)
  27.         if rc <> 0 then leave
  28.         if ret_str = "Hauppauge Celebrity" then
  29.             celebs = celebs + 1
  30.         if ret_str = "Hauppauge Prism" then
  31.             prisms = prisms + 1
  32.         if ret_str = "Hauppauge HighQ" then
  33.             highqs = highqs + 1
  34.         if ret_str = "Hauppauge WinCast TV" then
  35.             wcasts = wcasts + 1
  36.         m = m + 1
  37. END
  38.  
  39. DEL 'BIN\*.*'
  40. DEL 'BOOK\*.*'
  41. DEL 'DLL\*.*'
  42. DEL 'HELP\*.*'
  43. DEL 'H\*.*'
  44. DEL 'LIB\*.*'
  45. DEL 'SAMPLES\DIAG\*.*'
  46. DEL 'SAMPLES\EX1\*.*'
  47. DEL 'SAMPLES\EX2\*.*'
  48. DEL 'SAMPLES\EX3\*.*'
  49. DEL 'SAMPLES\EX4\*.*'
  50. Call SysRmDir 'BOOK'
  51. Call SysRmDir 'DLL'
  52. Call SysRmDir 'H'
  53. Call SysRmDir 'HELP'
  54. Call SysRmDir 'BIN'
  55. Call SysRmDir 'LIB'
  56. Call SysRmDir 'SAMPLES\DIAG'
  57. Call SysRmDir 'SAMPLES\EX1'
  58. Call SysRmDir 'SAMPLES\EX2'
  59. Call SysRmDir 'SAMPLES\EX3'
  60. Call SysRmDir 'SAMPLES\EX4'
  61. if wcasts > 0 then do
  62.     DEL 'SAMPLES\DIVE\*.*'
  63.     Call SysRmDir 'SAMPLES\DIVE'
  64. end
  65. Call SysRmDir 'SAMPLES'
  66.  
  67. n = 1
  68. if celebs > 0 then
  69. do
  70. do until n = celebs + 1
  71.     if SysDestroyObject( '<ABBPMTV2CEL'n'>')
  72.     then
  73.         say 'PMTV/2 Celeb 'n' destroyed successfully'
  74.     else
  75.         say 'Error destroying PMTV/2 Celeb 'n
  76.  
  77.     if SysDestroyObject( '<ABBCONFIGCEL'n'>')
  78.     then
  79.         say 'Celeb 'n' Config destroyed successfully'
  80.     else
  81.         say 'Error destroying Celeb 'n' Config'
  82.  
  83.     if SysDestroyObject( '<ABBROCKETCEL'n'>')
  84.     then
  85.         say 'Rocket Remote Celeb 'n' destroyed successfully'
  86.     else
  87.         say 'Error destroying Rocket Remote Celeb 'n
  88.  
  89.     if SysDestroyObject( '<ABBDIAGCEL'n'>')
  90.     then
  91.         say 'Diagnostics Celeb 'n' destroyed successfully'
  92.     else
  93.         say 'Error destroying Diagnostics Celeb 'n
  94.     n = n + 1
  95. end
  96. end
  97.  
  98. n = 1
  99. if prisms > 0 then
  100. do
  101. do until n = prisms + 1
  102.     if SysDestroyObject( '<ABBPMTV2PRM'n'>')
  103.     then
  104.         say 'PMTV/2 Prism 'n' destroyed successfully'
  105.     else
  106.         say 'Error destroying PMTV/2 Prism 'n
  107.  
  108.     if SysDestroyObject( '<ABBCONFIGPRM'n'>')
  109.     then
  110.         say 'Prism 'n' Config destroyed successfully'
  111.     else
  112.         say 'Error destroying Prism 'n' Config'
  113.  
  114.     if SysDestroyObject( '<ABBROCKETPRM'n'>')
  115.     then
  116.         say 'Rocket Remote Prism 'n' destroyed successfully'
  117.     else
  118.         say 'Error destroying Rocket Remote Prism 'n
  119.  
  120.     if SysDestroyObject( '<ABBDIAGPRM'n'>')
  121.     then
  122.         say 'Diagnostics Prism 'n' destroyed successfully'
  123.     else
  124.         say 'Error destroying Diagnostics Prism 'n
  125.     n = n + 1
  126. end
  127. end
  128.  
  129. n = 1
  130. if highqs > 0 then
  131. do
  132. do until n = highqs + 1
  133.     if SysDestroyObject( '<ABBPMTV2HQ'n'>')
  134.     then
  135.         say 'PMTV/2 HighQ 'n' destroyed successfully'
  136.     else
  137.         say 'Error destroying PMTV/2 HighQ 'n
  138.  
  139.     if SysDestroyObject( '<ABBCONFIGHQ'n'>')
  140.     then
  141.         say 'HighQ 'n' Config destroyed successfully'
  142.     else
  143.         say 'Error destroying HighQ 'n' Config'
  144.  
  145.     if SysDestroyObject( '<ABBROCKETHQ'n'>')
  146.     then
  147.         say 'Rocket Remote HighQ 'n' destroyed successfully'
  148.     else
  149.         say 'Error destroying Rocket Remote HighQ 'n
  150.  
  151.     if SysDestroyObject( '<ABBDIAGHQ'n'>')
  152.     then
  153.         say 'Diagnostics HighQ 'n' destroyed successfully'
  154.     else
  155.         say 'Error destroying Diagnostics HighQ 'n
  156.     n = n + 1
  157. end
  158. end
  159.  
  160. n = 1
  161. if wcasts > 0 then
  162. do
  163. do until n = wcasts + 1
  164.     if SysDestroyObject( '<ABBPMTV2WC'n'>')
  165.     then
  166.         say 'PMTV/2 Wincast 'n' destroyed successfully'
  167.     else
  168.         say 'Error destroying PMTV/2 Wincast 'n
  169.  
  170.     if SysDestroyObject( '<ABBCONFIGWC'n'>')
  171.     then
  172.         say 'Wincast 'n' Config destroyed successfully'
  173.     else
  174.         say 'Error destroying Wincast 'n' Config'
  175.  
  176.     if SysDestroyObject( '<ABBROCKETWC'n'>')
  177.     then
  178.         say 'Rocket Remote Wincast 'n' destroyed successfully'
  179.     else
  180.         say 'Error destroying Rocket Remote Wincast 'n
  181.  
  182.     if SysDestroyObject( '<ABBDIAGWC'n'>')
  183.     then
  184.         say 'Diagnostics Wincast 'n' destroyed successfully'
  185.     else
  186.         say 'Error destroying Diagnostics Wincast 'n
  187.     n = n + 1
  188. end
  189. end
  190.  
  191. if SysDestroyObject( '<ABBPIP>')
  192. then
  193.     say 'Picture In Picture destroyed successfully'
  194. else
  195.     say 'Error destroying Picture In Picture'
  196.  
  197. if SysDestroyObject( '<ABBUTILFolder>')
  198. then
  199.     say 'Utilities Folder destroyed successfully'
  200. else
  201.     say 'Error destroying Utilities Folder'
  202.  
  203.     Instance = 1
  204.     Video='CELEB'
  205.     if celebs > 0 then
  206.     do
  207.     do until Instance = celebs + 1
  208.  
  209.         rc = UninstEx('DIAG')
  210.         rc = UninstEx('EX1')
  211.         rc = UninstEx('EX2')
  212.         rc = UninstEx('EX3')
  213.         rc = UninstEx('EX4')
  214.         Instance = Instance + 1
  215.     end
  216.     end
  217.     Instance = 1
  218.     Video='PRISM'
  219.     if prisms > 0 then
  220.     do
  221.     do until Instance = prisms + 1
  222.  
  223.         rc = UninstEx('DIAG')
  224.         rc = UninstEx('EX1')
  225.         rc = UninstEx('EX2')
  226.         rc = UninstEx('EX3')
  227.         rc = UninstEx('EX4')
  228.         Instance = Instance + 1
  229.     end
  230.     end
  231.     Instance = 1
  232.     Video='HIGHQ'
  233.     if highqs > 0 then
  234.     do
  235.     do until Instance = highqs + 1
  236.  
  237.         rc = UninstEx('DIAG')
  238.         rc = UninstEx('EX1')
  239.         rc = UninstEx('EX2')
  240.         rc = UninstEx('EX3')
  241.         rc = UninstEx('EX4')
  242.         Instance = Instance + 1
  243.     end
  244.     end
  245.     Instance = 1
  246.     Video='WCAST'
  247.     if wcasts > 0 then
  248.     do
  249.     do until Instance = wcasts + 1
  250.  
  251.         rc = UninstEx('DIAG')
  252.         rc = UninstEx('EX1')
  253.         rc = UninstEx('EX2')
  254.         rc = UninstEx('EX3')
  255.         rc = UninstEx('EX4')
  256.         rc = UninstEx('DIVE')
  257.         Instance = Instance + 1
  258.     end
  259.     end
  260.  
  261. if SysDestroyObject( '<ABBOS2>')
  262. then
  263.     say 'OS/2 Full Screen destroyed successfully'
  264. else
  265.     say 'Error destroying OS/2 Full Screen'
  266.  
  267. if SysDestroyObject( '<ABBSAMPFolder>')
  268. then
  269.     say 'Samples Folder destroyed successfully'
  270. else
  271.     say 'Error destroying Samples Folder'
  272.  
  273. if SysDestroyObject( '<ABBVIEWVIDTLKT>')
  274. then
  275.     say 'Technical Reference destroyed successfully'
  276. else
  277.     say 'Error destroying Technical Reference'
  278.  
  279. if SysDestroyObject( '<ABBINFFolder>')
  280. then
  281.     say 'Information Folder destroyed successfully'
  282. else
  283.     say 'Error destroying Information Folder'
  284.  
  285. if SysDestroyObject( '<ABBVIDFolder>')
  286. then
  287.     say 'Toolkit Folder destroyed successfully'
  288. else
  289.     say 'Error destroying Toolkit Folder'
  290.  
  291. DEL '*.*'
  292.  
  293. Exit 0
  294.  
  295. UninstEx:
  296.     arg Ex
  297.  
  298.         name = 'Example' Ex 'using' Video''Instance
  299.         path = drivedir'\SAMPLES\'Ex'\'Ex
  300.         objid = 'ABB'Ex'PROG'Video''Instance
  301.  
  302.         if SysDestroyObject( '<'objid'>')
  303.         then
  304.             say name 'destroyed successfully'
  305.         else
  306.             say 'Error destroying' name
  307.  
  308.         return 0
  309.  
  310. /*   --- SendString --
  311. ** Call DLL function.  Pass the command to process and the
  312. ** name of a REXX variable that will receive textual return
  313. ** return code.
  314. */
  315. SendString:
  316.     arg CmndTxt
  317.     arg ret_str
  318.  
  319.         MacRC = mciRxSendString(CmndTxt, 'ret_str', '0', '0')
  320.         return MacRC
  321.