-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- New scripts/Makefile step "setup" installs all required .NET versio…
…ns and third-party tools (#299)
- Loading branch information
Showing
4 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
:: This script will: | ||
:: - use Microsoft's PowerShell script (https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script) to install the latest version of all required .NET SDKs. | ||
:: - install required third-party tools for running these scripts | ||
:: - add files to the current user's PATH environment variable | ||
|
||
:: Requirements: | ||
:: - PowerShell is enabled on the machine | ||
:: - Do not install dotnet via any other method (including via installing Visual Studio/Rider). This might otherwise cause two conflicting versions of 'dotnet' to exist in your PATH | ||
|
||
@ECHO OFF | ||
|
||
:: .NET Versions we want to install and destination | ||
SET NetVersions=Current 6.0 5.0 3.1 | ||
SET InstallPath=C:\dotnet | ||
|
||
:: Dependencies for these scripts | ||
SET DepFiles=SnInstallPfx.exe nuget.exe 7z.exe | ||
SET FileHost=https://files.nateharr.is/netdeps/ | ||
|
||
:: Install each .NET version | ||
@ECHO Installing .NET SDKs ... | ||
SETLOCAL | ||
for %%x IN (%NetVersions%) DO ( | ||
@ECHO Installing .NET %%x ... | ||
powershell -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://dot.net/v1/dotnet-install.ps1'))) -InstallDir %InstallPath% -Channel %%x -Verbose" | ||
) | ||
ENDLOCAL | ||
|
||
:: Download dependencies to the same directory as 'dotnet' | ||
@ECHO Downloading third-party tools ... | ||
SETLOCAL | ||
for %%x IN (%DepFiles%) DO ( | ||
@ECHO Downloading %%x ... | ||
powershell -NoProfile -ExecutionPolicy unrestricted -Command "Invoke-WebRequest -Uri '%FileHost%%%x' -OutFile '%InstallPath%\%%x'" | ||
) | ||
ENDLOCAL | ||
|
||
:: Add dotnet folder to PATH | ||
powershell -NoProfile -ExecutionPolicy unrestricted -Command "[Environment]::SetEnvironmentVariable('Path', $env:Path + ';%InstallPath%', 'User')" | ||
|
||
EXIT /B 0 | ||
|
||
:commandFailed | ||
@ECHO Command failed. | ||
GOTO :exitWithError | ||
|
||
:exitWithError | ||
@ECHO Exiting... | ||
EXIT /B 1 |