home *** CD-ROM | disk | FTP | other *** search
/ Freelog 15 / FREELOG 15.ISO / WebMaster / Perl / PERL5106.ZIP / perl5 / UNINSTALL.BAT < prev    next >
Encoding:
DOS Batch File  |  1996-01-31  |  2.4 KB  |  83 lines

  1. @rem = '--*-Perl-*--';
  2. @rem = '
  3. @echo off
  4. perl %0.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
  5. goto endofperl
  6. @rem ';
  7.  
  8. require 'NT.ph';
  9. #(c) 1995 Microsoft Corporation. All rights reserved. 
  10. #        Developed by hip communications inc., http://info.hip.com/info/
  11.  
  12. print <<'--end--';
  13. UNINSTALL.BAT:
  14.   This script will remove the registry entries created by the 
  15.   install.bat script.  You can re-install by running install.bat 
  16.   again. 
  17. Continue?(Y/N):
  18. --end--
  19.  
  20. $in = <STDIN>;
  21. until ( $in eq "\n" || $in =~ /^y/i ) {
  22.     exit if ( $in =~ /^no?\n$/i );
  23.     print "Do you wish to proceed? [Y/n]";
  24.     $in = <STDIN>;
  25. }
  26.  
  27. #check the registry entries
  28.  
  29.     NTRegOpenKeyEx ( &HKEY_LOCAL_MACHINE,
  30.     'SOFTWARE\Microsoft\Resource Kit\PERL5',
  31.     &NULL, &KEY_ALL_ACCESS, $PerlKey ) ?
  32.     print "Retrieving Perl dir information from Registry\n":
  33.     warn "Couldn't retrieve Perl dir information from Registry!!\n";
  34.  
  35.     NTRegQueryValueEx( $PerlKey, 'BIN', &NULL, $type, $bindir );
  36.   
  37.     NTRegDeleteValue( $PerlKey,'BIN')?
  38.     print" deleting BIN value from registry\n":
  39.     warn" cannot delete BIN value from registry!!!\n";
  40.  
  41.   NTRegDeleteValue( $PerlKey,'PRIVLIB')?
  42.     print" deleting PRIVLIB value from registry\n":
  43.     warn" cannot delete PRIVLIB value from registry!!!\n";
  44.  
  45.   NTRegDeleteValue( $PerlKey,'HTML-DOCS')?
  46.     print" deleting HTML-DOCS value from registry\n":
  47.     warn" cannot delete HTML-DOCS value from registry!!!\n";
  48.  
  49.   NTRegDeleteKey( &HKEY_LOCAL_MACHINE,
  50.     'SOFTWARE\Microsoft\Resource Kit\PERL5' )?
  51.     print"Removing Perl from Registry\n":
  52.     warn" Cannon remove Perl from Registry!!!\n";
  53.  
  54.   NTRegCloseKey( $PerlKey );
  55.  
  56. #remove the bin directory from the path.
  57.  
  58. if( Win32::IsWinNT()){
  59.     NTRegOpenKeyEx ( &HKEY_LOCAL_MACHINE,
  60.     'SYSTEM\CurrentcontrolSet\control\Session Manager\Environment',
  61.     &NULL, &KEY_ALL_ACCESS, $hkey ) ?
  62.     print "Retrieving Path information from session manager\n":
  63.     warn "Couldn't retrieve path information from session manager!!\n";
  64.  
  65.     NTRegQueryValueEx( $hkey, 'Path', &NULL, $type, $pathstring );
  66.  
  67.     $pathstring =~ s/$bindir;//g;
  68.  
  69.     NTRegSetValueEx( $hkey, 'Path', &NULL, $type, $pathstring ) ?
  70.     print "Updated path information in session manager\n":
  71.     warn"Couldn't update path information in session manager!!\n";
  72.  
  73.     NTRegCloseKey( $hkey );
  74. }
  75.  
  76.  
  77.    print "NOTE: The changes to the path will not take effect\n";
  78.    print "      until you log off and on again.\n";
  79.  
  80.  
  81. __END__
  82. :endofperl
  83.