home *** CD-ROM | disk | FTP | other *** search
/ IBM CD Showcase / OS2_CD_ROM.iso / smce0001 / wplace / install / deregist.cmd < prev    next >
Encoding:
Text File  |  1993-06-23  |  6.0 KB  |  153 lines

  1. /*  This cmd file de-registers the Workplace/2 classes                  */
  2. /************************************************************************/
  3.  
  4. Subdirectories = 'No'   /* Set to Yes if want to install into subdirectories */
  5.  
  6. lll = 0;                /* Counter for log file; set to -1 to turn off logging */
  7. Abort = 'No';           /* Flag to control aborting */
  8. DeskTop = "C:\DESKTOP";
  9. TempLate = "C:\DESKTOP\TEMPLATE";
  10.  
  11.         /* Initialize the RexxUtil environment */
  12.  
  13.         Call RxFuncadd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs';
  14.         Call SysLoadFuncs;
  15.  
  16.         /* Give introductory message       */
  17.  
  18.         rc = SayIntro();
  19.         If Abort = 'Yes' then Exit;
  20.  
  21.         /* Register the classes */
  22.  
  23.         rc = DeRegisterClasses();
  24.  
  25.         /* Cleanup Installed Objects */
  26.         rc = CleanUpObjects();
  27.  
  28.         /* Print the Log                   */
  29.  
  30.         Call PrintLog;
  31.  
  32.         /* Exit                            */
  33.  
  34.         Exit 0
  35.  
  36. /***********************************************************************/
  37. /* Gives the introductory message.                                     */
  38. /***********************************************************************/
  39. SayIntro:  Procedure Expose Abort DeskTop TempLate;
  40.         Call SysCls;
  41. Say  "                                                                      "
  42. Say  "  This cmd file will allow you to de-register the classes for         "
  43. Say  "  Ultimedia Workplace/2.  It should only be run if you want to        "
  44. Say  "  remove Workplace/2 from the system.                                 "
  45. Say  "                                                                      "
  46. Say  "  You may stop execution by responding with ENTER to any question.    "
  47. Say  "                                                                      "
  48. Say  "  Would you like to proceed with the de-registration  (Y/N)?"
  49.         Pull choice .
  50.         If (choice = "") | (choice = "N") then Do;
  51.           Abort = 'Yes'
  52.           Return 2;
  53.           End;
  54. Say  " Please Enter Desktop Location or Use Default("DeskTop")?"
  55.         Pull choice .
  56.         if (choice \= "") then DeskTop = choice;
  57. Say  " Desktop Location to Deinstall from is: "DeskTop
  58. Say  " Please Enter Template Location or Use Default("TempLate"*)?"
  59.         Pull choice .
  60.         if (choice \= "") then TempLate = choice;
  61. Say  " TempLate Location to Deinstall from is: "TempLate
  62. Return 0
  63. /***********************************************************************/
  64. /* Deregister the classes.                                             */
  65. /***********************************************************************/
  66. DeRegisterClasses:
  67.  
  68.        /*  Replace the WPDataFile Class  */
  69.  
  70.         '@REPL  WPDataFile  WPDataFile anything '
  71.         Call Logit("RegisterClasses: Replace:      rc: " rc)
  72.  
  73.        /* De-Register the classes */
  74.  
  75.         rc = SysDeregisterObjectClass("LTFolder");
  76.         Call Logit("DeRegisterClasses: LTFolder:     rc: " rc)
  77.  
  78.         rc = SysDeregisterObjectClass("LTQuerySeq");
  79.         Call Logit("DeRegisterClasses: LTQuerySeq:   rc: " rc)
  80.  
  81.         rc = SysDeregisterObjectClass("LTDataFile");
  82.         Call Logit("DeRegisterClasses: LTDataFile:   rc: " rc)
  83.  
  84.         rc = SysDeregisterObjectClass("SafeFolder");
  85.         Call Logit("DeRegisterClasses: SafeFolder:   rc: " rc)
  86.  
  87.         rc = SysDeregisterObjectClass("Clipdata");
  88.         Call Logit("DeRegisterClasses: Clipdata:     rc: " rc)
  89.  
  90.         rc = SysDeregisterObjectClass("LTReference");
  91.         Call Logit("DeRegisterClasses: LTReference:  rc: " rc)
  92.  
  93. Return 0
  94. /***********************************************************************/
  95. /* CleanUp Installed Objects                                                                                */
  96. /***********************************************************************/
  97. CleanUpObjects: Procedure Expose DeskTop TempLate;
  98.  
  99.         '@DELOBJ "<LT_SAMPLE>"'
  100.         rc = SysFileDelete(DeskTop||'\Clipdata.BMP');
  101.         rc = SysRmDir(DeskTop||'\Safe');
  102.         rc = SysRmDir(TempLate||'\Light_Ta');
  103.         rc = SysRmDir(TempLate||'s\Light Table');
  104.         rc = SysFileDelete(TempLate||'\LT_Quer2\LT_Query');
  105.         rc = SysFileDelete(TempLate||'s\LT Query Sequencer\LT Query');
  106.         rc = SysFileDelete(TempLate||'\LT_Quer2\LT_Quer1');
  107.         rc = SysFileDelete(TempLate||'s\LT Query Sequencer\LT Query Result');
  108.         rc = SysRmDir(TempLate||'\LT_Quer2');
  109.         rc = SysRmDir(TempLate||'s\LT Query Sequencer');
  110.         rc = SysFileDelete(TempLate||'\LT_Query');
  111.         rc = SysFileDelete(TempLate||'s\LT Query');
  112.         rc = SysFileDelete(TempLate||'\LT_Quer1');
  113.         rc = SysFileDelete(TempLate||'s\LT Query Result');
  114.         rc = SysFileDelete(TempLate||'\Clipdata.BMP');
  115.         rc = SysFileDelete(TempLate||'s\Clipdata.BMP');
  116.  
  117. Return 0
  118. /***********************************************************************/
  119. /* Saves a log record into the stem variable log.                      */
  120. /***********************************************************************/
  121. Logit: Procedure Expose lll log.;
  122.         If lll < 0 then Return;    /* No logging */
  123.         Parse arg instring 
  124.         instring = Strip(instring)
  125.         lll = lll + 1
  126.         log.lll = instring
  127. Return;
  128. /***********************************************************************/
  129. /* Prints the accumulated log entries to target disk, DEREGIST.LOG.    */
  130. /***********************************************************************/
  131. PrintLog: Procedure Expose lll log.;
  132.         If lll < 0 then Return;    /* No logging */
  133.         outname = DEREGIST.LOG
  134.  
  135.      log.0 = lll;
  136.  
  137.         rc = SysFileTree(outname,'lookf','F')
  138.         If lookf.0 <> 0 then Do;
  139.            Say "Erasing an old version of" outname
  140.            "ERASE" outname
  141.            End;
  142.  
  143.   Do i = 1 to log.0                         /* write the output file  */
  144.      rc = Lineout(outname,log.i);
  145.  /*  If rc \= 0 Then Do;
  146.         Say "Write error:" outname
  147.         Return 8
  148.         End;  */
  149.      End
  150.      rc = Stream(outname,C,"CLOSE");
  151.  
  152. Return;
  153.