Skip to content

Commit 587a8c8

Browse files
[windows] cleanup DotNETSdk install script (#8200)
* [win] some cleanup of DonetSDK installer FixPublish workaround not needed anymore, we do not install 3.1 C:\Temp not needed as well
1 parent 8077d7b commit 587a8c8

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

images/win/scripts/Installers/Install-DotnetSDK.ps1

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,14 @@
44
## cache. Should run after VS and Node
55
################################################################################
66

7-
# ensure temp
8-
New-Item -Path C:\Temp -Force -ItemType Directory
9-
107
# Set environment variables
118
Set-SystemVariable -SystemVariable DOTNET_MULTILEVEL_LOOKUP -Value "0"
129
Set-SystemVariable -SystemVariable DOTNET_NOLOGO -Value "1"
1310
Set-SystemVariable -SystemVariable DOTNET_SKIP_FIRST_TIME_EXPERIENCE -Value "1"
1411

1512
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor "Tls12"
1613

14+
#region "Functions"
1715
function Get-SDKVersionsToInstall (
1816
$DotnetVersion
1917
) {
@@ -52,18 +50,6 @@ function Invoke-Warmup (
5250
}
5351
}
5452

55-
function Fix-ImportPublishProfile (
56-
$SdkVersion
57-
) {
58-
if (Test-IsWin19) {
59-
# Fix for issue https://github.com/dotnet/sdk/issues/1276. This will be fixed in 3.1.
60-
$sdkTargetsName = "Microsoft.NET.Sdk.ImportPublishProfile.targets"
61-
$sdkTargetsUrl = "https://raw.githubusercontent.com/dotnet/sdk/82bc30c99f1325dfaa7ad450be96857a4fca2845/src/Tasks/Microsoft.NET.Build.Tasks/targets/${sdkTargetsName}"
62-
$sdkTargetsPath = "C:\Program Files\dotnet\sdk\$sdkVersion\Sdks\Microsoft.NET.Sdk\targets"
63-
Start-DownloadWithRetry -Url $sdkTargetsUrl -DownloadPath $sdkTargetsPath -Name $sdkTargetsName
64-
}
65-
}
66-
6753
function InstallSDKVersion (
6854
$SdkVersion,
6955
$Warmup
@@ -72,15 +58,13 @@ function InstallSDKVersion (
7258
if (!(Test-Path -Path "C:\Program Files\dotnet\sdk\$sdkVersion"))
7359
{
7460
Write-Host "Installing dotnet $sdkVersion"
75-
.\dotnet-install.ps1 -Architecture x64 -Version $sdkVersion -InstallDir $(Join-Path -Path $env:ProgramFiles -ChildPath 'dotnet')
61+
.\dotnet-install.ps1 -Version $sdkVersion -InstallDir $(Join-Path -Path $env:ProgramFiles -ChildPath 'dotnet')
7662
}
7763
else
7864
{
7965
Write-Host "Sdk version $sdkVersion already installed"
8066
}
8167

82-
Fix-ImportPublishProfile -SdkVersion $SdkVersion
83-
8468
if ($Warmup) {
8569
Invoke-Warmup -SdkVersion $SdkVersion
8670
}
@@ -138,6 +122,7 @@ function RunPostInstallationSteps()
138122
# Add %USERPROFILE%\.dotnet\tools to USER PATH
139123
Add-DefaultPathItem "%USERPROFILE%\.dotnet\tools"
140124
}
125+
#endregion
141126

142127
InstallAllValidSdks
143128
RunPostInstallationSteps

0 commit comments

Comments
 (0)