Updated setup script to recognize dotnet.exe if it is installed in Program Files (x86)

This commit is contained in:
Jimmy Campbell 2017-07-05 18:41:57 -07:00
Родитель eeabd5c836
Коммит 9167db4835
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -30,8 +30,12 @@ function Dotnet {
elseif ($dotnet -ne $null) {
$source = $dotnet.Definition
}
$dotnetSuffix = "dotnet\dotnet.exe"
$isInProgramFiles = $source -eq $(Join-Path $env:ProgramFiles $dotnetSuffix)
$isInProgramFilesx86 = $source -eq $(Join-Path ${env:ProgramFiles(x86)} $dotnetSuffix)
if(-not($source -eq $(Join-Path $env:ProgramFiles "dotnet\dotnet.exe"))) {
if(-not($isInProgramFiles) -and -not($isInProgramFilesx86)) {
Write-Warning ".NET Core Shared Framework not installed"
Write-Warning "Download the .NET Core Runtime (LTS) 'https://www.microsoft.com/net/download/core#/runtime'"
throw ".NET Core required to continue"