Skip to content

Commit

Permalink
VS2017 path detection
Browse files Browse the repository at this point in the history
  • Loading branch information
KindDragon committed Feb 8, 2017
1 parent f628aa8 commit c03c11c
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/tools/msvc.jam
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ local rule configure-really ( version ? : options * )
# version from the path.
# FIXME: We currently detect both Microsoft Visual Studio 9.0 and
# 9.0express as 9.0 here.
if [ MATCH "(Microsoft Visual Studio 15)" : $(command) ]
if [ MATCH "(Microsoft Visual Studio[\/\\]2017)" : $(command) ]
{
version = 15.0 ;
}
Expand Down Expand Up @@ -1624,7 +1624,6 @@ if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ]
.version-11.0-reg = "VisualStudio\\11.0\\Setup\\VC" ;
.version-12.0-reg = "VisualStudio\\12.0\\Setup\\VC" ;
.version-14.0-reg = "VisualStudio\\14.0\\Setup\\VC" ;
.version-15.0-reg = "VisualStudio\\15.0\\Setup\\VC" ;

# Visual C++ Toolkit 2003 does not store its installation path in the registry.
# The environment variable 'VCToolkitInstallDir' and the default installation
Expand Down
1 change: 0 additions & 1 deletion src/tools/msvc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1293,7 +1293,6 @@ def first(self):
__version_11_0_reg = "VisualStudio\\11.0\\Setup\\VC"
__version_12_0_reg = "VisualStudio\\12.0\\Setup\\VC"
__version_14_0_reg = "VisualStudio\\14.0\\Setup\\VC"
__version_15_0_reg = "VisualStudio\\15.0\\Setup\\VC"

# Visual C++ Toolkit 2003 does not store its installation path in the registry.
# The environment variable 'VCToolkitInstallDir' and the default installation
Expand Down
10 changes: 10 additions & 0 deletions src/tools/return-msvc-path.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Param(
[Parameter(Position=1, Mandatory=$true)]
[int]$version
)
Import-Module -Name .\VSSetup
$vs = Get-VSSetupInstance -All | Select-VSSetupInstance -Require 'Microsoft.VisualStudio.Workload.NativeDesktop' -Version "[$version.0,$($version+1).0)" -Latest
if (-Not $vs) {
exit 1
}
$vs.InstallationPath + "\VC\Auxiliary\Build\vcvarsall.bat"
Binary file not shown.
15 changes: 15 additions & 0 deletions src/tools/vssetup/VSSetup.psd1
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright (C) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license. See LICENSE.txt in the project root for license information.
@{
GUID = '440e8fb1-19c4-4d39-8f75-37424bc4265a'
Author = 'Microsoft Corporation'
CompanyName = 'Microsoft Corporation'
Copyright = 'Copyright (C) Microsoft Corporation. All rights reserved.'
Description = 'Visual Studio Setup PowerShell Module'
ModuleVersion = '1.0.36.5345'
PowerShellVersion = '3.0'
CLRVersion = '4.0'
RootModule = 'Microsoft.VisualStudio.Setup.PowerShell.dll'
RequiredAssemblies = 'Microsoft.VisualStudio.Setup.PowerShell.dll'
TypesToProcess = 'VSSetup.types.ps1xml'
}
66 changes: 66 additions & 0 deletions src/tools/vssetup/VSSetup.types.ps1xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8" ?>
<Types>
<Type>
<Name>Microsoft.VisualStudio.Setup.Instance</Name>
<Members>
<MemberSet>
<Name>PSStandardMembers</Name>
<Members>
<NoteProperty>
<Name>DefaultDisplayProperty</Name>
<Value>InstanceId</Value>
</NoteProperty>
<PropertySet>
<Name>DefaultKeyPropertySet</Name>
<ReferencedProperties>
<Name>InstanceId</Name>
</ReferencedProperties>
</PropertySet>
<PropertySet>
<Name>DefaultDisplayPropertySet</Name>
<ReferencedProperties>
<Name>InstanceId</Name>
<Name>DisplayName</Name>
<Name>InstallationVersion</Name>
<Name>InstallationPath</Name>
<Name>InstallDate</Name>
</ReferencedProperties>
</PropertySet>
</Members>
</MemberSet>
</Members>
<TypeAdapter>
<TypeName>Microsoft.VisualStudio.Setup.PowerShell.InstanceAdapter</TypeName>
</TypeAdapter>
</Type>
<Type>
<Name>Microsoft.VisualStudio.Setup.PackageReference</Name>
<Members>
<MemberSet>
<Name>PSStandardMembers</Name>
<Members>
<NoteProperty>
<Name>DefaultDisplayProperty</Name>
<Value>Id</Value>
</NoteProperty>
<PropertySet>
<Name>DefaultKeyPropertySet</Name>
<ReferencedProperties>
<Name>UniqueId</Name>
</ReferencedProperties>
</PropertySet>
<PropertySet>
<Name>DefaultDisplayPropertySet</Name>
<ReferencedProperties>
<Name>Id</Name>
<Name>Version</Name>
<Name>Chip</Name>
<Name>Language</Name>
<Name>Branch</Name>
</ReferencedProperties>
</PropertySet>
</Members>
</MemberSet>
</Members>
</Type>
</Types>

0 comments on commit c03c11c

Please sign in to comment.