Win32.pm 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #line 1
  2. package Module::Install::Win32;
  3. use strict;
  4. use Module::Install::Base ();
  5. use vars qw{$VERSION @ISA $ISCORE};
  6. BEGIN {
  7. $VERSION = '1.01';
  8. @ISA = 'Module::Install::Base';
  9. $ISCORE = 1;
  10. }
  11. # determine if the user needs nmake, and download it if needed
  12. sub check_nmake {
  13. my $self = shift;
  14. $self->load('can_run');
  15. $self->load('get_file');
  16. require Config;
  17. return unless (
  18. $^O eq 'MSWin32' and
  19. $Config::Config{make} and
  20. $Config::Config{make} =~ /^nmake\b/i and
  21. ! $self->can_run('nmake')
  22. );
  23. print "The required 'nmake' executable not found, fetching it...\n";
  24. require File::Basename;
  25. my $rv = $self->get_file(
  26. url => 'http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe',
  27. ftp_url => 'ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe',
  28. local_dir => File::Basename::dirname($^X),
  29. size => 51928,
  30. run => 'Nmake15.exe /o > nul',
  31. check_for => 'Nmake.exe',
  32. remove => 1,
  33. );
  34. die <<'END_MESSAGE' unless $rv;
  35. -------------------------------------------------------------------------------
  36. Since you are using Microsoft Windows, you will need the 'nmake' utility
  37. before installation. It's available at:
  38. http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe
  39. or
  40. ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe
  41. Please download the file manually, save it to a directory in %PATH% (e.g.
  42. C:\WINDOWS\COMMAND\), then launch the MS-DOS command line shell, "cd" to
  43. that directory, and run "Nmake15.exe" from there; that will create the
  44. 'nmake.exe' file needed by this module.
  45. You may then resume the installation process described in README.
  46. -------------------------------------------------------------------------------
  47. END_MESSAGE
  48. }
  49. 1;