home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / xwplascr.zip / XWPL0208.ZIP / release / install / deinst.cmd next >
OS/2 REXX Batch file  |  2002-02-04  |  7KB  |  233 lines

  1. /*
  2.     Delete XWorkplace installation objects.
  3.     (C) 2001 Ulrich Möller.
  4.  
  5.     NOTE: This file is the exact reverse to crobjXXX.cmd
  6.     and instlXXX.cmd, with XXX being the user's country code.
  7.  
  8.     While we need an NLS script for install to get the object
  9.     titles right, the deinstall script really needs no language
  10.     support, since we can just kill the objects by their
  11.     object IDs.
  12.  */
  13.  
  14. /* DO NOT CHANGE the following */
  15. call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs'
  16. call SysLoadFuncs
  17.  
  18. /*********************************************
  19.  *
  20.  * 1) UNDO CROBJxxx.CMD (CONFIG FOLDER)
  21.  *
  22.  *********************************************/
  23.  
  24. /* items in config folder */
  25. rc = Destroy("<XWP_PACKTREE>");
  26. rc = Destroy("<XWP_TREESIZE>");
  27. rc = Destroy("<XWP_NETSCAPE>");
  28.  
  29. rc = Destroy("<XWP_SEP1>");
  30.  
  31. /* config subfolders */
  32.     rc = Destroy("<XWP_CONFIGCFGSHADOW>");
  33.     rc = Destroy("<XWORKPLACE_SETUPCFGSHADOW>");
  34.     rc = Destroy("<XWP_WPSCFGSHADOW>");
  35.     rc = Destroy("<XWP_WPMOUSECFGSHADOW>");
  36.     rc = Destroy("<XWP_WPKEYBCFGSHADOW>");
  37.     rc = Destroy("<XWP_SCREENCFGSHADOW>");
  38.     rc = Destroy("<XWP_KERNELCFGSHADOW>");
  39.     rc = Destroy("<XWP_SEP41>");
  40.     rc = Destroy("<XWP_REFCFGSHADOW>");
  41.     rc = Destroy("<XWP_SEP42>");
  42. rc = Destroy("<XWP_CFG4>");
  43.  
  44.     rc = Destroy("<XWP_ICOSMALL>;");
  45.     rc = Destroy("<XWP_ICONORM>;");
  46.     rc = Destroy("<XWP_SHOWALL>;");
  47.         rc = Destroy("<XWP_DEFICON>;");
  48.         rc = Destroy("<XWP_DEFTREE>;");
  49.         rc = Destroy("<XWP_DEFDETLS>;");
  50.     rc = Destroy("<XWP_CFG3_1>");
  51. rc = Destroy("<XWP_CFG3>");
  52.  
  53.     rc = Destroy("<XWP_FOLDERTEMPLATE>");
  54.     rc = Destroy("<XWP_PROGRAMTEMPLATE>");
  55. rc = Destroy("<XWP_CFG2>");
  56.  
  57.     rc = Destroy("<XWP_CMDSHL>");
  58.     rc = Destroy("<XWP_BASH>");
  59.     rc = Destroy("<XWP_KSH>");
  60.     rc = Destroy("<XWP_OS2WIN>");
  61.     rc = Destroy("<XWP_OS2FULL>");
  62.     rc = Destroy("<XWP_DOSWIN>");
  63.     rc = Destroy("<XWP_DOSFULL>");
  64. rc = Destroy("<XWP_CFG1>");
  65.  
  66. /* kill config folder itself */
  67. rc = Destroy("<XWP_CONFIG>");
  68.  
  69. /*********************************************
  70.  *
  71.  * 2) UNDO INSTLxxx.CMD (INSTALL FOLDER)
  72.  *
  73.  *********************************************/
  74.  
  75. /* XShutdown... changed with V0.9.7 */
  76. rc = Destroy("<XWP_XSHUTDOWN>");
  77.  
  78. /*  "Setup String" template (added V0.9.5) */
  79. rc = Destroy("<XWP_STRINGTPL>");
  80.  
  81. /*  "WPS Class List" (added V0.9.2) */
  82. rc = Destroy("<XWP_CLASSLISTMAINSHADOW>");
  83. rc = Destroy("<XWP_CLASSLIST>");
  84.  
  85. /* "Mouse" shadow (added V0.9.2) */
  86. rc = Destroy("<XWP_MOUSEMAINSHADOW>");
  87. /* "Keyboard" shadow (added V0.9.2) */
  88. rc = Destroy("<XWP_KEYBMAINSHADOW>");
  89. /* "Sound" shadow (added V0.9.2) */
  90. rc = Destroy("<XWP_SOUNDMAINSHADOW>");
  91.  
  92. /*  "Media" (added V0.9.5) */
  93. rc = Destroy("<XWP_MEDIAMAINSHADOW>");
  94. rc = Destroy("<XWP_MEDIA>");
  95.  
  96. /*  "Screen" (added V0.9.2) */
  97. rc = Destroy("<XWP_SCREENMAINSHADOW>");
  98. rc = Destroy("<XWP_SCREEN>");
  99.  
  100. /*  "OS/2 Kernel" */
  101. rc = Destroy("<XWP_KERNELMAINSHADOW>");
  102. rc = Destroy("<XWP_KERNEL>");
  103.  
  104. /*  "Workplace Shell" */
  105. rc = Destroy("<XWP_WPSMAINSHADOW>");
  106. rc = Destroy("<XWP_WPS>");
  107.  
  108. /* "Font folder" ... added with V0.9.7 */
  109. rc = Destroy("<XWP_FONTFOLDERSHADOW>");
  110. rc = Destroy("<XWP_FONTFOLDER>");
  111.  
  112. /*  XCenter (V0.9.7) */
  113. rc = Destroy("<XWP_XCENTER>");
  114.  
  115. /*  "XWorkplace Setup" (added V0.9.0) */
  116. rc = Destroy("<XWP_SETUPMAINSHADOW>");
  117. rc = Destroy("<XWORKPLACE_SETUP>");
  118.  
  119. /* "Readme" shadow (added V0.9.2) */
  120. rc = Destroy("<XWP_READMEMAINSHADOW>");
  121.  
  122. /* User Guide */
  123. rc = Destroy("<XWP_REF>");
  124.  
  125. /* "SmartGuide" introduction: this was removed with V0.9.7, but still kill it */
  126. rc = Destroy("<XWP_INTRO>");
  127.  
  128. /* IN ADDITION, DESTROY TRASH CAN... THIS IS NOT IN THE INSTALL SCRIPT */
  129. rc = Destroy("<XWP_TRASHCAN>");
  130.  
  131. /* finally, destroy install folder */
  132. rc = Destroy("<XWP_MAINFLDR>");
  133.  
  134. /*********************************************
  135.  *
  136.  * 3) UNREPLACE/DEREGISTER WPS CLASSES
  137.  *
  138.  *********************************************/
  139.  
  140. rc = DeRegisterClass("XFldSystem");
  141. rc = DeRegisterClass("XFldWPS");
  142. rc = DeRegisterClass("XWPScreen");
  143. rc = DeRegisterClass("XFldStartup");
  144. rc = DeRegisterClass("XFldShutdown");
  145. rc = DeRegisterClass("XWPSetup");
  146. rc = DeRegisterClass("XWPTrashCan");
  147. rc = DeRegisterClass("XWPTrashObject");
  148. rc = DeRegisterClass("XWPClassList");
  149. rc = DeRegisterClass("XWPMedia");
  150. rc = DeRegisterClass("XCenter");
  151. rc = DeRegisterClass("XWPFontFolder");
  152. rc = DeRegisterClass("XWPFontFile");
  153. rc = DeRegisterClass("XWPFontObject");
  154.  
  155. rc = UnReplaceClass("WPFileSystem", "XWPFileSystem"); /* V0.9.16 */
  156. rc = UnReplaceClass("WPProgram", "XWPProgram");       /* V0.9.9 */
  157. rc = UnReplaceClass("WPFolder", "XFolder");
  158. rc = UnReplaceClass("WPObject", "XFldObject");
  159. rc = UnReplaceClass("WPDataFile", "XFldDataFile");
  160. rc = UnReplaceClass("WPDisk", "XFldDisk");
  161. rc = UnReplaceClass("WPDesktop", "XFldDesktop");
  162. /* V0.9.16: unreplace XFldProgramFile, which is the old name of XWPProgramFile */
  163. rc = UnReplaceClass("WPProgramFile", "XFldProgramFile");
  164. rc = UnReplaceClass("WPProgramFile", "XWPProgramFile");
  165. rc = UnReplaceClass("WPSound", "XWPSound");
  166. rc = UnReplaceClass("WPMouse", "XWPMouse");
  167. rc = UnReplaceClass("WPKeyboard", "XWPKeyboard");
  168.  
  169. rc = DeRegisterClass("XWPFileSystem");        /* V0.9.16 */
  170. rc = DeRegisterClass("XWPProgram");           /* V0.9.9 */
  171. rc = DeRegisterClass("XFolder");
  172. rc = DeRegisterClass("XFldObject");
  173. rc = DeRegisterClass("XFldDataFile");
  174. rc = DeRegisterClass("XFldDisk");
  175. rc = DeRegisterClass("XFldDesktop");
  176. /* V0.9.16: unreplace XFldProgramFile, which is the old name of XWPProgramFile */
  177. rc = DeRegisterClass("XFldProgramFile");
  178. rc = DeRegisterClass("XWPProgramFile");
  179. rc = DeRegisterClass("XWPSound");
  180. rc = DeRegisterClass("XWPString");
  181. rc = DeRegisterClass("XWPMouse");
  182. rc = DeRegisterClass("XWPKeyboard");
  183.  
  184. exit;
  185.  
  186. /* Destroy(): sneaky little subproc which first sets the NODELETE=NO style
  187.    to make sure we can really delete the object and then does a SysDestroyObject
  188.    on it. */
  189.  
  190. Destroy:
  191. parse arg objid
  192.  
  193. call charout , 'Killing object ID "'objid'"...'
  194.  
  195. rc = SysSetObjectData(objid, "NODELETE=NO;");
  196. if (rc \= 0) then do
  197.     /* got that: */
  198.     rc = SysDestroyObject(objid);
  199. end
  200.  
  201. if (rc \= 0) then say " OK"; else say " failed.";
  202.  
  203. return rc;
  204.  
  205. /*
  206.  * DeRegisterClass:
  207.  *      little helper to deregister a class.
  208.  */
  209.  
  210. DeRegisterClass:
  211. parse arg classname
  212.  
  213. say "Deregistering "classname
  214.  
  215. rc = SysDeregisterObjectClass(classname);
  216.  
  217. return rc;
  218.  
  219. /*
  220.  * UnReplaceClass:
  221.  *      little helper to un-replace a class with another.
  222.  */
  223.  
  224. UnReplaceClass:
  225. parse arg oldclass, newclass
  226.  
  227. say "Undoing replacement of "oldclass" with "newclass;
  228.  
  229. "..\bin\repclass" oldclass newclass
  230.  
  231. return rc;
  232.  
  233.