File Coverage

blib/lib/Module/Install/Win32.pm
Criterion Covered Total %
statement 12 21 57.1
branch 0 4 0.0
condition 0 9 0.0
subroutine 4 5 80.0
pod 0 1 0.0
total 16 40 40.0


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