Changeset 17052
- Timestamp:
- 07/01/19 09:53:48 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Build.ps1
r16624 r17052 1 1 # find ms build 2 2 $programFilesX86Dir = ($Env:ProgramFiles, ${Env:ProgramFiles(x86)})[[bool]${Env:ProgramFiles(x86)}] 3 $locations = @( 4 [System.IO.Path]::Combine($programFilesX86Dir, "Microsoft Visual Studio", "2017", "Enterprise", "MSBuild", "15.0", "Bin", "amd64") 5 [System.IO.Path]::Combine($programFilesX86Dir, "Microsoft Visual Studio", "2017", "Enterprise", "MSBuild", "15.0", "Bin") 6 [System.IO.Path]::Combine($programFilesX86Dir, "Microsoft Visual Studio", "2017", "Community", "MSBuild", "15.0", "Bin", "amd64") 7 [System.IO.Path]::Combine($programFilesX86Dir, "Microsoft Visual Studio", "2017", "Community", "MSBuild", "15.0", "Bin") 8 [System.IO.Path]::Combine($programFilesX86Dir, "Microsoft Visual Studio", "2017", "BuildTools", "MSBuild", "15.0", "Bin", "amd64"), 9 [System.IO.Path]::Combine($programFilesX86Dir, "Microsoft Visual Studio", "2017", "BuildTools", "MSBuild", "15.0", "Bin") 10 ) 3 $vsDir = [System.IO.Path]::Combine($programFilesX86Dir, "Microsoft Visual Studio") 4 $years = @("2019", "2017") 5 $editions = @("Enterprise", "Professional", "Community", "BuildTools") 6 $versions = @("Current", "15.0") 11 7 12 8 $msBuildPath = $undefined 13 Foreach ($loc in $locations) { 14 $loc = [System.IO.Path]::Combine($loc, "MSBuild.exe") 15 If ([System.IO.File]::Exists($loc)) { 16 $msBuildPath = $loc 17 Break; 9 :search Foreach ($year in $years) { 10 $loc = [System.IO.Path]::Combine($vsDir, $year) 11 Foreach ($edition in $editions) { 12 $edLoc = [System.IO.Path]::Combine($loc, $edition, "MSBuild") 13 Foreach ($version in $versions) { 14 $binLoc = [System.IO.Path]::Combine($edLoc, $version, "Bin") 15 $loc64 = [System.IO.Path]::Combine($binLoc, "amd64", "MSBuild.exe") 16 $loc32 = [System.IO.Path]::Combine($binLoc, "MSBuild.exe") 17 18 If ([System.IO.File]::Exists($loc64)) { 19 $msBuildPath = $loc64 20 Break search; 21 } 22 If ([System.IO.File]::Exists($loc32)) { 23 $msBuildPath = $loc32 24 Break search; 25 } 26 } 18 27 } 19 28 } … … 24 33 Return 25 34 } 35 36 "MSBuild located at `"{0}`"." -f $msBuildPath 26 37 27 38 $curPath = $MyInvocation.MyCommand.Path
Note: See TracChangeset
for help on using the changeset viewer.