home *** CD-ROM | disk | FTP | other *** search
/ c't freeware shareware 1997 / CT_SW_97.ISO / mac / Software / entwickl / win95 / plisi306.exe / bin / perlis-install.bat next >
DOS Batch File  |  1996-12-12  |  2KB  |  101 lines

  1. @rem = '--*-Perl-*--';      
  2. @rem = '
  3. @echo off
  4. if exist perl.exe goto perlhere
  5. cd bin
  6. if not exist perl.exe goto perlnotthere
  7. :perlhere
  8. if not exist Perl300.dll goto perlnotthere
  9. if not exist Perlglob.exe goto perlnotthere
  10. if not exist PerlIS.dll goto PerlISnotthere
  11. echo  Installing PerlIS
  12. pause
  13. perl.exe PerlIS-install.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
  14. if errorlevel 1 goto perlerror
  15. goto endofperl
  16. @rem ';
  17.  
  18. BEGIN{
  19.     @INC = qw( ..\Lib ..\Ext );
  20.  
  21. };
  22.  
  23. # xxx get rid of this dpreciated syntax !!!!
  24.  
  25. #(c) 1996 Microsoft Corporation. All rights reserved. 
  26. #    Developed by ActiveWare Internet Corp., http://www.ActiveWare.com
  27.  
  28.  
  29. require 'NT.ph';
  30. require 'ctime.pl';
  31.  
  32. $date = ctime( time );
  33.  
  34. sub MyLog ($) {
  35.     ( $message ) = @_;
  36.     print LOG $message;
  37.     print $message;
  38. }
  39.  
  40. sub gripe ($) {
  41.     ( $message ) = @_;
  42.     print LOG $message;
  43.     warn $message;
  44. }
  45.  
  46.  
  47. open ( LOG, '>>install.log' ) || warn "Couldn't open log file!\n";
  48.  
  49. MyLog( '***** '.$date );
  50.  
  51.  
  52. chop( $perldir = `cd` );
  53.  
  54. MyLog( "Installing PerlIS into $perldir" );
  55.  
  56. #Check for IIS.
  57. if(!Win32::RegOpenKeyEx (&HKEY_LOCAL_MACHINE,
  58.                 'SYSTEM\CurrentControlSet\Services\W3SVC\Parameters\Script Map',
  59.                 &NULL,&KEY_ALL_ACCESS,$Servkey)) {
  60.     gripe "No Microsoft Internet Information Server Installed\n";
  61.     exit;
  62. }
  63.  
  64. #Ask for the extension to associate with perlIS.dll.
  65. print "\nPlease choose a file extension to associate with PerlIS.dll.";
  66. print "\nExtension:<pl is the default>";
  67.  
  68. $extension = <STDIN>;
  69. chop($extension);
  70. $extension = "pl" if ( $extension eq "" );    
  71. $extension = '.'.$extension unless ($extension =~ /\..*/ );
  72.  
  73. #make association.
  74.  
  75. Win32::RegSetValueEx( $Servkey,"$extension", &NULL, ®_SZ, "$perldir\\PerlIS.dll" ) ?
  76.     MyLog( "-->Association made with $extension\n" ) :
  77.     gripe( "**Association of $extension to $perldir\\PerlIS.dll failed!!\n" );
  78.  
  79. Win32::RegCloseKey( $Servkey );
  80.  
  81. print "\nopening release.txt...\n";
  82.  
  83. __END__
  84.  
  85. :perlerror
  86. echo UH-OH... something bad happened
  87. goto done
  88. :perlnotthere
  89. echo Could not find Perl interpreter!!
  90. echo *gasp* *wheez* *choke*
  91. echo Did you install PerlIS into the same directory 
  92. echo as Perl for Win32???
  93. echo You need to install Perl for Win32 before PerlIS
  94. goto endofperl
  95. :PerlISnotthere
  96. echo Did you install PerlIS into the same directory as Perl?
  97. :endofperl
  98. notepad ..\docs\PerlIS\release.txt
  99. :done
  100. pause
  101.