Thanks for reading this thread.
Basically I am wondering how I can use relative path/environment variable pointing to visual studio 2012 vcvarsall.bat file in a script?
I am currently using absolute path:
call "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" x86_amd64
How can I do something like this?
call "$(System)\$(Program Files)$(VS)\$(VC)\vcvarsall.bat" x86_amd64
Thanks a lot.
EDIT
What if I have more than one version of visual studio? I have vs2008 and vs2012 both installed on my computer.
Using a Visual Studio macro VCInstallDir
call $(VCInstallDir)vcvarsall.bat
Or without Visual Studio macros use VS110COMNTOOLS
call $(VS110COMNTOOLS)..\..\VC\vcvarsall.bat
Related
How can the entry
<MsTestExePath>$(MSBuildProgramFiles32)Microsoft Visual Studio 14.0\Common7\IDE\mstest.exe</MsTestExePath>
in a .proj file be generalised, such that the build works for different licenses of Visual Studio 2019 as well, where mstest.exe is located at
C:\Program Files (x86)\Microsoft Visual
Studio\2019\Enterprise\Common7\IDE\MSTest.exe
in the case of an enterprise license?
The most generic solution may be to replace the variable parts of the path with msbuild macros, but which ones would that be?
According to this documentation,
The macro
$(VSInstallDir)
returns the path to the installation folder of the Visual Studio version currently used.
The following entry should therefore work for all versions of visual studio, for which mstest.exe is located in the subfolder \Common7\IDE\ under the installation directory:
<MsTestExePath>$(VSInstallDir)Common7\IDE\mstest.exe</MsTestExePath>
Is there a Visual Studio build command macros for determining the version of Visual Studio?
I want a post-build event that runs something in C:\Program Files (x86)\Common Files\microsoft shared\TextTemplating\<My MSVS version>, for example C:\Program Files (x86)\Common Files\microsoft shared\TextTemplating\14.0
We have different developers with different versions of Visual Studio installed, and this build event is currently hard-coded.
I looked here but didn't see anything.
I found the build command macro I was looking for. This did it for me:
$(MSBuildToolsVersion)
It resolves to the major-minor version number that I'm looking for (ie, 14.0).
In Visual Studio 2017's New Project dialog, there is no entry for Windows Installer XML (WiX).
Is it possible to enable WiX projects in Visual Studio 2017?
You can manually enable Visual Studio 2017 compatibility with WiX 3.10 or earlier:
Close all instances of Visual Studio.
Copy
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\WiX to
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\Microsoft\WiX
(In the destination path, replace "Enterprise" with "Professional" or "Community" depending on your edition.)
You may need to provide Administrator permission:
The result will look like this:
Copy C:\Program Files (x86)\MSBuild\Microsoft\WiX to C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\WiX
Then execute the following command as Administrator:
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\devenv" /setup
(Again, replace "Enterprise" with "Professional" or "Community" depending on your edition.)
When you open Visual Studio 2017, WiX 3.10 and earlier projects will be compatible.
WiX v3.11.0.1507 provides full support for the VS 2017 Extension For WiX.
The Release Notes provide insight into why it has taken so long to provide the extension and compatibility with the extension and older versions of WiX
Note: You can use the "WiX Toolset Visual Studio 2017 Extension" with previous versions of the WiX Toolset but there is a forwards compatibility issue when building managed custom actions that is only fixed in the WiX v3.11 RC release. In other words, if you have managed custom actions and you want to use VS 2017 then you must upgrade to WiX v3.11 RC.
Edit:
The VS 2019 Extension is now available.
Edit:
The VS 2022 Extension is now available.
The Wix Releases Page has links to the other extensions.
I found that I also had to copy the WiX folder from "C:\Program Files (x86)\MSBuild\Microsoft" "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft". Without this, I got an error trying to load my WiX project that one of the MSBuild targets files couldn't be found.
WiX now offers support for Visual Studio 2017.
All you have to do is:
Close Visual Studio 2017
Install the WiX Toolset Build Tools
Install the WiX Toolset Visual Studio 2017 Extension
The answer by Chris works, but on my machine, for some reason, the Wix folder in "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\WiX" had only one template named "CustomActionCPP.zip". I had to search for a complete Wix folder in other older versions of Visual Studio. It worked for me by copying Wix from "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft\WiX\ProjectTemplates".
Also, had to apply the answer by Basim, by copying Wix from "C:\Program Files (x86)\MSBuild\Microsoft" to "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft".
I have installed ONLY VS2017 and had to copy from another machine where VS2015 was installed the mentionen folder of #Chris Schiffhauer. The same for the folder of #Basim mentioned.
Addiontally I had to copy the "C:\Program Files (x86)\Wix Toolset 3.10\" because when I have installed WiX on my machine in this folder were still some assemblies missing.
Install the Wix Toolset Visual Studio 2019 Extension and reload the project
right-click the project folder in the path and uncheck the read-only
after install the Extension reload the Wix
use the below URL download
https://marketplace.visualstudio.com/items?itemName=WixToolset.WixToolsetVisualStudio2019Extension
I am pretty sure I installed VS 2012 Express on my new laptop a month ago. I even posted on Facebook about how I didn't like the default themes because the window borders were too light in color.
Now, I can't seem to find the VS 2012 Express installation. Where should I look?
I've looked for devenv.exe or any exe under C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common\IDE and in C:\Program Files\Microsoft Visual Studio 11.0\Common\IDE.
Okay, I found it. The exe name is VWDExpress.exe and it is located at C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common\IDE
If you are using the Ultimate version go to
C:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE
and look for "devenv" with visualStudio Icon .
I had the same problem. I found it in
Local Disk > Program Files 86 > Common7 > IDE > WDExpress
It wasn't an .exe when I found it, it was an application that I launched.
I want to write a simple batch script that loads the Visual Studio build environment using vcvars32.bat and then continue with the build, using vcbuild. However, my script won't execute past the invocation of vcvars32.bat. The last output I get is:
Setting environment for using Microsoft Visual Studio 2008 x86 tools.
As you can see I'm using Visual Studio 2008. Here is my simplest batch script:
#echo off
"C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat"
vcbuild
You have to use call in your batch script, or the termination of vcvars32.bat will terminate your own batch script. Therefore your script should be:
#echo off
call "C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat"
vcbuild
You'll also want to check that the script hasn't run already or you'll start running out of memory if you invoke your script over and over in the same console.
IF '%VSINSTALLDIR%' NOT EQU '' THEN EXIT 0
The exact program files path depends on whether you have a 32 or 64 bit OS and where you installed Visual Studio. Use the VS100COMNTOOLS environment variable which Visual Studio sets up at install time to solve this problem generically.
call "%VS100COMNTOOLS%\..\..\VC\bin\vcvars32.bat"
...
Note that each version of Visual Studio has a specific environment variable based on its underlying version number.
Visual Studio 2005 VS80COMNTOOLS
Visual Studio 2008 VS90COMNTOOLS
Visual Studio 2010 VS100COMNTOOLS
Visual Studio 2012 VS110COMNTOOLS
Visual Studio 2013 VS120COMNTOOLS
Visual Studio 2014 VS130COMNTOOLS
Visual Studio 2015 VS140COMNTOOLS
Visual Studio 2016 VS150COMNTOOLS
Visual Studio 2017 VS160COMNTOOLS
You get the idea.