home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / wps / system / deskman / remove.cmd < prev   
OS/2 REXX Batch file  |  1993-03-17  |  3KB  |  65 lines

  1. /* rexx - Remove.CMD removes previous beta from the system       */
  2. /* by   Greg Czaja Feb. 28, 1993       1.0 b3                    */
  3. /* and  Development Technologies, Inc.                           */
  4. /* destroys the object, deregisters the class, cleans up the INI */
  5. /* DMAN.DLL, DMAN.INF, DMANHELP.HLP are searched on all disks    */
  6. /* DeskMan.DLL, DeskMan.INF, DManHelp.HLP for drops after 1.0 b1 */
  7. /* and deleted after user's confirmation                         */
  8.  
  9.  
  10. Parse Arg drives_parm .   /* a drive letter may be passed as parameter */
  11. If drives_parm<>'' & Right(drives_parm,1) <> ':'
  12.    Then drives_parm=drives_parm||':';
  13.  
  14. Call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs';
  15. Call SysLoadFuncs;           
  16.      /* code below removes beta drops installed before 1.0 b1 */
  17.      rc=SysDestroyObject("<DMAN1>");
  18.      rc=SysDeregisterObjectClass('DMan');
  19.      Call SysIni 'USER', 'DMan', 'DELETE:';
  20.                              /* look for DeskMan files now... */
  21.      Call FindFile 'DMan.DLL';
  22.      Call FindFile 'DMan.INF';
  23.      Call FindFile 'DManHelp.HLP';
  24.  
  25.      /* code below removes beta drops installed after  1.0 b1 */
  26.      rc=SysDestroyObject("<DeskMan1>");
  27.      rc=SysDeregisterObjectClass('DMan');
  28.      Call SysIni 'USER', 'DeskMan', 'DELETE:';
  29.                              /* look for DeskMan files now... */
  30.      Call FindFile 'DeskMan.DLL';
  31.      Call FindFile 'DeskMan.INF';
  32.      Call FindFile 'DeskMan.HLP';
  33.  
  34. Exit;
  35.           /* looks for specified file and erases it upon user's confirmation */
  36. FindFile: Procedure Expose drives_parm;
  37. Arg file .
  38.      other_dirs='';
  39.     If drives_parm=''
  40.        Then drives=SysDriveMap(,'LOCAL');
  41.        Else drives=drives_parm;
  42.     Do While drives<>'';
  43.        Parse Var drives this_drive drives;
  44.        drive_info=SysDriveInfo(this_drive);
  45.        Parse Var drive_info dr free .
  46.        If free=0 Then Iterate;     /* probably CD-ROM - don't touch ! */
  47.        Say 'DeskMan/2 - looking for:' file 'on drive:' this_drive;
  48.        Call SysFileTree this_drive||'\'||file, 'files.', 'sfo';
  49.        Do i=1 to files.0;
  50.           If Pos(file, Translate(files.i)) > 0   /* found it ! */
  51.              Then Do;
  52.                other_dirs=files.i;
  53.                Say 'DeskMan/2 was previously installed on this system and 'file' was in:'
  54.                Say '          'other_dirs;
  55.                Say 'Do you want the 'file' to be removed? Enter Y(es) or N(o) now...';
  56.                reply=Translate(SysGetKey());
  57.                Say '';
  58.                If Left(reply,1) = 'Y'
  59.                   Then
  60.                     '@ERASE 'other_dirs;
  61.                End;
  62.        End;
  63.      End;
  64. Return;
  65.