Skip to content
Permalink
Browse files

Add automatic support for Visual Studio Community 2017 setup

  • Loading branch information...
jgranick committed Aug 10, 2017
1 parent 492b0cb commit e5e5c21dc128e66093cfa1b9c26ebc6f54ad1d10
Showing with 18 additions and 2 deletions.
  1. +4 −0 toolchain/msvc-setup.bat
  2. +5 −1 toolchain/msvc-winrt-setup.bat
  3. +5 −1 toolchain/msvc-winrt64-setup.bat
  4. +4 −0 toolchain/msvc64-setup.bat
@@ -7,6 +7,10 @@ setlocal enabledelayedexpansion
@call "%HXCPP_MSVC%\vsvars32.bat"
@echo HXCPP_VARS
@set
) else if exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat" (
@call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat" -arch=x86 -app_platform=Desktop -no_logo
@echo HXCPP_VARS
@set
) else if exist "%VS140COMNTOOLS%\vsvars32.bat" (
@call "%VS140COMNTOOLS%\vsvars32.bat"
@if defined HXCPP_WINXP_COMPAT (
@@ -1,5 +1,9 @@
setlocal enabledelayedexpansion
@if exist "%VS140COMNTOOLS%\vsvars32.bat" (
@if exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat" (
@call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat" -arch=x86 -app_platform=UWP -no_logo
@echo HXCPP_VARS
@set
) else if exist "%VS140COMNTOOLS%\vsvars32.bat" (
@call "%VS140COMNTOOLS%\vsvars32.bat"
@set "INCLUDE=%WindowsSdkDir%Include;!INCLUDE!"
@set "PATH=%WindowsSdkDir%bin\x86;!PATH!"
@@ -1,5 +1,9 @@
setlocal enabledelayedexpansion
@if exist "%VS140COMNTOOLS%\..\..\VC\bin\x86_amd64\vcvarsx86_amd64.bat" (
@if exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat" (
@call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat" -arch=amd64 -app_platform=UWP -no_logo
@echo HXCPP_VARS
@set
) else if exist "%VS140COMNTOOLS%\..\..\VC\bin\x86_amd64\vcvarsx86_amd64.bat" (
@call "%VS140COMNTOOLS%\..\..\VC\bin\x86_amd64\vcvarsx86_amd64.bat"
@set "INCLUDE=%WindowsSdkDir%Include;!INCLUDE!"
@set "PATH=%WindowsSdkDir%bin\x64;!PATH!"
@@ -8,6 +8,10 @@ setlocal enabledelayedexpansion
@echo HXCPP_VARS
@set
)
) else if exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat" (
@call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat" -arch=amd64 -app_platform=Desktop -no_logo
@echo HXCPP_VARS
@set
) else if exist "%VS140COMNTOOLS%\..\..\VC\bin\x86_amd64\vcvarsx86_amd64.bat" (
@echo "%VS140COMNTOOLS%"
@call "%VS140COMNTOOLS%\..\..\VC\bin\x86_amd64\vcvarsx86_amd64.bat"

3 comments on commit e5e5c21

@waneck

This comment has been minimized.

Copy link
Member

waneck replied Aug 10, 2017

Aren't there any environment variables you can use? Note that this will only work for english windows systems that installed on the default location. I think it's better to not make it work anywhere rather than working only for a specific case

@hughsando

This comment has been minimized.

Copy link
Member

hughsando replied Aug 11, 2017

Microsoft, in their wisdom, though an environment variable was too much of a hack. Now you have to create an intricate series of .net objects to perform the extremely complex task of looking up a name. Gotta love over-engineering.
I think I'm going to have to ship a "FindVisualStudio.exe" in hxcpp.

@waneck

This comment has been minimized.

Copy link
Member

waneck replied Aug 11, 2017

Classic Microsoft :P

Please sign in to comment.
You can’t perform that action at this time.