parent
7613b7ee81
commit
1c09412505
62
dnvm.ps1
62
dnvm.ps1
|
|
@ -67,7 +67,7 @@ function _WriteOut {
|
||||||
|
|
||||||
### Constants
|
### Constants
|
||||||
$ProductVersion="1.0.0"
|
$ProductVersion="1.0.0"
|
||||||
$BuildVersion="beta6-10383"
|
$BuildVersion="beta6-10386"
|
||||||
$Authors="Microsoft Open Technologies, Inc."
|
$Authors="Microsoft Open Technologies, Inc."
|
||||||
|
|
||||||
# If the Version hasn't been replaced...
|
# If the Version hasn't been replaced...
|
||||||
|
|
@ -87,6 +87,7 @@ Set-Variable -Option Constant "RuntimePackageName" "dnx"
|
||||||
Set-Variable -Option Constant "DefaultFeed" "https://www.nuget.org/api/v2"
|
Set-Variable -Option Constant "DefaultFeed" "https://www.nuget.org/api/v2"
|
||||||
Set-Variable -Option Constant "DefaultUnstableFeed" "https://www.myget.org/F/aspnetvnext/api/v2"
|
Set-Variable -Option Constant "DefaultUnstableFeed" "https://www.myget.org/F/aspnetvnext/api/v2"
|
||||||
Set-Variable -Option Constant "CrossGenCommand" "dnx-crossgen"
|
Set-Variable -Option Constant "CrossGenCommand" "dnx-crossgen"
|
||||||
|
Set-Variable -Option Constant "OldCrossGenCommand" "k-crossgen"
|
||||||
Set-Variable -Option Constant "CommandPrefix" "dnvm-"
|
Set-Variable -Option Constant "CommandPrefix" "dnvm-"
|
||||||
Set-Variable -Option Constant "DefaultArchitecture" "x86"
|
Set-Variable -Option Constant "DefaultArchitecture" "x86"
|
||||||
Set-Variable -Option Constant "DefaultRuntime" "clr"
|
Set-Variable -Option Constant "DefaultRuntime" "clr"
|
||||||
|
|
@ -751,7 +752,11 @@ function dnvm-help {
|
||||||
$Script:ExitCodes = $ExitCodes.UnknownCommand
|
$Script:ExitCodes = $ExitCodes.UnknownCommand
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
$help = Get-Help "dnvm-$Command" -ShowWindow:$false
|
if($Host.Version.Major -lt 3) {
|
||||||
|
$help = Get-Help "dnvm-$Command"
|
||||||
|
} else {
|
||||||
|
$help = Get-Help "dnvm-$Command" -ShowWindow:$false
|
||||||
|
}
|
||||||
if($PassThru -Or $Host.Version.Major -lt 3) {
|
if($PassThru -Or $Host.Version.Major -lt 3) {
|
||||||
$help
|
$help
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -833,7 +838,11 @@ function dnvm-help {
|
||||||
_WriteOut -ForegroundColor $ColorScheme.Help_Header "commands: "
|
_WriteOut -ForegroundColor $ColorScheme.Help_Header "commands: "
|
||||||
Get-Command "$CommandPrefix*" |
|
Get-Command "$CommandPrefix*" |
|
||||||
ForEach-Object {
|
ForEach-Object {
|
||||||
$h = Get-Help $_.Name -ShowWindow:$false
|
if($Host.Version.MajorVersion -lt 3) {
|
||||||
|
$h = Get-Help $_.Name
|
||||||
|
} else {
|
||||||
|
$h = Get-Help $_.Name -ShowWindow:$false
|
||||||
|
}
|
||||||
$name = $_.Name.Substring($CommandPrefix.Length)
|
$name = $_.Name.Substring($CommandPrefix.Length)
|
||||||
if($DeprecatedCommands -notcontains $name) {
|
if($DeprecatedCommands -notcontains $name) {
|
||||||
_WriteOut -NoNewLine " "
|
_WriteOut -NoNewLine " "
|
||||||
|
|
@ -896,31 +905,26 @@ function dnvm-list {
|
||||||
function dnvm-alias {
|
function dnvm-alias {
|
||||||
param(
|
param(
|
||||||
[Alias("d")]
|
[Alias("d")]
|
||||||
[Parameter(ParameterSetName="Delete",Mandatory=$true)]
|
|
||||||
[switch]$Delete,
|
[switch]$Delete,
|
||||||
|
|
||||||
[Parameter(ParameterSetName="Read",Mandatory=$false,Position=0)]
|
|
||||||
[Parameter(ParameterSetName="Write",Mandatory=$true,Position=0)]
|
|
||||||
[Parameter(ParameterSetName="Delete",Mandatory=$true,Position=0)]
|
|
||||||
[string]$Name,
|
[string]$Name,
|
||||||
|
|
||||||
[Parameter(ParameterSetName="Write",Mandatory=$true,Position=1)]
|
|
||||||
[string]$Version,
|
[string]$Version,
|
||||||
|
|
||||||
[Alias("arch")]
|
[Alias("arch")]
|
||||||
[ValidateSet("", "x86","x64")]
|
[ValidateSet("", "x86","x64")]
|
||||||
[Parameter(ParameterSetName="Write", Mandatory=$false)]
|
|
||||||
[string]$Architecture = "",
|
[string]$Architecture = "",
|
||||||
|
|
||||||
[Alias("r")]
|
[Alias("r")]
|
||||||
[ValidateSet("", "clr","coreclr")]
|
[ValidateSet("", "clr","coreclr")]
|
||||||
[Parameter(ParameterSetName="Write")]
|
|
||||||
[string]$Runtime = "")
|
[string]$Runtime = "")
|
||||||
|
|
||||||
switch($PSCmdlet.ParameterSetName) {
|
if($Version) {
|
||||||
"Read" { Read-Alias $Name }
|
Write-Alias $Name $Version -Architecture $Architecture -Runtime $Runtime
|
||||||
"Write" { Write-Alias $Name $Version -Architecture $Architecture -Runtime $Runtime }
|
} elseif ($Delete) {
|
||||||
"Delete" { Delete-Alias $Name }
|
Delete-Alias $Name
|
||||||
|
} else {
|
||||||
|
Read-Alias $Name
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1124,7 +1128,8 @@ function dnvm-install {
|
||||||
else {
|
else {
|
||||||
$Architecture = GetArch $Architecture
|
$Architecture = GetArch $Architecture
|
||||||
$Runtime = GetRuntime $Runtime
|
$Runtime = GetRuntime $Runtime
|
||||||
$UnpackFolder = Join-Path $RuntimesDir "temp"
|
$TempFolder = Join-Path $RuntimesDir "temp"
|
||||||
|
$UnpackFolder = Join-Path $TempFolder $runtimeFullName
|
||||||
$DownloadFile = Join-Path $UnpackFolder "$runtimeFullName.nupkg"
|
$DownloadFile = Join-Path $UnpackFolder "$runtimeFullName.nupkg"
|
||||||
|
|
||||||
if(Test-Path $UnpackFolder) {
|
if(Test-Path $UnpackFolder) {
|
||||||
|
|
@ -1155,7 +1160,19 @@ function dnvm-install {
|
||||||
else {
|
else {
|
||||||
_WriteOut "Installing to $RuntimeFolder"
|
_WriteOut "Installing to $RuntimeFolder"
|
||||||
_WriteDebug "Moving package contents to $RuntimeFolder"
|
_WriteDebug "Moving package contents to $RuntimeFolder"
|
||||||
Move-Item $UnpackFolder $RuntimeFolder
|
try {
|
||||||
|
Move-Item $UnpackFolder $RuntimeFolder
|
||||||
|
} catch {
|
||||||
|
if(Test-Path $RuntimeFolder) {
|
||||||
|
#Attempt to cleanup the runtime folder if it is there after a fail.
|
||||||
|
Remove-Item $RuntimeFolder -Recurse -Force
|
||||||
|
throw
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#If there is nothing left in the temp folder remove it. There could be other installs happening at the same time as this.
|
||||||
|
if(-Not(Test-Path $(Join-Path $TempFolder "*"))) {
|
||||||
|
Remove-Item $TempFolder -Recurse
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dnvm-use $PackageVersion -Architecture:$Architecture -Runtime:$Runtime -Persistent:$Persistent
|
dnvm-use $PackageVersion -Architecture:$Architecture -Runtime:$Runtime -Persistent:$Persistent
|
||||||
|
|
@ -1179,11 +1196,18 @@ function dnvm-install {
|
||||||
else {
|
else {
|
||||||
_WriteOut "Compiling native images for $runtimeFullName to improve startup performance..."
|
_WriteOut "Compiling native images for $runtimeFullName to improve startup performance..."
|
||||||
Write-Progress -Activity "Installing runtime" -Status "Generating runtime native images" -Id 1
|
Write-Progress -Activity "Installing runtime" -Status "Generating runtime native images" -Id 1
|
||||||
|
|
||||||
|
if(Get-Command $CrossGenCommand -ErrorAction SilentlyContinue) {
|
||||||
|
$crossGenCommand = $CrossGenCommand
|
||||||
|
} else {
|
||||||
|
$crossGenCommand = $OldCrossGenCommand
|
||||||
|
}
|
||||||
|
|
||||||
if ($DebugPreference -eq 'SilentlyContinue') {
|
if ($DebugPreference -eq 'SilentlyContinue') {
|
||||||
Start-Process $CrossGenCommand -Wait -WindowStyle Hidden
|
Start-Process $crossGenCommand -Wait -WindowStyle Hidden
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Start-Process $CrossGenCommand -Wait -NoNewWindow
|
Start-Process $crossGenCommand -Wait -NoNewWindow
|
||||||
}
|
}
|
||||||
_WriteOut "Finished native image compilation."
|
_WriteOut "Finished native image compilation."
|
||||||
}
|
}
|
||||||
|
|
|
||||||
2
dnvm.sh
2
dnvm.sh
|
|
@ -2,7 +2,7 @@
|
||||||
# Source this file from your .bash-profile or script to use
|
# Source this file from your .bash-profile or script to use
|
||||||
|
|
||||||
# "Constants"
|
# "Constants"
|
||||||
_DNVM_BUILDNUMBER="beta6-10383"
|
_DNVM_BUILDNUMBER="beta6-10386"
|
||||||
_DNVM_AUTHORS="Microsoft Open Technologies, Inc."
|
_DNVM_AUTHORS="Microsoft Open Technologies, Inc."
|
||||||
_DNVM_RUNTIME_PACKAGE_NAME="dnx"
|
_DNVM_RUNTIME_PACKAGE_NAME="dnx"
|
||||||
_DNVM_RUNTIME_FRIENDLY_NAME=".NET Execution Environment"
|
_DNVM_RUNTIME_FRIENDLY_NAME=".NET Execution Environment"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue