Blame inc/Module/Install/Win32.pm

Packit c9e8cb
#line 1
Packit c9e8cb
package Module::Install::Win32;
Packit c9e8cb
Packit c9e8cb
use strict;
Packit c9e8cb
use Module::Install::Base;
Packit c9e8cb
Packit c9e8cb
use vars qw{$VERSION $ISCORE @ISA};
Packit c9e8cb
BEGIN {
Packit c9e8cb
	$VERSION = '0.67';
Packit c9e8cb
	$ISCORE  = 1;
Packit c9e8cb
	@ISA     = qw{Module::Install::Base};
Packit c9e8cb
}
Packit c9e8cb
Packit c9e8cb
# determine if the user needs nmake, and download it if needed
Packit c9e8cb
sub check_nmake {
Packit c9e8cb
	my $self = shift;
Packit c9e8cb
	$self->load('can_run');
Packit c9e8cb
	$self->load('get_file');
Packit c9e8cb
	
Packit c9e8cb
	require Config;
Packit c9e8cb
	return unless (
Packit c9e8cb
		$^O eq 'MSWin32'                     and
Packit c9e8cb
		$Config::Config{make}                and
Packit c9e8cb
		$Config::Config{make} =~ /^nmake\b/i and
Packit c9e8cb
		! $self->can_run('nmake')
Packit c9e8cb
	);
Packit c9e8cb
Packit c9e8cb
	print "The required 'nmake' executable not found, fetching it...\n";
Packit c9e8cb
Packit c9e8cb
	require File::Basename;
Packit c9e8cb
	my $rv = $self->get_file(
Packit c9e8cb
		url       => 'http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe',
Packit c9e8cb
		ftp_url   => 'ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe',
Packit c9e8cb
		local_dir => File::Basename::dirname($^X),
Packit c9e8cb
		size      => 51928,
Packit c9e8cb
		run       => 'Nmake15.exe /o > nul',
Packit c9e8cb
		check_for => 'Nmake.exe',
Packit c9e8cb
		remove    => 1,
Packit c9e8cb
	);
Packit c9e8cb
Packit c9e8cb
	if (!$rv) {
Packit c9e8cb
        die <<'END_MESSAGE';
Packit c9e8cb
Packit c9e8cb
-------------------------------------------------------------------------------
Packit c9e8cb
Packit c9e8cb
Since you are using Microsoft Windows, you will need the 'nmake' utility
Packit c9e8cb
before installation. It's available at:
Packit c9e8cb
Packit c9e8cb
  http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe
Packit c9e8cb
      or
Packit c9e8cb
  ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe
Packit c9e8cb
Packit c9e8cb
Please download the file manually, save it to a directory in %PATH% (e.g.
Packit c9e8cb
C:\WINDOWS\COMMAND\), then launch the MS-DOS command line shell, "cd" to
Packit c9e8cb
that directory, and run "Nmake15.exe" from there; that will create the
Packit c9e8cb
'nmake.exe' file needed by this module.
Packit c9e8cb
Packit c9e8cb
You may then resume the installation process described in README.
Packit c9e8cb
Packit c9e8cb
-------------------------------------------------------------------------------
Packit c9e8cb
END_MESSAGE
Packit c9e8cb
	}
Packit c9e8cb
}
Packit c9e8cb
Packit c9e8cb
1;