Skip to content

Instantly share code, notes, and snippets.

@mikofski
Last active April 9, 2017 20:40
Show Gist options
  • Save mikofski/11024332 to your computer and use it in GitHub Desktop.
Save mikofski/11024332 to your computer and use it in GitHub Desktop.
Fix for vcvarsall.bat to build Python-2.7 extensions using v90 instead of sdk7
--- C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.txt
+++ C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat
@@ -16,23 +16,23 @@
goto :eof
:amd64
-if not exist "%~dp0bin\amd64\vcvarsamd64.bat" goto missing
-call "%~dp0bin\amd64\vcvarsamd64.bat"
+if not exist "%~dp0bin\vcvars64.bat" goto missing
+call "%~dp0bin\vcvars64.bat"
goto :eof
:ia64
-if not exist "%~dp0bin\ia64\vcvarsia64.bat" goto missing
-call "%~dp0bin\ia64\vcvarsia64.bat"
+if not exist "%~dp0bin\vcvarsia64.bat" goto missing
+call "%~dp0bin\vcvarsia64.bat"
goto :eof
:x86_amd64
-if not exist "%~dp0bin\x86_amd64\vcvarsx86_amd64.bat" goto missing
-call "%~dp0bin\x86_amd64\vcvarsx86_amd64.bat"
+if not exist "%~dp0bin\vcvarsx86_amd64.bat" goto missing
+call "%~dp0bin\vcvarsx86_amd64.bat"
goto :eof
:x86_ia64
-if not exist "%~dp0bin\x86_ia64\vcvarsx86_ia64.bat" goto missing
-call "%~dp0bin\x86_ia64\vcvarsx86_ia64.bat"
+if not exist "%~dp0bin\vcvarsx86_ia64.bat" goto missing
+call "%~dp0bin\vcvarsx86_ia64.bat"
goto :eof
:usage
@echo off
if "%1" == "" goto x86
if not "%2" == "" goto usage
if /i %1 == x86 goto x86
if /i %1 == amd64 goto amd64
if /i %1 == x64 goto amd64
if /i %1 == ia64 goto ia64
if /i %1 == x86_amd64 goto x86_amd64
if /i %1 == x86_ia64 goto x86_ia64
goto usage
:x86
if not exist "%~dp0bin\vcvars32.bat" goto missing
call "%~dp0bin\vcvars32.bat"
goto :eof
:amd64
if not exist "%~dp0bin\amd64\vcvarsamd64.bat" goto missing
call "%~dp0bin\amd64\vcvarsamd64.bat"
goto :eof
:ia64
if not exist "%~dp0bin\ia64\vcvarsia64.bat" goto missing
call "%~dp0bin\ia64\vcvarsia64.bat"
goto :eof
:x86_amd64
if not exist "%~dp0bin\x86_amd64\vcvarsx86_amd64.bat" goto missing
call "%~dp0bin\x86_amd64\vcvarsx86_amd64.bat"
goto :eof
:x86_ia64
if not exist "%~dp0bin\x86_ia64\vcvarsx86_ia64.bat" goto missing
call "%~dp0bin\x86_ia64\vcvarsx86_ia64.bat"
goto :eof
:usage
echo Error in script usage. The correct usage is:
echo %0 [option]
echo where [option] is: x86 ^| ia64 ^| amd64 ^| x86_amd64 ^| x86_ia64
echo:
echo For example:
echo %0 x86_ia64
goto :eof
:missing
echo The specified configuration type is missing. The tools for the
echo configuration might not be installed.
goto :eof
@mikofski
Copy link
Author

get both files, copy vcvarsall.txt as vcvarsall.bat then run

patch vcvarsall.bat vcvarsall.bat.patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment