6 use File::Temp qw/tempfile/;
12 my ($fh, $path) = tempfile(UNLINK => 0, SUFFIX => '.cmd') or die;
14 chomp(my $vcBin = `cygpath -w "$FindBin::Bin/../vcbin"`);
15 chomp(my $scriptsPath = `cygpath -w "$FindBin::Bin"`);
18 if ($ENV{'VS80COMNTOOLS'}) {
19 $vsToolsVar = "VS80COMNTOOLS";
20 } elsif ($ENV{'VS90COMNTOOLS'}) {
21 $vsToolsVar = "VS90COMNTOOLS";
23 print "*************************************************************\n";
24 print "Cannot find Visual Studio tools dir.\n";
25 print "Please ensure that \$VS80COMNTOOLS or \$VS90COMNTOOLS\n";
26 print "is set to a valid location.\n";
27 print "*************************************************************\n";
31 print $fh "\@echo off\n\n";
32 print $fh "call \"\%" . $vsToolsVar . "\%\\vsvars32.bat\"\n\n";
33 print $fh "set PATH=$vcBin;$scriptsPath;\%PATH\%\n\n";
35 print $fh "IF EXIST \"\%VSINSTALLDIR\%\\Common7\\IDE\\devenv.com\" (devenv.com /useenv " . join(" ", @ARGV) . ") ELSE ";
36 print $fh "VCExpress.exe /useenv " . join(" ", @ARGV) . "\n";
43 chomp($path = `cygpath -w -s '$path'`);
45 exec("cmd /c \"call $path\"");