This commit is contained in:
James Newton-King
2016-07-01 17:11:00 +12:00
parent 3a0b272b83
commit 8dae7a7dab
3 changed files with 37 additions and 17 deletions
+1 -1
View File
@@ -11,7 +11,7 @@
$buildNuGet = $true $buildNuGet = $true
$treatWarningsAsErrors = $false $treatWarningsAsErrors = $false
$workingName = if ($workingName) {$workingName} else {"Working"} $workingName = if ($workingName) {$workingName} else {"Working"}
$netCliVersion = "1.0.0-preview1-002702" $netCliVersion = "1.0.0-preview3-003171"
$baseDir = resolve-path .. $baseDir = resolve-path ..
$buildDir = "$baseDir\Build" $buildDir = "$baseDir\Build"
+1 -1
View File
@@ -96,7 +96,7 @@
"System.Runtime.Serialization.Json": "4.0.2", "System.Runtime.Serialization.Json": "4.0.2",
"System.Runtime.Serialization.Xml": "4.1.1", "System.Runtime.Serialization.Xml": "4.1.1",
"xunit": "2.1.0", "xunit": "2.1.0",
"dotnet-test-xunit": "1.0.0-rc2-build10015" "dotnet-test-xunit": "1.0.0-rc2-build10025"
}, },
"imports": [ "imports": [
"dnxcore50", "dnxcore50",
+35 -15
View File
@@ -29,6 +29,9 @@
Default: <auto> - this value represents currently running OS architecture Default: <auto> - this value represents currently running OS architecture
Architecture of dotnet binaries to be installed. Architecture of dotnet binaries to be installed.
Possible values are: <auto>, x64 and x86 Possible values are: <auto>, x64 and x86
.PARAMETER SharedRuntime
Default: false
Installs just the shared runtime bits, not the entire SDK
.PARAMETER DebugSymbols .PARAMETER DebugSymbols
If set the installer will include symbols in the installation. If set the installer will include symbols in the installation.
.PARAMETER DryRun .PARAMETER DryRun
@@ -47,10 +50,11 @@
#> #>
[cmdletbinding()] [cmdletbinding()]
param( param(
[string]$Channel="preview", [string]$Channel="rel-1.0.0",
[string]$Version="Latest", [string]$Version="Latest",
[string]$InstallDir="<auto>", [string]$InstallDir="<auto>",
[string]$Architecture="<auto>", [string]$Architecture="<auto>",
[switch]$SharedRuntime,
[switch]$DebugSymbols, # TODO: Switch does not work yet. Symbols zip is not being uploaded yet. [switch]$DebugSymbols, # TODO: Switch does not work yet. Symbols zip is not being uploaded yet.
[switch]$DryRun, [switch]$DryRun,
[switch]$NoPath, [switch]$NoPath,
@@ -68,11 +72,11 @@ $VersionRegEx="/\d+\.\d+[^/]+/"
$OverrideNonVersionedFiles=$true $OverrideNonVersionedFiles=$true
function Say($str) { function Say($str) {
Write-Host "dotnet_install: $str" Write-Host "dotnet-install: $str"
} }
function Say-Verbose($str) { function Say-Verbose($str) {
Write-Verbose "dotnet_install: $str" Write-Verbose "dotnet-install: $str"
} }
function Say-Invocation($Invocation) { function Say-Invocation($Invocation) {
@@ -114,9 +118,22 @@ function Get-Version-Info-From-Version-Text([string]$VersionText) {
function Get-Latest-Version-Info([string]$AzureFeed, [string]$AzureChannel, [string]$CLIArchitecture) { function Get-Latest-Version-Info([string]$AzureFeed, [string]$AzureChannel, [string]$CLIArchitecture) {
Say-Invocation $MyInvocation Say-Invocation $MyInvocation
$VersionFileUrl = "$AzureFeed/$AzureChannel/dnvm/latest.win.$CLIArchitecture.version" $VersionFileUrl = $null
if ($SharedRuntime) {
$VersionFileUrl = "$AzureFeed/$AzureChannel/dnvm/latest.sharedfx.win.$CLIArchitecture.version"
}
else {
$VersionFileUrl = "$AzureFeed/Sdk/$AzureChannel/latest.version"
}
$Response = Invoke-WebRequest -UseBasicParsing $VersionFileUrl $Response = Invoke-WebRequest -UseBasicParsing $VersionFileUrl
$VersionText = [Text.Encoding]::UTF8.GetString($Response.Content)
switch ($Response.Headers.'Content-Type'){
{ ($_ -eq "application/octet-stream") } { $VersionText = [Text.Encoding]::UTF8.GetString($Response.Content) }
{ ($_ -eq "text/plain") } { $VersionText = $Response.Content }
default { throw "``$Response.Headers.'Content-Type'`` is an unknown .version file content type." }
}
$VersionInfo = Get-Version-Info-From-Version-Text $VersionText $VersionInfo = Get-Version-Info-From-Version-Text $VersionText
@@ -130,9 +147,8 @@ function Get-Azure-Channel-From-Channel([string]$Channel) {
# For compatibility with build scripts accept also directly Azure channels names # For compatibility with build scripts accept also directly Azure channels names
switch ($Channel.ToLower()) { switch ($Channel.ToLower()) {
{ ($_ -eq "future") -or ($_ -eq "dev") } { return "dev" } { ($_ -eq "future") -or ($_ -eq "dev") } { return "dev" }
{ ($_ -eq "preview") -or ($_ -eq "beta") } { return "beta" }
{ $_ -eq "production" } { throw "Production channel does not exist yet" } { $_ -eq "production" } { throw "Production channel does not exist yet" }
default { throw "``$Channel`` is an invalid channel name. Use one of the following: ``future``, ``preview``, ``production``" } default { return $_ }
} }
} }
@@ -153,13 +169,16 @@ function Get-Download-Links([string]$AzureFeed, [string]$AzureChannel, [string]$
Say-Invocation $MyInvocation Say-Invocation $MyInvocation
$ret = @() $ret = @()
$files = @("dotnet-dev")
foreach ($file in $files) { if ($SharedRuntime) {
$PayloadURL = "$AzureFeed/$AzureChannel/Binaries/$SpecificVersion/$file-win-$CLIArchitecture.$SpecificVersion.zip" $PayloadURL = "$AzureFeed/$AzureChannel/Binaries/$SpecificVersion/dotnet-win-$CLIArchitecture.$SpecificVersion.zip"
Say-Verbose "Constructed payload URL: $PayloadURL"
$ret += $PayloadURL
} }
else {
$PayloadURL = "$AzureFeed/Sdk/$SpecificVersion/dotnet-dev-win-$CLIArchitecture.$SpecificVersion.zip"
}
Say-Verbose "Constructed payload URL: $PayloadURL"
$ret += $PayloadURL
return $ret return $ret
} }
@@ -300,7 +319,7 @@ if ($DryRun) {
Say "- $DownloadLink" Say "- $DownloadLink"
} }
Say "Repeatable invocation: .\$($MyInvocation.MyCommand) -Version $SpecificVersion -Channel $Channel -Architecture $CLIArchitecture -InstallDir $InstallDir" Say "Repeatable invocation: .\$($MyInvocation.MyCommand) -Version $SpecificVersion -Channel $Channel -Architecture $CLIArchitecture -InstallDir $InstallDir"
return exit 0
} }
$InstallRoot = Resolve-Installation-Path $InstallDir $InstallRoot = Resolve-Installation-Path $InstallDir
@@ -310,7 +329,7 @@ $IsSdkInstalled = Is-Dotnet-Package-Installed -InstallRoot $InstallRoot -Relativ
Say-Verbose ".NET SDK installed? $IsSdkInstalled" Say-Verbose ".NET SDK installed? $IsSdkInstalled"
if ($IsSdkInstalled) { if ($IsSdkInstalled) {
Say ".NET SDK version $SpecificVersion is already installed." Say ".NET SDK version $SpecificVersion is already installed."
return exit 0
} }
New-Item -ItemType Directory -Force -Path $InstallRoot | Out-Null New-Item -ItemType Directory -Force -Path $InstallRoot | Out-Null
@@ -329,10 +348,11 @@ foreach ($DownloadLink in $DownloadLinks) {
$BinPath = Get-Absolute-Path $(Join-Path -Path $InstallRoot -ChildPath $BinFolderRelativePath) $BinPath = Get-Absolute-Path $(Join-Path -Path $InstallRoot -ChildPath $BinFolderRelativePath)
if (-Not $NoPath) { if (-Not $NoPath) {
Say "Adding to current process PATH: `"$BinPath`". Note: This change will not be visible if PowerShell was run as a child process." Say "Adding to current process PATH: `"$BinPath`". Note: This change will not be visible if PowerShell was run as a child process."
$env:path += ";$BinPath" $env:path = "$BinPath;" + $env:path
} }
else { else {
Say "Binaries of dotnet can be found in $BinPath" Say "Binaries of dotnet can be found in $BinPath"
} }
Say "Installation finished" Say "Installation finished"
exit 0