Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vsvars32.bat in Visual Studio 2017

As the Visual Studio installer is new from Visual Studio 2017 version, I cannot located the Visual C++ component, explained here.

How do I proceed to get the vsvars32.bat in VS2017?

like image 643
Tobias Moe Thorstensen Avatar asked Mar 15 '17 09:03

Tobias Moe Thorstensen


People also ask

What is vsvars32 bat?

BAT files such as vsvars32. bat are categorized as Script (DOS Batch) files. As a DOS Batch file, it was created for use in Microsoft Visual Studio 2010 Ultimate 2010 by Microsoft. The first version of vsvars32. bat for Microsoft Visual Studio 2010 Ultimate 2010 was seen on 04/12/2010 in Windows 10.

What is VsDevCmd bat?

VsDevCmd. bat sets the Visual Studio related environment variables that are necessary for compiling, linking and building applications on the command line. VsDevCmd. bat is new with Visual Studio 2017 and replaces vsvars32.


1 Answers

VS2017 suffers from very seriously brain-damaged install path location choices. Most damning dumb thing they did is to make the edition name (Professional, Enterprise, probably Community) part of the path. This makes it quite difficult to find tools back reliably from one machine to another.

There is one environment variable that I think can solve the problem, the VSAPPIDDIR variable stores the path to the folder where the IDE is installed (devenv.exe). So if you want to run vcvars32.bat from a build event then you'd use

   call "%vsappiddir%..\..\VC\Auxiliary\Build\vcvars32.bat" x86 

Note that it is vc, not vs, vsvars32.bat no longer exists. You could possibly favor the "Developer Command Prompt:

   call "%vsappiddir%..\tools\vsdevcmd.bat" 

But judging from your link, you actually want to run the editbin.exe utility:

   "%vsappiddir%..\..\VC\Tools\MSVC\14.10.25017\bin\HostX86\x86\editbin.exe" args... 

The 14.10.25017 version number is no joy whatsoever either, no real insight in how that is going to change from one update to the next. It probably will.

like image 184
Hans Passant Avatar answered Sep 18 '22 15:09

Hans Passant